@lincyaw/kernel 1.0.0-rc.61 → 1.0.0-rc.63

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.61",
3
+ "version": "1.0.0-rc.63",
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. */
@@ -50,6 +52,10 @@ export interface DocumentVoiceAuthoring extends DocumentVoiceTasks {
50
52
  /** Undefined when there is something to cancel; otherwise the unchanged state that cancel would report. */
51
53
  checkCancel(document: string, query: VoiceoverJobQuery, member: Member): Promise<VoiceoverCancellation | undefined>
52
54
  prepareClone?(document: string, request: DocumentVoiceCloneRequest, member: Member, signal?: AbortSignal): Promise<PreparedVoiceClone>
55
+ /** Trusted host preparation uses the same bounded native bank; references never enter model arguments. */
56
+ prepareCloneReference?(document: string, request: DocumentVoiceCloneRequest, member: Member, signal?: AbortSignal): Promise<{ id: string, engine: string, voice: string }>
57
+ runPreparedClone?(document: string, id: string, request: DocumentVoiceCloneRequest, member: Member, signal?: AbortSignal): Promise<VoiceCloneStatus>
58
+ releasePreparedClone?(document: string, id: string, member: Member): boolean
53
59
  cloneStatus?(document: string, query: DocumentVoiceCloneQuery, member: Member, signal?: AbortSignal): Promise<VoiceCloneStatus>
54
60
  }
55
61
 
@@ -63,6 +69,7 @@ export const DOCUMENT_VOICE_CATALOG_SCHEMA = {
63
69
  } as const
64
70
 
65
71
  const cloneText = { type: 'string', minLength: 1, maxLength: 200 } as const
72
+ const cloneAudio: Schema = { oneOf: [{ type: 'string', minLength: 1, maxLength: 1024 }, { type: 'object', additionalProperties: false, properties: { upload: MEDIA_LOCATION_PROPERTIES.upload }, required: ['upload'] }] }
66
73
  export const DOCUMENT_VOICE_CLONE_QUERY_SCHEMA: Schema = {
67
74
  type: 'object', additionalProperties: false, properties: { engine: cloneText, voice: cloneText }, required: ['voice'],
68
75
  }
@@ -70,8 +77,8 @@ export const DOCUMENT_VOICE_CLONE_SCHEMA: Schema = {
70
77
  type: 'object', additionalProperties: false,
71
78
  properties: {
72
79
  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'] },
80
+ sample: cloneAudio,
81
+ consent: { type: 'object', additionalProperties: false, properties: { speaker: cloneText, scope: { type: 'string', minLength: 1, maxLength: 2000 }, statement: cloneAudio }, required: ['speaker', 'scope', 'statement'] },
75
82
  lang: { type: 'string', minLength: 1, maxLength: 100 }, text: { type: 'string', maxLength: 4000 },
76
83
  }, required: ['voice', 'sample', 'consent'],
77
84
  }