@williamzujkowski/live-coding-music-mcp 3.0.0 → 4.0.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.
@@ -1,17 +1,12 @@
1
1
  /**
2
2
  * transform domain — mutate the current pattern.
3
3
  *
4
- * Owns (14 tools): transpose, reverse, stretch, quantize, humanize,
5
- * add_swing, apply_scale, generate_variation, add_effect, remove_effect,
6
- * set_tempo, shift_mood, set_energy, refine.
7
- *
8
- * Per the #110 audit this eventually collapses into:
9
- * - `transform` (op enum) — 8 tools
10
- * - `effect` (add/remove enum) — 2 tools
11
- * - `shape` (mood/energy/refine enum) — 3 tools
12
- * - `set_tempo` stays — high-traffic verb
13
- *
14
- * For now we keep the individual verbs and just move them out of server.ts.
4
+ * Owns (4 tools):
5
+ * - `transform` (op enum: transpose/reverse/stretch/quantize/humanize/
6
+ * swing/scale/vary)
7
+ * - `effect` (action enum: add/remove)
8
+ * - `shape` (dimension enum: mood/energy/refine)
9
+ * - `set_tempo` — high-traffic standalone verb
15
10
  */
16
11
  import { InputValidator } from '../../utils/InputValidator.js';
17
12
  const ENERGY_LEVELS = {
@@ -65,9 +60,9 @@ export const tools = [
65
60
  'op=stretch slows by `factor` (>1 slower, <1 faster). ' +
66
61
  'op=quantize snaps to the `grid` (e.g. "1/16"). ' +
67
62
  'op=humanize adds rand-nudge timing of `amount` (0-1). ' +
68
- 'op=swing applies `.swing(amount)` (alias for add_swing). ' +
69
- 'op=scale applies a `root`/`scale` filter to notes (alias for apply_scale). ' +
70
- 'op=vary returns a variation of `type` (subtle/moderate/extreme/glitch/evolving — note: this is what generate_variation does today; the name is misleading because it transforms rather than generates). ' +
63
+ 'op=swing applies `.swing(amount)`. ' +
64
+ 'op=scale applies a `root`/`scale` filter to notes. ' +
65
+ 'op=vary returns a variation of `type` (subtle/moderate/extreme/glitch/evolving). ' +
71
66
  'Example: transform({ op: "transpose", semitones: 7 }). ' +
72
67
  'For effects (add/remove) use effect; for mood/energy/refine use shape; for tempo use set_tempo.',
73
68
  inputSchema: {
@@ -90,54 +85,6 @@ export const tools = [
90
85
  required: ['op'],
91
86
  },
92
87
  },
93
- {
94
- name: 'transpose',
95
- description: '[DEPRECATED — use transform({ op: "transpose" }) instead] Transpose notes by semitones',
96
- inputSchema: {
97
- type: 'object',
98
- properties: { semitones: { type: 'number', description: 'Semitones to transpose' }, ...SESSION_ID_PROP },
99
- required: ['semitones'],
100
- },
101
- },
102
- {
103
- name: 'reverse',
104
- description: '[DEPRECATED — use transform({ op: "reverse" }) instead] Reverse pattern',
105
- inputSchema: { type: 'object', properties: { ...SESSION_ID_PROP } },
106
- },
107
- {
108
- name: 'stretch',
109
- description: '[DEPRECATED — use transform({ op: "stretch" }) instead] Time stretch pattern',
110
- inputSchema: {
111
- type: 'object',
112
- properties: { factor: { type: 'number', description: 'Stretch factor' }, ...SESSION_ID_PROP },
113
- required: ['factor'],
114
- },
115
- },
116
- {
117
- name: 'quantize',
118
- description: '[DEPRECATED — use transform({ op: "quantize" }) instead] Quantize to grid',
119
- inputSchema: {
120
- type: 'object',
121
- properties: { grid: { type: 'string', description: 'Grid size (e.g., "1/16")' }, ...SESSION_ID_PROP },
122
- required: ['grid'],
123
- },
124
- },
125
- {
126
- name: 'humanize',
127
- description: '[DEPRECATED — use transform({ op: "humanize" }) instead] Add human timing variation',
128
- inputSchema: {
129
- type: 'object',
130
- properties: { amount: { type: 'number', description: 'Humanization amount (0-1)' }, ...SESSION_ID_PROP },
131
- },
132
- },
133
- {
134
- name: 'generate_variation',
135
- description: '[DEPRECATED — use transform({ op: "vary" }) instead] Create pattern variations (mis-named today; it transforms, not generates)',
136
- inputSchema: {
137
- type: 'object',
138
- properties: { type: { type: 'string', description: 'Variation type (subtle/moderate/extreme/glitch/evolving)' }, ...SESSION_ID_PROP },
139
- },
140
- },
141
88
  {
142
89
  name: 'effect',
143
90
  description: 'Add or remove a Strudel effect on the current session pattern. ' +
@@ -156,28 +103,6 @@ export const tools = [
156
103
  required: ['action', 'effect'],
157
104
  },
158
105
  },
159
- {
160
- name: 'add_effect',
161
- description: '[DEPRECATED — use effect({ action: "add" }) instead] Add effect to pattern',
162
- inputSchema: {
163
- type: 'object',
164
- properties: {
165
- effect: { type: 'string', description: 'Effect name' },
166
- params: { type: 'string', description: 'Effect parameters' },
167
- ...SESSION_ID_PROP,
168
- },
169
- required: ['effect'],
170
- },
171
- },
172
- {
173
- name: 'remove_effect',
174
- description: '[DEPRECATED — use effect({ action: "remove" }) instead] Remove effect',
175
- inputSchema: {
176
- type: 'object',
177
- properties: { effect: { type: 'string', description: 'Effect to remove' }, ...SESSION_ID_PROP },
178
- required: ['effect'],
179
- },
180
- },
181
106
  {
182
107
  name: 'set_tempo',
183
108
  description: 'Set BPM',
@@ -187,28 +112,6 @@ export const tools = [
187
112
  required: ['bpm'],
188
113
  },
189
114
  },
190
- {
191
- name: 'add_swing',
192
- description: '[DEPRECATED — use transform({ op: "swing" }) instead] Add swing to pattern',
193
- inputSchema: {
194
- type: 'object',
195
- properties: { amount: { type: 'number', description: 'Swing amount (0-1)' }, ...SESSION_ID_PROP },
196
- required: ['amount'],
197
- },
198
- },
199
- {
200
- name: 'apply_scale',
201
- description: '[DEPRECATED — use transform({ op: "scale" }) instead] Apply scale to notes',
202
- inputSchema: {
203
- type: 'object',
204
- properties: {
205
- scale: { type: 'string', description: 'Scale name' },
206
- root: { type: 'string', description: 'Root note' },
207
- ...SESSION_ID_PROP,
208
- },
209
- required: ['scale', 'root'],
210
- },
211
- },
212
115
  {
213
116
  name: 'shape',
214
117
  description: 'Shape the current pattern along one of three high-level dimensions. ' +
@@ -236,42 +139,6 @@ export const tools = [
236
139
  required: ['dimension'],
237
140
  },
238
141
  },
239
- {
240
- name: 'shift_mood',
241
- description: '[DEPRECATED — use shape({ dimension: "mood" }) instead] Transform current pattern to match a different emotional mood. Moods: dark, euphoric, melancholic, aggressive, dreamy, peaceful, energetic.',
242
- inputSchema: {
243
- type: 'object',
244
- properties: {
245
- target_mood: {
246
- type: 'string',
247
- enum: ['dark', 'euphoric', 'melancholic', 'aggressive', 'dreamy', 'peaceful', 'energetic'],
248
- description: 'Target mood',
249
- },
250
- intensity: { type: 'number', minimum: 0, maximum: 1, description: 'How strongly to apply the mood transformation (0-1, default: 0.5)' },
251
- auto_play: { type: 'boolean', description: 'Start playback after transformation (default: true)' },
252
- ...SESSION_ID_PROP,
253
- },
254
- required: ['target_mood'],
255
- },
256
- },
257
- {
258
- name: 'set_energy',
259
- description: '[DEPRECATED — use shape({ dimension: "energy" }) instead] Adjust energy level 0-10. Auto-plays after applying.',
260
- inputSchema: {
261
- type: 'object',
262
- properties: { level: { type: 'number', description: 'Energy level from 0 (minimal) to 10 (maximum)' }, ...SESSION_ID_PROP },
263
- required: ['level'],
264
- },
265
- },
266
- {
267
- name: 'refine',
268
- description: '[DEPRECATED — use shape({ dimension: "refine" }) instead] Incrementally refine current pattern: faster/slower/louder/quieter/brighter/darker/"more reverb"/drier.',
269
- inputSchema: {
270
- type: 'object',
271
- properties: { direction: { type: 'string', description: 'Refinement direction: faster, slower, louder, quieter, brighter, darker, "more reverb", or drier' }, ...SESSION_ID_PROP },
272
- required: ['direction'],
273
- },
274
- },
275
142
  ];
276
143
  export const toolNames = new Set(tools.map(t => t.name));
277
144
  // ---- per-op helpers (shared by transform({op}) and the deprecated aliases)
@@ -369,15 +236,6 @@ export async function execute(name, args, ctx) {
369
236
  throw new Error(`Invalid op: ${op}. Must be one of: transpose, reverse, stretch, quantize, humanize, swing, scale, vary`);
370
237
  }
371
238
  }
372
- // Deprecated aliases — forward to per-op helpers.
373
- case 'transpose': return await opTranspose(args, ctx, sid);
374
- case 'reverse': return await opReverse(ctx, sid);
375
- case 'stretch': return await opStretch(args, ctx, sid);
376
- case 'quantize': return await opQuantize(args, ctx, sid);
377
- case 'humanize': return await opHumanize(args, ctx, sid);
378
- case 'generate_variation': return await opVary(args, ctx, sid);
379
- case 'add_swing': return await opSwing(args, ctx, sid);
380
- case 'apply_scale': return await opScale(args, ctx, sid);
381
239
  case 'effect': {
382
240
  const a = args?.action;
383
241
  if (a !== 'add' && a !== 'remove') {
@@ -387,8 +245,6 @@ export async function execute(name, args, ctx) {
387
245
  ? await opEffectAdd(args, ctx, sid)
388
246
  : await opEffectRemove(args, ctx, sid);
389
247
  }
390
- case 'add_effect': return await opEffectAdd(args, ctx, sid);
391
- case 'remove_effect': return await opEffectRemove(args, ctx, sid);
392
248
  case 'set_tempo': {
393
249
  InputValidator.validateBPM(args.bpm);
394
250
  const p = await ctx.getCurrentPatternSafe(sid);
@@ -405,9 +261,6 @@ export async function execute(name, args, ctx) {
405
261
  throw new Error(`Invalid dimension: ${dim}. Must be one of: mood, energy, refine`);
406
262
  }
407
263
  }
408
- case 'shift_mood': return await shiftMood(args, ctx, sid);
409
- case 'set_energy': return await setEnergyLevel(args.level, ctx, sid);
410
- case 'refine': return await refinePattern(args.direction, ctx, sid);
411
264
  default:
412
265
  throw new Error(`transform module does not handle tool: ${name}`);
413
266
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@williamzujkowski/live-coding-music-mcp",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "MCP server (unofficial, fan project) for AI-assisted live-coding music via strudel.cc. Lets Claude drive pattern generation, audio analysis, and MIDI export through the Strudel browser REPL.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",