@signalsandsorcery/plugin-sdk 1.3.3 → 2.0.2
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/dist/index.d.mts +77 -10
- package/dist/index.d.ts +77 -10
- package/dist/index.js +1 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -163,6 +163,19 @@ interface PluginHost {
|
|
|
163
163
|
shufflePreset(trackId: string): Promise<ShufflePresetResult>;
|
|
164
164
|
/** Duplicate track: copy MIDI + role to a new track with a different preset. Only works on owned tracks. */
|
|
165
165
|
duplicateTrack(trackId: string): Promise<PluginTrackHandle>;
|
|
166
|
+
/**
|
|
167
|
+
* Return the canonical list of valid role tokens that the host's
|
|
168
|
+
* classifier and UI understand. Plugins should use this list when
|
|
169
|
+
* building LLM prompts or validating role values before calling
|
|
170
|
+
* {@link setTrackRole}.
|
|
171
|
+
*
|
|
172
|
+
* The assistant owns the canonical taxonomy — plugins MUST NOT ship
|
|
173
|
+
* their own hardcoded list, which would drift from the host. Pair with
|
|
174
|
+
* {@link setTrackRole} to persist a classified role.
|
|
175
|
+
*
|
|
176
|
+
* @since SDK 2.0.0
|
|
177
|
+
*/
|
|
178
|
+
getValidRoles(): readonly string[];
|
|
166
179
|
/** Get detailed FX state for a track (enabled, preset, dry/wet per category). */
|
|
167
180
|
getTrackFxState(trackId: string): Promise<PluginTrackFxDetailState>;
|
|
168
181
|
/** Toggle an FX category on/off for a track. */
|
|
@@ -349,6 +362,20 @@ interface PluginHost {
|
|
|
349
362
|
getPluginSampleTracks(): Promise<PluginSampleTrackInfo[]>;
|
|
350
363
|
/** Time-stretch a sample to a target BPM. Returns the new sample info. */
|
|
351
364
|
timeStretchSample(sampleId: string, targetBpm: number): Promise<PluginSampleInfo>;
|
|
365
|
+
/**
|
|
366
|
+
* Fit a sample to the active scene's `(bpm, length_bars)`. Composes:
|
|
367
|
+
* 1. Time-stretch to scene BPM (no-op if already matching).
|
|
368
|
+
* 2. Chop / loop-stitch / passthrough so the resulting clip's duration
|
|
369
|
+
* equals exactly `length_bars × 4 × (60 / bpm)` seconds.
|
|
370
|
+
*
|
|
371
|
+
* Required because the deck loops the clip at the scene's bar boundary —
|
|
372
|
+
* a 4-bar sample dropped into a 2-bar scene used to over-run; a 4-bar
|
|
373
|
+
* sample dropped into an 8-bar scene used to leave 4 bars of silence.
|
|
374
|
+
*
|
|
375
|
+
* The fitted sample is cached in the library by content hash, so
|
|
376
|
+
* subsequent calls for the same `(sample, bpm, bars)` return instantly.
|
|
377
|
+
*/
|
|
378
|
+
fitSampleToScene(sampleId: string): Promise<PluginSampleInfo>;
|
|
352
379
|
/**
|
|
353
380
|
* Lightweight one-shot sample audition through the cue (headphone) output.
|
|
354
381
|
*
|
|
@@ -366,6 +393,25 @@ interface PluginHost {
|
|
|
366
393
|
stopPreview(): Promise<void>;
|
|
367
394
|
/** Invoke the host's audio texture generation pipeline. */
|
|
368
395
|
generateAudioTexture(request: PluginAudioTextureRequest): Promise<PluginAudioTextureResult>;
|
|
396
|
+
/**
|
|
397
|
+
* Persist cue points (detected beat positions) for an audio track.
|
|
398
|
+
* Called once after `writeAudioClip` to remember the trim metadata so the
|
|
399
|
+
* UI can later draw beat ticks and snap-to-beat the manual offset.
|
|
400
|
+
*
|
|
401
|
+
* Pass `null` to clear cue points. Throws OWNERSHIP_VIOLATION if the
|
|
402
|
+
* track wasn't created by this plugin.
|
|
403
|
+
*/
|
|
404
|
+
setCuePoints(trackId: string, cues: PluginCuePoints | null): Promise<void>;
|
|
405
|
+
/** Read cue points previously written by `setCuePoints`. Returns null when none stored. */
|
|
406
|
+
getCuePoints(trackId: string): Promise<PluginCuePoints | null>;
|
|
407
|
+
/**
|
|
408
|
+
* Set the manual sample-offset applied to the track's audio clip during
|
|
409
|
+
* playback. Positive shifts later, negative shifts earlier with head
|
|
410
|
+
* silence. Throws OWNERSHIP_VIOLATION if not owned by this plugin.
|
|
411
|
+
*/
|
|
412
|
+
setAudioOffsetSamples(trackId: string, offsetSamples: number): Promise<void>;
|
|
413
|
+
/** Read the current manual offset (0 if never set). */
|
|
414
|
+
getAudioOffsetSamples(trackId: string): Promise<number>;
|
|
369
415
|
/** Trigger bulk composition for the active scene (LLM plans arrangement, creates tracks, generates MIDI). */
|
|
370
416
|
composeScene(options: ComposeSceneOptions): Promise<ComposeSceneResult>;
|
|
371
417
|
/** Subscribe to composition progress events (planning, generating, complete, error). */
|
|
@@ -780,7 +826,7 @@ interface PluginSettingsStore {
|
|
|
780
826
|
/** Subscribe to settings changes. Returns unsubscribe fn. */
|
|
781
827
|
onChange(listener: (key: string, value: unknown) => void): UnsubscribeFn;
|
|
782
828
|
}
|
|
783
|
-
type PluginErrorCode = 'NOT_OWNED' | 'TRACK_NOT_FOUND' | 'TRACK_LIMIT_EXCEEDED' | 'NO_ACTIVE_SCENE' | 'ENGINE_ERROR' | 'INVALID_MIDI' | 'FILE_NOT_FOUND' | 'INVALID_FORMAT' | 'PLUGIN_NOT_FOUND' | 'LLM_BUDGET_EXCEEDED' | 'LLM_UNAVAILABLE' | 'NOT_AUTHENTICATED' | 'TIMEOUT' | 'CANCELLED' | 'INCOMPATIBLE' | 'CAPABILITY_DENIED' | 'SECRET_NOT_FOUND';
|
|
829
|
+
type PluginErrorCode = 'NOT_OWNED' | 'TRACK_NOT_FOUND' | 'TRACK_LIMIT_EXCEEDED' | 'NO_ACTIVE_SCENE' | 'ENGINE_ERROR' | 'INVALID_MIDI' | 'FILE_NOT_FOUND' | 'INVALID_FORMAT' | 'PLUGIN_NOT_FOUND' | 'LLM_BUDGET_EXCEEDED' | 'LLM_UNAVAILABLE' | 'NOT_AUTHENTICATED' | 'TIMEOUT' | 'CANCELLED' | 'INCOMPATIBLE' | 'CAPABILITY_DENIED' | 'SECRET_NOT_FOUND' | 'VALIDATION_ERROR';
|
|
784
830
|
declare class PluginError extends Error {
|
|
785
831
|
readonly code: PluginErrorCode;
|
|
786
832
|
readonly details?: Record<string, unknown>;
|
|
@@ -892,6 +938,34 @@ interface PluginAudioTextureResult {
|
|
|
892
938
|
filePath: string;
|
|
893
939
|
/** Duration of the generated audio in seconds */
|
|
894
940
|
durationSeconds: number;
|
|
941
|
+
/**
|
|
942
|
+
* Beat positions inside the generated audio file plus the detected BPM.
|
|
943
|
+
* Sample positions are relative to the file at `filePath`. Null when the
|
|
944
|
+
* audio-processor did not surface detection data (older binary, fallback
|
|
945
|
+
* path, or processing failed). Persist via `host.setCuePoints` after the
|
|
946
|
+
* clip is written so the OffsetScrubber UI can read them later.
|
|
947
|
+
*/
|
|
948
|
+
cuePoints: PluginCuePoints | null;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Cue-points sidecar surfaced by the audio-processor `trim` command —
|
|
952
|
+
* sample positions for each detected beat inside the generated WAV.
|
|
953
|
+
* Mirrors the canonical `CuePoints` shape from the assistant; duplicated
|
|
954
|
+
* here so external plugins don't reach into sas-assistant internals.
|
|
955
|
+
*/
|
|
956
|
+
interface PluginCuePoints {
|
|
957
|
+
/** Schema version (currently 1). */
|
|
958
|
+
schema: 1;
|
|
959
|
+
/** Sample rate the beat positions are expressed in. */
|
|
960
|
+
sample_rate: number;
|
|
961
|
+
/** Detected BPM (may differ from project BPM). Null when detection failed. */
|
|
962
|
+
detected_bpm: number | null;
|
|
963
|
+
/** Sample position of bar 1 / beat 1 inside the clip. */
|
|
964
|
+
downbeat_sample: number;
|
|
965
|
+
/** Monotone-increasing array of beat positions in samples. */
|
|
966
|
+
beats: number[];
|
|
967
|
+
/** ISO-8601 timestamp of when detection ran. */
|
|
968
|
+
detected_at: string;
|
|
895
969
|
}
|
|
896
970
|
/** Options for composing a full scene arrangement via LLM. */
|
|
897
971
|
interface ComposeSceneOptions {
|
|
@@ -1327,13 +1401,6 @@ type SetSceneState<T> = (value: T | ((prev: T) => T)) => void;
|
|
|
1327
1401
|
type SetSceneStateForScene<T> = (sceneId: string, value: T | ((prev: T) => T)) => void;
|
|
1328
1402
|
declare function useSceneState<T>(activeSceneId: string | null, initialValue: T): [T, SetSceneState<T>, SetSceneStateForScene<T>];
|
|
1329
1403
|
|
|
1330
|
-
/**
|
|
1331
|
-
* Valid instrument roles for synth track generation.
|
|
1332
|
-
* Used in LLM prompts and preset selection.
|
|
1333
|
-
* Canonical source — imported by both plugin SDK and core services.
|
|
1334
|
-
*/
|
|
1335
|
-
declare const VALID_INSTRUMENT_ROLES: readonly string[];
|
|
1336
|
-
|
|
1337
1404
|
/**
|
|
1338
1405
|
* Plugin SDK Version
|
|
1339
1406
|
*
|
|
@@ -1342,7 +1409,7 @@ declare const VALID_INSTRUMENT_ROLES: readonly string[];
|
|
|
1342
1409
|
* Registry checks semver.gte(PLUGIN_SDK_VERSION, manifest.minHostVersion)
|
|
1343
1410
|
* during activation and marks incompatible plugins accordingly.
|
|
1344
1411
|
*/
|
|
1345
|
-
declare const PLUGIN_SDK_VERSION = "
|
|
1412
|
+
declare const PLUGIN_SDK_VERSION = "2.0.0";
|
|
1346
1413
|
|
|
1347
1414
|
/**
|
|
1348
1415
|
* FX Preset Definitions
|
|
@@ -1396,4 +1463,4 @@ declare function sliderToDb(slider: number): number;
|
|
|
1396
1463
|
*/
|
|
1397
1464
|
declare function dbToSlider(db: number): number;
|
|
1398
1465
|
|
|
1399
|
-
export { type BulkAddPlaceholderTrack, type ComposeProgressEvent, type ComposeProgressListener, type ComposeSceneOptions, type ComposeSceneResult, type CreateTrackOptions, DB_MAX, DB_MIN, DEFAULT_FX_CATEGORY_DETAIL, DEFAULT_FX_DRY_WET, type DeckBoundaryEvent, type DeckBoundaryListener, EMPTY_FX_DETAIL_STATE, EMPTY_FX_STATE, type ExportMidiBundleOptions, type ExportMidiBundleResult, type ExportedPluginData, FX_CATEGORIES, FX_CHAIN_ORDER, FX_DISPLAY_LABELS, FX_ENGINE_PLUGIN_NAMES, FX_PRESET_CONFIGS, type FxCategory, type FxCategoryDetailState, type FxPreset, type FxPresetConfig, type FxPresetData, type FxPresetDataEntry, FxToggleBar, type FxToggleBarProps, type GeneratorPlugin, type GeneratorType, type InstrumentDescriptor, InstrumentDrawer, type InstrumentDrawerProps, type LLMGenerationRequest, type LLMGenerationResult, type MidiClipData, type MidiWriteResult, type MixInterpolation, type MusicalContext, PLUGIN_SDK_VERSION, PanSlider, type PluginAppTool, type PluginAppToolInputSchema, type PluginAppToolResult, type PluginAudioTextureRequest, type PluginAudioTextureResult, type PluginCapabilities, type PluginChordSegment, type PluginChordTiming, type PluginConcurrentTrackInfo, type PluginDownloadOptions, PluginError, type PluginErrorCode, type PluginFileDialogOptions, type PluginFxCategoryDetailState, type PluginGenerationContext, type PluginHost, type PluginHttpRequestOptions, type PluginHttpResponse, type PluginManifest, type PluginMidiNote, type PluginPresetData, type PluginPresetInfo, type PluginRegistration, type PluginSampleFilter, type PluginSampleImportResult, type PluginSampleInfo, type PluginSampleTrackInfo, type PluginSceneContext, type PluginSceneInfo, type PluginSettingsSchema, type PluginSettingsStore, type PluginSkill, type PluginSkillInputSchema, type PluginStatus, type PluginStemSplitResult, type PluginStemTrackInfo, type PluginSynthInfo, type PluginTrackFxDetailState, type PluginTrackHandle, type PluginTrackInfo, type PluginTrackRuntimeState, type PluginTransportState, type PluginUIProps, type PostProcessOptions, type SDKTrackRowProps, SLIDER_UNITY, type SavePluginPresetOptions, type SceneChangeListener, type SettingDefinition, type ShufflePresetResult, SorceryProgressBar, type StemType, type TrackFxDetailState, type TrackFxState, TrackRow, type TrackStateChangeListener, type TransportEvent, type TransportEventListener, type UnsubscribeFn,
|
|
1466
|
+
export { type BulkAddPlaceholderTrack, type ComposeProgressEvent, type ComposeProgressListener, type ComposeSceneOptions, type ComposeSceneResult, type CreateTrackOptions, DB_MAX, DB_MIN, DEFAULT_FX_CATEGORY_DETAIL, DEFAULT_FX_DRY_WET, type DeckBoundaryEvent, type DeckBoundaryListener, EMPTY_FX_DETAIL_STATE, EMPTY_FX_STATE, type ExportMidiBundleOptions, type ExportMidiBundleResult, type ExportedPluginData, FX_CATEGORIES, FX_CHAIN_ORDER, FX_DISPLAY_LABELS, FX_ENGINE_PLUGIN_NAMES, FX_PRESET_CONFIGS, type FxCategory, type FxCategoryDetailState, type FxPreset, type FxPresetConfig, type FxPresetData, type FxPresetDataEntry, FxToggleBar, type FxToggleBarProps, type GeneratorPlugin, type GeneratorType, type InstrumentDescriptor, InstrumentDrawer, type InstrumentDrawerProps, type LLMGenerationRequest, type LLMGenerationResult, type MidiClipData, type MidiWriteResult, type MixInterpolation, type MusicalContext, PLUGIN_SDK_VERSION, PanSlider, type PluginAppTool, type PluginAppToolInputSchema, type PluginAppToolResult, type PluginAudioTextureRequest, type PluginAudioTextureResult, type PluginCapabilities, type PluginChordSegment, type PluginChordTiming, type PluginConcurrentTrackInfo, type PluginCuePoints, type PluginDownloadOptions, PluginError, type PluginErrorCode, type PluginFileDialogOptions, type PluginFxCategoryDetailState, type PluginGenerationContext, type PluginHost, type PluginHttpRequestOptions, type PluginHttpResponse, type PluginManifest, type PluginMidiNote, type PluginPresetData, type PluginPresetInfo, type PluginRegistration, type PluginSampleFilter, type PluginSampleImportResult, type PluginSampleInfo, type PluginSampleTrackInfo, type PluginSceneContext, type PluginSceneInfo, type PluginSettingsSchema, type PluginSettingsStore, type PluginSkill, type PluginSkillInputSchema, type PluginStatus, type PluginStemSplitResult, type PluginStemTrackInfo, type PluginSynthInfo, type PluginTrackFxDetailState, type PluginTrackHandle, type PluginTrackInfo, type PluginTrackRuntimeState, type PluginTransportState, type PluginUIProps, type PostProcessOptions, type SDKTrackRowProps, SLIDER_UNITY, type SavePluginPresetOptions, type SceneChangeListener, type SettingDefinition, type ShufflePresetResult, SorceryProgressBar, type StemType, type TrackFxDetailState, type TrackFxState, TrackRow, type TrackStateChangeListener, type TransportEvent, type TransportEventListener, type UnsubscribeFn, VolumeSlider, calculateTimeBasedTarget, dbToSlider, sliderToDb, useSceneState };
|
package/dist/index.d.ts
CHANGED
|
@@ -163,6 +163,19 @@ interface PluginHost {
|
|
|
163
163
|
shufflePreset(trackId: string): Promise<ShufflePresetResult>;
|
|
164
164
|
/** Duplicate track: copy MIDI + role to a new track with a different preset. Only works on owned tracks. */
|
|
165
165
|
duplicateTrack(trackId: string): Promise<PluginTrackHandle>;
|
|
166
|
+
/**
|
|
167
|
+
* Return the canonical list of valid role tokens that the host's
|
|
168
|
+
* classifier and UI understand. Plugins should use this list when
|
|
169
|
+
* building LLM prompts or validating role values before calling
|
|
170
|
+
* {@link setTrackRole}.
|
|
171
|
+
*
|
|
172
|
+
* The assistant owns the canonical taxonomy — plugins MUST NOT ship
|
|
173
|
+
* their own hardcoded list, which would drift from the host. Pair with
|
|
174
|
+
* {@link setTrackRole} to persist a classified role.
|
|
175
|
+
*
|
|
176
|
+
* @since SDK 2.0.0
|
|
177
|
+
*/
|
|
178
|
+
getValidRoles(): readonly string[];
|
|
166
179
|
/** Get detailed FX state for a track (enabled, preset, dry/wet per category). */
|
|
167
180
|
getTrackFxState(trackId: string): Promise<PluginTrackFxDetailState>;
|
|
168
181
|
/** Toggle an FX category on/off for a track. */
|
|
@@ -349,6 +362,20 @@ interface PluginHost {
|
|
|
349
362
|
getPluginSampleTracks(): Promise<PluginSampleTrackInfo[]>;
|
|
350
363
|
/** Time-stretch a sample to a target BPM. Returns the new sample info. */
|
|
351
364
|
timeStretchSample(sampleId: string, targetBpm: number): Promise<PluginSampleInfo>;
|
|
365
|
+
/**
|
|
366
|
+
* Fit a sample to the active scene's `(bpm, length_bars)`. Composes:
|
|
367
|
+
* 1. Time-stretch to scene BPM (no-op if already matching).
|
|
368
|
+
* 2. Chop / loop-stitch / passthrough so the resulting clip's duration
|
|
369
|
+
* equals exactly `length_bars × 4 × (60 / bpm)` seconds.
|
|
370
|
+
*
|
|
371
|
+
* Required because the deck loops the clip at the scene's bar boundary —
|
|
372
|
+
* a 4-bar sample dropped into a 2-bar scene used to over-run; a 4-bar
|
|
373
|
+
* sample dropped into an 8-bar scene used to leave 4 bars of silence.
|
|
374
|
+
*
|
|
375
|
+
* The fitted sample is cached in the library by content hash, so
|
|
376
|
+
* subsequent calls for the same `(sample, bpm, bars)` return instantly.
|
|
377
|
+
*/
|
|
378
|
+
fitSampleToScene(sampleId: string): Promise<PluginSampleInfo>;
|
|
352
379
|
/**
|
|
353
380
|
* Lightweight one-shot sample audition through the cue (headphone) output.
|
|
354
381
|
*
|
|
@@ -366,6 +393,25 @@ interface PluginHost {
|
|
|
366
393
|
stopPreview(): Promise<void>;
|
|
367
394
|
/** Invoke the host's audio texture generation pipeline. */
|
|
368
395
|
generateAudioTexture(request: PluginAudioTextureRequest): Promise<PluginAudioTextureResult>;
|
|
396
|
+
/**
|
|
397
|
+
* Persist cue points (detected beat positions) for an audio track.
|
|
398
|
+
* Called once after `writeAudioClip` to remember the trim metadata so the
|
|
399
|
+
* UI can later draw beat ticks and snap-to-beat the manual offset.
|
|
400
|
+
*
|
|
401
|
+
* Pass `null` to clear cue points. Throws OWNERSHIP_VIOLATION if the
|
|
402
|
+
* track wasn't created by this plugin.
|
|
403
|
+
*/
|
|
404
|
+
setCuePoints(trackId: string, cues: PluginCuePoints | null): Promise<void>;
|
|
405
|
+
/** Read cue points previously written by `setCuePoints`. Returns null when none stored. */
|
|
406
|
+
getCuePoints(trackId: string): Promise<PluginCuePoints | null>;
|
|
407
|
+
/**
|
|
408
|
+
* Set the manual sample-offset applied to the track's audio clip during
|
|
409
|
+
* playback. Positive shifts later, negative shifts earlier with head
|
|
410
|
+
* silence. Throws OWNERSHIP_VIOLATION if not owned by this plugin.
|
|
411
|
+
*/
|
|
412
|
+
setAudioOffsetSamples(trackId: string, offsetSamples: number): Promise<void>;
|
|
413
|
+
/** Read the current manual offset (0 if never set). */
|
|
414
|
+
getAudioOffsetSamples(trackId: string): Promise<number>;
|
|
369
415
|
/** Trigger bulk composition for the active scene (LLM plans arrangement, creates tracks, generates MIDI). */
|
|
370
416
|
composeScene(options: ComposeSceneOptions): Promise<ComposeSceneResult>;
|
|
371
417
|
/** Subscribe to composition progress events (planning, generating, complete, error). */
|
|
@@ -780,7 +826,7 @@ interface PluginSettingsStore {
|
|
|
780
826
|
/** Subscribe to settings changes. Returns unsubscribe fn. */
|
|
781
827
|
onChange(listener: (key: string, value: unknown) => void): UnsubscribeFn;
|
|
782
828
|
}
|
|
783
|
-
type PluginErrorCode = 'NOT_OWNED' | 'TRACK_NOT_FOUND' | 'TRACK_LIMIT_EXCEEDED' | 'NO_ACTIVE_SCENE' | 'ENGINE_ERROR' | 'INVALID_MIDI' | 'FILE_NOT_FOUND' | 'INVALID_FORMAT' | 'PLUGIN_NOT_FOUND' | 'LLM_BUDGET_EXCEEDED' | 'LLM_UNAVAILABLE' | 'NOT_AUTHENTICATED' | 'TIMEOUT' | 'CANCELLED' | 'INCOMPATIBLE' | 'CAPABILITY_DENIED' | 'SECRET_NOT_FOUND';
|
|
829
|
+
type PluginErrorCode = 'NOT_OWNED' | 'TRACK_NOT_FOUND' | 'TRACK_LIMIT_EXCEEDED' | 'NO_ACTIVE_SCENE' | 'ENGINE_ERROR' | 'INVALID_MIDI' | 'FILE_NOT_FOUND' | 'INVALID_FORMAT' | 'PLUGIN_NOT_FOUND' | 'LLM_BUDGET_EXCEEDED' | 'LLM_UNAVAILABLE' | 'NOT_AUTHENTICATED' | 'TIMEOUT' | 'CANCELLED' | 'INCOMPATIBLE' | 'CAPABILITY_DENIED' | 'SECRET_NOT_FOUND' | 'VALIDATION_ERROR';
|
|
784
830
|
declare class PluginError extends Error {
|
|
785
831
|
readonly code: PluginErrorCode;
|
|
786
832
|
readonly details?: Record<string, unknown>;
|
|
@@ -892,6 +938,34 @@ interface PluginAudioTextureResult {
|
|
|
892
938
|
filePath: string;
|
|
893
939
|
/** Duration of the generated audio in seconds */
|
|
894
940
|
durationSeconds: number;
|
|
941
|
+
/**
|
|
942
|
+
* Beat positions inside the generated audio file plus the detected BPM.
|
|
943
|
+
* Sample positions are relative to the file at `filePath`. Null when the
|
|
944
|
+
* audio-processor did not surface detection data (older binary, fallback
|
|
945
|
+
* path, or processing failed). Persist via `host.setCuePoints` after the
|
|
946
|
+
* clip is written so the OffsetScrubber UI can read them later.
|
|
947
|
+
*/
|
|
948
|
+
cuePoints: PluginCuePoints | null;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Cue-points sidecar surfaced by the audio-processor `trim` command —
|
|
952
|
+
* sample positions for each detected beat inside the generated WAV.
|
|
953
|
+
* Mirrors the canonical `CuePoints` shape from the assistant; duplicated
|
|
954
|
+
* here so external plugins don't reach into sas-assistant internals.
|
|
955
|
+
*/
|
|
956
|
+
interface PluginCuePoints {
|
|
957
|
+
/** Schema version (currently 1). */
|
|
958
|
+
schema: 1;
|
|
959
|
+
/** Sample rate the beat positions are expressed in. */
|
|
960
|
+
sample_rate: number;
|
|
961
|
+
/** Detected BPM (may differ from project BPM). Null when detection failed. */
|
|
962
|
+
detected_bpm: number | null;
|
|
963
|
+
/** Sample position of bar 1 / beat 1 inside the clip. */
|
|
964
|
+
downbeat_sample: number;
|
|
965
|
+
/** Monotone-increasing array of beat positions in samples. */
|
|
966
|
+
beats: number[];
|
|
967
|
+
/** ISO-8601 timestamp of when detection ran. */
|
|
968
|
+
detected_at: string;
|
|
895
969
|
}
|
|
896
970
|
/** Options for composing a full scene arrangement via LLM. */
|
|
897
971
|
interface ComposeSceneOptions {
|
|
@@ -1327,13 +1401,6 @@ type SetSceneState<T> = (value: T | ((prev: T) => T)) => void;
|
|
|
1327
1401
|
type SetSceneStateForScene<T> = (sceneId: string, value: T | ((prev: T) => T)) => void;
|
|
1328
1402
|
declare function useSceneState<T>(activeSceneId: string | null, initialValue: T): [T, SetSceneState<T>, SetSceneStateForScene<T>];
|
|
1329
1403
|
|
|
1330
|
-
/**
|
|
1331
|
-
* Valid instrument roles for synth track generation.
|
|
1332
|
-
* Used in LLM prompts and preset selection.
|
|
1333
|
-
* Canonical source — imported by both plugin SDK and core services.
|
|
1334
|
-
*/
|
|
1335
|
-
declare const VALID_INSTRUMENT_ROLES: readonly string[];
|
|
1336
|
-
|
|
1337
1404
|
/**
|
|
1338
1405
|
* Plugin SDK Version
|
|
1339
1406
|
*
|
|
@@ -1342,7 +1409,7 @@ declare const VALID_INSTRUMENT_ROLES: readonly string[];
|
|
|
1342
1409
|
* Registry checks semver.gte(PLUGIN_SDK_VERSION, manifest.minHostVersion)
|
|
1343
1410
|
* during activation and marks incompatible plugins accordingly.
|
|
1344
1411
|
*/
|
|
1345
|
-
declare const PLUGIN_SDK_VERSION = "
|
|
1412
|
+
declare const PLUGIN_SDK_VERSION = "2.0.0";
|
|
1346
1413
|
|
|
1347
1414
|
/**
|
|
1348
1415
|
* FX Preset Definitions
|
|
@@ -1396,4 +1463,4 @@ declare function sliderToDb(slider: number): number;
|
|
|
1396
1463
|
*/
|
|
1397
1464
|
declare function dbToSlider(db: number): number;
|
|
1398
1465
|
|
|
1399
|
-
export { type BulkAddPlaceholderTrack, type ComposeProgressEvent, type ComposeProgressListener, type ComposeSceneOptions, type ComposeSceneResult, type CreateTrackOptions, DB_MAX, DB_MIN, DEFAULT_FX_CATEGORY_DETAIL, DEFAULT_FX_DRY_WET, type DeckBoundaryEvent, type DeckBoundaryListener, EMPTY_FX_DETAIL_STATE, EMPTY_FX_STATE, type ExportMidiBundleOptions, type ExportMidiBundleResult, type ExportedPluginData, FX_CATEGORIES, FX_CHAIN_ORDER, FX_DISPLAY_LABELS, FX_ENGINE_PLUGIN_NAMES, FX_PRESET_CONFIGS, type FxCategory, type FxCategoryDetailState, type FxPreset, type FxPresetConfig, type FxPresetData, type FxPresetDataEntry, FxToggleBar, type FxToggleBarProps, type GeneratorPlugin, type GeneratorType, type InstrumentDescriptor, InstrumentDrawer, type InstrumentDrawerProps, type LLMGenerationRequest, type LLMGenerationResult, type MidiClipData, type MidiWriteResult, type MixInterpolation, type MusicalContext, PLUGIN_SDK_VERSION, PanSlider, type PluginAppTool, type PluginAppToolInputSchema, type PluginAppToolResult, type PluginAudioTextureRequest, type PluginAudioTextureResult, type PluginCapabilities, type PluginChordSegment, type PluginChordTiming, type PluginConcurrentTrackInfo, type PluginDownloadOptions, PluginError, type PluginErrorCode, type PluginFileDialogOptions, type PluginFxCategoryDetailState, type PluginGenerationContext, type PluginHost, type PluginHttpRequestOptions, type PluginHttpResponse, type PluginManifest, type PluginMidiNote, type PluginPresetData, type PluginPresetInfo, type PluginRegistration, type PluginSampleFilter, type PluginSampleImportResult, type PluginSampleInfo, type PluginSampleTrackInfo, type PluginSceneContext, type PluginSceneInfo, type PluginSettingsSchema, type PluginSettingsStore, type PluginSkill, type PluginSkillInputSchema, type PluginStatus, type PluginStemSplitResult, type PluginStemTrackInfo, type PluginSynthInfo, type PluginTrackFxDetailState, type PluginTrackHandle, type PluginTrackInfo, type PluginTrackRuntimeState, type PluginTransportState, type PluginUIProps, type PostProcessOptions, type SDKTrackRowProps, SLIDER_UNITY, type SavePluginPresetOptions, type SceneChangeListener, type SettingDefinition, type ShufflePresetResult, SorceryProgressBar, type StemType, type TrackFxDetailState, type TrackFxState, TrackRow, type TrackStateChangeListener, type TransportEvent, type TransportEventListener, type UnsubscribeFn,
|
|
1466
|
+
export { type BulkAddPlaceholderTrack, type ComposeProgressEvent, type ComposeProgressListener, type ComposeSceneOptions, type ComposeSceneResult, type CreateTrackOptions, DB_MAX, DB_MIN, DEFAULT_FX_CATEGORY_DETAIL, DEFAULT_FX_DRY_WET, type DeckBoundaryEvent, type DeckBoundaryListener, EMPTY_FX_DETAIL_STATE, EMPTY_FX_STATE, type ExportMidiBundleOptions, type ExportMidiBundleResult, type ExportedPluginData, FX_CATEGORIES, FX_CHAIN_ORDER, FX_DISPLAY_LABELS, FX_ENGINE_PLUGIN_NAMES, FX_PRESET_CONFIGS, type FxCategory, type FxCategoryDetailState, type FxPreset, type FxPresetConfig, type FxPresetData, type FxPresetDataEntry, FxToggleBar, type FxToggleBarProps, type GeneratorPlugin, type GeneratorType, type InstrumentDescriptor, InstrumentDrawer, type InstrumentDrawerProps, type LLMGenerationRequest, type LLMGenerationResult, type MidiClipData, type MidiWriteResult, type MixInterpolation, type MusicalContext, PLUGIN_SDK_VERSION, PanSlider, type PluginAppTool, type PluginAppToolInputSchema, type PluginAppToolResult, type PluginAudioTextureRequest, type PluginAudioTextureResult, type PluginCapabilities, type PluginChordSegment, type PluginChordTiming, type PluginConcurrentTrackInfo, type PluginCuePoints, type PluginDownloadOptions, PluginError, type PluginErrorCode, type PluginFileDialogOptions, type PluginFxCategoryDetailState, type PluginGenerationContext, type PluginHost, type PluginHttpRequestOptions, type PluginHttpResponse, type PluginManifest, type PluginMidiNote, type PluginPresetData, type PluginPresetInfo, type PluginRegistration, type PluginSampleFilter, type PluginSampleImportResult, type PluginSampleInfo, type PluginSampleTrackInfo, type PluginSceneContext, type PluginSceneInfo, type PluginSettingsSchema, type PluginSettingsStore, type PluginSkill, type PluginSkillInputSchema, type PluginStatus, type PluginStemSplitResult, type PluginStemTrackInfo, type PluginSynthInfo, type PluginTrackFxDetailState, type PluginTrackHandle, type PluginTrackInfo, type PluginTrackRuntimeState, type PluginTransportState, type PluginUIProps, type PostProcessOptions, type SDKTrackRowProps, SLIDER_UNITY, type SavePluginPresetOptions, type SceneChangeListener, type SettingDefinition, type ShufflePresetResult, SorceryProgressBar, type StemType, type TrackFxDetailState, type TrackFxState, TrackRow, type TrackStateChangeListener, type TransportEvent, type TransportEventListener, type UnsubscribeFn, VolumeSlider, calculateTimeBasedTarget, dbToSlider, sliderToDb, useSceneState };
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,6 @@ __export(index_exports, {
|
|
|
39
39
|
SLIDER_UNITY: () => SLIDER_UNITY,
|
|
40
40
|
SorceryProgressBar: () => SorceryProgressBar,
|
|
41
41
|
TrackRow: () => TrackRow,
|
|
42
|
-
VALID_INSTRUMENT_ROLES: () => VALID_INSTRUMENT_ROLES,
|
|
43
42
|
VolumeSlider: () => VolumeSlider,
|
|
44
43
|
calculateTimeBasedTarget: () => calculateTimeBasedTarget,
|
|
45
44
|
dbToSlider: () => dbToSlider,
|
|
@@ -1293,37 +1292,8 @@ function useSceneState(activeSceneId, initialValue) {
|
|
|
1293
1292
|
return [currentValue, setForCurrentScene, setForScene];
|
|
1294
1293
|
}
|
|
1295
1294
|
|
|
1296
|
-
// src/constants/instrument-roles.ts
|
|
1297
|
-
var VALID_INSTRUMENT_ROLES = [
|
|
1298
|
-
"bass",
|
|
1299
|
-
"kick",
|
|
1300
|
-
"snare",
|
|
1301
|
-
"hat",
|
|
1302
|
-
"808",
|
|
1303
|
-
"percussion",
|
|
1304
|
-
"lead",
|
|
1305
|
-
"pad",
|
|
1306
|
-
"keys",
|
|
1307
|
-
"piano",
|
|
1308
|
-
"organ",
|
|
1309
|
-
"pluck",
|
|
1310
|
-
"strings",
|
|
1311
|
-
"brass",
|
|
1312
|
-
"winds",
|
|
1313
|
-
"bell",
|
|
1314
|
-
"mallet",
|
|
1315
|
-
"guitar",
|
|
1316
|
-
"synth",
|
|
1317
|
-
"atmosphere",
|
|
1318
|
-
"drone",
|
|
1319
|
-
"rhythm",
|
|
1320
|
-
"soundscape",
|
|
1321
|
-
"vocal",
|
|
1322
|
-
"fx"
|
|
1323
|
-
];
|
|
1324
|
-
|
|
1325
1295
|
// src/constants/sdk-version.ts
|
|
1326
|
-
var PLUGIN_SDK_VERSION = "
|
|
1296
|
+
var PLUGIN_SDK_VERSION = "2.0.0";
|
|
1327
1297
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1328
1298
|
0 && (module.exports = {
|
|
1329
1299
|
DB_MAX,
|
|
@@ -1345,7 +1315,6 @@ var PLUGIN_SDK_VERSION = "1.2.0";
|
|
|
1345
1315
|
SLIDER_UNITY,
|
|
1346
1316
|
SorceryProgressBar,
|
|
1347
1317
|
TrackRow,
|
|
1348
|
-
VALID_INSTRUMENT_ROLES,
|
|
1349
1318
|
VolumeSlider,
|
|
1350
1319
|
calculateTimeBasedTarget,
|
|
1351
1320
|
dbToSlider,
|