@lincyaw/kernel 1.0.0-rc.43 → 1.0.0-rc.45

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.43",
3
+ "version": "1.0.0-rc.45",
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": {
@@ -8,7 +8,7 @@ import type { DocumentChangePlan } from './authoring.ts'
8
8
 
9
9
  export const DOCUMENT_ACTION_MAX_REQUEST_CHARS = 4096
10
10
  export const DOCUMENT_ACTION_MAX_RESPONSE_CHARS = 7168
11
- export const DOCUMENT_AUTHORING_ACTION_TYPES = ['comment.create', 'comment.reply', 'comment.update', 'comment.react', 'comment.resolve', 'comment.reopen', 'comment.delete', 'voice.set', 'component.parameters.patch', 'component.step-parameters.patch', 'component.step-parameters.reset', 'component.definition.use', 'caption.timing.set', 'caption.timing.reset', 'caption.scale.set'] as const
11
+ export const DOCUMENT_AUTHORING_ACTION_TYPES = ['comment.create', 'comment.reply', 'comment.update', 'comment.react', 'comment.resolve', 'comment.reopen', 'comment.delete', 'voice.set', 'component.parameters.patch', 'component.step-parameters.patch', 'component.step-parameters.reset', 'component.definition.use', 'caption.timing.set', 'caption.timing.reset', 'caption.scale.set', 'production.enable'] as const
12
12
  export const DOCUMENT_PARAMETER_MAX_CHANGES = 32
13
13
  export const DOCUMENT_PARAMETER_MAX_PATH_DEPTH = 16
14
14
  /** Paths belong only to this component's parameters; set replaces an array item or appends at its length. */
@@ -39,9 +39,9 @@ export interface DocumentComponentImpactAnswer {
39
39
  collection: DocumentComponentImpactCollection, offset: number, total: number, entries: string[], nextOffset?: number, complete: boolean
40
40
  }
41
41
  /** New recording adoption belongs to the real-media service, never a raw settings action. */
42
- export type DocumentAuthoringAction = DocumentCommentAction | DocumentComponentAction | DocumentCaptionTimingAction | { type: 'caption.scale.set', scale: number } | { type: 'voice.set', scope: DocumentVoiceScope, source: Exclude<VoiceSource, { type: 'recording' }> | null, replaceOverrides?: boolean }
42
+ export type DocumentAuthoringAction = DocumentCommentAction | DocumentComponentAction | DocumentCaptionTimingAction | { type: 'production.enable' } | { type: 'caption.scale.set', scale: number } | { type: 'voice.set', scope: DocumentVoiceScope, source: Exclude<VoiceSource, { type: 'recording' }> | null, replaceOverrides?: boolean }
43
43
  export interface DocumentAuthoringActionRequest { id: string, source: CanonicalSource, action: DocumentAuthoringAction }
44
- export type DocumentAuthoringActionEffect = { kind: 'caption-scale', value: { scale: number, changed: boolean } } | { kind: 'caption', value: { stepId: string, segments: number, changed: boolean, mode: 'manual' | 'automatic' } } | { kind: 'comment', value: DocumentCommentEffect } | { kind: 'voice', scope: DocumentVoiceScope['kind'], value: DocumentVoiceImpact, recordings: { preserved: number, removed: number } } | { kind: 'component', value: DocumentComponentEffect }
44
+ export type DocumentAuthoringActionEffect = { kind: 'production', value: { enabled: true, changed: boolean } } | { kind: 'caption-scale', value: { scale: number, changed: boolean } } | { kind: 'caption', value: { stepId: string, segments: number, changed: boolean, mode: 'manual' | 'automatic' } } | { kind: 'comment', value: DocumentCommentEffect } | { kind: 'voice', scope: DocumentVoiceScope['kind'], value: DocumentVoiceImpact, recordings: { preserved: number, removed: number } } | { kind: 'component', value: DocumentComponentEffect }
45
45
  export interface DocumentAuthoringActionPlan extends DocumentChangePlan {
46
46
  action: DocumentAuthoringAction
47
47
  effect: DocumentAuthoringActionEffect
@@ -12,12 +12,19 @@ export const AUTHORING_CLIENT_MAX_REQUESTS = 64
12
12
  export const AUTHORING_CLIENT_REQUEST_TIMEOUT_MS = 30000
13
13
  export const AUTHORING_CLIENT_ACK_MAX_BYTES = 32768
14
14
  export const AUTHORING_CLIENT_EVENT_MAX_BYTES = 8 << 10
15
- export const AUTHORING_CLIENT_ACTIONS = ['state.read', 'source.flush', 'preview.prepare', 'comment-drafts.inspect', 'comment-drafts.read', 'comment-drafts.restore', 'comment-drafts.discard', 'component-drafts.inspect', 'component-drafts.read', 'component-drafts.restore', 'component-drafts.discard', 'playback.pause', 'position.step', 'playback.play', 'playback.seek', 'playback.rate'] as const
15
+ export const AUTHORING_CLIENT_ACTIONS = ['state.read', 'source.flush', 'preview.prepare', 'view.set', 'native-history.undo', 'native-history.redo', 'recording.start', 'recording.stop', 'recording.cancel', 'recording.discard', 'recording.save', 'recording.listen', 'recording.pause', 'comment-drafts.inspect', 'comment-drafts.read', 'comment-drafts.restore', 'comment-drafts.discard', 'component-drafts.inspect', 'component-drafts.read', 'component-drafts.restore', 'component-drafts.discard', 'playback.pause', 'position.step', 'playback.play', 'playback.seek', 'playback.rate'] as const
16
16
  export type AuthoringClientActionType = typeof AUTHORING_CLIENT_ACTIONS[number]
17
+ export type AuthoringClientView = 'document' | 'reading' | 'presentation' | 'production'
18
+ /** Only these browser-owned actions may finish at a new saved source of the same document. */
19
+ export const authoringClientActionChangesSource = (type: AuthoringClientActionType): boolean => ['source.flush', 'native-history.undo', 'native-history.redo', 'recording.save'].includes(type)
17
20
  export type AuthoringClientAction =
18
21
  | { type: 'state.read' }
19
22
  | { type: 'source.flush' }
20
23
  | { type: 'preview.prepare' }
24
+ | { type: 'view.set', view: AuthoringClientView }
25
+ | { type: 'native-history.undo' | 'native-history.redo' }
26
+ | { type: 'recording.start' | 'recording.stop' | 'recording.cancel' | 'recording.save' | 'recording.listen' | 'recording.pause' }
27
+ | { type: 'recording.discard', confirm: true }
21
28
  | { type: 'comment-drafts.inspect', cursor?: { after: string, token: string }, limit?: number }
22
29
  | { type: 'comment-drafts.read', draft: ClientCommentDraftReference, offset: number, maxChars?: number }
23
30
  | { type: 'comment-drafts.restore', draft: ClientCommentDraftReference, composerId: string, expectedCurrent: ClientCommentDraftReference | null }
@@ -78,6 +85,8 @@ export interface AuthoringClientSnapshot {
78
85
  revision: number
79
86
  source: CanonicalSource
80
87
  view: 'document' | 'present'
88
+ mode?: AuthoringClientView
89
+ recording?: { phase: 'idle' | 'requesting' | 'recording' | 'stopping' | 'ready' | 'failed', elapsedMs: number, candidate?: { byteLength: number, mime: string, assetId?: string }, error?: string, audition?: 'idle' | 'loading' | 'playing' | 'failed' }
81
90
  editing: { dirty: boolean, saving: boolean, composing: boolean, conflicted: boolean, locked: boolean, loading: boolean }
82
91
  interaction: string
83
92
  position?: { sectionId: string, stepId?: string }
@@ -97,6 +106,7 @@ export interface AuthoringClientDescriptor extends AuthoringClientConnection {
97
106
  observedAt: string
98
107
  verification: 'reported-state'
99
108
  snapshot: AuthoringClientSnapshot
109
+ pendingRequest?: { requestId: string, action: AuthoringClientActionType, cancellationRequested?: true }
100
110
  }
101
111
  export interface AuthoringClientList { document: string, clients: AuthoringClientDescriptor[], nextAfter?: string, unavailable: readonly string[] }
102
112
  export interface AuthoringClientRequest {
@@ -114,6 +124,7 @@ export interface AuthoringClientRequestResult extends AuthoringClientConnection
114
124
  action: AuthoringClientActionType
115
125
  source: CanonicalSource
116
126
  state: AuthoringClientRequestState
127
+ cancellationRequested?: true
117
128
  admittedAt: string
118
129
  expiresAt: string
119
130
  observedAt?: string
@@ -138,6 +149,7 @@ export interface AuthoringClients {
138
149
  list(document: string, query: { clientId?: string, after?: string }, member: Member): Promise<AuthoringClientList>
139
150
  request(document: string, request: AuthoringClientRequest, member: Member): Promise<AuthoringClientRequestResult>
140
151
  get(document: string, query: { clientId: string, epoch: string, requestId: string }, member: Member): Promise<AuthoringClientRequestResult>
152
+ cancel?(document: string, query: { clientId: string, epoch: string, requestId: string }, member: Member): Promise<AuthoringClientRequestResult>
141
153
  }
142
154
 
143
155
  /** Reserve the complete receipt and the host-only lease, rather than budgeting only the text fragment. */
@@ -187,6 +199,10 @@ const position = object({ timeMs: number, stepTimeMs: number, sectionId: entity,
187
199
  const playback = object({ binding, status: { enum: ['loading', 'ready', 'estimated', 'unavailable', 'failed'] }, position, error: { type: 'string', maxLength: 300 } }, ['binding', 'status'])
188
200
  export const AUTHORING_CLIENT_SNAPSHOT_SCHEMA: Schema = object({
189
201
  revision: integer, source, view: { enum: ['document', 'present'] }, editing: object({ dirty: bool, saving: bool, composing: bool, conflicted: bool, locked: bool, loading: bool }),
202
+ mode: { enum: ['document', 'reading', 'presentation', 'production'] },
203
+ recording: object({ phase: { enum: ['idle', 'requesting', 'recording', 'stopping', 'ready', 'failed'] }, elapsedMs: number,
204
+ candidate: object({ byteLength: integer, mime: { type: 'string', maxLength: 200 }, assetId: entity }, ['byteLength', 'mime']),
205
+ error: entity, audition: { enum: ['idle', 'loading', 'playing', 'failed'] } }, ['phase', 'elapsedMs']),
190
206
  interaction: { type: 'string', maxLength: 200 }, position: object({ sectionId: entity, stepId: entity }, ['sectionId']), binding, playback,
191
207
  preview: { oneOf: [object({ status: { enum: ['unprepared', 'preparing', 'unavailable'] } }), object({ status: { const: 'prepared' }, source, irRevision: entity, projectRevision: integer })] },
192
208
  actions: { type: 'array', items: { enum: [...AUTHORING_CLIENT_ACTIONS] }, maxItems: AUTHORING_CLIENT_ACTIONS.length, uniqueItems: true }, unsubmittedContent: { const: 'not-inspected' },
@@ -194,6 +210,9 @@ export const AUTHORING_CLIENT_SNAPSHOT_SCHEMA: Schema = object({
194
210
  const action = (type: string, properties: Record<string, Schema> = {}): Schema => object({ type: { const: type }, ...properties })
195
211
  export const AUTHORING_CLIENT_ACTION_SCHEMA: Schema = { oneOf: [
196
212
  action('state.read'), action('source.flush'), action('preview.prepare'), action('playback.pause'), action('position.step', { sectionId: entity, stepId: entity }),
213
+ action('view.set', { view: { enum: ['document', 'reading', 'presentation', 'production'] } }),
214
+ ...['native-history.undo', 'native-history.redo', 'recording.start', 'recording.stop', 'recording.cancel', 'recording.save', 'recording.listen', 'recording.pause'].map(type => action(type)),
215
+ action('recording.discard', { confirm: { const: true } }),
197
216
  object({ type: { const: 'comment-drafts.inspect' }, cursor, limit: { type: 'integer', minimum: 1, maximum: 10 } }, ['type']),
198
217
  object({ type: { const: 'comment-drafts.read' }, draft: draftReference, offset: integer, maxChars: { type: 'integer', minimum: 2, maximum: 2048 } }, ['type', 'draft', 'offset']),
199
218
  action('comment-drafts.restore', { draft: draftReference, composerId: id, expectedCurrent: nullableCommentReference }),
@@ -1,7 +1,8 @@
1
1
  import type { CanonicalSource } from '../ir.ts'
2
+ import type { Schema } from '@cfworker/json-schema'
2
3
  import type { Finding } from './checks.ts'
3
4
  import type { Member } from './server.ts'
4
- import type { SpeechEngineInfo } from './speech.ts'
5
+ import type { SpeechEngineInfo, VoiceCloneRequest, VoiceCloneStatus } from './speech.ts'
5
6
  import type { VoiceCatalogAnswer, VoiceoverCancellation } from './voice.ts'
6
7
  import type { DocumentVoiceTasks, VoiceoverJobQuery, VoiceoverStart, VoicePreviewStart } from './voiceover-execution.ts'
7
8
 
@@ -16,13 +17,29 @@ export interface DocumentVoiceCapabilities {
16
17
  preview: boolean
17
18
  engines: SpeechEngineInfo[]
18
19
  defaultEngine?: string
19
- actions: { status: boolean, list: true, get: true, start: boolean, cancel: true, quotePreview: boolean, preview: boolean, readPreview: true }
20
+ actions: { status: boolean, list: true, get: true, start: boolean, cancel: true, quotePreview: boolean, preview: boolean, readPreview: true, clone?: boolean, cloneStatus?: boolean }
20
21
  tasks: { idempotency: 'process', limits: { intents: number, recentJobs: number, concurrent: number, quotes: number, quoteLifetimeMs: number, previewBytes: number, previewResources: number, retainedPreviewBytes: number } }
21
22
  findings?: Finding[]
22
23
  }
23
24
  export interface DocumentVoiceCatalogQuery { source?: CanonicalSource, engine?: string, lang?: string }
24
25
  export interface DocumentVoiceCatalogAnswer extends VoiceCatalogAnswer { document: string, source: CanonicalSource, findings?: Finding[] }
25
26
 
27
+ 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 DocumentVoiceCloneRequest = Omit<VoiceCloneRequest, 'sample' | 'consent'> & {
30
+ source?: CanonicalSource
31
+ sample: string
32
+ consent: { speaker: string, scope: string, statement: string }
33
+ }
34
+ export interface DocumentVoiceCloneQuery { engine?: string, voice: string }
35
+ /** A process-local capability for this call, never a model argument or a retained plan. */
36
+ export interface PreparedVoiceClone {
37
+ engine: string
38
+ voice: string
39
+ start(signal?: AbortSignal): Promise<VoiceCloneStatus>
40
+ close(): void
41
+ }
42
+
26
43
  /** Shared voice discovery and explicitly authorized tasks; discovery never compiles or synthesizes. */
27
44
  export interface DocumentVoiceAuthoring extends DocumentVoiceTasks {
28
45
  capabilities(document: string, member: Member, signal?: AbortSignal): Promise<DocumentVoiceCapabilities>
@@ -32,6 +49,8 @@ export interface DocumentVoiceAuthoring extends DocumentVoiceTasks {
32
49
  checkPreview(document: string, request: VoicePreviewStart, member: Member, signal?: AbortSignal): Promise<void>
33
50
  /** Undefined when there is something to cancel; otherwise the unchanged state that cancel would report. */
34
51
  checkCancel(document: string, query: VoiceoverJobQuery, member: Member): Promise<VoiceoverCancellation | undefined>
52
+ prepareClone?(document: string, request: DocumentVoiceCloneRequest, member: Member, signal?: AbortSignal): Promise<PreparedVoiceClone>
53
+ cloneStatus?(document: string, query: DocumentVoiceCloneQuery, member: Member, signal?: AbortSignal): Promise<VoiceCloneStatus>
35
54
  }
36
55
 
37
56
  export const DOCUMENT_VOICE_CATALOG_SCHEMA = {
@@ -42,3 +61,17 @@ export const DOCUMENT_VOICE_CATALOG_SCHEMA = {
42
61
  lang: { type: 'string', minLength: 1, maxLength: 100 },
43
62
  },
44
63
  } as const
64
+
65
+ const cloneText = { type: 'string', minLength: 1, maxLength: 200 } as const
66
+ export const DOCUMENT_VOICE_CLONE_QUERY_SCHEMA: Schema = {
67
+ type: 'object', additionalProperties: false, properties: { engine: cloneText, voice: cloneText }, required: ['voice'],
68
+ }
69
+ export const DOCUMENT_VOICE_CLONE_SCHEMA: Schema = {
70
+ type: 'object', additionalProperties: false,
71
+ properties: {
72
+ 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'] },
75
+ lang: { type: 'string', minLength: 1, maxLength: 100 }, text: { type: 'string', maxLength: 4000 },
76
+ }, required: ['voice', 'sample', 'consent'],
77
+ }
@@ -0,0 +1,39 @@
1
+ import type { Member } from './server.ts'
2
+ import type { ReviewChange, ReviewStep } from './workspace.ts'
3
+
4
+ export const WORKSPACE_REVIEW_MAX_REQUEST_CHARS = 8192
5
+ export const WORKSPACE_REVIEW_MAX_RESPONSE_CHARS = 7168
6
+ export const WORKSPACE_REVIEW_FRAGMENT_CHARS = 4000
7
+ export interface WorkspaceReviewQuery { part?: 'summary' | 'files' | 'steps' | 'diff', path?: string, step?: string, offset?: number, snapshot?: string }
8
+ export interface WorkspaceReviewSummary { id: string, document: string, running: boolean, mode: 'required' | 'auto', files: number, steps: number }
9
+ export interface WorkspaceReviewAnswer {
10
+ review: WorkspaceReviewSummary | null
11
+ snapshot?: string
12
+ files?: Omit<ReviewChange, 'diff'>[]
13
+ steps?: (Omit<ReviewStep, 'changes'> & { files: number })[]
14
+ nextOffset?: number
15
+ diff?: { path: string, step?: string, text: string, offset: number, totalChars: number, sha256: string }
16
+ }
17
+ export type WorkspaceReviewChange =
18
+ | { action: 'accept', snapshot: string, reject?: string[], message?: string }
19
+ | { action: 'reject', snapshot: string, paths?: string[], confirm: true }
20
+ | { action: 'restore', snapshot: string, step: string, confirm: true }
21
+ export interface WorkspaceReviewChanged { outcome: 'accepted' | 'rejected' | 'restored' | 'updated' | 'empty', revision?: string, files?: number, remainingFiles?: number }
22
+ /** Workspace publication authority; document-scoped agent credentials must never receive this service. */
23
+ export interface WorkspaceReview {
24
+ read(query: WorkspaceReviewQuery, member: Member): Promise<WorkspaceReviewAnswer>
25
+ check(change: WorkspaceReviewChange, member: Member): Promise<void>
26
+ change(change: WorkspaceReviewChange, member: Member, signal?: AbortSignal): Promise<WorkspaceReviewChanged>
27
+ }
28
+ const path = { type: 'string', minLength: 1, maxLength: 500 } as const
29
+ const snapshot = { type: 'string', pattern: '^[a-f0-9]{64}$' } as const
30
+ const step = { type: 'string', minLength: 1, maxLength: 100 } as const
31
+ const paths = { type: 'array', minItems: 1, maxItems: 200, uniqueItems: true, items: path } as const
32
+ export const WORKSPACE_REVIEW_QUERY_SCHEMA = { type: 'object', additionalProperties: false, properties: {
33
+ part: { enum: ['summary', 'files', 'steps', 'diff'] }, path, step, offset: { type: 'integer', minimum: 0 }, snapshot,
34
+ } } as const
35
+ export const WORKSPACE_REVIEW_CHANGE_SCHEMA = { oneOf: [
36
+ { type: 'object', additionalProperties: false, required: ['action', 'snapshot'], properties: { action: { const: 'accept' }, snapshot, reject: paths, message: { type: 'string', minLength: 1, maxLength: 4000 } } },
37
+ { type: 'object', additionalProperties: false, required: ['action', 'snapshot', 'confirm'], properties: { action: { const: 'reject' }, snapshot, paths, confirm: { const: true } } },
38
+ { type: 'object', additionalProperties: false, required: ['action', 'snapshot', 'step', 'confirm'], properties: { action: { const: 'restore' }, snapshot, step, confirm: { const: true } } },
39
+ ] } as const
package/src/contracts.ts CHANGED
@@ -23,6 +23,7 @@ export * from './contracts/server.ts'
23
23
  export * from './contracts/service.ts'
24
24
  export * from './contracts/speech.ts'
25
25
  export * from './contracts/speech-settings.ts'
26
+ export * from './contracts/workspace-review.ts'
26
27
  export * from './contracts/transcription.ts'
27
28
  export * from './contracts/transcription-adoption.ts'
28
29
  export * from './contracts/voice.ts'
@@ -9,9 +9,19 @@ import type { DocumentAuthoringAction, DocumentAuthoringActionEffect } from './c
9
9
  import type { DocumentCommentContext } from './contracts/document-comments.ts'
10
10
  import type { TeachingDocument } from './contracts/document.ts'
11
11
 
12
+ export function enableDocumentProduction(document: TeachingDocument): TeachingDocument {
13
+ const plugins = [...new Set([...(document.metadata.plugins ?? []), '@lincyaw/addon-lecture', '@lincyaw/addon-speech'])]
14
+ if (JSON.stringify(plugins) === JSON.stringify(document.metadata.plugins) && document.metadata.renderers?.lecture) return document
15
+ return { ...document, metadata: { ...document.metadata, plugins, renderers: { ...document.metadata.renderers, lecture: document.metadata.renderers?.lecture ?? {} } } }
16
+ }
17
+
12
18
  /** Fixed context is supplied by the owning adapter exactly once per semantic plan. */
13
19
  export function applyDocumentAuthoringAction(document: TeachingDocument, action: DocumentAuthoringAction, context: DocumentCommentContext): { content: TeachingDocument, effect: DocumentAuthoringActionEffect } {
14
20
  if (!context.member || !hasRole(context.member, 'editor')) throw new DocumentCommentError(403, 'authoring-permission-denied')
21
+ if (action.type === 'production.enable') {
22
+ const content = enableDocumentProduction(document)
23
+ return { content, effect: { kind: 'production', value: { enabled: true, changed: content !== document } } }
24
+ }
15
25
  if (action.type === 'caption.scale.set') {
16
26
  const content = changeDocumentCaptionScale(document, action.scale)
17
27
  return { content, effect: { kind: 'caption-scale', value: { scale: captionScale(content.production), changed: content !== document } } }
package/src/index.ts CHANGED
@@ -10,7 +10,7 @@ export { DOCUMENT_COLOR_NAMES, documentColorToken, documentColorValue } from './
10
10
  export type { DocumentColorKind, DocumentColorName } from './document-colors.ts'
11
11
  export { applyDocumentCommentAction, degradeDocumentCommentAnchor, isDocumentTextLink, documentCommentTargets, validateDocumentCommentAnchor, DocumentCommentError } from './document-comments.ts'
12
12
  export { documentAnchorKey, documentAnchorOrder, documentBlockSection, walkDocumentPlaces } from './document-places.ts'
13
- export { applyDocumentAuthoringAction } from './document-authoring-actions.ts'
13
+ export { applyDocumentAuthoringAction, enableDocumentProduction } from './document-authoring-actions.ts'
14
14
  export { applyDocumentComponentAction, effectiveComponentParameters, createDocumentParameterChanges, documentComponentSection, DocumentComponentError } from './document-components.ts'
15
15
  export type { DocumentStepVoice, DocumentVoiceImpact, DocumentVoiceOptions, DocumentVoiceScope } from './document-voices.ts'
16
16
  export { prepareTranscriptionAdoption } from './transcription-adoption.ts'
@@ -34,6 +34,7 @@ export const DOCUMENT_AUTHORING_ACTION_SCHEMA: Schema = {
34
34
  action('caption.timing.set', { stepId: id, value: { $ref: '#/$defs/CaptionTiming' } }),
35
35
  action('caption.timing.reset', { stepId: id }),
36
36
  action('caption.scale.set', { scale: { type: 'number' } }),
37
+ action('production.enable', {}),
37
38
  action('component.parameters.patch', { blockId: id, changes }),
38
39
  action('component.step-parameters.patch', { blockId: id, stepId: id, changes }),
39
40
  action('component.step-parameters.reset', { blockId: id, stepId: id }),
@@ -1,7 +1,11 @@
1
1
  import { Validator } from '@cfworker/json-schema'
2
2
  import type { Schema } from '@cfworker/json-schema'
3
- import { DOCUMENT_VOICE_CATALOG_SCHEMA } from '../contracts/document-voice.ts'
4
- import type { DocumentVoiceCatalogQuery } from '../contracts/document-voice.ts'
3
+ import { DOCUMENT_VOICE_CATALOG_SCHEMA, DOCUMENT_VOICE_CLONE_SCHEMA, DOCUMENT_VOICE_CLONE_QUERY_SCHEMA } from '../contracts/document-voice.ts'
4
+ import type { DocumentVoiceCatalogQuery, DocumentVoiceCloneRequest, DocumentVoiceCloneQuery } from '../contracts/document-voice.ts'
5
5
 
6
6
  const validator = new Validator(structuredClone(DOCUMENT_VOICE_CATALOG_SCHEMA) as unknown as Schema, '2020-12', false)
7
7
  export const validateDocumentVoiceCatalogQuery = (value: unknown): value is DocumentVoiceCatalogQuery => validator.validate(value).valid
8
+ const clone = new Validator(structuredClone(DOCUMENT_VOICE_CLONE_SCHEMA), '2020-12', false)
9
+ const cloneQuery = new Validator(structuredClone(DOCUMENT_VOICE_CLONE_QUERY_SCHEMA), '2020-12', false)
10
+ export const validateDocumentVoiceClone = (value: unknown): value is DocumentVoiceCloneRequest => clone.validate(value).valid
11
+ export const validateDocumentVoiceCloneQuery = (value: unknown): value is DocumentVoiceCloneQuery => cloneQuery.validate(value).valid
package/src/node/index.ts CHANGED
@@ -5,7 +5,7 @@ export { validateDocumentOutlineQuery, validateDocumentPartQuery } from './docum
5
5
  export { DOCUMENT_AUTHORING_ACTION_SCHEMA, DOCUMENT_AUTHORING_ACTION_APPLY_SCHEMA, DOCUMENT_AUTHORING_ACTION_IMPACT_SCHEMA, validateDocumentAuthoringAction, validateDocumentAuthoringActionReference, validateDocumentAuthoringActionImpact } from './authoring-actions.ts'
6
6
  export { validateDocumentTranscriptionRequest } from './transcription.ts'
7
7
  export { validateDocumentRecordingAdoption, validateDocumentAudioInspect, validateDocumentWorkspaceAudioImport, validateDocumentWorkspaceAudioInspect, validateDocumentMediaClipValidation, validateDocumentMediaClipEdit, validateDocumentProductionPlanQuery } from './document-audio.ts'
8
- export { validateDocumentVoiceCatalogQuery } from './document-voice.ts'
8
+ export { validateDocumentVoiceCatalogQuery, validateDocumentVoiceClone, validateDocumentVoiceCloneQuery } from './document-voice.ts'
9
9
  export { createVoiceoverOwner, VoiceoverOperationError, validateVoiceoverStart, validateVoiceoverStatus, validateVoiceoverJobQuery, validateVoicePreviewCheck, validateVoicePreviewStart } from './voiceover.ts'
10
10
  export { createVoiceoverRoutes } from './voiceover-routes.ts'
11
11
  export { validateTranscriptionAdoptionDraft, validateTranscriptionAdoptionApply } from './transcription-adoption.ts'
@@ -29,3 +29,4 @@ export { systemLocale } from './locale.ts'
29
29
  export { OperatorSpeechSettings, operatorSpeechSecrets, SpeechSettingsError, validateSpeechSettingsChange } from './operator-speech.ts'
30
30
  export { devStateFile, readServiceState, removeServiceState, serveStateDir } from './service-state.ts'
31
31
  export type { ServiceState } from './service-state.ts'
32
+ export { validateWorkspaceReviewQuery, validateWorkspaceReviewChange } from './workspace-review.ts'
@@ -0,0 +1,9 @@
1
+ import { Validator } from '@cfworker/json-schema'
2
+ import type { Schema } from '@cfworker/json-schema'
3
+ import { WORKSPACE_REVIEW_CHANGE_SCHEMA, WORKSPACE_REVIEW_QUERY_SCHEMA } from '../contracts/workspace-review.ts'
4
+ import type { WorkspaceReviewChange, WorkspaceReviewQuery } from '../contracts/workspace-review.ts'
5
+
6
+ const query = new Validator(WORKSPACE_REVIEW_QUERY_SCHEMA as unknown as Schema)
7
+ const change = new Validator(WORKSPACE_REVIEW_CHANGE_SCHEMA as unknown as Schema)
8
+ export const validateWorkspaceReviewQuery = (value: unknown): value is WorkspaceReviewQuery => query.validate(value).valid
9
+ export const validateWorkspaceReviewChange = (value: unknown): value is WorkspaceReviewChange => change.validate(value).valid