@deadair/plugin-sdk 0.37.6 → 0.38.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/README.md +16 -6
- package/dist/boundary.json.safe.d.ts +5 -3
- package/dist/boundary.json.safe.d.ts.map +1 -1
- package/dist/capabilities/transcode.d.ts +94 -0
- package/dist/capabilities/transcode.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin.manifest.d.ts +10 -1
- package/dist/plugin.manifest.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ A plugin extends deadair by declaring capabilities:
|
|
|
17
17
|
| `llm` | produce words: a conversation in, text out |
|
|
18
18
|
| `analysis` | measure a track's audio: bytes in, cue points and loudness out |
|
|
19
19
|
| `mixer` | make one piece of audio out of several: parts in, audio out |
|
|
20
|
+
| `transcode` | make a small copy of some audio to share: audio in, audio out |
|
|
20
21
|
| `charts` | say what is popular: a chart id in, ranked names out |
|
|
21
22
|
| `similarity` | say what sounds like this: an artist or a record in, names out |
|
|
22
23
|
| `news` | say what happened outside the station: a feed in, entries out |
|
|
@@ -1206,10 +1207,11 @@ plugins it is the only place an operator can learn them.
|
|
|
1206
1207
|
|
|
1207
1208
|
## Decoded audio
|
|
1208
1209
|
|
|
1209
|
-
`analysis` and `
|
|
1210
|
-
the one thing that does not happen inside deadair. The expected
|
|
1211
|
-
an adapter over a separate program
|
|
1212
|
-
|
|
1210
|
+
`analysis`, `mixer` and `transcode` are the three capabilities that need decoded
|
|
1211
|
+
PCM, which is the one thing that does not happen inside deadair. The expected
|
|
1212
|
+
shape for all three is an adapter over a separate program (the bundled one is an
|
|
1213
|
+
HTTP sidecar serving all of them), in the same relationship a speech plugin has
|
|
1214
|
+
with its engine.
|
|
1213
1215
|
|
|
1214
1216
|
### Measuring, and joining
|
|
1215
1217
|
|
|
@@ -1231,7 +1233,14 @@ rather than failing where the thing behind you cannot join what it was given; a
|
|
|
1231
1233
|
station that asks has somewhere to go, since a programme whose parts were not
|
|
1232
1234
|
joined simply airs as its parts.
|
|
1233
1235
|
|
|
1234
|
-
|
|
1236
|
+
`transcode(request)` is what `transcode` requires: one URL, a bitrate and a
|
|
1237
|
+
channel count in, a smaller copy out, as a `mime` and a stream. The station asks
|
|
1238
|
+
for it when a listener shares a talk break and keeps what you answer for a while,
|
|
1239
|
+
so the numbers are the station's decision and not yours; encode at what you are
|
|
1240
|
+
asked for. It never airs, so lossy is fine. Answer `unsupported` where the thing
|
|
1241
|
+
behind you cannot encode, and the listener is told the station cannot make a copy.
|
|
1242
|
+
|
|
1243
|
+
### Why these are separate capabilities and can still be one plugin
|
|
1235
1244
|
|
|
1236
1245
|
Joining is the same requirement seen from the other end: whatever decodes for you
|
|
1237
1246
|
can almost certainly concatenate. So declare both and serve them off one address,
|
|
@@ -1244,7 +1253,8 @@ was whichever plugin the operator chose to MEASURE with: install one that
|
|
|
1244
1253
|
measures better and cannot join, name it, and joining stops with nothing to do
|
|
1245
1254
|
about it but choose a worse analyzer. Two keys (`analysis.pluginId` and
|
|
1246
1255
|
`render.mixerPluginId`) let a station measure with one engine and join with
|
|
1247
|
-
another, and let a mix-only plugin exist at all.
|
|
1256
|
+
another, and let a mix-only plugin exist at all. `transcode` has its own third key
|
|
1257
|
+
(`render.transcodePluginId`) for the same reason.
|
|
1248
1258
|
|
|
1249
1259
|
Declaring several capabilities is ordinary here rather than a compromise: the
|
|
1250
1260
|
bundled music providers declare three and four.
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
import type { AlmanacDay, AlmanacEntry, AlmanacQuery, AlmanacSubject } from './capabilities/almanac.js';
|
|
39
39
|
import type { AnalysisRef, TrackAnalysis, TrackCuePoints, TrackLoudness, TrackTaggedLoudness } from './capabilities/analysis.js';
|
|
40
40
|
import type { AudioJoin, AudioOverlay } from './capabilities/mixer.js';
|
|
41
|
+
import type { AudioTranscode } from './capabilities/transcode.js';
|
|
41
42
|
import type { ChartDescriptor, ChartEntry, ChartQuery } from './capabilities/charts.js';
|
|
42
43
|
import type { NarrationPart, NarrationPiece, NarrationPiecesQuery, NarrationSeries, NarrationText, NarrationTextQuery } from './capabilities/narration.js';
|
|
43
44
|
import type { NewsFeedDescriptor, NewsItem, NewsQuery } from './capabilities/news.js';
|
|
@@ -145,6 +146,7 @@ export type AssertAllBoundaryPayloadsAreJsonSafe = AssertAllTrue<{
|
|
|
145
146
|
AnalysisRef: IsJsonSafe<AnalysisRef>;
|
|
146
147
|
AudioJoin: IsJsonSafe<AudioJoin>;
|
|
147
148
|
AudioOverlay: IsJsonSafe<AudioOverlay>;
|
|
149
|
+
AudioTranscode: IsJsonSafe<AudioTranscode>;
|
|
148
150
|
TrackCuePoints: IsJsonSafe<TrackCuePoints>;
|
|
149
151
|
TrackLoudness: IsJsonSafe<TrackLoudness>;
|
|
150
152
|
TrackTaggedLoudness: IsJsonSafe<TrackTaggedLoudness>;
|
|
@@ -199,7 +201,7 @@ export type AssertAllBoundaryPayloadsAreJsonSafe = AssertAllTrue<{
|
|
|
199
201
|
* registry-coverage test can compare it against what is actually exported
|
|
200
202
|
* from the boundary source files.
|
|
201
203
|
*/
|
|
202
|
-
export declare const JSON_SAFE_PAYLOAD_TYPES: readonly ["PluginConnectionResult", "PluginPermissions", "NetworkPermissionHost", "NetworkPermissionFromConfig", "PluginGrantRequest", "ConfigField", "ConfigFieldOption", "ConfigFieldColumn", "ConfigFieldPreset", "PluginManifest", "ProviderTrack", "ProviderPlaylist", "ProviderStream", "TrackFetchSession", "TrackFetchRequest", "PlaylistTracksRequest", "PluginSocketOptions", "SearchTracksOptions", "ListPlaylistsOptions", "GetPlaylistTracksOptions", "PlaybackState", "TrackRef", "ArtistRef", "AlbumRef", "ExternalId", "ExternalLink", "SourceDocument", "TrackEnrichment", "ArtistEnrichment", "AlbumEnrichment", "SpeechRequest", "SpeechVoice", "LlmMessage", "LlmToolDeclaration", "LlmToolCall", "LlmUsage", "LlmRequest", "LlmResult", "LlmModelInfo", "AnalysisRef", "AudioJoin", "AudioOverlay", "TrackCuePoints", "TrackLoudness", "TrackTaggedLoudness", "TrackAnalysis", "ChartDescriptor", "ChartQuery", "ChartEntry", "NewsFeedDescriptor", "NewsQuery", "NewsItem", "NarrationSeries", "NarrationPiece", "NarrationPart", "NarrationText", "NarrationPiecesQuery", "NarrationTextQuery", "PodcastShow", "PodcastAudio", "PodcastEpisode", "PodcastEpisodesQuery", "PodcastDirectoryQuery", "PodcastDirectoryEntry", "SimilarArtist", "ArtistTrack", "SearchQuery", "SearchResult", "WeatherQuery", "WeatherConditions", "WeatherDay", "WeatherReading", "AlmanacQuery", "AlmanacSubject", "AlmanacEntry", "AlmanacDay", "ScrobblePlay", "ScrobbleRejection", "ScrobbleResult", "MessagingSender", "MessagingAction", "MessagingButton", "InboundMessage", "MessagingReceiveQuery", "MessagingReceiveResult", "OutboundMessage", "MessagingSendResult", "MessagingAnnounceTarget", "MessagingCommand", "SpeechLimits"];
|
|
204
|
+
export declare const JSON_SAFE_PAYLOAD_TYPES: readonly ["PluginConnectionResult", "PluginPermissions", "NetworkPermissionHost", "NetworkPermissionFromConfig", "PluginGrantRequest", "ConfigField", "ConfigFieldOption", "ConfigFieldColumn", "ConfigFieldPreset", "PluginManifest", "ProviderTrack", "ProviderPlaylist", "ProviderStream", "TrackFetchSession", "TrackFetchRequest", "PlaylistTracksRequest", "PluginSocketOptions", "SearchTracksOptions", "ListPlaylistsOptions", "GetPlaylistTracksOptions", "PlaybackState", "TrackRef", "ArtistRef", "AlbumRef", "ExternalId", "ExternalLink", "SourceDocument", "TrackEnrichment", "ArtistEnrichment", "AlbumEnrichment", "SpeechRequest", "SpeechVoice", "LlmMessage", "LlmToolDeclaration", "LlmToolCall", "LlmUsage", "LlmRequest", "LlmResult", "LlmModelInfo", "AnalysisRef", "AudioJoin", "AudioOverlay", "AudioTranscode", "TrackCuePoints", "TrackLoudness", "TrackTaggedLoudness", "TrackAnalysis", "ChartDescriptor", "ChartQuery", "ChartEntry", "NewsFeedDescriptor", "NewsQuery", "NewsItem", "NarrationSeries", "NarrationPiece", "NarrationPart", "NarrationText", "NarrationPiecesQuery", "NarrationTextQuery", "PodcastShow", "PodcastAudio", "PodcastEpisode", "PodcastEpisodesQuery", "PodcastDirectoryQuery", "PodcastDirectoryEntry", "SimilarArtist", "ArtistTrack", "SearchQuery", "SearchResult", "WeatherQuery", "WeatherConditions", "WeatherDay", "WeatherReading", "AlmanacQuery", "AlmanacSubject", "AlmanacEntry", "AlmanacDay", "ScrobblePlay", "ScrobbleRejection", "ScrobbleResult", "MessagingSender", "MessagingAction", "MessagingButton", "InboundMessage", "MessagingReceiveQuery", "MessagingReceiveResult", "OutboundMessage", "MessagingSendResult", "MessagingAnnounceTarget", "MessagingCommand", "SpeechLimits"];
|
|
203
205
|
/**
|
|
204
206
|
* Boundary interfaces that are deliberately NOT payloads: they describe
|
|
205
207
|
* methods, so they carry functions by definition and can never be JSON-safe.
|
|
@@ -209,7 +211,7 @@ export declare const JSON_SAFE_PAYLOAD_TYPES: readonly ["PluginConnectionResult"
|
|
|
209
211
|
* interfaces explicitly is what makes "is this a payload or a contract?" a
|
|
210
212
|
* conscious decision for anyone adding one, rather than a silent omission.
|
|
211
213
|
*/
|
|
212
|
-
export declare const BOUNDARY_METHOD_TYPES: readonly ["PluginLogger", "PluginStorage", "PluginSecrets", "PluginConfigAccess", "PluginOAuth", "PluginEvents", "PluginTrackFetcher", "PluginSocket", "PluginHost", "PluginLifecycle", "MusicProviderCatalog", "MusicProviderStream", "MusicProviderSteer", "MusicProviderOAuth", "MusicProvider", "EnrichmentProvider", "SpeechPluginInstance", "LlmPluginInstance", "AnalysisProvider", "MixerProvider", "ChartsProvider", "NewsProvider", "NarrationProvider", "PodcastProvider", "SimilarityProvider", "SearchProvider", "WeatherProvider", "AlmanacProvider", "ScrobbleProvider", "MessagingProvider"];
|
|
214
|
+
export declare const BOUNDARY_METHOD_TYPES: readonly ["PluginLogger", "PluginStorage", "PluginSecrets", "PluginConfigAccess", "PluginOAuth", "PluginEvents", "PluginTrackFetcher", "PluginSocket", "PluginHost", "PluginLifecycle", "MusicProviderCatalog", "MusicProviderStream", "MusicProviderSteer", "MusicProviderOAuth", "MusicProvider", "EnrichmentProvider", "SpeechPluginInstance", "LlmPluginInstance", "AnalysisProvider", "MixerProvider", "TranscodeProvider", "ChartsProvider", "NewsProvider", "NarrationProvider", "PodcastProvider", "SimilarityProvider", "SearchProvider", "WeatherProvider", "AlmanacProvider", "ScrobbleProvider", "MessagingProvider"];
|
|
213
215
|
/**
|
|
214
216
|
* Boundary interfaces that deliberately carry a LIVE object, and so are neither
|
|
215
217
|
* payloads nor method contracts.
|
|
@@ -220,6 +222,6 @@ export declare const BOUNDARY_METHOD_TYPES: readonly ["PluginLogger", "PluginSto
|
|
|
220
222
|
* registry-coverage test treats an unclassified boundary interface as an omission, and "this one
|
|
221
223
|
* holds a live object on purpose" is a decision somebody should have to make in writing.
|
|
222
224
|
*/
|
|
223
|
-
export declare const BOUNDARY_LIVE_OBJECT_TYPES: readonly ["HostFetchInit", "SpeechHandle", "JoinedAudio", "LlmHandle"];
|
|
225
|
+
export declare const BOUNDARY_LIVE_OBJECT_TYPES: readonly ["HostFetchInit", "SpeechHandle", "JoinedAudio", "TranscodedAudio", "LlmHandle"];
|
|
224
226
|
export {};
|
|
225
227
|
//# sourceMappingURL=boundary.json.safe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boundary.json.safe.d.ts","sourceRoot":"","sources":["../src/boundary.json.safe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa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A0B,2FAmB7B,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `transcode` capability. A transcode plugin takes one piece of audio and
|
|
3
|
+
* answers with a smaller copy of it.
|
|
4
|
+
*
|
|
5
|
+
* ## What it is for
|
|
6
|
+
*
|
|
7
|
+
* A copy made to be SENT rather than aired. A talk break is rendered as whatever
|
|
8
|
+
* the speech engine produced, which is often wav at three megabytes a minute, and
|
|
9
|
+
* a listener sharing one by text message needs something a plain MMS will carry.
|
|
10
|
+
* The station asks for that copy once per break and keeps it for a while; nothing
|
|
11
|
+
* this capability answers ever goes back into the programme, which is why it may
|
|
12
|
+
* be lossy where a join may not.
|
|
13
|
+
*
|
|
14
|
+
* ## Why it is not the mixer, or the analysis capability
|
|
15
|
+
*
|
|
16
|
+
* `mixer.ts` argues it in full, and the argument carries over unchanged: a
|
|
17
|
+
* capability is the unit of SELECTION. Carried as a method on the mixer, the
|
|
18
|
+
* plugin making shareable copies would be whichever plugin the operator chose to
|
|
19
|
+
* JOIN with, and a better joiner that cannot encode would take sharing away. The
|
|
20
|
+
* bundled analyzer declares all three and serves them off one sidecar; that is a
|
|
21
|
+
* fact about the adapter, not the contract.
|
|
22
|
+
*
|
|
23
|
+
* ## The plugin is an adapter, not an encoder
|
|
24
|
+
*
|
|
25
|
+
* Encoding does not happen in Node, so the expected implementation is a thin
|
|
26
|
+
* adapter over a separate program, as it is for analysis and mixing. Nothing
|
|
27
|
+
* here requires that shape.
|
|
28
|
+
*
|
|
29
|
+
* Every shape here is JSON-safe except {@link TranscodedAudio}, which carries a
|
|
30
|
+
* live stream deliberately. Durations are integer milliseconds.
|
|
31
|
+
*/
|
|
32
|
+
import type { PluginLifecycle } from '../plugin.lifecycle.js';
|
|
33
|
+
/**
|
|
34
|
+
* One piece of audio to be made smaller.
|
|
35
|
+
*
|
|
36
|
+
* The numbers are the HOST's decision, carried here so it is made in one place:
|
|
37
|
+
* the station names a purpose to its clients ("a copy to share") and turns that
|
|
38
|
+
* into these, so an implementation is never the one deciding how small is small.
|
|
39
|
+
*/
|
|
40
|
+
export interface AudioTranscode {
|
|
41
|
+
/**
|
|
42
|
+
* The audio, complete and fetchable exactly as a mixer part's url is, and
|
|
43
|
+
* carrying whatever authentication it needs. It has to be reachable from
|
|
44
|
+
* wherever the encoding happens, which is not necessarily where this plugin
|
|
45
|
+
* runs.
|
|
46
|
+
*/
|
|
47
|
+
url: string;
|
|
48
|
+
/** The bitrate to encode at, in kilobits per second. */
|
|
49
|
+
bitrateKbps: number;
|
|
50
|
+
/** How many channels the copy has: `1` for mono, `2` for stereo. */
|
|
51
|
+
channels: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The copy, and what it is.
|
|
55
|
+
*
|
|
56
|
+
* {@link JoinedAudio}'s shape, for its reasons: `mime` is what the host stores
|
|
57
|
+
* and serves the bytes under, and the audio is a stream the host reads to the
|
|
58
|
+
* end or cancels.
|
|
59
|
+
*/
|
|
60
|
+
export interface TranscodedAudio {
|
|
61
|
+
/**
|
|
62
|
+
* What the bytes ARE, as a media type (`audio/mp4`).
|
|
63
|
+
*
|
|
64
|
+
* The host checks it rather than trusting it to be what it asked for: a copy
|
|
65
|
+
* announced as one thing and stored as another is served wrongly to everybody
|
|
66
|
+
* who asks for it afterwards.
|
|
67
|
+
*/
|
|
68
|
+
mime: string;
|
|
69
|
+
/** The audio. The host reads it to the end or cancels it. */
|
|
70
|
+
audio: ReadableStream<Uint8Array>;
|
|
71
|
+
/** How long the copy runs, if the encoder can say. Absent is fine. */
|
|
72
|
+
durationMs?: number;
|
|
73
|
+
}
|
|
74
|
+
/** A plugin that can make a smaller copy of a piece of audio. */
|
|
75
|
+
export interface TranscodeProvider extends PluginLifecycle {
|
|
76
|
+
/**
|
|
77
|
+
* Make a smaller copy of one piece of audio.
|
|
78
|
+
*
|
|
79
|
+
* Required, on the mixer's argument: a plugin declaring this capability that
|
|
80
|
+
* cannot encode is not a state worth being able to express. A station with
|
|
81
|
+
* no transcoder at all is an ordinary one: a listener asking for a copy to
|
|
82
|
+
* share is told the station cannot make one, and everything else carries on.
|
|
83
|
+
*
|
|
84
|
+
* Seconds rather than minutes for the talk this exists for, but honour
|
|
85
|
+
* `host.signal` all the same.
|
|
86
|
+
*
|
|
87
|
+
* @throws {PluginError} `config` when the plugin is not set up enough to try,
|
|
88
|
+
* `upstream` when the audio could not be fetched or decoded, `unsupported`
|
|
89
|
+
* when whatever is behind this plugin cannot encode, `timeout` when it did
|
|
90
|
+
* not answer.
|
|
91
|
+
*/
|
|
92
|
+
transcode(request: AudioTranscode): Promise<TranscodedAudio>;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=transcode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcode.d.ts","sourceRoot":"","sources":["../../src/capabilities/transcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC3B;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IAEpB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb,6DAA6D;IAC7D,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAElC,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,iEAAiE;AACjE,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACtD;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAChE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './capabilities/scrobble.js';
|
|
|
14
14
|
export * from './capabilities/search.js';
|
|
15
15
|
export * from './capabilities/similarity.js';
|
|
16
16
|
export * from './capabilities/speech.js';
|
|
17
|
+
export * from './capabilities/transcode.js';
|
|
17
18
|
export * from './capabilities/weather.js';
|
|
18
19
|
export * from './article.parse.js';
|
|
19
20
|
export * from './define.plugin.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ var JSON_SAFE_PAYLOAD_TYPES = [
|
|
|
46
46
|
"AnalysisRef",
|
|
47
47
|
"AudioJoin",
|
|
48
48
|
"AudioOverlay",
|
|
49
|
+
"AudioTranscode",
|
|
49
50
|
"TrackCuePoints",
|
|
50
51
|
"TrackLoudness",
|
|
51
52
|
"TrackTaggedLoudness",
|
|
@@ -116,6 +117,7 @@ var BOUNDARY_METHOD_TYPES = [
|
|
|
116
117
|
"LlmPluginInstance",
|
|
117
118
|
"AnalysisProvider",
|
|
118
119
|
"MixerProvider",
|
|
120
|
+
"TranscodeProvider",
|
|
119
121
|
"ChartsProvider",
|
|
120
122
|
"NewsProvider",
|
|
121
123
|
"NarrationProvider",
|
|
@@ -138,6 +140,9 @@ var BOUNDARY_LIVE_OBJECT_TYPES = [
|
|
|
138
140
|
// longest single piece of audio the station ever makes, so holding it whole
|
|
139
141
|
// is the one thing this must not do.
|
|
140
142
|
"JoinedAudio",
|
|
143
|
+
// `audio`: and once more on the `transcode` side, for the copy made to be shared. Small, but
|
|
144
|
+
// the same shape for the same reason, so the host has one way to take audio from a plugin.
|
|
145
|
+
"TranscodedAudio",
|
|
141
146
|
// `text`: the words as the model produces them, and `result`: a promise that
|
|
142
147
|
// settles when it stops. The stream is what lets the host hold its single
|
|
143
148
|
// model slot until the generation really ends rather than until the call
|
|
@@ -1214,6 +1219,7 @@ var PLUGIN_CAPABILITY_SPEECH = "speech";
|
|
|
1214
1219
|
var PLUGIN_CAPABILITY_LLM = "llm";
|
|
1215
1220
|
var PLUGIN_CAPABILITY_ANALYSIS = "analysis";
|
|
1216
1221
|
var PLUGIN_CAPABILITY_MIXER = "mixer";
|
|
1222
|
+
var PLUGIN_CAPABILITY_TRANSCODE = "transcode";
|
|
1217
1223
|
var PLUGIN_CAPABILITY_CHARTS = "charts";
|
|
1218
1224
|
var PLUGIN_CAPABILITY_NEWS = "news";
|
|
1219
1225
|
var PLUGIN_CAPABILITY_NARRATION = "narration";
|
|
@@ -1234,6 +1240,7 @@ var KNOWN_PLUGIN_CAPABILITIES = [
|
|
|
1234
1240
|
PLUGIN_CAPABILITY_LLM,
|
|
1235
1241
|
PLUGIN_CAPABILITY_ANALYSIS,
|
|
1236
1242
|
PLUGIN_CAPABILITY_MIXER,
|
|
1243
|
+
PLUGIN_CAPABILITY_TRANSCODE,
|
|
1237
1244
|
PLUGIN_CAPABILITY_CHARTS,
|
|
1238
1245
|
PLUGIN_CAPABILITY_NEWS,
|
|
1239
1246
|
PLUGIN_CAPABILITY_NARRATION,
|
|
@@ -1300,6 +1307,7 @@ export {
|
|
|
1300
1307
|
PLUGIN_CAPABILITY_SPEECH,
|
|
1301
1308
|
PLUGIN_CAPABILITY_STEER,
|
|
1302
1309
|
PLUGIN_CAPABILITY_STREAM,
|
|
1310
|
+
PLUGIN_CAPABILITY_TRANSCODE,
|
|
1303
1311
|
PLUGIN_CAPABILITY_WEATHER,
|
|
1304
1312
|
PLUGIN_ERROR_CODES,
|
|
1305
1313
|
Plugin,
|