agent-afk 5.328.1 → 5.328.2

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.
@@ -20,12 +20,17 @@ export type TranscribeResult = {
20
20
  export interface AudioTranscriber {
21
21
  transcribe(bytes: Buffer, fileName: string, maxBytes: number): Promise<TranscribeResult>;
22
22
  }
23
+ type EgressCheckFn = (url: string) => Promise<{
24
+ allowed: boolean;
25
+ reason?: string;
26
+ }>;
23
27
  export declare class OpenAIAudioTranscriber implements AudioTranscriber {
24
28
  private readonly apiUrl;
25
29
  private readonly apiKey;
26
30
  private readonly model;
27
31
  private readonly timeoutMs;
28
- constructor(apiUrl: string, apiKey: string | undefined, model: string, timeoutMs?: number);
32
+ private readonly checkEgress?;
33
+ constructor(apiUrl: string, apiKey: string | undefined, model: string, timeoutMs?: number, checkEgress?: EgressCheckFn | undefined);
29
34
  transcribe(bytes: Buffer, fileName: string, maxBytes: number): Promise<TranscribeResult>;
30
35
  }
31
36
  export declare function createTranscriber(env: {
@@ -33,4 +38,10 @@ export declare function createTranscriber(env: {
33
38
  AFK_TRANSCRIBE_API_KEY?: string;
34
39
  AFK_TRANSCRIBE_MODEL?: string;
35
40
  AFK_TRANSCRIBE_TIMEOUT_MS?: string;
41
+ }, opts?: {
42
+ checkEgress?: (url: string) => Promise<{
43
+ allowed: boolean;
44
+ reason?: string;
45
+ }>;
36
46
  }): AudioTranscriber | null;
47
+ export {};