@signalsandsorcery/plugin-sdk 1.3.2 → 2.0.1

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 CHANGED
@@ -145,10 +145,37 @@ interface PluginHost {
145
145
  setTrackSolo(trackId: string, solo: boolean): Promise<void>;
146
146
  /** Rename a track. Only works on owned tracks. */
147
147
  setTrackName(trackId: string, name: string): Promise<void>;
148
+ /**
149
+ * Persist a track's musical role to the `tracks.role` column. Call this
150
+ * after an LLM generation classifies the track (e.g. `'bass'`, `'lead'`,
151
+ * `'pad'`, `'fx'`, `'kicks'`) so downstream features — especially the v1
152
+ * transition generator's layer classifier — can see the role.
153
+ *
154
+ * Canonical values understood by the transition classifier include
155
+ * `bass`, `drums`, `lead`, `chords`, `pad`, `arp`, `fx`, `kicks`,
156
+ * `snares`, `hats`, `clap`, `perc`, `riser`, `impact`. Anything else is
157
+ * stored verbatim but won't match the neutral-role set.
158
+ *
159
+ * Only works on owned tracks.
160
+ */
161
+ setTrackRole(trackId: string, role: string): Promise<void>;
148
162
  /** Shuffle preset: keep MIDI, apply a random preset from the same category. Only works on owned tracks. */
149
163
  shufflePreset(trackId: string): Promise<ShufflePresetResult>;
150
164
  /** Duplicate track: copy MIDI + role to a new track with a different preset. Only works on owned tracks. */
151
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[];
152
179
  /** Get detailed FX state for a track (enabled, preset, dry/wet per category). */
153
180
  getTrackFxState(trackId: string): Promise<PluginTrackFxDetailState>;
154
181
  /** Toggle an FX category on/off for a track. */
@@ -1313,13 +1340,6 @@ type SetSceneState<T> = (value: T | ((prev: T) => T)) => void;
1313
1340
  type SetSceneStateForScene<T> = (sceneId: string, value: T | ((prev: T) => T)) => void;
1314
1341
  declare function useSceneState<T>(activeSceneId: string | null, initialValue: T): [T, SetSceneState<T>, SetSceneStateForScene<T>];
1315
1342
 
1316
- /**
1317
- * Valid instrument roles for synth track generation.
1318
- * Used in LLM prompts and preset selection.
1319
- * Canonical source — imported by both plugin SDK and core services.
1320
- */
1321
- declare const VALID_INSTRUMENT_ROLES: readonly string[];
1322
-
1323
1343
  /**
1324
1344
  * Plugin SDK Version
1325
1345
  *
@@ -1328,7 +1348,7 @@ declare const VALID_INSTRUMENT_ROLES: readonly string[];
1328
1348
  * Registry checks semver.gte(PLUGIN_SDK_VERSION, manifest.minHostVersion)
1329
1349
  * during activation and marks incompatible plugins accordingly.
1330
1350
  */
1331
- declare const PLUGIN_SDK_VERSION = "1.2.0";
1351
+ declare const PLUGIN_SDK_VERSION = "2.0.0";
1332
1352
 
1333
1353
  /**
1334
1354
  * FX Preset Definitions
@@ -1382,4 +1402,4 @@ declare function sliderToDb(slider: number): number;
1382
1402
  */
1383
1403
  declare function dbToSlider(db: number): number;
1384
1404
 
1385
- 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, VALID_INSTRUMENT_ROLES, VolumeSlider, calculateTimeBasedTarget, dbToSlider, sliderToDb, useSceneState };
1405
+ 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, VolumeSlider, calculateTimeBasedTarget, dbToSlider, sliderToDb, useSceneState };
package/dist/index.d.ts CHANGED
@@ -145,10 +145,37 @@ interface PluginHost {
145
145
  setTrackSolo(trackId: string, solo: boolean): Promise<void>;
146
146
  /** Rename a track. Only works on owned tracks. */
147
147
  setTrackName(trackId: string, name: string): Promise<void>;
148
+ /**
149
+ * Persist a track's musical role to the `tracks.role` column. Call this
150
+ * after an LLM generation classifies the track (e.g. `'bass'`, `'lead'`,
151
+ * `'pad'`, `'fx'`, `'kicks'`) so downstream features — especially the v1
152
+ * transition generator's layer classifier — can see the role.
153
+ *
154
+ * Canonical values understood by the transition classifier include
155
+ * `bass`, `drums`, `lead`, `chords`, `pad`, `arp`, `fx`, `kicks`,
156
+ * `snares`, `hats`, `clap`, `perc`, `riser`, `impact`. Anything else is
157
+ * stored verbatim but won't match the neutral-role set.
158
+ *
159
+ * Only works on owned tracks.
160
+ */
161
+ setTrackRole(trackId: string, role: string): Promise<void>;
148
162
  /** Shuffle preset: keep MIDI, apply a random preset from the same category. Only works on owned tracks. */
149
163
  shufflePreset(trackId: string): Promise<ShufflePresetResult>;
150
164
  /** Duplicate track: copy MIDI + role to a new track with a different preset. Only works on owned tracks. */
151
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[];
152
179
  /** Get detailed FX state for a track (enabled, preset, dry/wet per category). */
153
180
  getTrackFxState(trackId: string): Promise<PluginTrackFxDetailState>;
154
181
  /** Toggle an FX category on/off for a track. */
@@ -1313,13 +1340,6 @@ type SetSceneState<T> = (value: T | ((prev: T) => T)) => void;
1313
1340
  type SetSceneStateForScene<T> = (sceneId: string, value: T | ((prev: T) => T)) => void;
1314
1341
  declare function useSceneState<T>(activeSceneId: string | null, initialValue: T): [T, SetSceneState<T>, SetSceneStateForScene<T>];
1315
1342
 
1316
- /**
1317
- * Valid instrument roles for synth track generation.
1318
- * Used in LLM prompts and preset selection.
1319
- * Canonical source — imported by both plugin SDK and core services.
1320
- */
1321
- declare const VALID_INSTRUMENT_ROLES: readonly string[];
1322
-
1323
1343
  /**
1324
1344
  * Plugin SDK Version
1325
1345
  *
@@ -1328,7 +1348,7 @@ declare const VALID_INSTRUMENT_ROLES: readonly string[];
1328
1348
  * Registry checks semver.gte(PLUGIN_SDK_VERSION, manifest.minHostVersion)
1329
1349
  * during activation and marks incompatible plugins accordingly.
1330
1350
  */
1331
- declare const PLUGIN_SDK_VERSION = "1.2.0";
1351
+ declare const PLUGIN_SDK_VERSION = "2.0.0";
1332
1352
 
1333
1353
  /**
1334
1354
  * FX Preset Definitions
@@ -1382,4 +1402,4 @@ declare function sliderToDb(slider: number): number;
1382
1402
  */
1383
1403
  declare function dbToSlider(db: number): number;
1384
1404
 
1385
- 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, VALID_INSTRUMENT_ROLES, VolumeSlider, calculateTimeBasedTarget, dbToSlider, sliderToDb, useSceneState };
1405
+ 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, 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 = "1.2.0";
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,