@mastra/voice-cloudflare 0.10.6 → 0.10.7

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/index.cjs CHANGED
@@ -80,3 +80,5 @@ var CloudflareVoice = class extends voice.MastraVoice {
80
80
  };
81
81
 
82
82
  exports.CloudflareVoice = CloudflareVoice;
83
+ //# sourceMappingURL=index.cjs.map
84
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":["MastraVoice","Cloudflare"],"mappings":";;;;;;;;;;AAoBA,IAAM,qBAAA,GAAwB;AAAA,EAC5B,KAAA,EAAO,mCAAA;AAAA,EACP,MAAA,EAAQ,QAAQ,GAAA,CAAI,qBAAA;AAAA,EACpB,UAAA,EAAY,QAAQ,GAAA,CAAI;AAC1B,CAAA;AAEO,IAAM,eAAA,GAAN,cAA8BA,iBAAA,CAAY;AAAA,EACvC,QAAA;AAAA,EACA,MAAA,GAA4B,IAAA;AAAA,EAC5B,OAAA;AAAA,EAER,WAAA,CAAY;AAAA,IACV,cAAA;AAAA,IACA;AAAA,GACF,GAGI,EAAC,EAAG;AACN,IAAA,KAAA,CAAM;AAAA,MACJ,cAAA,EAAgB;AAAA,QACd,IAAA,EAAM,cAAA,EAAgB,KAAA,IAAS,qBAAA,CAAsB,KAAA;AAAA,QACrD,MAAA,EAAQ,cAAA,EAAgB,MAAA,IAAU,qBAAA,CAAsB;AAAA;AAC1D,KACD,CAAA;AAGD,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAGf,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,IAAA,CAAK,QAAA,GAAW,cAAA,EAAgB,MAAA,IAAU,qBAAA,CAAsB,MAAA;AAChE,MAAA,IAAI,CAAC,KAAK,QAAA,EAAU;AAClB,QAAA,MAAM,IAAI,MAAM,2DAA2D,CAAA;AAAA,MAC7E;AACA,MAAA,IAAA,CAAK,SAAS,IAA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,CAAA;AACzD,QAAA,OAAO,QAAA,CAAS,IAAA;AAAA,MAClB,CAAA,MAAO;AACL,QAAA,MAAM,IAAI,MAAM,+CAA+C,CAAA;AAAA,MACjE;AAAA,IACF,CAAA,EAAG,yBAAyB,CAAA,EAAE;AAAA,EAChC;AAAA,EACA,MAAM,KAAA,GAAwC;AAC5C,IAAA,MAAM,IAAI,MAAM,sCAAsC,CAAA;AAAA,EACxD;AAAA,EACA,MAAM,WAAA,GAAuE;AAC3E,IAAA,MAAM,IAAI,MAAM,sCAAsC,CAAA;AAAA,EACxD;AACF","file":"index.cjs","sourcesContent":["import type {\n Ai,\n Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output,\n Ai_Cf_Openai_Whisper_Output,\n Ai_Cf_Openai_Whisper_Tiny_En_Output,\n} from '@cloudflare/workers-types';\nimport { MastraVoice } from '@mastra/core/voice';\nimport Cloudflare from 'cloudflare';\n\ninterface CloudflareListenOptions {\n apiKey?: string;\n model?: '@cf/openai/whisper-tiny-en' | '@cf/openai/whisper' | '@cf/openai/whisper-large-v3-turbo';\n account_id?: string;\n}\n\ntype CloudflareListenOutput =\n | Ai_Cf_Openai_Whisper_Tiny_En_Output\n | Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output\n | Ai_Cf_Openai_Whisper_Output;\n\nconst defaultListeningModel = {\n model: '@cf/openai/whisper-large-v3-turbo' as const,\n apiKey: process.env.CLOUDFLARE_AI_API_KEY,\n account_id: process.env.CLOUDFLARE_ACCOUNT_ID!,\n};\n\nexport class CloudflareVoice extends MastraVoice {\n private apiToken?: string;\n private client: Cloudflare | null = null;\n private binding?: Ai;\n\n constructor({\n listeningModel,\n binding,\n }: {\n listeningModel?: CloudflareListenOptions;\n binding?: Ai;\n } = {}) {\n super({\n listeningModel: {\n name: listeningModel?.model ?? defaultListeningModel.model,\n apiKey: listeningModel?.apiKey ?? defaultListeningModel.apiKey,\n },\n });\n\n // Store Workers AI binding if provided\n this.binding = binding;\n\n // Only setup REST client if no binding provided or both are needed\n if (!binding) {\n this.apiToken = listeningModel?.apiKey || defaultListeningModel.apiKey;\n if (!this.apiToken) {\n throw new Error('CLOUDFLARE_AI_API_KEY must be set when not using bindings');\n }\n this.client = new Cloudflare({ apiToken: this.apiToken });\n }\n }\n\n /**\n * Checks if listening capabilities are enabled.\n *\n * @returns {Promise<{ enabled: boolean }>}\n */\n async getListener() {\n return { enabled: true };\n }\n\n async listen(audioStream: NodeJS.ReadableStream, options?: CloudflareListenOptions): Promise<string> {\n return this.traced(async () => {\n // Collect audio data into buffer\n const chunks: Buffer[] = [];\n for await (const chunk of audioStream) {\n if (typeof chunk === 'string') {\n chunks.push(Buffer.from(chunk));\n } else {\n chunks.push(chunk);\n }\n }\n const audioBuffer = Buffer.concat(chunks);\n const base64Audio = audioBuffer.toString('base64');\n\n const model = options?.model || defaultListeningModel.model;\n\n // Use native binding if available, otherwise use REST API\n if (this.binding) {\n // Using Workers AI binding\n const response = (await this.binding.run(model, {\n audio: base64Audio,\n })) as CloudflareListenOutput;\n return response.text;\n } else if (this.client) {\n // Using REST API client\n const payload = { audio: base64Audio, account_id: options?.account_id || defaultListeningModel.account_id };\n const response = (await this.client.ai.run(model, payload)) as any;\n return response.text as string;\n } else {\n throw new Error('Neither binding nor REST client is configured');\n }\n }, 'voice.cloudflare.listen')();\n }\n async speak(): Promise<NodeJS.ReadableStream> {\n throw new Error('This feature is not yet implemented.');\n }\n async getSpeakers(): Promise<Array<{ voiceId: string; [key: string]: any }>> {\n throw new Error('This feature is not yet implemented.');\n }\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1 +1,32 @@
1
- export { CloudflareVoice } from './_tsup-dts-rollup.js';
1
+ import type { Ai } from '@cloudflare/workers-types';
2
+ import { MastraVoice } from '@mastra/core/voice';
3
+ interface CloudflareListenOptions {
4
+ apiKey?: string;
5
+ model?: '@cf/openai/whisper-tiny-en' | '@cf/openai/whisper' | '@cf/openai/whisper-large-v3-turbo';
6
+ account_id?: string;
7
+ }
8
+ export declare class CloudflareVoice extends MastraVoice {
9
+ private apiToken?;
10
+ private client;
11
+ private binding?;
12
+ constructor({ listeningModel, binding, }?: {
13
+ listeningModel?: CloudflareListenOptions;
14
+ binding?: Ai;
15
+ });
16
+ /**
17
+ * Checks if listening capabilities are enabled.
18
+ *
19
+ * @returns {Promise<{ enabled: boolean }>}
20
+ */
21
+ getListener(): Promise<{
22
+ enabled: boolean;
23
+ }>;
24
+ listen(audioStream: NodeJS.ReadableStream, options?: CloudflareListenOptions): Promise<string>;
25
+ speak(): Promise<NodeJS.ReadableStream>;
26
+ getSpeakers(): Promise<Array<{
27
+ voiceId: string;
28
+ [key: string]: any;
29
+ }>>;
30
+ }
31
+ export {};
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,EAAE,EAIH,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,UAAU,uBAAuB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,4BAA4B,GAAG,oBAAoB,GAAG,mCAAmC,CAAC;IAClG,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAaD,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,OAAO,CAAC,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,OAAO,CAAC,CAAK;gBAET,EACV,cAAc,EACd,OAAO,GACR,GAAE;QACD,cAAc,CAAC,EAAE,uBAAuB,CAAC;QACzC,OAAO,CAAC,EAAE,EAAE,CAAC;KACT;IAqBN;;;;OAIG;IACG,WAAW;;;IAIX,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IAiC9F,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;IAGvC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAC;CAG7E"}
package/dist/index.js CHANGED
@@ -74,3 +74,5 @@ var CloudflareVoice = class extends MastraVoice {
74
74
  };
75
75
 
76
76
  export { CloudflareVoice };
77
+ //# sourceMappingURL=index.js.map
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;AAoBA,IAAM,qBAAA,GAAwB;AAAA,EAC5B,KAAA,EAAO,mCAAA;AAAA,EACP,MAAA,EAAQ,QAAQ,GAAA,CAAI,qBAAA;AAAA,EACpB,UAAA,EAAY,QAAQ,GAAA,CAAI;AAC1B,CAAA;AAEO,IAAM,eAAA,GAAN,cAA8B,WAAA,CAAY;AAAA,EACvC,QAAA;AAAA,EACA,MAAA,GAA4B,IAAA;AAAA,EAC5B,OAAA;AAAA,EAER,WAAA,CAAY;AAAA,IACV,cAAA;AAAA,IACA;AAAA,GACF,GAGI,EAAC,EAAG;AACN,IAAA,KAAA,CAAM;AAAA,MACJ,cAAA,EAAgB;AAAA,QACd,IAAA,EAAM,cAAA,EAAgB,KAAA,IAAS,qBAAA,CAAsB,KAAA;AAAA,QACrD,MAAA,EAAQ,cAAA,EAAgB,MAAA,IAAU,qBAAA,CAAsB;AAAA;AAC1D,KACD,CAAA;AAGD,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAGf,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,IAAA,CAAK,QAAA,GAAW,cAAA,EAAgB,MAAA,IAAU,qBAAA,CAAsB,MAAA;AAChE,MAAA,IAAI,CAAC,KAAK,QAAA,EAAU;AAClB,QAAA,MAAM,IAAI,MAAM,2DAA2D,CAAA;AAAA,MAC7E;AAC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AAG,GAAA,CAAI,OAAO,OAAO,CAAA;AACzD,QAAA,OAAO,QAAA,CAAS,IAAA;AAAA,MAClB,CAAA,MAAO;AACL,QAAA,MAAM,IAAI,MAAM,+CAA+C,CAAA;AAAA,MACjE;AAAA,IACF,CAAA,EAAG,yBAAyB,CAAA,EAAE;AAAA,EAChC;AAAA,EACA,MAAM,KAAA,GAAwC;AAC5C,IAAA,MAAM,IAAI,MAAM,sCAAsC,CAAA;AAAA,EACxD;AAAA,EACA,MAAM,WAAA,GAAuE;AAC3E,IAAA,MAAM,IAAI,MAAM,sCAAsC,CAAA;AAAA,EACxD;AACF","file":"index.js","sourcesContent":["import type {\n Ai,\n Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output,\n Ai_Cf_Openai_Whisper_Output,\n Ai_Cf_Openai_Whisper_Tiny_En_Output,\n} from '@cloudflare/workers-types';\nimport { MastraVoice } from '@mastra/core/voice';\nimport Cloudflare from 'cloudflare';\n\ninterface CloudflareListenOptions {\n apiKey?: string;\n model?: '@cf/openai/whisper-tiny-en' | '@cf/openai/whisper' | '@cf/openai/whisper-large-v3-turbo';\n account_id?: string;\n}\n\ntype CloudflareListenOutput =\n | Ai_Cf_Openai_Whisper_Tiny_En_Output\n | Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output\n | Ai_Cf_Openai_Whisper_Output;\n\nconst defaultListeningModel = {\n model: '@cf/openai/whisper-large-v3-turbo' as const,\n apiKey: process.env.CLOUDFLARE_AI_API_KEY,\n account_id: process.env.CLOUDFLARE_ACCOUNT_ID!,\n};\n\nexport class CloudflareVoice extends MastraVoice {\n private apiToken?: string;\n private client: Cloudflare | null = null;\n private binding?: Ai;\n\n constructor({\n listeningModel,\n binding,\n }: {\n listeningModel?: CloudflareListenOptions;\n binding?: Ai;\n } = {}) {\n super({\n listeningModel: {\n name: listeningModel?.model ?? defaultListeningModel.model,\n apiKey: listeningModel?.apiKey ?? defaultListeningModel.apiKey,\n },\n });\n\n // Store Workers AI binding if provided\n this.binding = binding;\n\n // Only setup REST client if no binding provided or both are needed\n if (!binding) {\n this.apiToken = listeningModel?.apiKey || defaultListeningModel.apiKey;\n if (!this.apiToken) {\n throw new Error('CLOUDFLARE_AI_API_KEY must be set when not using bindings');\n }\n this.client = new Cloudflare({ apiToken: this.apiToken });\n }\n }\n\n /**\n * Checks if listening capabilities are enabled.\n *\n * @returns {Promise<{ enabled: boolean }>}\n */\n async getListener() {\n return { enabled: true };\n }\n\n async listen(audioStream: NodeJS.ReadableStream, options?: CloudflareListenOptions): Promise<string> {\n return this.traced(async () => {\n // Collect audio data into buffer\n const chunks: Buffer[] = [];\n for await (const chunk of audioStream) {\n if (typeof chunk === 'string') {\n chunks.push(Buffer.from(chunk));\n } else {\n chunks.push(chunk);\n }\n }\n const audioBuffer = Buffer.concat(chunks);\n const base64Audio = audioBuffer.toString('base64');\n\n const model = options?.model || defaultListeningModel.model;\n\n // Use native binding if available, otherwise use REST API\n if (this.binding) {\n // Using Workers AI binding\n const response = (await this.binding.run(model, {\n audio: base64Audio,\n })) as CloudflareListenOutput;\n return response.text;\n } else if (this.client) {\n // Using REST API client\n const payload = { audio: base64Audio, account_id: options?.account_id || defaultListeningModel.account_id };\n const response = (await this.client.ai.run(model, payload)) as any;\n return response.text as string;\n } else {\n throw new Error('Neither binding nor REST client is configured');\n }\n }, 'voice.cloudflare.listen')();\n }\n async speak(): Promise<NodeJS.ReadableStream> {\n throw new Error('This feature is not yet implemented.');\n }\n async getSpeakers(): Promise<Array<{ voiceId: string; [key: string]: any }>> {\n throw new Error('This feature is not yet implemented.');\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/voice-cloudflare",
3
- "version": "0.10.6",
3
+ "version": "0.10.7",
4
4
  "description": "Mastra Sarvam AI voice integration",
5
5
  "type": "module",
6
6
  "files": [
@@ -15,7 +15,7 @@
15
15
  "default": "./dist/index.js"
16
16
  },
17
17
  "require": {
18
- "types": "./dist/index.d.cts",
18
+ "types": "./dist/index.d.ts",
19
19
  "default": "./dist/index.cjs"
20
20
  }
21
21
  },
@@ -27,15 +27,16 @@
27
27
  "zod": "^3.25.67"
28
28
  },
29
29
  "devDependencies": {
30
- "@cloudflare/workers-types": "^4.20250725.0",
30
+ "@cloudflare/workers-types": "^4.20250801.0",
31
31
  "@microsoft/api-extractor": "^7.52.8",
32
32
  "@types/node": "^20.19.0",
33
33
  "eslint": "^9.30.1",
34
34
  "tsup": "^8.5.0",
35
35
  "typescript": "^5.8.3",
36
36
  "vitest": "^3.2.4",
37
- "@internal/lint": "0.0.24",
38
- "@mastra/core": "0.12.0"
37
+ "@internal/lint": "0.0.27",
38
+ "@internal/types-builder": "0.0.2",
39
+ "@mastra/core": "0.13.0"
39
40
  },
40
41
  "keywords": [
41
42
  "mastra",
@@ -48,11 +49,11 @@
48
49
  "speech-recognition"
49
50
  ],
50
51
  "peerDependencies": {
51
- "@mastra/core": ">=0.10.7-0 <0.13.0-0"
52
+ "@mastra/core": ">=0.10.7-0 <0.14.0-0"
52
53
  },
53
54
  "scripts": {
54
- "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
55
- "build:watch": "pnpm build --watch",
55
+ "build": "tsup --silent --config tsup.config.ts",
56
+ "build:watch": "tsup --watch --silent --config tsup.config.ts",
56
57
  "test": "vitest run",
57
58
  "test:watch": "vitest watch",
58
59
  "lint": "eslint ."
@@ -1,34 +0,0 @@
1
- import type { Ai as Ai_2 } from '@cloudflare/workers-types';
2
- import { MastraVoice } from '@mastra/core/voice';
3
-
4
- declare interface CloudflareListenOptions {
5
- apiKey?: string;
6
- model?: '@cf/openai/whisper-tiny-en' | '@cf/openai/whisper' | '@cf/openai/whisper-large-v3-turbo';
7
- account_id?: string;
8
- }
9
-
10
- export declare class CloudflareVoice extends MastraVoice {
11
- private apiToken?;
12
- private client;
13
- private binding?;
14
- constructor({ listeningModel, binding, }?: {
15
- listeningModel?: CloudflareListenOptions;
16
- binding?: Ai_2;
17
- });
18
- /**
19
- * Checks if listening capabilities are enabled.
20
- *
21
- * @returns {Promise<{ enabled: boolean }>}
22
- */
23
- getListener(): Promise<{
24
- enabled: boolean;
25
- }>;
26
- listen(audioStream: NodeJS.ReadableStream, options?: CloudflareListenOptions): Promise<string>;
27
- speak(): Promise<NodeJS.ReadableStream>;
28
- getSpeakers(): Promise<Array<{
29
- voiceId: string;
30
- [key: string]: any;
31
- }>>;
32
- }
33
-
34
- export { }
@@ -1,34 +0,0 @@
1
- import type { Ai as Ai_2 } from '@cloudflare/workers-types';
2
- import { MastraVoice } from '@mastra/core/voice';
3
-
4
- declare interface CloudflareListenOptions {
5
- apiKey?: string;
6
- model?: '@cf/openai/whisper-tiny-en' | '@cf/openai/whisper' | '@cf/openai/whisper-large-v3-turbo';
7
- account_id?: string;
8
- }
9
-
10
- export declare class CloudflareVoice extends MastraVoice {
11
- private apiToken?;
12
- private client;
13
- private binding?;
14
- constructor({ listeningModel, binding, }?: {
15
- listeningModel?: CloudflareListenOptions;
16
- binding?: Ai_2;
17
- });
18
- /**
19
- * Checks if listening capabilities are enabled.
20
- *
21
- * @returns {Promise<{ enabled: boolean }>}
22
- */
23
- getListener(): Promise<{
24
- enabled: boolean;
25
- }>;
26
- listen(audioStream: NodeJS.ReadableStream, options?: CloudflareListenOptions): Promise<string>;
27
- speak(): Promise<NodeJS.ReadableStream>;
28
- getSpeakers(): Promise<Array<{
29
- voiceId: string;
30
- [key: string]: any;
31
- }>>;
32
- }
33
-
34
- export { }
package/dist/index.d.cts DELETED
@@ -1 +0,0 @@
1
- export { CloudflareVoice } from './_tsup-dts-rollup.cjs';