@contractspec/example.voice-providers 2.3.0 → 2.5.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.
@@ -3,10 +3,10 @@ $ bun run prebuild && bun run build:bundle && bun run build:types
3
3
  $ contractspec-bun-build prebuild
4
4
  $ contractspec-bun-build transpile
5
5
  [contractspec-bun-build] transpile target=bun root=src entries=9
6
- Bundled 9 modules in 20ms
6
+ Bundled 9 modules in 30ms
7
7
 
8
8
  ./connection.sample.js 1.50 KB (entry point)
9
- ./run.js 5.59 KB (entry point)
9
+ ./run.js 5.65 KB (entry point)
10
10
  ./index.js 5.99 KB (entry point)
11
11
  docs/index.js 1.93 KB (entry point)
12
12
  docs/voice-providers.docblock.js 1.93 KB (entry point)
@@ -16,10 +16,10 @@ Bundled 9 modules in 20ms
16
16
  handlers/create-provider.js 1.27 KB (entry point)
17
17
 
18
18
  [contractspec-bun-build] transpile target=node root=src entries=9
19
- Bundled 9 modules in 41ms
19
+ Bundled 9 modules in 47ms
20
20
 
21
21
  ./connection.sample.js 1.49 KB (entry point)
22
- ./run.js 5.58 KB (entry point)
22
+ ./run.js 5.64 KB (entry point)
23
23
  ./index.js 5.98 KB (entry point)
24
24
  docs/index.js 1.92 KB (entry point)
25
25
  docs/voice-providers.docblock.js 1.92 KB (entry point)
@@ -29,10 +29,10 @@ Bundled 9 modules in 41ms
29
29
  handlers/create-provider.js 1.26 KB (entry point)
30
30
 
31
31
  [contractspec-bun-build] transpile target=browser root=src entries=9
32
- Bundled 9 modules in 31ms
32
+ Bundled 9 modules in 60ms
33
33
 
34
34
  ./connection.sample.js 1.49 KB (entry point)
35
- ./run.js 5.58 KB (entry point)
35
+ ./run.js 5.64 KB (entry point)
36
36
  ./index.js 5.98 KB (entry point)
37
37
  docs/index.js 1.92 KB (entry point)
38
38
  docs/voice-providers.docblock.js 1.92 KB (entry point)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @contractspec/example.voice-providers
2
2
 
3
+ ## 2.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c83c323: feat: major change to content generation
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [4fa3bd4]
12
+ - Updated dependencies [63eee9b]
13
+ - Updated dependencies [284cbe2]
14
+ - Updated dependencies [c83c323]
15
+ - @contractspec/lib.contracts-spec@2.5.0
16
+ - @contractspec/lib.contracts-integrations@2.5.0
17
+ - @contractspec/integration.providers-impls@2.5.0
18
+
19
+ ## 2.4.0
20
+
21
+ ### Minor Changes
22
+
23
+ - chore: improve documentation
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+ - @contractspec/integration.providers-impls@2.4.0
29
+ - @contractspec/lib.contracts-integrations@2.4.0
30
+ - @contractspec/lib.contracts-spec@2.4.0
31
+
3
32
  ## 2.3.0
4
33
 
5
34
  ### Minor Changes
@@ -82,14 +82,14 @@ async function runVoiceProvidersExampleFromEnv() {
82
82
  ...input,
83
83
  synthesis: {
84
84
  text,
85
- voiceId
85
+ voiceId: voiceId ?? "default"
86
86
  }
87
87
  });
88
88
  output.synthesis = {
89
- format: result.format,
90
- sampleRateHz: result.sampleRateHz,
91
- bytes: result.audio.length,
92
- url: result.url
89
+ format: result.audio.format,
90
+ sampleRateHz: result.audio.sampleRateHz,
91
+ bytes: result.audio.data.length,
92
+ durationMs: result.audio.durationMs
93
93
  };
94
94
  }
95
95
  return output;
@@ -1,4 +1,4 @@
1
- import type { VoiceProvider } from '@contractspec/lib.contracts-integrations';
1
+ import type { TTSProvider } from '@contractspec/lib.contracts-integrations';
2
2
  export type VoiceIntegrationKey = 'ai-voice.gradium' | 'ai-voice.fal';
3
3
  export interface VoiceProviderSecrets {
4
4
  apiKey: string;
@@ -21,4 +21,4 @@ export interface VoiceProviderFactoryInput {
21
21
  secrets: VoiceProviderSecrets;
22
22
  config?: VoiceProviderConfig;
23
23
  }
24
- export declare function createVoiceProvider(input: VoiceProviderFactoryInput): VoiceProvider;
24
+ export declare function createVoiceProvider(input: VoiceProviderFactoryInput): TTSProvider;
@@ -1,6 +1,6 @@
1
- import type { VoiceSynthesisInput, VoiceSynthesisResult } from '@contractspec/lib.contracts-integrations';
1
+ import type { TTSSynthesisInput, TTSSynthesisResult } from '@contractspec/lib.contracts-integrations';
2
2
  import { type VoiceProviderFactoryInput } from './create-provider';
3
3
  export interface SynthesizeVoiceInput extends VoiceProviderFactoryInput {
4
- synthesis: VoiceSynthesisInput;
4
+ synthesis: TTSSynthesisInput;
5
5
  }
6
- export declare function synthesizeVoice(input: SynthesizeVoiceInput): Promise<VoiceSynthesisResult>;
6
+ export declare function synthesizeVoice(input: SynthesizeVoiceInput): Promise<TTSSynthesisResult>;
package/dist/node/run.js CHANGED
@@ -82,14 +82,14 @@ async function runVoiceProvidersExampleFromEnv() {
82
82
  ...input,
83
83
  synthesis: {
84
84
  text,
85
- voiceId
85
+ voiceId: voiceId ?? "default"
86
86
  }
87
87
  });
88
88
  output.synthesis = {
89
- format: result.format,
90
- sampleRateHz: result.sampleRateHz,
91
- bytes: result.audio.length,
92
- url: result.url
89
+ format: result.audio.format,
90
+ sampleRateHz: result.audio.sampleRateHz,
91
+ bytes: result.audio.data.length,
92
+ durationMs: result.audio.durationMs
93
93
  };
94
94
  }
95
95
  return output;
package/dist/run.js CHANGED
@@ -83,14 +83,14 @@ async function runVoiceProvidersExampleFromEnv() {
83
83
  ...input,
84
84
  synthesis: {
85
85
  text,
86
- voiceId
86
+ voiceId: voiceId ?? "default"
87
87
  }
88
88
  });
89
89
  output.synthesis = {
90
- format: result.format,
91
- sampleRateHz: result.sampleRateHz,
92
- bytes: result.audio.length,
93
- url: result.url
90
+ format: result.audio.format,
91
+ sampleRateHz: result.audio.sampleRateHz,
92
+ bytes: result.audio.data.length,
93
+ durationMs: result.audio.durationMs
94
94
  };
95
95
  }
96
96
  return output;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.voice-providers",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "Voice provider example: Gradium and Fal text-to-speech integration patterns.",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -92,14 +92,14 @@
92
92
  "typecheck": "tsc --noEmit"
93
93
  },
94
94
  "dependencies": {
95
- "@contractspec/integration.providers-impls": "2.3.0",
96
- "@contractspec/lib.contracts-spec": "2.3.0",
97
- "@contractspec/lib.contracts-integrations": "2.3.0"
95
+ "@contractspec/integration.providers-impls": "2.5.0",
96
+ "@contractspec/lib.contracts-spec": "2.5.0",
97
+ "@contractspec/lib.contracts-integrations": "2.5.0"
98
98
  },
99
99
  "devDependencies": {
100
- "@contractspec/tool.typescript": "2.3.0",
100
+ "@contractspec/tool.typescript": "2.5.0",
101
101
  "typescript": "^5.9.3",
102
- "@contractspec/tool.bun": "2.3.0"
102
+ "@contractspec/tool.bun": "2.5.0"
103
103
  },
104
104
  "publishConfig": {
105
105
  "access": "public",
@@ -1,6 +1,6 @@
1
1
  import { FalVoiceProvider } from '@contractspec/integration.providers-impls/impls/fal-voice';
2
2
  import { GradiumVoiceProvider } from '@contractspec/integration.providers-impls/impls/gradium-voice';
3
- import type { VoiceProvider } from '@contractspec/lib.contracts-integrations';
3
+ import type { TTSProvider } from '@contractspec/lib.contracts-integrations';
4
4
 
5
5
  export type VoiceIntegrationKey = 'ai-voice.gradium' | 'ai-voice.fal';
6
6
 
@@ -37,7 +37,7 @@ export interface VoiceProviderFactoryInput {
37
37
 
38
38
  export function createVoiceProvider(
39
39
  input: VoiceProviderFactoryInput
40
- ): VoiceProvider {
40
+ ): TTSProvider {
41
41
  const { integrationKey, secrets, config } = input;
42
42
 
43
43
  if (!secrets.apiKey) {
@@ -1,6 +1,6 @@
1
1
  import type {
2
- VoiceSynthesisInput,
3
- VoiceSynthesisResult,
2
+ TTSSynthesisInput,
3
+ TTSSynthesisResult,
4
4
  } from '@contractspec/lib.contracts-integrations';
5
5
 
6
6
  import {
@@ -9,12 +9,12 @@ import {
9
9
  } from './create-provider';
10
10
 
11
11
  export interface SynthesizeVoiceInput extends VoiceProviderFactoryInput {
12
- synthesis: VoiceSynthesisInput;
12
+ synthesis: TTSSynthesisInput;
13
13
  }
14
14
 
15
15
  export async function synthesizeVoice(
16
16
  input: SynthesizeVoiceInput
17
- ): Promise<VoiceSynthesisResult> {
17
+ ): Promise<TTSSynthesisResult> {
18
18
  const provider = createVoiceProvider(input);
19
19
  return provider.synthesize(input.synthesis);
20
20
  }
package/src/run.ts CHANGED
@@ -53,14 +53,14 @@ export async function runVoiceProvidersExampleFromEnv() {
53
53
  ...input,
54
54
  synthesis: {
55
55
  text,
56
- voiceId,
56
+ voiceId: voiceId ?? 'default',
57
57
  },
58
58
  });
59
59
  output.synthesis = {
60
- format: result.format,
61
- sampleRateHz: result.sampleRateHz,
62
- bytes: result.audio.length,
63
- url: result.url,
60
+ format: result.audio.format,
61
+ sampleRateHz: result.audio.sampleRateHz,
62
+ bytes: result.audio.data.length,
63
+ durationMs: result.audio.durationMs,
64
64
  };
65
65
  }
66
66