@lincyaw/kernel 1.0.0-rc.4 → 1.0.0-rc.40
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.md +1 -1
- package/package.json +4 -2
- package/src/contracts/capture.ts +148 -0
- package/src/contracts/document.ts +14 -1
- package/src/contracts/plugin.ts +1 -3
- package/src/contracts/preview.ts +3 -3
- package/src/contracts/speech.ts +16 -0
- package/src/contracts/voiceover-execution.ts +25 -1
- package/src/contracts/workspace.ts +2 -0
- package/src/contracts.ts +1 -0
- package/src/document-authoring-actions.ts +8 -4
- package/src/document-caption-scale.ts +17 -0
- package/src/document-comments.ts +30 -37
- package/src/document-components.ts +4 -12
- package/src/document-narrations.ts +33 -0
- package/src/document-operations.ts +15 -1
- package/src/document-pages.ts +8 -1
- package/src/document-places.ts +92 -0
- package/src/document-schema.ts +3 -3
- package/src/document.ts +13 -1
- package/src/embed.ts +26 -0
- package/src/escape-html.ts +4 -0
- package/src/html.ts +1 -4
- package/src/index.ts +14 -5
- package/src/ir.ts +23 -48
- package/src/lower-myst.ts +3 -12
- package/src/myst-marks.ts +15 -0
- package/src/node/authoring-actions.ts +1 -1
- package/src/node/fonts.ts +6 -3
- package/src/node/index.ts +3 -1
- package/src/node/packages.ts +25 -0
- package/src/node/service-state.ts +52 -0
- package/src/preview-events.ts +6 -4
- package/src/preview-frame-connect.ts +1105 -0
- package/src/preview-frame.ts +32 -1119
- package/src/random-uuid.ts +8 -0
- package/src/stale-module.ts +15 -0
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Plugins declare it as a peer dependency, so they share the application's copy:
|
|
|
14
14
|
|
|
15
15
|
## Entries
|
|
16
16
|
|
|
17
|
-
- `@lincyaw/kernel`: the contracts (`PresmiumNodePlugin`, `PluginDefinition`, `
|
|
17
|
+
- `@lincyaw/kernel`: the contracts (`PresmiumNodePlugin`, `PluginDefinition`, `IRPass`, `Renderer`, `RenderContext`, `Check`, the service tokens), the canonical authoring types (`TeachingDocument`, `DocumentEditOperation`), `DOCUMENT_ENTRY`, `DOCUMENT_SCHEMA_VERSION`, `DOCUMENT_JSON_SCHEMA`, `validateDocument`, the derived IR types (`IRDocument` and its nodes), `KERNEL_VERSION`, `IR_VERSION`, and plain helpers such as `docBlocks`, `withProp`, `deckLocale`, `jsonResponse` and `problemResponse`.
|
|
18
18
|
- `@lincyaw/kernel/contracts`, `@lincyaw/kernel/ir`: the contracts (types, service tokens and the preview protocol's parsers) or the IR types alone; the helpers are only in `@lincyaw/kernel`.
|
|
19
19
|
- `@lincyaw/kernel/reading`: plain functions that read a compiled document, the IR (`chapters`, `blockText`, `narrationAt`, `tokenize`); they do no I/O.
|
|
20
20
|
- `@lincyaw/kernel/node`: helpers for Node code: `copyPublished` and `isInside` (its other exports are internal).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincyaw/kernel",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.40",
|
|
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": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"ir"
|
|
16
16
|
],
|
|
17
17
|
"type": "module",
|
|
18
|
+
"sideEffects": false,
|
|
18
19
|
"engines": {
|
|
19
20
|
"node": ">=22.19"
|
|
20
21
|
},
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
"json-schema-library": "11.6.16",
|
|
40
41
|
"parse5": "7.3.0",
|
|
41
42
|
"semver": "^7.8.5",
|
|
42
|
-
"proper-lockfile": "4.1.2"
|
|
43
|
+
"proper-lockfile": "4.1.2",
|
|
44
|
+
"resolve.exports": "2.0.4"
|
|
43
45
|
}
|
|
44
46
|
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pictures of a document as its presentation shows it, taken by the workspace service in a headless browser: the rest
|
|
3
|
+
* frame of each step, or a moment into a step's animation, with the boxes of the elements an agent asks about. Agents
|
|
4
|
+
* (over MCP) check animations and layout with it instead of scripting a browser.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** At most this many pictures a request: each is one image in a tool result. */
|
|
8
|
+
export const CAPTURE_MAX_FRAMES = 12
|
|
9
|
+
/** At most this many boxes a picture reports for `measure`. */
|
|
10
|
+
export const CAPTURE_MAX_BOXES = 200
|
|
11
|
+
|
|
12
|
+
export interface SlideCaptureRequest {
|
|
13
|
+
/** The page (section) id, or its number from 1. */
|
|
14
|
+
section: string
|
|
15
|
+
/** The steps to show, from 0; every step of the page when omitted. */
|
|
16
|
+
steps?: number[]
|
|
17
|
+
/** Milliseconds into each step's animation; each step's rest frame (its final state) when omitted. */
|
|
18
|
+
at?: number[]
|
|
19
|
+
appearance?: 'light' | 'dark'
|
|
20
|
+
/** Device pixels per slide pixel. */
|
|
21
|
+
scale?: 1 | 2
|
|
22
|
+
/** A region of the slide, in slide pixels. */
|
|
23
|
+
clip?: { x: number, y: number, width: number, height: number }
|
|
24
|
+
/** A CSS selector: the boxes of the matching elements in the slide are reported, in slide pixels. */
|
|
25
|
+
measure?: string
|
|
26
|
+
/**
|
|
27
|
+
* How the presentation reaches each step: `direct` (default) draws it from its step and moment; `backward` shows the
|
|
28
|
+
* step after it first and goes back as a presenter does, with the page's own clock, to check that going back works.
|
|
29
|
+
*/
|
|
30
|
+
arrive?: 'direct' | 'backward'
|
|
31
|
+
/** Draw the presentation's captions over the slide (default true); false shows the whole slide, the narration being in `narration`. */
|
|
32
|
+
captions?: boolean
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ReadingCaptureRequest {
|
|
36
|
+
/** The page (section) id, or its number from 1. */
|
|
37
|
+
section: string
|
|
38
|
+
/** The window's width in CSS pixels (default 1280; 390 for a phone). */
|
|
39
|
+
width?: number
|
|
40
|
+
appearance?: 'light' | 'dark'
|
|
41
|
+
/** Device pixels per CSS pixel. */
|
|
42
|
+
scale?: 1 | 2
|
|
43
|
+
/** A CSS selector: the boxes of the matching elements in the page's section are reported, in CSS pixels. */
|
|
44
|
+
measure?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface CapturedReading {
|
|
48
|
+
section: string
|
|
49
|
+
/** The PNG file of the picture, in the service's state directory. */
|
|
50
|
+
file: string
|
|
51
|
+
/** The section's size in CSS pixels; the picture is cut at `CAPTURE_MAX_HEIGHT`. */
|
|
52
|
+
width: number
|
|
53
|
+
height: number
|
|
54
|
+
cut: boolean
|
|
55
|
+
boxes?: CapturedBox[]
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface ReadingCaptureResult {
|
|
59
|
+
document: string
|
|
60
|
+
width: number
|
|
61
|
+
frames: CapturedReading[]
|
|
62
|
+
problems: string[]
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** The tallest picture of a reading page's section, in CSS pixels. */
|
|
66
|
+
export const CAPTURE_MAX_HEIGHT = 8000
|
|
67
|
+
|
|
68
|
+
export interface CapturedBox {
|
|
69
|
+
x: number
|
|
70
|
+
y: number
|
|
71
|
+
width: number
|
|
72
|
+
height: number
|
|
73
|
+
visible: boolean
|
|
74
|
+
/** The start of the element's text. */
|
|
75
|
+
text: string
|
|
76
|
+
/** Its `id`, `class` and `data-*` attributes. */
|
|
77
|
+
attributes: Record<string, string>
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface CapturedSlide {
|
|
81
|
+
section: string
|
|
82
|
+
slide: number
|
|
83
|
+
step: number
|
|
84
|
+
/** Milliseconds into the step, or null for its rest frame. */
|
|
85
|
+
at: number | null
|
|
86
|
+
/** The step's narration (its script), as text: what the captions show. */
|
|
87
|
+
narration: string
|
|
88
|
+
/** The PNG file of the picture, in the service's state directory. */
|
|
89
|
+
file: string
|
|
90
|
+
width: number
|
|
91
|
+
height: number
|
|
92
|
+
boxes?: CapturedBox[]
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface SlideCaptureResult {
|
|
96
|
+
document: string
|
|
97
|
+
/** The slide's size in slide pixels. */
|
|
98
|
+
shape: { width: number, height: number }
|
|
99
|
+
frames: CapturedSlide[]
|
|
100
|
+
/** What failed in the page while it was drawn: component errors, page errors. */
|
|
101
|
+
problems: string[]
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface OverviewCaptureRequest {
|
|
105
|
+
/** Each page's last step (default), or every step of every page. */
|
|
106
|
+
steps?: 'last' | 'all'
|
|
107
|
+
appearance?: 'light' | 'dark'
|
|
108
|
+
/** Thumbnails a row on a sheet (default 4). */
|
|
109
|
+
columns?: number
|
|
110
|
+
/** Draw the presentation's captions over the slides (default true). */
|
|
111
|
+
captions?: boolean
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface OverviewCaptureResult {
|
|
115
|
+
document: string
|
|
116
|
+
/** The directory of the pictures, named so that they sort in reading order (`03-12-page.png`: page 3, step 12 from 0). */
|
|
117
|
+
dir: string
|
|
118
|
+
frames: { section: string, slide: number, step: number, file: string, narration: string }[]
|
|
119
|
+
/** `narration.md` beside the pictures: each picture's narration under its file name. */
|
|
120
|
+
narrationFile: string
|
|
121
|
+
/** Sheets of thumbnails, at most `CAPTURE_SHEET_SIZE` each, in order. */
|
|
122
|
+
sheets: string[]
|
|
123
|
+
problems: string[]
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Thumbnails on one overview sheet; and the most pictures an overview takes. */
|
|
127
|
+
export const CAPTURE_SHEET_SIZE = 20
|
|
128
|
+
export const CAPTURE_MAX_OVERVIEW = 400
|
|
129
|
+
|
|
130
|
+
export interface DocumentCapture {
|
|
131
|
+
/** The pictures, with their PNG bytes in the order of `frames`. */
|
|
132
|
+
slides(document: string, request: SlideCaptureRequest, signal?: AbortSignal): Promise<SlideCaptureResult & { images: Uint8Array[] }>
|
|
133
|
+
/** A page of the reading version (the web page), with its PNG bytes. */
|
|
134
|
+
reading(document: string, request: ReadingCaptureRequest, signal?: AbortSignal): Promise<ReadingCaptureResult & { images: Uint8Array[] }>
|
|
135
|
+
/** Every page's rest frames as the presentation shows them, as files and as sheets of thumbnails (the images). */
|
|
136
|
+
overview(document: string, request: OverviewCaptureRequest, signal?: AbortSignal): Promise<OverviewCaptureResult & { images: Uint8Array[] }>
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** The hook a viewer page opened with `?capture` installs, which the capturing browser drives. */
|
|
140
|
+
export interface CaptureHook {
|
|
141
|
+
/** A slide at a step: drawn at the moment `at` (its rest frame when omitted), or reached going back from the step after. */
|
|
142
|
+
show(position: { section: string, step: number, at?: number, arrive?: 'direct' | 'backward' }): Promise<{ problems: string[] }>
|
|
143
|
+
/** A section of the reading page, scrolled through so that its components load, at rest. */
|
|
144
|
+
read(section: string): Promise<{ problems: string[] }>
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export const CAPTURE_HOOK = 'presmiumCapture'
|
|
148
|
+
export const CAPTURE_PARAM = 'capture'
|
|
@@ -194,11 +194,24 @@ export interface Production {
|
|
|
194
194
|
cueTimings?: Record<string, { pauseMs: number }>
|
|
195
195
|
/** Stale mappings remain inspectable but never retime audio or replace changed narration. */
|
|
196
196
|
captionTimings?: Record<StepId, CaptionTiming>
|
|
197
|
+
/** How large the captions are, in the presentation and burned into a lecture video; absent is the default size. */
|
|
198
|
+
captions?: CaptionStyle
|
|
197
199
|
mediaClips: MediaClip[]
|
|
198
200
|
}
|
|
201
|
+
/** `scale` multiplies the captions' default size, from `CAPTION_SCALE_MIN` to `CAPTION_SCALE_MAX` (Studio offers tenths). */
|
|
202
|
+
export interface CaptionStyle { scale: number }
|
|
203
|
+
export const CAPTION_SCALE_MIN = 0.7
|
|
204
|
+
export const CAPTION_SCALE_MAX = 1.6
|
|
199
205
|
|
|
200
206
|
/** A stable rich-text/code ID, or `page:${sectionId}` reserved for an existing section title. */
|
|
201
207
|
export interface DocumentTextPoint { blockId: string, offset: number }
|
|
208
|
+
export interface DocumentTextAnchor { from: DocumentTextPoint, to: DocumentTextPoint }
|
|
209
|
+
/** A stable block, optionally at one step that renders it; the step belongs to the block's section. */
|
|
210
|
+
export interface DocumentPlaceAnchor { blockId: BlockId, stepId?: StepId }
|
|
211
|
+
export type DocumentThreadAnchor = DocumentTextAnchor | DocumentPlaceAnchor
|
|
212
|
+
/** A text range and a place are disjoint shapes; read the shape instead of guessing from offsets. */
|
|
213
|
+
export const isDocumentTextAnchor = (anchor: DocumentThreadAnchor | undefined): anchor is DocumentTextAnchor => Boolean(anchor && 'from' in anchor && 'to' in anchor)
|
|
214
|
+
export const isDocumentPlaceAnchor = (anchor: DocumentThreadAnchor | undefined): anchor is DocumentPlaceAnchor => Boolean(anchor && 'blockId' in anchor && !('from' in anchor))
|
|
202
215
|
export interface DocumentComment {
|
|
203
216
|
id: string
|
|
204
217
|
type: 'comment'
|
|
@@ -220,7 +233,7 @@ export interface DocumentThread {
|
|
|
220
233
|
resolvedBy?: string
|
|
221
234
|
metadata?: JsonObject
|
|
222
235
|
deletedAt?: string
|
|
223
|
-
anchor?:
|
|
236
|
+
anchor?: DocumentThreadAnchor
|
|
224
237
|
comments: DocumentComment[]
|
|
225
238
|
}
|
|
226
239
|
|
package/src/contracts/plugin.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CanonicalSource,
|
|
1
|
+
import type { CanonicalSource, IRDocument, IRPass, Renderer, RendererContribution } from '../ir.ts'
|
|
2
2
|
import type { AgentTool } from './agent.ts'
|
|
3
3
|
import type { AnchorResolver, AnchorString } from './anchors.ts'
|
|
4
4
|
import type { Check, CheckContext } from './checks.ts'
|
|
@@ -159,7 +159,6 @@ export interface PresmiumNodePlugin {
|
|
|
159
159
|
resolvers?: AnchorResolver[]
|
|
160
160
|
checks?: Check[]
|
|
161
161
|
anchors?(ctx: CheckContext): AnchorString[] | Promise<AnchorString[]>
|
|
162
|
-
directives?: DirectiveSpec[]
|
|
163
162
|
passes?: IRPass[]
|
|
164
163
|
executors?: Executor[]
|
|
165
164
|
renderer?: Renderer
|
|
@@ -177,7 +176,6 @@ export interface PresmiumNodePlugin {
|
|
|
177
176
|
services?(ctx: NodeServiceContext): [ServiceToken<unknown>, unknown][]
|
|
178
177
|
environments?: Record<string, EnvironmentProvider>
|
|
179
178
|
server?(ctx: ServerContext): ServerContribution | Promise<ServerContribution>
|
|
180
|
-
roles?: RoleSpec[]
|
|
181
179
|
tools?: AgentTool[]
|
|
182
180
|
operator?: boolean
|
|
183
181
|
}
|
package/src/contracts/preview.ts
CHANGED
|
@@ -10,6 +10,9 @@ export const PREVIEW_PARAM = 'presmium-preview'
|
|
|
10
10
|
/** The workbench's appearance when it loads a preview (`dark` or `light`), so that the page's first paint matches it. */
|
|
11
11
|
export const PREVIEW_APPEARANCE_PARAM = 'presmium-appearance'
|
|
12
12
|
|
|
13
|
+
/** `?captions=off` starts a presentation with its captions off (a reader turns them on again with the captions button). */
|
|
14
|
+
export const CAPTIONS_PARAM = 'captions'
|
|
15
|
+
|
|
13
16
|
export const PREVIEW_REVISION = 'presmiumRevision'
|
|
14
17
|
|
|
15
18
|
export const AUTHOR_MARKS_CLASS = 'pm-author-marks'
|
|
@@ -201,8 +204,6 @@ export type PreviewReport =
|
|
|
201
204
|
| { type: 'selection', selection: (PreviewAnchor & { text: string, rect?: PreviewRect, obstacles?: PreviewRect[] }) | null }
|
|
202
205
|
/** Where the picked block or the selection is after the page scrolled or resized; null when it is out of sight. */
|
|
203
206
|
| { type: 'rect', rect: PreviewRect | null, obstacles?: PreviewRect[] }
|
|
204
|
-
/** Where the blocks the AI changed are in the preview's viewport while they blink, and again as the page scrolls (at most 16). */
|
|
205
|
-
| { type: 'flashed', rects: PreviewRect[] }
|
|
206
207
|
| { type: 'editing', target: PreviewAnchor, active: boolean }
|
|
207
208
|
/** The text of a block edited in place, before and after (its `textContent`); sent only when it changed. */
|
|
208
209
|
| { type: 'edited', target: PreviewAnchor, before: string, after: string, request?: number, revision?: string, binding?: string }
|
|
@@ -371,7 +372,6 @@ export function toPreviewReport(data: unknown, nonce: string): PreviewReport | u
|
|
|
371
372
|
? { type: 'selection', selection: { ...toAnchor(selected), text: selected.text, ...selected.rect ? { rect: toRect(selected.rect as PreviewRect) } : {}, ...selected.obstacles !== undefined ? { obstacles: (selected.obstacles as PreviewRect[]).map(toRect) } : {} } }
|
|
372
373
|
: undefined
|
|
373
374
|
}
|
|
374
|
-
case 'flashed': return Array.isArray(m.rects) && m.rects.length <= 16 && m.rects.every(rect) ? { type: 'flashed', rects: (m.rects as PreviewRect[]).map(toRect) } : undefined
|
|
375
375
|
case 'rect': return (m.rect === null || rect(m.rect)) && optional(m.obstacles, obstacles) ? { type: 'rect', rect: m.rect === null ? null : toRect(m.rect), ...m.obstacles !== undefined ? { obstacles: (m.obstacles as PreviewRect[]).map(toRect) } : {} } : undefined
|
|
376
376
|
case 'editing': return anchor(m.target) && typeof m.active === 'boolean' ? { type: 'editing', target: toAnchor(m.target), active: m.active } : undefined
|
|
377
377
|
case 'edited': return anchor(m.target) && text(m.before) && text(m.after) && m.before.length <= MAX_EDITED && m.after.length <= MAX_EDITED && editedRequest(m) ? { type: 'edited', target: toAnchor(m.target), before: m.before, after: m.after, ...m.request === undefined ? {} : { request: m.request as number, revision: m.revision as string, binding: m.binding as string } } : undefined
|
package/src/contracts/speech.ts
CHANGED
|
@@ -103,6 +103,15 @@ export interface VoiceCloneStatus {
|
|
|
103
103
|
message?: string
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
export interface SpeechCachePrune {
|
|
107
|
+
/** Entries some request uses. */
|
|
108
|
+
kept: number
|
|
109
|
+
/** Entries no request uses, with the bytes of their files. */
|
|
110
|
+
unused: { key: string, bytes: number }[]
|
|
111
|
+
/** Whether the unused entries were deleted. */
|
|
112
|
+
removed: boolean
|
|
113
|
+
}
|
|
114
|
+
|
|
106
115
|
export interface TranscriptionRequest {
|
|
107
116
|
engine?: string
|
|
108
117
|
audio: Blob
|
|
@@ -124,6 +133,13 @@ export interface SpeechService {
|
|
|
124
133
|
cached?(key: string, signal?: AbortSignal): Promise<Synthesis | undefined>
|
|
125
134
|
alignWords?(key: string, options: { lang: string, transcribe?: boolean }, signal?: AbortSignal): Promise<SpeechWord[] | undefined>
|
|
126
135
|
pruneLock?(keep: ReadonlySet<string>): Promise<number>
|
|
136
|
+
/**
|
|
137
|
+
* The document's cached audio that no request of `keep` (every sentence the document says) uses: kept is any entry
|
|
138
|
+
* made for the same request under any configuration of the voice service. With `remove`, deletes the unused entries
|
|
139
|
+
* with their alignments and speech lock entries. Throws `speech-prune-engine-unknown` when a request names no engine
|
|
140
|
+
* and no default engine is configured, since its entries cannot be told apart then.
|
|
141
|
+
*/
|
|
142
|
+
pruneCache?(keep: readonly SynthesisRequest[], options?: { remove?: boolean, signal?: AbortSignal }): Promise<SpeechCachePrune>
|
|
127
143
|
transcribe(request: TranscriptionRequest, signal?: AbortSignal): Promise<Transcript>
|
|
128
144
|
/** Registers the consent, then starts training; only for the document's owner. Absent: the service cannot clone. */
|
|
129
145
|
cloneVoice?(request: VoiceCloneRequest, signal?: AbortSignal): Promise<VoiceCloneStatus>
|
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
import type { CanonicalSource } from '../ir.ts'
|
|
2
2
|
import type { Member } from './server.ts'
|
|
3
|
-
import type {
|
|
3
|
+
import type { SpeechVoice, SynthesisRequest } from './speech.ts'
|
|
4
|
+
import type { VoiceoverCancellation, VoiceoverJob, VoiceoverRequest, VoiceoverSnapshot, VoicePreviewAnswer, VoicePreviewQuery, VoicePreviewQuote, VoicePreviewRequest, VoiceTarget } from './voice.ts'
|
|
4
5
|
import { defineService } from './service.ts'
|
|
5
6
|
|
|
6
7
|
export interface VoiceoverStatusQuery { source?: CanonicalSource, revision?: string }
|
|
8
|
+
export interface VoiceoverSentencesQuery extends VoiceoverStatusQuery {
|
|
9
|
+
/** Answer as if this were the document's default voice: sentences that inherit the default, or have no voice, use it. */
|
|
10
|
+
defaultVoice?: SpeechVoice
|
|
11
|
+
}
|
|
12
|
+
/** One sentence that a document-scope generation processes, in reading order. */
|
|
13
|
+
export interface VoiceoverSentence {
|
|
14
|
+
section: string
|
|
15
|
+
step: number
|
|
16
|
+
stepId?: string
|
|
17
|
+
/** The step binding for a `steps` scope; absent when the sentence cannot be generated by step (it crosses steps). */
|
|
18
|
+
target?: VoiceTarget
|
|
19
|
+
/** The spoken text, which the voice service receives (and a cloud provider charges for). */
|
|
20
|
+
text: string
|
|
21
|
+
/** The exact synthesis request; absent when the sentence has no usable voice. */
|
|
22
|
+
request?: SynthesisRequest
|
|
23
|
+
/** Exact audio for the request is in the speech cache. */
|
|
24
|
+
cached: boolean
|
|
25
|
+
/** Why it cannot be generated now: no voice, or the voice service or voice is unavailable. */
|
|
26
|
+
reason?: string
|
|
27
|
+
}
|
|
28
|
+
export interface VoiceoverSentences { source: CanonicalSource, revision: string, sentences: VoiceoverSentence[] }
|
|
7
29
|
export type VoiceoverStart = Omit<VoiceoverRequest, 'confirmed'>
|
|
8
30
|
export type VoicePreviewStart = Omit<VoicePreviewRequest, 'confirmed'>
|
|
9
31
|
export type VoicePreviewCheck = VoicePreviewQuery & { source?: CanonicalSource }
|
|
@@ -23,6 +45,8 @@ export interface VoicePreviewMedia extends Omit<VoicePreviewAnswer, 'audio'> { b
|
|
|
23
45
|
/** Stateless plugin execution. The host owns intents and jobs; discovery creates neither. */
|
|
24
46
|
export interface VoiceoverExecution {
|
|
25
47
|
status(query: VoiceoverStatusQuery, signal: AbortSignal): Promise<Omit<VoiceoverSnapshot, 'jobs'>>
|
|
48
|
+
/** Every sentence with its request and cache state; reads the cache and the voice catalog, never generates. */
|
|
49
|
+
sentences?(query: VoiceoverSentencesQuery, signal: AbortSignal): Promise<VoiceoverSentences>
|
|
26
50
|
prepare(request: VoiceoverStart, signal: AbortSignal): Promise<PreparedVoiceover>
|
|
27
51
|
quote(query: VoicePreviewCheck, signal: AbortSignal): Promise<VoicePreviewQuote>
|
|
28
52
|
preview(request: VoicePreviewStart, signal: AbortSignal): Promise<VoicePreviewMedia>
|
|
@@ -94,6 +94,8 @@ export interface DocumentSummary {
|
|
|
94
94
|
description?: string
|
|
95
95
|
lang?: string
|
|
96
96
|
tags?: string[]
|
|
97
|
+
/** Whether its metadata asks for a presentation (`renderers.slides`), which a site serves below its pages. */
|
|
98
|
+
slides?: boolean
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
/** @experimental The workspace service's answer to `documents`. */
|
package/src/contracts.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { applyDocumentCaptionTiming } from './document-caption-timings.ts'
|
|
2
2
|
import { hasRole } from './access.ts'
|
|
3
|
-
import { applyDocumentCommentAction, DocumentCommentError, validateDocumentCommentAnchor } from './document-comments.ts'
|
|
3
|
+
import { applyDocumentCommentAction, degradeDocumentCommentAnchor, DocumentCommentError, validateDocumentCommentAnchor } from './document-comments.ts'
|
|
4
|
+
import { documentAnchorKey } from './document-places.ts'
|
|
4
5
|
import { changeDocumentVoice, documentVoiceStepIds, previewDocumentVoiceChange } from './document-voices.ts'
|
|
5
6
|
import { applyDocumentComponentAction } from './document-components.ts'
|
|
6
7
|
import type { DocumentAuthoringAction, DocumentAuthoringActionEffect } from './contracts/authoring-actions.ts'
|
|
@@ -29,17 +30,20 @@ export function applyDocumentAuthoringAction(document: TeachingDocument, action:
|
|
|
29
30
|
return { content, effect: { kind: 'voice', scope: action.scope.kind, value: previewDocumentVoiceChange(document, action.scope, action.source, { replaceOverrides: action.replaceOverrides }), recordings } }
|
|
30
31
|
}
|
|
31
32
|
if (action.type === 'comment.create') validateDocumentCommentAnchor(document, action.anchor ?? undefined)
|
|
32
|
-
let source = document.comments ?? {}, detached = false
|
|
33
|
+
let source = document.comments ?? {}, detached = false, degraded = false
|
|
33
34
|
if (action.type !== 'comment.create' && Object.hasOwn(source, action.threadId)) {
|
|
34
35
|
const thread = source[action.threadId]!
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
const anchor = degradeDocumentCommentAnchor(document, thread.anchor)
|
|
37
|
+
if (thread.anchor && !anchor) {
|
|
37
38
|
const { anchor: _anchor, ...unanchored } = thread
|
|
38
39
|
source = { ...source, [thread.id]: unanchored }; detached = true
|
|
40
|
+
} else if (anchor && documentAnchorKey(anchor) !== documentAnchorKey(thread.anchor)) {
|
|
41
|
+
source = { ...source, [thread.id]: { ...thread, anchor } }; degraded = true
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
const { threads, effect } = applyDocumentCommentAction(source, action, context)
|
|
42
45
|
if (detached) { effect.anchorDetached = true; effect.changed = true }
|
|
46
|
+
else if (degraded) effect.changed = true
|
|
43
47
|
const content = { ...document }
|
|
44
48
|
if (Object.keys(threads).length) content.comments = threads
|
|
45
49
|
else delete content.comments
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CAPTION_SCALE_MAX, CAPTION_SCALE_MIN } from './contracts/document.ts'
|
|
2
|
+
import type { Production, TeachingDocument } from './contracts/document.ts'
|
|
3
|
+
|
|
4
|
+
/** The caption size a document sets (`production.captions.scale`); 1 when it sets none or one out of range. */
|
|
5
|
+
export function captionScale(production: Pick<Production, 'captions'> | undefined): number {
|
|
6
|
+
const scale = production?.captions?.scale
|
|
7
|
+
return typeof scale === 'number' && scale >= CAPTION_SCALE_MIN && scale <= CAPTION_SCALE_MAX ? scale : 1
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Sets the caption size, kept in range and rounded to a tenth; the default size 1 removes the setting. */
|
|
11
|
+
export function changeDocumentCaptionScale(document: TeachingDocument, scale: number): TeachingDocument {
|
|
12
|
+
if (!Number.isFinite(scale)) throw new Error('document-caption-scale')
|
|
13
|
+
const value = Math.round(Math.min(CAPTION_SCALE_MAX, Math.max(CAPTION_SCALE_MIN, scale)) * 10) / 10
|
|
14
|
+
if (value === captionScale(document.production)) return document
|
|
15
|
+
const { captions: _captions, ...production } = document.production
|
|
16
|
+
return { ...document, production: value === 1 ? production : { ...production, captions: { scale: value } } }
|
|
17
|
+
}
|
package/src/document-comments.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { hasRole } from './access.ts'
|
|
2
2
|
import type { DocumentCommentAction, DocumentCommentContext, DocumentCommentEffect } from './contracts/document-comments.ts'
|
|
3
|
-
import
|
|
3
|
+
import { isDocumentPlaceAnchor, isDocumentTextAnchor } from './contracts/document.ts'
|
|
4
|
+
import { documentBlockSection, documentCommentTargets } from './document-places.ts'
|
|
5
|
+
import type { DocumentComment, DocumentThread, DocumentThreadAnchor, JsonObject, ListItemNode, RichTextNode, TableCellNode, TableRowNode, TeachingDocument } from './contracts/document.ts'
|
|
6
|
+
|
|
7
|
+
export { documentCommentTargets, isDocumentTextLink } from './document-places.ts'
|
|
4
8
|
|
|
5
9
|
export class DocumentCommentError extends Error {
|
|
6
10
|
readonly status: number
|
|
@@ -8,45 +12,19 @@ export class DocumentCommentError extends Error {
|
|
|
8
12
|
}
|
|
9
13
|
function fail(status: number, code: string): never { throw new DocumentCommentError(status, code) }
|
|
10
14
|
|
|
11
|
-
/** Canonical anchor v1 expands only nonempty styled-text links; other inline values are atoms. */
|
|
12
|
-
export function isDocumentTextLink(node: InlineNode): node is Extract<InlineNode, { type: 'link' }> & { children: Extract<InlineNode, { type: 'text' | 'break' }>[] } {
|
|
13
|
-
return node.type === 'link' && node.children.length > 0 && node.children.every(child => child.type === 'text' || child.type === 'break')
|
|
14
|
-
}
|
|
15
|
-
function inlineText(nodes: readonly InlineNode[]): string {
|
|
16
|
-
return nodes.map(node => node.type === 'text' ? node.text : node.type === 'break' ? '\n' : isDocumentTextLink(node) ? inlineText(node.children) : '\uFFFC').join('')
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** Only addressable canonical text identities, in native document order; opaque data is never traversed. */
|
|
20
|
-
export function documentCommentTargets(document: TeachingDocument): Map<string, { order: number, text: string }> {
|
|
21
|
-
const targets = new Map<string, { order: number, text: string }>()
|
|
22
|
-
const add = (id: string, text: string) => { targets.set(id, { order: targets.size, text }) }
|
|
23
|
-
const rich = (node: RichTextNode): void => {
|
|
24
|
-
if (node.type === 'paragraph' || node.type === 'heading') add(node.id, inlineText(node.children))
|
|
25
|
-
else if (node.type === 'code') add(node.id, node.value)
|
|
26
|
-
else if (node.type === 'list') for (const item of node.children) {
|
|
27
|
-
const [first, ...rest] = item.children
|
|
28
|
-
add(item.id, first?.type === 'paragraph' ? inlineText(first.children) : '')
|
|
29
|
-
;(first?.type === 'paragraph' ? rest : item.children).forEach(rich)
|
|
30
|
-
}
|
|
31
|
-
else if (node.type === 'blockquote') {
|
|
32
|
-
const [first, ...rest] = node.children
|
|
33
|
-
if (first?.type === 'paragraph') { add(node.id, inlineText(first.children)); rest.forEach(rich) }
|
|
34
|
-
else node.children.forEach(rich)
|
|
35
|
-
} else if (node.type === 'table') for (const row of node.children) for (const cell of row.children) add(cell.id, inlineText(cell.children))
|
|
36
|
-
}
|
|
37
|
-
const block = (id: string): void => {
|
|
38
|
-
const value = document.blocks[id]
|
|
39
|
-
if (value?.type === 'text') value.content.forEach(rich)
|
|
40
|
-
else if (value?.type === 'code' && value.value !== undefined) add(id, value.value)
|
|
41
|
-
else if (value?.type === 'container' || value?.type === 'component') value.children?.forEach(block)
|
|
42
|
-
}
|
|
43
|
-
for (const id of document.sectionOrder) { const page = document.sections[id]!; add(`page:${id}`, page.title); page.children.forEach(block) }
|
|
44
|
-
return targets
|
|
45
|
-
}
|
|
46
|
-
|
|
47
15
|
/** No ordinal, offset clamping, surrogate splitting or guessed fallback identity. */
|
|
48
16
|
export function validateDocumentCommentAnchor(document: TeachingDocument, anchor: DocumentThread['anchor']): void {
|
|
49
17
|
if (!anchor) return
|
|
18
|
+
if (isDocumentPlaceAnchor(anchor)) {
|
|
19
|
+
if (!Object.hasOwn(document.blocks, anchor.blockId)) fail(422, 'comment-anchor-target-unavailable')
|
|
20
|
+
if (anchor.stepId !== undefined) {
|
|
21
|
+
const step = Object.hasOwn(document.steps, anchor.stepId) ? document.steps[anchor.stepId] : undefined
|
|
22
|
+
const section = step ? document.sections[step.sectionId] : undefined
|
|
23
|
+
if (!step || !section || !section.stepOrder.includes(anchor.stepId) || step.sectionId !== documentBlockSection(document, anchor.blockId)) fail(422, 'comment-anchor-target-unavailable')
|
|
24
|
+
}
|
|
25
|
+
return
|
|
26
|
+
}
|
|
27
|
+
if (!isDocumentTextAnchor(anchor)) fail(422, 'comment-anchor-target-unavailable')
|
|
50
28
|
const targets = documentCommentTargets(document), a = targets.get(anchor.from.blockId), b = targets.get(anchor.to.blockId)
|
|
51
29
|
if (!a || !b) fail(422, 'comment-anchor-target-unavailable')
|
|
52
30
|
for (const [point, target] of [[anchor.from, a], [anchor.to, b]] as const) {
|
|
@@ -57,6 +35,21 @@ export function validateDocumentCommentAnchor(document: TeachingDocument, anchor
|
|
|
57
35
|
if (a.order > b.order || a.order === b.order && anchor.from.offset >= anchor.to.offset) fail(422, 'comment-anchor-range-invalid')
|
|
58
36
|
}
|
|
59
37
|
|
|
38
|
+
/**
|
|
39
|
+
* The strongest still-valid anchor. A place whose step no longer exists keeps the block; a missing block or an
|
|
40
|
+
* unmappable text range leaves the discussion explicitly unanchored rather than silently pointing elsewhere.
|
|
41
|
+
*/
|
|
42
|
+
export function degradeDocumentCommentAnchor(document: TeachingDocument, anchor: DocumentThreadAnchor | undefined): DocumentThreadAnchor | undefined {
|
|
43
|
+
if (!anchor) return undefined
|
|
44
|
+
try { validateDocumentCommentAnchor(document, anchor); return anchor }
|
|
45
|
+
catch (error) { if (!(error instanceof DocumentCommentError) || error.status !== 422) throw error }
|
|
46
|
+
if (isDocumentPlaceAnchor(anchor) && anchor.stepId !== undefined && Object.hasOwn(document.blocks, anchor.blockId)) {
|
|
47
|
+
const place: DocumentThreadAnchor = { blockId: anchor.blockId }
|
|
48
|
+
try { validateDocumentCommentAnchor(document, place); return place } catch { /* The block itself is not addressable. */ }
|
|
49
|
+
}
|
|
50
|
+
return undefined
|
|
51
|
+
}
|
|
52
|
+
|
|
60
53
|
/** Shared native/editor permissions: editors may delete any discussion, but edit their own comment; a document owner may manage earlier authors. */
|
|
61
54
|
export function applyDocumentCommentAction(source: NonNullable<TeachingDocument['comments']>, action: DocumentCommentAction, context: DocumentCommentContext): { threads: NonNullable<TeachingDocument['comments']>, effect: DocumentCommentEffect } {
|
|
62
55
|
const member = context.member
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import jsonPatch from 'fast-json-patch'
|
|
2
2
|
import type { Operation } from 'fast-json-patch'
|
|
3
3
|
import { validateDocument } from './document.ts'
|
|
4
|
+
import { documentBlockSection } from './document-places.ts'
|
|
4
5
|
import { documentParameterAccess } from './parameters.ts'
|
|
5
6
|
import { DOCUMENT_PARAMETER_MAX_CHANGES, DOCUMENT_PARAMETER_MAX_PATH_DEPTH } from './contracts/authoring-actions.ts'
|
|
6
7
|
import type { DocumentComponentAction, DocumentComponentEffect, DocumentParameterChange } from './contracts/authoring-actions.ts'
|
|
@@ -26,18 +27,9 @@ function component(document: TeachingDocument, id: string): ComponentBlock {
|
|
|
26
27
|
}
|
|
27
28
|
export function documentComponentSection(document: TeachingDocument, blockId: string): string {
|
|
28
29
|
component(document, blockId)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const id = pending.pop()!
|
|
33
|
-
if (id === blockId) return sectionId
|
|
34
|
-
if (seen.has(id)) continue
|
|
35
|
-
seen.add(id)
|
|
36
|
-
const block = document.blocks[id]
|
|
37
|
-
if (block?.type === 'container' || block?.type === 'component') pending.push(...block.children ?? [])
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return fail(422, 'component-block-owner-missing', { blockId })
|
|
30
|
+
const section = documentBlockSection(document, blockId)
|
|
31
|
+
if (!section) return fail(422, 'component-block-owner-missing', { blockId })
|
|
32
|
+
return section
|
|
41
33
|
}
|
|
42
34
|
function stepOf(document: TeachingDocument, stepId: string, sectionId: string) {
|
|
43
35
|
const step = own(document.steps, stepId) ? document.steps[stepId] : undefined
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Validator } from '@cfworker/json-schema'
|
|
2
|
+
import { DOCUMENT_JSON_SCHEMA } from './document-schema.ts'
|
|
3
|
+
import type { Narration, TeachingDocument } from './contracts/document.ts'
|
|
4
|
+
|
|
5
|
+
const schema = new Validator({ $id: 'urn:presmium:step-narrations:1', $defs: structuredClone(DOCUMENT_JSON_SCHEMA.$defs), type: 'array', items: { $ref: '#/$defs/Narration' } }, '2020-12', false)
|
|
6
|
+
|
|
7
|
+
/** Replace one step's ordered script blocks, retaining entities still used by other steps. */
|
|
8
|
+
export function replaceStepNarrations(source: TeachingDocument, stepId: string, narrations: readonly Narration[]): TeachingDocument {
|
|
9
|
+
const step = source.steps[stepId]
|
|
10
|
+
if (!step || !source.sections[step.sectionId]?.stepOrder.includes(stepId)) throw new Error('document-narration-target')
|
|
11
|
+
if (!schema.validate(narrations).valid) throw new Error('document-narration-content')
|
|
12
|
+
const ids = narrations.map(narration => narration.id)
|
|
13
|
+
if (new Set(ids).size !== ids.length) throw new Error('document-narration-target')
|
|
14
|
+
const content = { ...source,
|
|
15
|
+
steps: { ...source.steps, [stepId]: { ...step, narrationIds: ids } },
|
|
16
|
+
narrations: { ...source.narrations },
|
|
17
|
+
production: { ...source.production,
|
|
18
|
+
...source.production.narrationOverrides ? { narrationOverrides: { ...source.production.narrationOverrides } } : {},
|
|
19
|
+
...source.production.cueTimings ? { cueTimings: { ...source.production.cueTimings } } : {},
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
for (const narration of narrations) {
|
|
23
|
+
content.narrations[narration.id] = structuredClone(narration)
|
|
24
|
+
}
|
|
25
|
+
const used = new Set(Object.values(content.steps).flatMap(step => step.narrationIds))
|
|
26
|
+
for (const id of step.narrationIds) if (!used.has(id)) {
|
|
27
|
+
delete content.narrations[id]
|
|
28
|
+
if (content.production.narrationOverrides) delete content.production.narrationOverrides[id]
|
|
29
|
+
}
|
|
30
|
+
const cues = new Set(Object.values(content.narrations).flatMap(narration => narration.content.flatMap(node => node.type === 'cue' ? [node.id] : [])))
|
|
31
|
+
for (const id of Object.keys(content.production.cueTimings ?? {})) if (!cues.has(id)) delete content.production.cueTimings![id]
|
|
32
|
+
return content
|
|
33
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isDocumentPlaceAnchor } from './contracts/document.ts'
|
|
2
|
+
import { degradeDocumentCommentAnchor } from './document-comments.ts'
|
|
1
3
|
import type { DocumentBlock, DocumentEditOperation, TeachingDocument } from './contracts/document.ts'
|
|
2
4
|
|
|
3
5
|
/** Operations describe author intent; the caller validates the resulting complete document before committing it. */
|
|
@@ -69,6 +71,14 @@ export function applyDocumentOperations(source: TeachingDocument, operations: re
|
|
|
69
71
|
if (!targetSteps.has(value.id)) value.visuals = value.visuals.filter(visual => !moved.has(visual.blockId))
|
|
70
72
|
else for (const id of moved) if (!value.visuals.some(visual => visual.blockId === id)) value.visuals.push({ blockId: id, visible: true })
|
|
71
73
|
}
|
|
74
|
+
// A step belongs to one section; a place comment stays on the block when that step no longer renders it.
|
|
75
|
+
for (const thread of Object.values(document.comments ?? {})) {
|
|
76
|
+
const anchor = thread.anchor
|
|
77
|
+
if (!anchor || !isDocumentPlaceAnchor(anchor) || anchor.stepId === undefined || !moved.has(anchor.blockId)) continue
|
|
78
|
+
const degraded = degradeDocumentCommentAnchor(document, anchor)
|
|
79
|
+
if (degraded) thread.anchor = degraded
|
|
80
|
+
else delete thread.anchor
|
|
81
|
+
}
|
|
72
82
|
break
|
|
73
83
|
}
|
|
74
84
|
case 'deleteBlock': {
|
|
@@ -82,7 +92,11 @@ export function applyDocumentOperations(source: TeachingDocument, operations: re
|
|
|
82
92
|
}
|
|
83
93
|
for (const id of removed) visit(block(id))
|
|
84
94
|
// A deleted range becomes an unanchored thread; its discussion survives.
|
|
85
|
-
for (const thread of Object.values(document.comments ?? {}))
|
|
95
|
+
for (const thread of Object.values(document.comments ?? {})) {
|
|
96
|
+
const anchor = thread.anchor
|
|
97
|
+
if (!anchor) continue
|
|
98
|
+
if (isDocumentPlaceAnchor(anchor) ? identities.has(anchor.blockId) : identities.has(anchor.from.blockId) || identities.has(anchor.to.blockId)) delete thread.anchor
|
|
99
|
+
}
|
|
86
100
|
detach(operation.blockId)
|
|
87
101
|
for (const id of removed) delete document.blocks[id]
|
|
88
102
|
for (const value of Object.values(document.steps)) value.visuals = value.visuals.filter(visual => !removed.has(visual.blockId))
|
package/src/document-pages.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isDocumentPlaceAnchor } from './contracts/document.ts'
|
|
1
2
|
import type { ListItemNode, RichTextNode, TableCellNode, TableRowNode, TeachingDocument } from './contracts/document.ts'
|
|
2
3
|
import type { DocumentPageDeletionImpact, DocumentPageIds } from './contracts/authoring.ts'
|
|
3
4
|
import type { PageDeletePlan } from './contracts/workspace.ts'
|
|
@@ -89,7 +90,13 @@ export function pageDeletionImpact(document: TeachingDocument, section: string):
|
|
|
89
90
|
for (const id of blocks) { const block = document.blocks[id]; if (block?.type === 'text') block.content.forEach(rich) }
|
|
90
91
|
return { sectionId: section, retainedEmpty: document.sectionOrder.length === 1, blocks: [...blocks], steps: [...steps], narrations: [...removed], retainedNarrations: [...candidates].filter(id => !removed.has(id)), cues,
|
|
91
92
|
clips: document.production.mediaClips.filter(clip => steps.has(clip.attachment.stepId)).map(clip => clip.id),
|
|
92
|
-
detachedComments: Object.values(document.comments ?? {}).filter(thread =>
|
|
93
|
+
detachedComments: Object.values(document.comments ?? {}).filter(thread => {
|
|
94
|
+
const anchor = thread.anchor
|
|
95
|
+
if (!anchor) return false
|
|
96
|
+
return isDocumentPlaceAnchor(anchor)
|
|
97
|
+
? targets.has(anchor.blockId) || Boolean(anchor.stepId && steps.has(anchor.stepId))
|
|
98
|
+
: targets.has(anchor.from.blockId) || targets.has(anchor.to.blockId)
|
|
99
|
+
}).map(thread => thread.id), references }
|
|
93
100
|
}
|
|
94
101
|
|
|
95
102
|
export function pageDeletion(document: TeachingDocument, directory: string, version: string, section: string): PageDeletePlan {
|