@deepseek-ai/dsh-experimental-api-speech-to-text 0.1.7-alpha.2 → 0.1.7-rc.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.
package/README.i18n.yaml CHANGED
@@ -1,6 +1,37 @@
1
- # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
- # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
- # after editing either side, bring the other along and re-record with:
1
+ # Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
2
+ # section, a hash of its English and Chinese blocks outside code blocks and generated regions.
3
+ # After editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/experimental/api-speech-to-text/README.md
5
- README.md: ecc83c15b4217323c074733ae77259261598803c
6
- README.zh.md: 46ac6a16c902c32f2effb23a98141b1afbdccd37
5
+ /:
6
+ en: 492c18403fe67bc0
7
+ zh: 547cb261324c7691
8
+ /deepseek-ai-dsh-experimental-api-speech-to-text:
9
+ en: 9273fdafb9804346
10
+ zh: 4fec3a81b4d29fc6
11
+ /deepseek-ai-dsh-experimental-api-speech-to-text/summary:
12
+ en: 81978b4b6c035754
13
+ zh: f1a08200eb31c020
14
+ /deepseek-ai-dsh-experimental-api-speech-to-text/table-of-contents:
15
+ en: d152484eb41ac6b4
16
+ zh: 364c80ee00a374ff
17
+ /deepseek-ai-dsh-experimental-api-speech-to-text/use-this-package:
18
+ en: 23efd2789fe70cd9
19
+ zh: 3edd559ee5975742
20
+ /deepseek-ai-dsh-experimental-api-speech-to-text/understand-the-implementation:
21
+ en: 83c580c412f4026a
22
+ zh: cd6742fef27de9e5
23
+ /deepseek-ai-dsh-experimental-api-speech-to-text/further-exploration:
24
+ en: 5c64426add9d79d6
25
+ zh: 4e06aa2ead8d2ccd
26
+ /deepseek-ai-dsh-experimental-api-speech-to-text/model-experience:
27
+ en: 3c5a85f8b7129ce8
28
+ zh: d5f491ca88d9a810
29
+ /deepseek-ai-dsh-experimental-api-speech-to-text/model-experience/kv-cache-effect:
30
+ en: b5ec79db2e1d0dbc
31
+ zh: e5aff567ae5ee6fc
32
+ /deepseek-ai-dsh-experimental-api-speech-to-text/known-limitations-and-deferred-work:
33
+ en: 067a5c6a1772f2eb
34
+ zh: 6973c5a4a950c5cf
35
+ /deepseek-ai-dsh-experimental-api-speech-to-text/known-limitations-and-deferred-work/dev-note:
36
+ en: 0225ba087c5266f3
37
+ zh: 4e706f1b2b984e63
package/README.md CHANGED
@@ -27,6 +27,8 @@ The `speech` Remote connects browser recordings to `ctx.speechToText`. It expose
27
27
 
28
28
  Compose with the speech Service Definition and Typert. `maxAudioBytes` and `maxDurationSeconds` limit accepted recordings. The browser UI mounts this package’s generated `/remote` contribution when enabled.
29
29
 
30
+ `prepare(providerId, { downloadSource })` forwards one advertised source to the provider; omission keeps its configured policy. The catalog carries `downloadSources` for the picker. The provider rejects unavailable choices and changes to an active task’s source.
31
+
30
32
  -----
31
33
 
32
34
  <a id="understand-the-implementation"></a>
package/README.zh.md CHANGED
@@ -27,6 +27,8 @@ kind: "package-reference"
27
27
 
28
28
  与语音服务定义和 Typert 组合。`maxAudioBytes` 与 `maxDurationSeconds` 限制接收的录音。浏览器 UI 启用时挂载本包生成的 `/remote` 贡献。
29
29
 
30
+ `prepare(providerId, { downloadSource })` 将公布的一个下载源转发给提供方,省略时保留其配置策略。目录通过 `downloadSources` 提供选择器选项。提供方拒绝不可用的源,以及对进行中任务的源变更。
31
+
30
32
  -----
31
33
 
32
34
  <a id="understand-the-implementation"></a>
package/lib/index.js CHANGED
@@ -173,9 +173,10 @@ let SpeechController = (() => {
173
173
  /**
174
174
  * Start or join one Host-owned preparation task.
175
175
  * @param providerId - selected recognizer.
176
+ * @param options - task-local source selection validated by the provider.
176
177
  */
177
- prepare(providerId) {
178
- this.ctx.speechToText.prepare(providerId);
178
+ prepare(providerId, options) {
179
+ this.ctx.speechToText.prepare(providerId, options);
179
180
  }
180
181
  /**
181
182
  * Explicitly cancel resource preparation.
@@ -69,6 +69,7 @@ const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_catalog_result$sch
69
69
  'minimumMinutes': z.number().readonly(),
70
70
  'maximumMinutes': z.number().readonly(),
71
71
  }).readonly().optional(),
72
+ 'downloadSources': z.array(z.string()).readonly().optional(),
72
73
  })).readonly(),
73
74
  'selection': z.object({
74
75
  'providerId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -146,6 +147,7 @@ const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_follow_result$sche
146
147
  'minimumMinutes': z.number().readonly(),
147
148
  'maximumMinutes': z.number().readonly(),
148
149
  }).readonly().optional(),
150
+ 'downloadSources': z.array(z.string()).readonly().optional(),
149
151
  })).readonly(),
150
152
  'selection': z.object({
151
153
  'providerId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -154,6 +156,10 @@ const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_follow_result$sche
154
156
  }))
155
157
  let _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_0$schema$value
156
158
  const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_0$schema = () => (_deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
159
+ let _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_1$schema$value
160
+ const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_1$schema = () => (_deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_1$schema$value ??= z.union([z.undefined(), z.object({
161
+ 'downloadSource': z.string().readonly().optional(),
162
+ })]))
157
163
  let _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_result$schema$value
158
164
  const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_result$schema = () => (_deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_result$schema$value ??= z.void())
159
165
  let _deepseek_ai_dsh_experimental_api_speech_to_text_speech_transcribe_parameter_0$schema$value
@@ -198,7 +204,7 @@ export const TYPERT = {
198
204
  typeSymbol: '@deepseek-ai/dsh-experimental-api-speech-to-text#speech/cancelPreparation:result',
199
205
  create: _deepseek_ai_dsh_experimental_api_speech_to_text_speech_cancelPreparation_result$schema,
200
206
  },
201
- sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":79,"column":3},
207
+ sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":80,"column":3},
202
208
  },
203
209
  {
204
210
  id: '@deepseek-ai/dsh-experimental-api-speech-to-text#speech/catalog',
@@ -274,13 +280,24 @@ export const TYPERT = {
274
280
  create: _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_0$schema,
275
281
  },
276
282
  },
283
+ {
284
+ name: 'options',
285
+ wire: 'options',
286
+ source: 'json',
287
+ acceptsUndefined: true,
288
+ codec: {
289
+ mode: 'strict',
290
+ typeSymbol: '@deepseek-ai/dsh-experimental-speech-to-text/types#SpeechPreparationOptions',
291
+ create: _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_1$schema,
292
+ },
293
+ },
277
294
  ],
278
295
  result: {
279
296
  mode: 'strict',
280
297
  typeSymbol: '@deepseek-ai/dsh-experimental-api-speech-to-text#speech/prepare:result',
281
298
  create: _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_result$schema,
282
299
  },
283
- sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":71,"column":3},
300
+ sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":72,"column":3},
284
301
  },
285
302
  {
286
303
  id: '@deepseek-ai/dsh-experimental-api-speech-to-text#speech/transcribe',
@@ -306,7 +323,7 @@ export const TYPERT = {
306
323
  typeSymbol: '@deepseek-ai/dsh-experimental-speech-to-text/types#Transcript',
307
324
  create: _deepseek_ai_dsh_experimental_api_speech_to_text_speech_transcribe_result$schema,
308
325
  },
309
- sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":88,"column":9},
326
+ sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":89,"column":9},
310
327
  },
311
328
  ],
312
329
  model: {
@@ -343,9 +360,9 @@ export const TYPERT = {
343
360
  {
344
361
  "kind": "method",
345
362
  "name": "prepare",
346
- "signature": "@Remote prepare(providerId: SpeechProviderId): void",
363
+ "signature": "@Remote prepare(providerId: SpeechProviderId, options?: SpeechPreparationOptions): void",
347
364
  "summary": "Start or join one Host-owned preparation task.",
348
- "jsDoc": "/**\n * Start or join one Host-owned preparation task.\n * @param providerId - selected recognizer.\n */"
365
+ "jsDoc": "/**\n * Start or join one Host-owned preparation task.\n * @param providerId - selected recognizer.\n * @param options - task-local source selection validated by the provider.\n */"
349
366
  },
350
367
  {
351
368
  "kind": "method",
@@ -375,6 +392,10 @@ export const TYPERT = {
375
392
  "name": "SpeechDownloadFailure",
376
393
  "declaration": "export interface SpeechDownloadFailure {\n readonly resource: string;\n readonly source: string;\n readonly reason: 'network' | 'dns' | 'timeout' | 'certificate' | 'http' | 'integrity' | 'storage' | 'unknown';\n readonly code?: string;\n readonly status?: number;\n}"
377
394
  },
395
+ {
396
+ "name": "SpeechPreparationOptions",
397
+ "declaration": "export interface SpeechPreparationOptions {\n readonly downloadSource?: string;\n}"
398
+ },
378
399
  {
379
400
  "name": "SpeechPreparationState",
380
401
  "declaration": "export type SpeechPreparationState = ({ readonly phase: 'unprepared' | 'ready' | 'standby' | 'cancelled'; } | { readonly phase: 'downloading'; readonly resource: string; readonly completedBytes: number; readonly totalBytes?: number; } | { readonly phase: 'checking' | 'loading' | 'waking' | 'cancelling'; readonly startedAt: number; } | { readonly phase: 'failed'; readonly message: string; readonly download?: SpeechDownloadFailure; }) & { readonly step?: SpeechPreparationStepKind; readonly steps?: readonly SpeechPreparationStep[]; };"
@@ -393,7 +414,7 @@ export const TYPERT = {
393
414
  },
394
415
  {
395
416
  "name": "SpeechProviderInfo",
396
- "declaration": "export interface SpeechProviderInfo {\n readonly id: SpeechProviderId;\n readonly name: string;\n readonly location: 'host-local' | 'cloud';\n readonly languages: readonly string[];\n readonly setupEstimate?: SpeechSetupEstimate;\n}"
417
+ "declaration": "export interface SpeechProviderInfo {\n readonly id: SpeechProviderId;\n readonly name: string;\n readonly location: 'host-local' | 'cloud';\n readonly languages: readonly string[];\n readonly setupEstimate?: SpeechSetupEstimate;\n readonly downloadSources?: readonly string[];\n}"
397
418
  },
398
419
  {
399
420
  "name": "SpeechProviderView",
@@ -5,7 +5,7 @@ import type {
5
5
  TypertRemoteContribution,
6
6
  } from '@deepseek-ai/dsh-typert-protocol'
7
7
  import type { SpeechCatalog, TranscriptionRequest } from '@deepseek-ai/dsh-experimental-api-speech-to-text/types'
8
- import type { SpeechProviderId, SpeechSelectionPatch, Transcript } from '@deepseek-ai/dsh-experimental-speech-to-text/types'
8
+ import type { SpeechPreparationOptions, SpeechProviderId, SpeechSelectionPatch, Transcript } from '@deepseek-ai/dsh-experimental-speech-to-text/types'
9
9
 
10
10
  declare module '@deepseek-ai/dsh-typert-protocol' {
11
11
  interface TypertRemoteNamespace$737065656368 {
@@ -13,7 +13,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
13
13
  catalog: () => Promise<RemoteResult<SpeechCatalog>>
14
14
  configure: (patch: SpeechSelectionPatch) => Promise<RemoteResult<void>>
15
15
  follow: (signal?: AbortSignal) => RemoteStreamHandle<SpeechCatalog, never>
16
- prepare: (providerId: SpeechProviderId) => Promise<RemoteResult<void>>
16
+ prepare: (providerId: SpeechProviderId, options?: SpeechPreparationOptions) => Promise<RemoteResult<void>>
17
17
  transcribe: (request: TranscriptionRequest, signal?: AbortSignal) => Promise<RemoteResult<Transcript>>
18
18
  }
19
19
  interface TypertRemoteMap {
@@ -21,7 +21,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
21
21
  'speech/catalog': () => Promise<RemoteResult<SpeechCatalog>>
22
22
  'speech/configure': (patch: SpeechSelectionPatch) => Promise<RemoteResult<void>>
23
23
  'speech/follow': (signal?: AbortSignal) => RemoteStreamHandle<SpeechCatalog, never>
24
- 'speech/prepare': (providerId: SpeechProviderId) => Promise<RemoteResult<void>>
24
+ 'speech/prepare': (providerId: SpeechProviderId, options?: SpeechPreparationOptions) => Promise<RemoteResult<void>>
25
25
  'speech/transcribe': (request: TranscriptionRequest, signal?: AbortSignal) => Promise<RemoteResult<Transcript>>
26
26
  }
27
27
  interface TypertRemoteNamespaceMap {
@@ -69,6 +69,7 @@ const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_catalog_result$sch
69
69
  'minimumMinutes': z.number().readonly(),
70
70
  'maximumMinutes': z.number().readonly(),
71
71
  }).readonly().optional(),
72
+ 'downloadSources': z.array(z.string()).readonly().optional(),
72
73
  })).readonly(),
73
74
  'selection': z.object({
74
75
  'providerId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -146,6 +147,7 @@ const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_follow_result$sche
146
147
  'minimumMinutes': z.number().readonly(),
147
148
  'maximumMinutes': z.number().readonly(),
148
149
  }).readonly().optional(),
150
+ 'downloadSources': z.array(z.string()).readonly().optional(),
149
151
  })).readonly(),
150
152
  'selection': z.object({
151
153
  'providerId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -154,6 +156,10 @@ const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_follow_result$sche
154
156
  }))
155
157
  let _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_0$schema$value
156
158
  const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_0$schema = () => (_deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
159
+ let _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_1$schema$value
160
+ const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_1$schema = () => (_deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_1$schema$value ??= z.union([z.undefined(), z.object({
161
+ 'downloadSource': z.string().readonly().optional(),
162
+ })]))
157
163
  let _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_result$schema$value
158
164
  const _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_result$schema = () => (_deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_result$schema$value ??= z.void())
159
165
  let _deepseek_ai_dsh_experimental_api_speech_to_text_speech_transcribe_parameter_0$schema$value
@@ -195,7 +201,7 @@ export const TYPERT_REMOTE = {
195
201
  typeSymbol: '@deepseek-ai/dsh-experimental-api-speech-to-text#speech/cancelPreparation:result',
196
202
  create: _deepseek_ai_dsh_experimental_api_speech_to_text_speech_cancelPreparation_result$schema,
197
203
  },
198
- sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":79,"column":3},
204
+ sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":80,"column":3},
199
205
  },
200
206
  {
201
207
  id: '@deepseek-ai/dsh-experimental-api-speech-to-text#speech/catalog',
@@ -271,13 +277,24 @@ export const TYPERT_REMOTE = {
271
277
  create: _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_0$schema,
272
278
  },
273
279
  },
280
+ {
281
+ name: 'options',
282
+ wire: 'options',
283
+ source: 'json',
284
+ acceptsUndefined: true,
285
+ codec: {
286
+ mode: 'strict',
287
+ typeSymbol: '@deepseek-ai/dsh-experimental-speech-to-text/types#SpeechPreparationOptions',
288
+ create: _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_parameter_1$schema,
289
+ },
290
+ },
274
291
  ],
275
292
  result: {
276
293
  mode: 'strict',
277
294
  typeSymbol: '@deepseek-ai/dsh-experimental-api-speech-to-text#speech/prepare:result',
278
295
  create: _deepseek_ai_dsh_experimental_api_speech_to_text_speech_prepare_result$schema,
279
296
  },
280
- sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":71,"column":3},
297
+ sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":72,"column":3},
281
298
  },
282
299
  {
283
300
  id: '@deepseek-ai/dsh-experimental-api-speech-to-text#speech/transcribe',
@@ -303,7 +320,7 @@ export const TYPERT_REMOTE = {
303
320
  typeSymbol: '@deepseek-ai/dsh-experimental-speech-to-text/types#Transcript',
304
321
  create: _deepseek_ai_dsh_experimental_api_speech_to_text_speech_transcribe_result$schema,
305
322
  },
306
- sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":88,"column":9},
323
+ sourceLocation: {"file":"packages/experimental/api-speech-to-text/src/index.ts","line":89,"column":9},
307
324
  },
308
325
  ],
309
326
  }
@@ -2,7 +2,7 @@
2
2
  import { Context } from '@deepseek-ai/cordis';
3
3
  import z from '@deepseek-ai/schemastery';
4
4
  import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
5
- import type { SpeechProviderId, SpeechSelectionPatch, Transcript } from '@deepseek-ai/dsh-experimental-speech-to-text/types';
5
+ import type { SpeechPreparationOptions, SpeechProviderId, SpeechSelectionPatch, Transcript } from '@deepseek-ai/dsh-experimental-speech-to-text/types';
6
6
  import type { SpeechCatalog, TranscriptionRequest } from './types.ts';
7
7
  export type * from './types.ts';
8
8
  declare module '@deepseek-ai/cordis' {
@@ -44,8 +44,9 @@ export default class SpeechController extends TypertRemoteService {
44
44
  /**
45
45
  * Start or join one Host-owned preparation task.
46
46
  * @param providerId - selected recognizer.
47
+ * @param options - task-local source selection validated by the provider.
47
48
  */
48
- prepare(providerId: SpeechProviderId): void;
49
+ prepare(providerId: SpeechProviderId, options?: SpeechPreparationOptions): void;
49
50
  /**
50
51
  * Explicitly cancel resource preparation.
51
52
  * @param providerId - selected recognizer.
@@ -96,8 +96,9 @@ let SpeechController = (() => {
96
96
  /**
97
97
  * Start or join one Host-owned preparation task.
98
98
  * @param providerId - selected recognizer.
99
+ * @param options - task-local source selection validated by the provider.
99
100
  */
100
- prepare(providerId) { this.ctx.speechToText.prepare(providerId); }
101
+ prepare(providerId, options) { this.ctx.speechToText.prepare(providerId, options); }
101
102
  /**
102
103
  * Explicitly cancel resource preparation.
103
104
  * @param providerId - selected recognizer.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-experimental-api-speech-to-text",
3
3
  "description": "Authenticated experimental speech transcription for browser clients",
4
- "version": "0.1.7-alpha.2",
4
+ "version": "0.1.7-rc.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -49,12 +49,12 @@
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@deepseek-ai/cordis": "~4.0.4",
52
- "@deepseek-ai/dsh-experimental-speech-to-text": "0.1.7-alpha.2",
53
- "@deepseek-ai/dsh-typert-protocol": "0.1.7-alpha.2"
52
+ "@deepseek-ai/dsh-experimental-speech-to-text": "0.1.7-rc.2",
53
+ "@deepseek-ai/dsh-typert-protocol": "0.1.7-rc.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@deepseek-ai/cordis": "~4.0.4",
57
- "@deepseek-ai/dsh-experimental-speech-to-text": "0.1.7-alpha.2",
58
- "@deepseek-ai/dsh-typert-protocol": "0.1.7-alpha.2"
57
+ "@deepseek-ai/dsh-typert-protocol": "0.1.7-rc.2",
58
+ "@deepseek-ai/dsh-experimental-speech-to-text": "0.1.7-rc.2"
59
59
  }
60
60
  }