@webmusic/kernel 0.2.0 → 0.4.0
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/LICENSE +202 -21
- package/NOTICE +2 -0
- package/README.md +103 -64
- package/dist/audio-context.cjs.map +1 -1
- package/dist/build-receipt.json +3 -3
- package/dist/chunk-27LH6QLZ.cjs +277 -0
- package/dist/chunk-27LH6QLZ.cjs.map +1 -0
- package/dist/chunk-3INDOVUC.cjs.map +1 -1
- package/dist/chunk-3RR2VIKA.js +393 -0
- package/dist/chunk-3RR2VIKA.js.map +1 -0
- package/dist/chunk-3YTKIKKX.cjs +378 -0
- package/dist/chunk-3YTKIKKX.cjs.map +1 -0
- package/dist/chunk-4RG4WQKC.js +360 -0
- package/dist/chunk-4RG4WQKC.js.map +1 -0
- package/dist/chunk-5AHVQXTF.cjs +620 -0
- package/dist/chunk-5AHVQXTF.cjs.map +1 -0
- package/dist/chunk-624KWJWZ.js +170 -0
- package/dist/chunk-624KWJWZ.js.map +1 -0
- package/dist/chunk-6HGFEKD3.cjs +851 -0
- package/dist/chunk-6HGFEKD3.cjs.map +1 -0
- package/dist/chunk-7ZTZZ5PN.cjs.map +1 -1
- package/dist/chunk-ALWV4P7D.js +726 -0
- package/dist/chunk-ALWV4P7D.js.map +1 -0
- package/dist/chunk-BADJJ6DV.cjs +143 -0
- package/dist/chunk-BADJJ6DV.cjs.map +1 -0
- package/dist/chunk-C3LMS36L.cjs +393 -0
- package/dist/chunk-C3LMS36L.cjs.map +1 -0
- package/dist/chunk-C3YWUZW3.cjs.map +1 -1
- package/dist/chunk-CR6OUWBJ.cjs +726 -0
- package/dist/chunk-CR6OUWBJ.cjs.map +1 -0
- package/dist/chunk-CYWDZLWC.js +2141 -0
- package/dist/chunk-CYWDZLWC.js.map +1 -0
- package/dist/chunk-DDOGX2D5.js +378 -0
- package/dist/chunk-DDOGX2D5.js.map +1 -0
- package/dist/chunk-DVN6E5U3.js +620 -0
- package/dist/chunk-DVN6E5U3.js.map +1 -0
- package/dist/chunk-EURMRU2S.js +208 -0
- package/dist/chunk-EURMRU2S.js.map +1 -0
- package/dist/chunk-EXDCK2VL.cjs +20 -0
- package/dist/chunk-EXDCK2VL.cjs.map +1 -0
- package/dist/chunk-G5EIUP52.js +114 -0
- package/dist/chunk-G5EIUP52.js.map +1 -0
- package/dist/chunk-GB4DGKLZ.js +143 -0
- package/dist/chunk-GB4DGKLZ.js.map +1 -0
- package/dist/chunk-GPOEAYOW.js +2147 -0
- package/dist/chunk-GPOEAYOW.js.map +1 -0
- package/dist/chunk-I4YMA5VM.cjs +120 -0
- package/dist/chunk-I4YMA5VM.cjs.map +1 -0
- package/dist/chunk-IVWHMDCB.cjs +4383 -0
- package/dist/chunk-IVWHMDCB.cjs.map +1 -0
- package/dist/chunk-JFCBJMA7.cjs +2147 -0
- package/dist/chunk-JFCBJMA7.cjs.map +1 -0
- package/dist/chunk-JLVSAZ3K.cjs +813 -0
- package/dist/chunk-JLVSAZ3K.cjs.map +1 -0
- package/dist/chunk-K7FYH6UG.cjs +208 -0
- package/dist/chunk-K7FYH6UG.cjs.map +1 -0
- package/dist/chunk-L4MYCETM.cjs +970 -0
- package/dist/chunk-L4MYCETM.cjs.map +1 -0
- package/dist/chunk-MNCMYNYL.js +970 -0
- package/dist/chunk-MNCMYNYL.js.map +1 -0
- package/dist/chunk-NT2BZ3QM.js +120 -0
- package/dist/chunk-NT2BZ3QM.js.map +1 -0
- package/dist/chunk-O7SA5GLC.js +277 -0
- package/dist/chunk-O7SA5GLC.js.map +1 -0
- package/dist/chunk-OCKAHITL.cjs +548 -0
- package/dist/chunk-OCKAHITL.cjs.map +1 -0
- package/dist/chunk-OTXYWCLA.js +206 -0
- package/dist/chunk-OTXYWCLA.js.map +1 -0
- package/dist/chunk-P6ZA63J7.js +548 -0
- package/dist/chunk-P6ZA63J7.js.map +1 -0
- package/dist/chunk-QLF3BOST.js +20 -0
- package/dist/chunk-QLF3BOST.js.map +1 -0
- package/dist/chunk-RCWFRZDR.js +4383 -0
- package/dist/chunk-RCWFRZDR.js.map +1 -0
- package/dist/chunk-RZBLPM3L.cjs +206 -0
- package/dist/chunk-RZBLPM3L.cjs.map +1 -0
- package/dist/chunk-TA3TNJZU.cjs +360 -0
- package/dist/chunk-TA3TNJZU.cjs.map +1 -0
- package/dist/chunk-TZSRPTQL.cjs +2141 -0
- package/dist/chunk-TZSRPTQL.cjs.map +1 -0
- package/dist/chunk-UMTPJ76S.cjs.map +1 -1
- package/dist/chunk-UY77FXDW.js +813 -0
- package/dist/chunk-UY77FXDW.js.map +1 -0
- package/dist/chunk-VFU3S7OC.js +851 -0
- package/dist/chunk-VFU3S7OC.js.map +1 -0
- package/dist/chunk-VY6WWZSW.cjs.map +1 -1
- package/dist/chunk-WN5DZOVT.cjs +170 -0
- package/dist/chunk-WN5DZOVT.cjs.map +1 -0
- package/dist/chunk-WOPW6WLR.cjs.map +1 -1
- package/dist/chunk-XBSIYUHM.cjs +114 -0
- package/dist/chunk-XBSIYUHM.cjs.map +1 -0
- package/dist/chunk-ZMU72HJS.cjs.map +1 -1
- package/dist/context-DSa0ymyN.d.cts +664 -0
- package/dist/context-DaxfAg3b.d.ts +664 -0
- package/dist/effect-chain-Cu03O5Y0.d.ts +91 -0
- package/dist/effect-chain-Do75T7uK.d.cts +91 -0
- package/dist/effect.cjs +16 -1
- package/dist/effect.cjs.map +1 -1
- package/dist/effect.d.cts +56 -14
- package/dist/effect.d.ts +56 -14
- package/dist/effect.js +16 -1
- package/dist/elements.cjs +37 -2
- package/dist/elements.cjs.map +1 -1
- package/dist/elements.d.cts +197 -8
- package/dist/elements.d.ts +197 -8
- package/dist/elements.js +36 -1
- package/dist/events.cjs.map +1 -1
- package/dist/index.cjs +555 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -4
- package/dist/index.d.ts +16 -4
- package/dist/index.js +566 -19
- package/dist/message.cjs +104 -0
- package/dist/message.cjs.map +1 -0
- package/dist/message.d.cts +738 -0
- package/dist/message.d.ts +738 -0
- package/dist/message.js +104 -0
- package/dist/meter.cjs.map +1 -1
- package/dist/module-control-C25BMtH7.d.ts +61 -0
- package/dist/module-control-yH6nTJM9.d.cts +61 -0
- package/dist/module-plugin-BnPmq1VP.d.ts +198 -0
- package/dist/module-plugin-CHb-5W0Y.d.cts +198 -0
- package/dist/module.cjs +263 -0
- package/dist/module.cjs.map +1 -0
- package/dist/module.d.cts +1112 -0
- package/dist/module.d.ts +1112 -0
- package/dist/module.js +263 -0
- package/dist/parameter-DwQzFmBR.d.cts +172 -0
- package/dist/parameter-DwQzFmBR.d.ts +172 -0
- package/dist/player.cjs.map +1 -1
- package/dist/processor-worklet.cjs +18 -0
- package/dist/processor-worklet.cjs.map +1 -0
- package/dist/processor-worklet.d.cts +166 -0
- package/dist/processor-worklet.d.ts +166 -0
- package/dist/processor-worklet.js +18 -0
- package/dist/processor-worklet.js.map +1 -0
- package/dist/processor.cjs +51 -0
- package/dist/processor.cjs.map +1 -0
- package/dist/processor.d.cts +397 -0
- package/dist/processor.d.ts +397 -0
- package/dist/processor.js +51 -0
- package/dist/processor.js.map +1 -0
- package/dist/project-types-BU4awMnL.d.ts +323 -0
- package/dist/project-types-DufCV8Ma.d.cts +323 -0
- package/dist/ring-C-i9N90a.d.cts +139 -0
- package/dist/ring-DkcMt2Eg.d.ts +139 -0
- package/dist/sequence.cjs +68 -0
- package/dist/sequence.cjs.map +1 -0
- package/dist/sequence.d.cts +303 -0
- package/dist/sequence.d.ts +303 -0
- package/dist/sequence.js +68 -0
- package/dist/sequence.js.map +1 -0
- package/dist/session.cjs +16 -0
- package/dist/session.cjs.map +1 -0
- package/dist/session.d.cts +407 -0
- package/dist/session.d.ts +407 -0
- package/dist/session.js +16 -0
- package/dist/session.js.map +1 -0
- package/dist/tick.cjs.map +1 -1
- package/dist/transport.cjs +50 -2
- package/dist/transport.cjs.map +1 -1
- package/dist/transport.d.cts +145 -1
- package/dist/transport.d.ts +145 -1
- package/dist/transport.js +51 -3
- package/dist/worker.cjs.map +1 -1
- package/package.json +61 -10
- package/dist/chunk-53YD73OY.js +0 -162
- package/dist/chunk-53YD73OY.js.map +0 -1
- package/dist/chunk-54JYWB5X.cjs +0 -1051
- package/dist/chunk-54JYWB5X.cjs.map +0 -1
- package/dist/chunk-BR63OD53.cjs +0 -1
- package/dist/chunk-BR63OD53.cjs.map +0 -1
- package/dist/chunk-ON64FRCF.js +0 -1051
- package/dist/chunk-ON64FRCF.js.map +0 -1
- package/dist/chunk-SM5YPDDI.cjs +0 -162
- package/dist/chunk-SM5YPDDI.cjs.map +0 -1
- package/dist/chunk-TEM2I2NN.js +0 -1
- package/dist/chunk-VVZX7DQ6.cjs +0 -254
- package/dist/chunk-VVZX7DQ6.cjs.map +0 -1
- package/dist/chunk-WNFGDB7B.js +0 -254
- package/dist/chunk-WNFGDB7B.js.map +0 -1
- package/dist/sync.cjs +0 -12
- package/dist/sync.cjs.map +0 -1
- package/dist/sync.d.cts +0 -307
- package/dist/sync.d.ts +0 -307
- package/dist/sync.js +0 -12
- /package/dist/{chunk-TEM2I2NN.js.map → message.js.map} +0 -0
- /package/dist/{sync.js.map → module.js.map} +0 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { SessionTransport } from './session.js';
|
|
2
|
+
import { r as ModuleAudioEnvironment, u as ModuleContext, w as ModuleHandle } from './context-DaxfAg3b.js';
|
|
3
|
+
import { a as ControlSignal, C as ConnectionLease } from './parameter-DwQzFmBR.js';
|
|
4
|
+
|
|
5
|
+
type ProjectJson = null | boolean | number | string | readonly ProjectJson[] | ProjectJsonObject;
|
|
6
|
+
interface ProjectJsonObject {
|
|
7
|
+
readonly [key: string]: ProjectJson;
|
|
8
|
+
}
|
|
9
|
+
interface ProjectPluginReference {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly version: string;
|
|
12
|
+
}
|
|
13
|
+
interface ProjectAssetReference {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly uri: string;
|
|
16
|
+
readonly mediaType?: string;
|
|
17
|
+
readonly integrity?: string;
|
|
18
|
+
}
|
|
19
|
+
interface ProjectContextRecord {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly parentId?: string;
|
|
22
|
+
/** An owner in the direct parent context supplies the nested audio/admission bus. */
|
|
23
|
+
readonly ownerModuleId?: string;
|
|
24
|
+
}
|
|
25
|
+
interface ProjectModuleRecord {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly plugin: ProjectPluginReference;
|
|
28
|
+
readonly contextId: string;
|
|
29
|
+
readonly label?: string;
|
|
30
|
+
readonly config: ProjectJsonObject;
|
|
31
|
+
/** Named asset roles point at project asset IDs; Kernel never fetches these URIs. */
|
|
32
|
+
readonly assets?: Readonly<Record<string, string>>;
|
|
33
|
+
readonly params?: Readonly<Record<string, number>>;
|
|
34
|
+
}
|
|
35
|
+
type ProjectSignalKind = 'audio' | 'control' | 'note' | 'transport' | 'source' | 'message';
|
|
36
|
+
interface ProjectEndpoint {
|
|
37
|
+
readonly moduleId: string;
|
|
38
|
+
readonly port: string;
|
|
39
|
+
}
|
|
40
|
+
interface ProjectParamEndpoint {
|
|
41
|
+
readonly moduleId: string;
|
|
42
|
+
readonly param: string;
|
|
43
|
+
}
|
|
44
|
+
interface ProjectConnectionRecord {
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly kind: ProjectSignalKind;
|
|
47
|
+
readonly from: ProjectEndpoint;
|
|
48
|
+
readonly to: ProjectEndpoint;
|
|
49
|
+
readonly mode?: 'replace' | 'send' | 'tap';
|
|
50
|
+
}
|
|
51
|
+
interface ProjectModulationRecord {
|
|
52
|
+
readonly id: string;
|
|
53
|
+
readonly source: ProjectEndpoint;
|
|
54
|
+
readonly target: ProjectParamEndpoint;
|
|
55
|
+
readonly depth: number;
|
|
56
|
+
readonly polarity?: 'bipolar' | 'unipolar';
|
|
57
|
+
}
|
|
58
|
+
interface ProjectMacroRecord {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly label?: string;
|
|
61
|
+
readonly value: number;
|
|
62
|
+
readonly targets: readonly (ProjectParamEndpoint & {
|
|
63
|
+
readonly min: number;
|
|
64
|
+
readonly max: number;
|
|
65
|
+
})[];
|
|
66
|
+
}
|
|
67
|
+
interface ProjectAutomationPoint {
|
|
68
|
+
readonly type: 'set' | 'linear' | 'exponential';
|
|
69
|
+
readonly value: number;
|
|
70
|
+
readonly timeSeconds: number;
|
|
71
|
+
}
|
|
72
|
+
interface ProjectAutomationRecord {
|
|
73
|
+
readonly id: string;
|
|
74
|
+
readonly target: ProjectParamEndpoint;
|
|
75
|
+
readonly points: readonly ProjectAutomationPoint[];
|
|
76
|
+
readonly loop?: 'repeat' | 'once';
|
|
77
|
+
/** A manual base edit can suspend a track without discarding its authored points. */
|
|
78
|
+
readonly enabled?: boolean;
|
|
79
|
+
/** Baseline before the first authored point; preserved independently of current base value. */
|
|
80
|
+
readonly initialValue?: number;
|
|
81
|
+
}
|
|
82
|
+
interface ProjectModuleLayout {
|
|
83
|
+
readonly moduleId: string;
|
|
84
|
+
readonly x: number;
|
|
85
|
+
readonly y: number;
|
|
86
|
+
readonly collapsed?: boolean;
|
|
87
|
+
/** The box's width and height in canvas pixels, when it was resized; absent means its natural size. */
|
|
88
|
+
readonly width?: number;
|
|
89
|
+
readonly height?: number;
|
|
90
|
+
}
|
|
91
|
+
/** A text note on the canvas of one context (DEC-076). */
|
|
92
|
+
interface ProjectComment {
|
|
93
|
+
readonly id: string;
|
|
94
|
+
readonly contextId: string;
|
|
95
|
+
readonly text: string;
|
|
96
|
+
readonly x: number;
|
|
97
|
+
readonly y: number;
|
|
98
|
+
}
|
|
99
|
+
/** Modules selected and moved together. */
|
|
100
|
+
interface ProjectGroup {
|
|
101
|
+
readonly id: string;
|
|
102
|
+
readonly moduleIds: readonly string[];
|
|
103
|
+
}
|
|
104
|
+
interface ProjectLayout {
|
|
105
|
+
readonly modules: readonly ProjectModuleLayout[];
|
|
106
|
+
/**
|
|
107
|
+
* The presentation view (DEC-076): the modules it shows and where. A module
|
|
108
|
+
* without an entry is absent from presentation.
|
|
109
|
+
*/
|
|
110
|
+
readonly presentation?: readonly ProjectModuleLayout[];
|
|
111
|
+
readonly comments?: readonly ProjectComment[];
|
|
112
|
+
readonly groups?: readonly ProjectGroup[];
|
|
113
|
+
/**
|
|
114
|
+
* Custom properties of the presentation as a whole (DEC-088): their names
|
|
115
|
+
* and the CSS values they are given. Kernel only keeps them; a host that
|
|
116
|
+
* shows the presentation decides which it applies.
|
|
117
|
+
*/
|
|
118
|
+
readonly style?: Readonly<Record<string, string>>;
|
|
119
|
+
/**
|
|
120
|
+
* The page a host lays the presentation out in (DEC-092): a tree of its
|
|
121
|
+
* own design that says where each shown module sits among whatever else
|
|
122
|
+
* the page holds. Kernel keeps it as plain data, under the project's
|
|
123
|
+
* limits; what it means, and what of it is safe to show, is the host's.
|
|
124
|
+
*/
|
|
125
|
+
readonly page?: ProjectJsonObject;
|
|
126
|
+
}
|
|
127
|
+
/** What drives a mapped parameter: a MIDI controller, pitch bend, program change or a computer key. */
|
|
128
|
+
type ProjectMappingSource = {
|
|
129
|
+
readonly kind: 'cc';
|
|
130
|
+
readonly controller: number;
|
|
131
|
+
readonly channel?: number;
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: 'pitchbend';
|
|
134
|
+
readonly channel?: number;
|
|
135
|
+
} | {
|
|
136
|
+
readonly kind: 'program';
|
|
137
|
+
readonly channel?: number;
|
|
138
|
+
} | {
|
|
139
|
+
readonly kind: 'pressure';
|
|
140
|
+
readonly channel?: number;
|
|
141
|
+
} | {
|
|
142
|
+
readonly kind: 'key';
|
|
143
|
+
readonly key: string;
|
|
144
|
+
};
|
|
145
|
+
/** One mapping from a control source to a parameter (DEC-076). */
|
|
146
|
+
interface ProjectMappingRecord {
|
|
147
|
+
readonly id: string;
|
|
148
|
+
readonly source: ProjectMappingSource;
|
|
149
|
+
readonly target: ProjectParamEndpoint;
|
|
150
|
+
/** Target range the source's 0–1 maps onto; defaults to the parameter's display range. */
|
|
151
|
+
readonly min?: number;
|
|
152
|
+
readonly max?: number;
|
|
153
|
+
}
|
|
154
|
+
interface ProjectSessionState {
|
|
155
|
+
/** Unwrapped Session seconds, preserving once-only automation and LFO phase across loop passes. */
|
|
156
|
+
readonly positionSeconds: number;
|
|
157
|
+
readonly rate: number;
|
|
158
|
+
readonly loop?: Readonly<{
|
|
159
|
+
startSeconds: number;
|
|
160
|
+
endSeconds: number;
|
|
161
|
+
}> | null;
|
|
162
|
+
/** Tempo and meter of the Session's musical time (DEC-077); 120 bpm in 4/4 when absent. */
|
|
163
|
+
readonly tempo?: Readonly<{
|
|
164
|
+
bpm: number;
|
|
165
|
+
beatsPerBar: number;
|
|
166
|
+
beatUnit: number;
|
|
167
|
+
}>;
|
|
168
|
+
}
|
|
169
|
+
/** Serializable project state. DSP objects, DOM, storage and undo history are deliberately absent. */
|
|
170
|
+
interface ModuleProject {
|
|
171
|
+
readonly schema: 'webmusic.module-project';
|
|
172
|
+
readonly version: 1;
|
|
173
|
+
readonly id: string;
|
|
174
|
+
readonly contexts: readonly ProjectContextRecord[];
|
|
175
|
+
readonly modules: readonly ProjectModuleRecord[];
|
|
176
|
+
readonly assets: readonly ProjectAssetReference[];
|
|
177
|
+
readonly connections: readonly ProjectConnectionRecord[];
|
|
178
|
+
readonly modulations: readonly ProjectModulationRecord[];
|
|
179
|
+
readonly macros: readonly ProjectMacroRecord[];
|
|
180
|
+
readonly automation: readonly ProjectAutomationRecord[];
|
|
181
|
+
readonly session: ProjectSessionState;
|
|
182
|
+
readonly layout: ProjectLayout;
|
|
183
|
+
/** Control mappings (DEC-076); absent means none. */
|
|
184
|
+
readonly mappings?: readonly ProjectMappingRecord[];
|
|
185
|
+
}
|
|
186
|
+
interface ProjectPortDescriptor {
|
|
187
|
+
readonly id: string;
|
|
188
|
+
readonly label?: string;
|
|
189
|
+
readonly kind: ProjectSignalKind;
|
|
190
|
+
readonly direction: 'input' | 'output';
|
|
191
|
+
}
|
|
192
|
+
interface ProjectFactoryRequest {
|
|
193
|
+
readonly record: ProjectModuleRecord;
|
|
194
|
+
readonly context: ModuleContext;
|
|
195
|
+
readonly signal: AbortSignal;
|
|
196
|
+
asset(role: string): ProjectAssetReference | undefined;
|
|
197
|
+
resolveAsset(role: string): Promise<unknown>;
|
|
198
|
+
}
|
|
199
|
+
/** Exclusively owned by one staged graph. Factories must respect context.destination and must not publish externally. */
|
|
200
|
+
interface ProjectModuleInstance {
|
|
201
|
+
readonly module: ModuleHandle;
|
|
202
|
+
readonly ports?: readonly ProjectPortDescriptor[];
|
|
203
|
+
getInput?(port: string): AudioNode | undefined;
|
|
204
|
+
getControl?(port: string): ControlSignal | undefined;
|
|
205
|
+
/** Enrich a fresh child scope; keep its ID, registry and shared AudioEnvironment. */
|
|
206
|
+
childContext?(context: ModuleContext): ModuleContext;
|
|
207
|
+
/**
|
|
208
|
+
* The module a `source` cord from `port` carries (DEC-089). Without it, or
|
|
209
|
+
* when it returns undefined, the cord carries this instance's module.
|
|
210
|
+
*/
|
|
211
|
+
sourceOutput?(port: string): ModuleHandle | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* Accept a `source` cord on `port`: follow `module` until the lease is
|
|
214
|
+
* released (DEC-089). Return undefined to leave the cord to the runtime's
|
|
215
|
+
* connector.
|
|
216
|
+
*/
|
|
217
|
+
connectSource?(port: string, module: ModuleHandle): ConnectionLease | undefined;
|
|
218
|
+
/** Capture live serializable configuration such as oscillator waveform. */
|
|
219
|
+
exportConfig?(): ProjectJsonObject;
|
|
220
|
+
/**
|
|
221
|
+
* Called once after the graph holding this instance commits, before
|
|
222
|
+
* observers hear of it; a candidate graph that never commits is disposed
|
|
223
|
+
* without activation. Message modules start timers and send load-time output here.
|
|
224
|
+
*/
|
|
225
|
+
activate?(): void;
|
|
226
|
+
dispose(): void;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Thrown by a plugin factory when its module cannot exist in this environment
|
|
230
|
+
* (a capability, preparation or resource it needs is unavailable). Restoration
|
|
231
|
+
* keeps the record unresolved with this message, exactly like a missing
|
|
232
|
+
* plugin, instead of failing; any other error still fails the restore.
|
|
233
|
+
*/
|
|
234
|
+
declare class ProjectModuleUnavailableError extends Error {
|
|
235
|
+
/** The underlying failure, when there is one. */
|
|
236
|
+
readonly cause?: unknown;
|
|
237
|
+
constructor(message: string, options?: {
|
|
238
|
+
cause?: unknown;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/** True for {@link ProjectModuleUnavailableError}, also across duplicate package copies. */
|
|
242
|
+
declare function isProjectModuleUnavailable(error: unknown): error is ProjectModuleUnavailableError;
|
|
243
|
+
interface ProjectPluginFactory extends ProjectPluginReference {
|
|
244
|
+
/**
|
|
245
|
+
* Must return a fresh, exclusively owned instance, even when replacing the
|
|
246
|
+
* same stable ID. Throw {@link ProjectModuleUnavailableError} to leave the
|
|
247
|
+
* module unresolved.
|
|
248
|
+
*/
|
|
249
|
+
create(request: ProjectFactoryRequest): ProjectModuleInstance | Promise<ProjectModuleInstance>;
|
|
250
|
+
}
|
|
251
|
+
interface ProjectConnectionRequest {
|
|
252
|
+
readonly connection: ProjectConnectionRecord;
|
|
253
|
+
readonly from: ProjectModuleInstance;
|
|
254
|
+
readonly to: ProjectModuleInstance;
|
|
255
|
+
readonly context: ModuleContext;
|
|
256
|
+
readonly signal: AbortSignal;
|
|
257
|
+
}
|
|
258
|
+
/** Adapters explicitly opt in to domain signals; undefined means retained unresolved. */
|
|
259
|
+
type ProjectConnector = (request: ProjectConnectionRequest) => ConnectionLease | undefined | Promise<ConnectionLease | undefined>;
|
|
260
|
+
interface ProjectRuntimeOptions {
|
|
261
|
+
/** Borrowed environment/context. Disposing a project never closes it. */
|
|
262
|
+
readonly audio: ModuleAudioEnvironment;
|
|
263
|
+
readonly plugins: ProjectPluginLookup;
|
|
264
|
+
readonly destination?: () => AudioNode | undefined;
|
|
265
|
+
readonly resolveAsset?: (asset: ProjectAssetReference, signal: AbortSignal) => unknown | Promise<unknown>;
|
|
266
|
+
readonly connect?: ProjectConnector;
|
|
267
|
+
readonly onCleanupError?: (error: unknown) => void;
|
|
268
|
+
/**
|
|
269
|
+
* Preload the active graph's Session as members join it (DEC-069,
|
|
270
|
+
* DEC-094): the runtime owns that Session, so its players' sound,
|
|
271
|
+
* parameters and inserts are real before the first play. `true`, or the
|
|
272
|
+
* options of {@link keepProjectSessionPreloaded}.
|
|
273
|
+
*/
|
|
274
|
+
readonly preload?: boolean | ProjectPreloadOptions;
|
|
275
|
+
}
|
|
276
|
+
/** How a runtime preloads its Session. */
|
|
277
|
+
interface ProjectPreloadOptions {
|
|
278
|
+
/** A failure that is a moment, not an error (a member not ready yet): the preload is asked again shortly, at most twenty times. */
|
|
279
|
+
readonly transient?: (error: unknown) => boolean;
|
|
280
|
+
/** Where a preload that failed is reported; by default the runtime's `onCleanupError`, else nowhere. */
|
|
281
|
+
readonly onError?: (error: unknown) => void;
|
|
282
|
+
}
|
|
283
|
+
interface ProjectPluginLookup {
|
|
284
|
+
get(id: string, version: string): ProjectPluginFactory | undefined;
|
|
285
|
+
}
|
|
286
|
+
interface ProjectDiagnostic {
|
|
287
|
+
readonly kind: 'module' | 'context' | 'connection' | 'modulation' | 'macro' | 'automation';
|
|
288
|
+
readonly id: string;
|
|
289
|
+
readonly reason: string;
|
|
290
|
+
}
|
|
291
|
+
interface ProjectRuntimeModule {
|
|
292
|
+
readonly record: ProjectModuleRecord;
|
|
293
|
+
readonly status: 'ready' | 'unresolved';
|
|
294
|
+
readonly ports: readonly ProjectPortDescriptor[];
|
|
295
|
+
/** Effective audio owner established by the context's destination/admission, inherited through organizational scopes. */
|
|
296
|
+
readonly defaultOwnerModuleId?: string;
|
|
297
|
+
readonly diagnostic?: string;
|
|
298
|
+
}
|
|
299
|
+
interface ProjectRuntimeSnapshot {
|
|
300
|
+
readonly project?: ModuleProject;
|
|
301
|
+
readonly revision: number;
|
|
302
|
+
readonly restoring: boolean;
|
|
303
|
+
readonly disposed: boolean;
|
|
304
|
+
readonly modules: readonly ProjectRuntimeModule[];
|
|
305
|
+
readonly unresolved: readonly ProjectDiagnostic[];
|
|
306
|
+
}
|
|
307
|
+
interface ProjectRestoreOptions {
|
|
308
|
+
readonly signal?: AbortSignal;
|
|
309
|
+
/** Restore remains paused by default; the caller owns any user-gesture resume policy. */
|
|
310
|
+
readonly play?: boolean;
|
|
311
|
+
}
|
|
312
|
+
interface ProjectRestoreResult {
|
|
313
|
+
readonly status: 'committed' | 'cancelled';
|
|
314
|
+
readonly snapshot: ProjectRuntimeSnapshot;
|
|
315
|
+
}
|
|
316
|
+
/** Borrowed current resources; disposal stays with ModuleProjectRuntime. */
|
|
317
|
+
interface ProjectRuntimeResources {
|
|
318
|
+
readonly context: ModuleContext;
|
|
319
|
+
readonly session: SessionTransport;
|
|
320
|
+
module(id: string): ModuleHandle | undefined;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export { type ProjectPortDescriptor as A, type ProjectPreloadOptions as B, type ProjectRestoreOptions as C, type ProjectRestoreResult as D, type ProjectRuntimeModule as E, type ProjectRuntimeOptions as F, type ProjectRuntimeResources as G, type ProjectRuntimeSnapshot as H, type ProjectSessionState as I, type ProjectSignalKind as J, isProjectModuleUnavailable as K, type ModuleProject as M, type ProjectAssetReference as P, type ProjectAutomationPoint as a, type ProjectAutomationRecord as b, type ProjectComment as c, type ProjectConnectionRecord as d, type ProjectConnectionRequest as e, type ProjectConnector as f, type ProjectContextRecord as g, type ProjectDiagnostic as h, type ProjectEndpoint as i, type ProjectFactoryRequest as j, type ProjectGroup as k, type ProjectJson as l, type ProjectJsonObject as m, type ProjectLayout as n, type ProjectMacroRecord as o, type ProjectMappingRecord as p, type ProjectMappingSource as q, type ProjectModulationRecord as r, type ProjectModuleInstance as s, type ProjectModuleLayout as t, type ProjectModuleRecord as u, ProjectModuleUnavailableError as v, type ProjectParamEndpoint as w, type ProjectPluginFactory as x, type ProjectPluginLookup as y, type ProjectPluginReference as z };
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { SessionTransport } from './session.cjs';
|
|
2
|
+
import { r as ModuleAudioEnvironment, u as ModuleContext, w as ModuleHandle } from './context-DSa0ymyN.cjs';
|
|
3
|
+
import { a as ControlSignal, C as ConnectionLease } from './parameter-DwQzFmBR.cjs';
|
|
4
|
+
|
|
5
|
+
type ProjectJson = null | boolean | number | string | readonly ProjectJson[] | ProjectJsonObject;
|
|
6
|
+
interface ProjectJsonObject {
|
|
7
|
+
readonly [key: string]: ProjectJson;
|
|
8
|
+
}
|
|
9
|
+
interface ProjectPluginReference {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly version: string;
|
|
12
|
+
}
|
|
13
|
+
interface ProjectAssetReference {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly uri: string;
|
|
16
|
+
readonly mediaType?: string;
|
|
17
|
+
readonly integrity?: string;
|
|
18
|
+
}
|
|
19
|
+
interface ProjectContextRecord {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly parentId?: string;
|
|
22
|
+
/** An owner in the direct parent context supplies the nested audio/admission bus. */
|
|
23
|
+
readonly ownerModuleId?: string;
|
|
24
|
+
}
|
|
25
|
+
interface ProjectModuleRecord {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly plugin: ProjectPluginReference;
|
|
28
|
+
readonly contextId: string;
|
|
29
|
+
readonly label?: string;
|
|
30
|
+
readonly config: ProjectJsonObject;
|
|
31
|
+
/** Named asset roles point at project asset IDs; Kernel never fetches these URIs. */
|
|
32
|
+
readonly assets?: Readonly<Record<string, string>>;
|
|
33
|
+
readonly params?: Readonly<Record<string, number>>;
|
|
34
|
+
}
|
|
35
|
+
type ProjectSignalKind = 'audio' | 'control' | 'note' | 'transport' | 'source' | 'message';
|
|
36
|
+
interface ProjectEndpoint {
|
|
37
|
+
readonly moduleId: string;
|
|
38
|
+
readonly port: string;
|
|
39
|
+
}
|
|
40
|
+
interface ProjectParamEndpoint {
|
|
41
|
+
readonly moduleId: string;
|
|
42
|
+
readonly param: string;
|
|
43
|
+
}
|
|
44
|
+
interface ProjectConnectionRecord {
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly kind: ProjectSignalKind;
|
|
47
|
+
readonly from: ProjectEndpoint;
|
|
48
|
+
readonly to: ProjectEndpoint;
|
|
49
|
+
readonly mode?: 'replace' | 'send' | 'tap';
|
|
50
|
+
}
|
|
51
|
+
interface ProjectModulationRecord {
|
|
52
|
+
readonly id: string;
|
|
53
|
+
readonly source: ProjectEndpoint;
|
|
54
|
+
readonly target: ProjectParamEndpoint;
|
|
55
|
+
readonly depth: number;
|
|
56
|
+
readonly polarity?: 'bipolar' | 'unipolar';
|
|
57
|
+
}
|
|
58
|
+
interface ProjectMacroRecord {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly label?: string;
|
|
61
|
+
readonly value: number;
|
|
62
|
+
readonly targets: readonly (ProjectParamEndpoint & {
|
|
63
|
+
readonly min: number;
|
|
64
|
+
readonly max: number;
|
|
65
|
+
})[];
|
|
66
|
+
}
|
|
67
|
+
interface ProjectAutomationPoint {
|
|
68
|
+
readonly type: 'set' | 'linear' | 'exponential';
|
|
69
|
+
readonly value: number;
|
|
70
|
+
readonly timeSeconds: number;
|
|
71
|
+
}
|
|
72
|
+
interface ProjectAutomationRecord {
|
|
73
|
+
readonly id: string;
|
|
74
|
+
readonly target: ProjectParamEndpoint;
|
|
75
|
+
readonly points: readonly ProjectAutomationPoint[];
|
|
76
|
+
readonly loop?: 'repeat' | 'once';
|
|
77
|
+
/** A manual base edit can suspend a track without discarding its authored points. */
|
|
78
|
+
readonly enabled?: boolean;
|
|
79
|
+
/** Baseline before the first authored point; preserved independently of current base value. */
|
|
80
|
+
readonly initialValue?: number;
|
|
81
|
+
}
|
|
82
|
+
interface ProjectModuleLayout {
|
|
83
|
+
readonly moduleId: string;
|
|
84
|
+
readonly x: number;
|
|
85
|
+
readonly y: number;
|
|
86
|
+
readonly collapsed?: boolean;
|
|
87
|
+
/** The box's width and height in canvas pixels, when it was resized; absent means its natural size. */
|
|
88
|
+
readonly width?: number;
|
|
89
|
+
readonly height?: number;
|
|
90
|
+
}
|
|
91
|
+
/** A text note on the canvas of one context (DEC-076). */
|
|
92
|
+
interface ProjectComment {
|
|
93
|
+
readonly id: string;
|
|
94
|
+
readonly contextId: string;
|
|
95
|
+
readonly text: string;
|
|
96
|
+
readonly x: number;
|
|
97
|
+
readonly y: number;
|
|
98
|
+
}
|
|
99
|
+
/** Modules selected and moved together. */
|
|
100
|
+
interface ProjectGroup {
|
|
101
|
+
readonly id: string;
|
|
102
|
+
readonly moduleIds: readonly string[];
|
|
103
|
+
}
|
|
104
|
+
interface ProjectLayout {
|
|
105
|
+
readonly modules: readonly ProjectModuleLayout[];
|
|
106
|
+
/**
|
|
107
|
+
* The presentation view (DEC-076): the modules it shows and where. A module
|
|
108
|
+
* without an entry is absent from presentation.
|
|
109
|
+
*/
|
|
110
|
+
readonly presentation?: readonly ProjectModuleLayout[];
|
|
111
|
+
readonly comments?: readonly ProjectComment[];
|
|
112
|
+
readonly groups?: readonly ProjectGroup[];
|
|
113
|
+
/**
|
|
114
|
+
* Custom properties of the presentation as a whole (DEC-088): their names
|
|
115
|
+
* and the CSS values they are given. Kernel only keeps them; a host that
|
|
116
|
+
* shows the presentation decides which it applies.
|
|
117
|
+
*/
|
|
118
|
+
readonly style?: Readonly<Record<string, string>>;
|
|
119
|
+
/**
|
|
120
|
+
* The page a host lays the presentation out in (DEC-092): a tree of its
|
|
121
|
+
* own design that says where each shown module sits among whatever else
|
|
122
|
+
* the page holds. Kernel keeps it as plain data, under the project's
|
|
123
|
+
* limits; what it means, and what of it is safe to show, is the host's.
|
|
124
|
+
*/
|
|
125
|
+
readonly page?: ProjectJsonObject;
|
|
126
|
+
}
|
|
127
|
+
/** What drives a mapped parameter: a MIDI controller, pitch bend, program change or a computer key. */
|
|
128
|
+
type ProjectMappingSource = {
|
|
129
|
+
readonly kind: 'cc';
|
|
130
|
+
readonly controller: number;
|
|
131
|
+
readonly channel?: number;
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: 'pitchbend';
|
|
134
|
+
readonly channel?: number;
|
|
135
|
+
} | {
|
|
136
|
+
readonly kind: 'program';
|
|
137
|
+
readonly channel?: number;
|
|
138
|
+
} | {
|
|
139
|
+
readonly kind: 'pressure';
|
|
140
|
+
readonly channel?: number;
|
|
141
|
+
} | {
|
|
142
|
+
readonly kind: 'key';
|
|
143
|
+
readonly key: string;
|
|
144
|
+
};
|
|
145
|
+
/** One mapping from a control source to a parameter (DEC-076). */
|
|
146
|
+
interface ProjectMappingRecord {
|
|
147
|
+
readonly id: string;
|
|
148
|
+
readonly source: ProjectMappingSource;
|
|
149
|
+
readonly target: ProjectParamEndpoint;
|
|
150
|
+
/** Target range the source's 0–1 maps onto; defaults to the parameter's display range. */
|
|
151
|
+
readonly min?: number;
|
|
152
|
+
readonly max?: number;
|
|
153
|
+
}
|
|
154
|
+
interface ProjectSessionState {
|
|
155
|
+
/** Unwrapped Session seconds, preserving once-only automation and LFO phase across loop passes. */
|
|
156
|
+
readonly positionSeconds: number;
|
|
157
|
+
readonly rate: number;
|
|
158
|
+
readonly loop?: Readonly<{
|
|
159
|
+
startSeconds: number;
|
|
160
|
+
endSeconds: number;
|
|
161
|
+
}> | null;
|
|
162
|
+
/** Tempo and meter of the Session's musical time (DEC-077); 120 bpm in 4/4 when absent. */
|
|
163
|
+
readonly tempo?: Readonly<{
|
|
164
|
+
bpm: number;
|
|
165
|
+
beatsPerBar: number;
|
|
166
|
+
beatUnit: number;
|
|
167
|
+
}>;
|
|
168
|
+
}
|
|
169
|
+
/** Serializable project state. DSP objects, DOM, storage and undo history are deliberately absent. */
|
|
170
|
+
interface ModuleProject {
|
|
171
|
+
readonly schema: 'webmusic.module-project';
|
|
172
|
+
readonly version: 1;
|
|
173
|
+
readonly id: string;
|
|
174
|
+
readonly contexts: readonly ProjectContextRecord[];
|
|
175
|
+
readonly modules: readonly ProjectModuleRecord[];
|
|
176
|
+
readonly assets: readonly ProjectAssetReference[];
|
|
177
|
+
readonly connections: readonly ProjectConnectionRecord[];
|
|
178
|
+
readonly modulations: readonly ProjectModulationRecord[];
|
|
179
|
+
readonly macros: readonly ProjectMacroRecord[];
|
|
180
|
+
readonly automation: readonly ProjectAutomationRecord[];
|
|
181
|
+
readonly session: ProjectSessionState;
|
|
182
|
+
readonly layout: ProjectLayout;
|
|
183
|
+
/** Control mappings (DEC-076); absent means none. */
|
|
184
|
+
readonly mappings?: readonly ProjectMappingRecord[];
|
|
185
|
+
}
|
|
186
|
+
interface ProjectPortDescriptor {
|
|
187
|
+
readonly id: string;
|
|
188
|
+
readonly label?: string;
|
|
189
|
+
readonly kind: ProjectSignalKind;
|
|
190
|
+
readonly direction: 'input' | 'output';
|
|
191
|
+
}
|
|
192
|
+
interface ProjectFactoryRequest {
|
|
193
|
+
readonly record: ProjectModuleRecord;
|
|
194
|
+
readonly context: ModuleContext;
|
|
195
|
+
readonly signal: AbortSignal;
|
|
196
|
+
asset(role: string): ProjectAssetReference | undefined;
|
|
197
|
+
resolveAsset(role: string): Promise<unknown>;
|
|
198
|
+
}
|
|
199
|
+
/** Exclusively owned by one staged graph. Factories must respect context.destination and must not publish externally. */
|
|
200
|
+
interface ProjectModuleInstance {
|
|
201
|
+
readonly module: ModuleHandle;
|
|
202
|
+
readonly ports?: readonly ProjectPortDescriptor[];
|
|
203
|
+
getInput?(port: string): AudioNode | undefined;
|
|
204
|
+
getControl?(port: string): ControlSignal | undefined;
|
|
205
|
+
/** Enrich a fresh child scope; keep its ID, registry and shared AudioEnvironment. */
|
|
206
|
+
childContext?(context: ModuleContext): ModuleContext;
|
|
207
|
+
/**
|
|
208
|
+
* The module a `source` cord from `port` carries (DEC-089). Without it, or
|
|
209
|
+
* when it returns undefined, the cord carries this instance's module.
|
|
210
|
+
*/
|
|
211
|
+
sourceOutput?(port: string): ModuleHandle | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* Accept a `source` cord on `port`: follow `module` until the lease is
|
|
214
|
+
* released (DEC-089). Return undefined to leave the cord to the runtime's
|
|
215
|
+
* connector.
|
|
216
|
+
*/
|
|
217
|
+
connectSource?(port: string, module: ModuleHandle): ConnectionLease | undefined;
|
|
218
|
+
/** Capture live serializable configuration such as oscillator waveform. */
|
|
219
|
+
exportConfig?(): ProjectJsonObject;
|
|
220
|
+
/**
|
|
221
|
+
* Called once after the graph holding this instance commits, before
|
|
222
|
+
* observers hear of it; a candidate graph that never commits is disposed
|
|
223
|
+
* without activation. Message modules start timers and send load-time output here.
|
|
224
|
+
*/
|
|
225
|
+
activate?(): void;
|
|
226
|
+
dispose(): void;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Thrown by a plugin factory when its module cannot exist in this environment
|
|
230
|
+
* (a capability, preparation or resource it needs is unavailable). Restoration
|
|
231
|
+
* keeps the record unresolved with this message, exactly like a missing
|
|
232
|
+
* plugin, instead of failing; any other error still fails the restore.
|
|
233
|
+
*/
|
|
234
|
+
declare class ProjectModuleUnavailableError extends Error {
|
|
235
|
+
/** The underlying failure, when there is one. */
|
|
236
|
+
readonly cause?: unknown;
|
|
237
|
+
constructor(message: string, options?: {
|
|
238
|
+
cause?: unknown;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/** True for {@link ProjectModuleUnavailableError}, also across duplicate package copies. */
|
|
242
|
+
declare function isProjectModuleUnavailable(error: unknown): error is ProjectModuleUnavailableError;
|
|
243
|
+
interface ProjectPluginFactory extends ProjectPluginReference {
|
|
244
|
+
/**
|
|
245
|
+
* Must return a fresh, exclusively owned instance, even when replacing the
|
|
246
|
+
* same stable ID. Throw {@link ProjectModuleUnavailableError} to leave the
|
|
247
|
+
* module unresolved.
|
|
248
|
+
*/
|
|
249
|
+
create(request: ProjectFactoryRequest): ProjectModuleInstance | Promise<ProjectModuleInstance>;
|
|
250
|
+
}
|
|
251
|
+
interface ProjectConnectionRequest {
|
|
252
|
+
readonly connection: ProjectConnectionRecord;
|
|
253
|
+
readonly from: ProjectModuleInstance;
|
|
254
|
+
readonly to: ProjectModuleInstance;
|
|
255
|
+
readonly context: ModuleContext;
|
|
256
|
+
readonly signal: AbortSignal;
|
|
257
|
+
}
|
|
258
|
+
/** Adapters explicitly opt in to domain signals; undefined means retained unresolved. */
|
|
259
|
+
type ProjectConnector = (request: ProjectConnectionRequest) => ConnectionLease | undefined | Promise<ConnectionLease | undefined>;
|
|
260
|
+
interface ProjectRuntimeOptions {
|
|
261
|
+
/** Borrowed environment/context. Disposing a project never closes it. */
|
|
262
|
+
readonly audio: ModuleAudioEnvironment;
|
|
263
|
+
readonly plugins: ProjectPluginLookup;
|
|
264
|
+
readonly destination?: () => AudioNode | undefined;
|
|
265
|
+
readonly resolveAsset?: (asset: ProjectAssetReference, signal: AbortSignal) => unknown | Promise<unknown>;
|
|
266
|
+
readonly connect?: ProjectConnector;
|
|
267
|
+
readonly onCleanupError?: (error: unknown) => void;
|
|
268
|
+
/**
|
|
269
|
+
* Preload the active graph's Session as members join it (DEC-069,
|
|
270
|
+
* DEC-094): the runtime owns that Session, so its players' sound,
|
|
271
|
+
* parameters and inserts are real before the first play. `true`, or the
|
|
272
|
+
* options of {@link keepProjectSessionPreloaded}.
|
|
273
|
+
*/
|
|
274
|
+
readonly preload?: boolean | ProjectPreloadOptions;
|
|
275
|
+
}
|
|
276
|
+
/** How a runtime preloads its Session. */
|
|
277
|
+
interface ProjectPreloadOptions {
|
|
278
|
+
/** A failure that is a moment, not an error (a member not ready yet): the preload is asked again shortly, at most twenty times. */
|
|
279
|
+
readonly transient?: (error: unknown) => boolean;
|
|
280
|
+
/** Where a preload that failed is reported; by default the runtime's `onCleanupError`, else nowhere. */
|
|
281
|
+
readonly onError?: (error: unknown) => void;
|
|
282
|
+
}
|
|
283
|
+
interface ProjectPluginLookup {
|
|
284
|
+
get(id: string, version: string): ProjectPluginFactory | undefined;
|
|
285
|
+
}
|
|
286
|
+
interface ProjectDiagnostic {
|
|
287
|
+
readonly kind: 'module' | 'context' | 'connection' | 'modulation' | 'macro' | 'automation';
|
|
288
|
+
readonly id: string;
|
|
289
|
+
readonly reason: string;
|
|
290
|
+
}
|
|
291
|
+
interface ProjectRuntimeModule {
|
|
292
|
+
readonly record: ProjectModuleRecord;
|
|
293
|
+
readonly status: 'ready' | 'unresolved';
|
|
294
|
+
readonly ports: readonly ProjectPortDescriptor[];
|
|
295
|
+
/** Effective audio owner established by the context's destination/admission, inherited through organizational scopes. */
|
|
296
|
+
readonly defaultOwnerModuleId?: string;
|
|
297
|
+
readonly diagnostic?: string;
|
|
298
|
+
}
|
|
299
|
+
interface ProjectRuntimeSnapshot {
|
|
300
|
+
readonly project?: ModuleProject;
|
|
301
|
+
readonly revision: number;
|
|
302
|
+
readonly restoring: boolean;
|
|
303
|
+
readonly disposed: boolean;
|
|
304
|
+
readonly modules: readonly ProjectRuntimeModule[];
|
|
305
|
+
readonly unresolved: readonly ProjectDiagnostic[];
|
|
306
|
+
}
|
|
307
|
+
interface ProjectRestoreOptions {
|
|
308
|
+
readonly signal?: AbortSignal;
|
|
309
|
+
/** Restore remains paused by default; the caller owns any user-gesture resume policy. */
|
|
310
|
+
readonly play?: boolean;
|
|
311
|
+
}
|
|
312
|
+
interface ProjectRestoreResult {
|
|
313
|
+
readonly status: 'committed' | 'cancelled';
|
|
314
|
+
readonly snapshot: ProjectRuntimeSnapshot;
|
|
315
|
+
}
|
|
316
|
+
/** Borrowed current resources; disposal stays with ModuleProjectRuntime. */
|
|
317
|
+
interface ProjectRuntimeResources {
|
|
318
|
+
readonly context: ModuleContext;
|
|
319
|
+
readonly session: SessionTransport;
|
|
320
|
+
module(id: string): ModuleHandle | undefined;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export { type ProjectPortDescriptor as A, type ProjectPreloadOptions as B, type ProjectRestoreOptions as C, type ProjectRestoreResult as D, type ProjectRuntimeModule as E, type ProjectRuntimeOptions as F, type ProjectRuntimeResources as G, type ProjectRuntimeSnapshot as H, type ProjectSessionState as I, type ProjectSignalKind as J, isProjectModuleUnavailable as K, type ModuleProject as M, type ProjectAssetReference as P, type ProjectAutomationPoint as a, type ProjectAutomationRecord as b, type ProjectComment as c, type ProjectConnectionRecord as d, type ProjectConnectionRequest as e, type ProjectConnector as f, type ProjectContextRecord as g, type ProjectDiagnostic as h, type ProjectEndpoint as i, type ProjectFactoryRequest as j, type ProjectGroup as k, type ProjectJson as l, type ProjectJsonObject as m, type ProjectLayout as n, type ProjectMacroRecord as o, type ProjectMappingRecord as p, type ProjectMappingSource as q, type ProjectModulationRecord as r, type ProjectModuleInstance as s, type ProjectModuleLayout as t, type ProjectModuleRecord as u, ProjectModuleUnavailableError as v, type ProjectParamEndpoint as w, type ProjectPluginFactory as x, type ProjectPluginLookup as y, type ProjectPluginReference as z };
|