@lincyaw/kernel 1.0.0-rc.60 → 1.0.0-rc.62

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lincyaw/kernel",
3
- "version": "1.0.0-rc.60",
3
+ "version": "1.0.0-rc.62",
4
4
  "description": "Presmium's shared kernel: the IR and plugin contracts, the service registry, anchors and checks",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -5,6 +5,7 @@ import type { Member } from './server.ts'
5
5
  import type { SpeechEngineInfo, VoiceCloneRequest, VoiceCloneStatus } from './speech.ts'
6
6
  import type { VoiceCatalogAnswer, VoiceoverCancellation } from './voice.ts'
7
7
  import type { DocumentVoiceTasks, VoiceoverJobQuery, VoiceoverStart, VoicePreviewStart } from './voiceover-execution.ts'
8
+ import { MEDIA_LOCATION_PROPERTIES } from './media-uploads.ts'
8
9
 
9
10
  export interface DocumentVoiceCapabilities {
10
11
  document: string
@@ -25,11 +26,12 @@ export interface DocumentVoiceCatalogQuery { source?: CanonicalSource, engine?:
25
26
  export interface DocumentVoiceCatalogAnswer extends VoiceCatalogAnswer { document: string, source: CanonicalSource, findings?: Finding[] }
26
27
 
27
28
  export const VOICE_CLONE_MAX_AUDIO_BYTES = 10 << 20
28
- /** Files are scoped workspace paths; the service reads and fixes their bytes before spending approval. */
29
+ export type DocumentVoiceCloneAudio = string | { upload: string }
30
+ /** Scoped workspace paths or ready uploads; the service fixes their bytes before spending approval. */
29
31
  export type DocumentVoiceCloneRequest = Omit<VoiceCloneRequest, 'sample' | 'consent'> & {
30
32
  source?: CanonicalSource
31
- sample: string
32
- consent: { speaker: string, scope: string, statement: string }
33
+ sample: DocumentVoiceCloneAudio
34
+ consent: { speaker: string, scope: string, statement: DocumentVoiceCloneAudio }
33
35
  }
34
36
  export interface DocumentVoiceCloneQuery { engine?: string, voice: string }
35
37
  /** A process-local capability for this call, never a model argument or a retained plan. */
@@ -63,6 +65,7 @@ export const DOCUMENT_VOICE_CATALOG_SCHEMA = {
63
65
  } as const
64
66
 
65
67
  const cloneText = { type: 'string', minLength: 1, maxLength: 200 } as const
68
+ const cloneAudio: Schema = { oneOf: [{ type: 'string', minLength: 1, maxLength: 1024 }, { type: 'object', additionalProperties: false, properties: { upload: MEDIA_LOCATION_PROPERTIES.upload }, required: ['upload'] }] }
66
69
  export const DOCUMENT_VOICE_CLONE_QUERY_SCHEMA: Schema = {
67
70
  type: 'object', additionalProperties: false, properties: { engine: cloneText, voice: cloneText }, required: ['voice'],
68
71
  }
@@ -70,8 +73,8 @@ export const DOCUMENT_VOICE_CLONE_SCHEMA: Schema = {
70
73
  type: 'object', additionalProperties: false,
71
74
  properties: {
72
75
  source: structuredClone(DOCUMENT_VOICE_CATALOG_SCHEMA.properties.source) as unknown as Schema, engine: cloneText, voice: cloneText,
73
- sample: { type: 'string', minLength: 1, maxLength: 1024 },
74
- consent: { type: 'object', additionalProperties: false, properties: { speaker: cloneText, scope: { type: 'string', minLength: 1, maxLength: 2000 }, statement: { type: 'string', minLength: 1, maxLength: 1024 } }, required: ['speaker', 'scope', 'statement'] },
76
+ sample: cloneAudio,
77
+ consent: { type: 'object', additionalProperties: false, properties: { speaker: cloneText, scope: { type: 'string', minLength: 1, maxLength: 2000 }, statement: cloneAudio }, required: ['speaker', 'scope', 'statement'] },
75
78
  lang: { type: 'string', minLength: 1, maxLength: 100 }, text: { type: 'string', maxLength: 4000 },
76
79
  }, required: ['voice', 'sample', 'consent'],
77
80
  }