@xiaolaa2/ableton-copilot-mcp
Version:
Ableton Live MCP depend on Ableton JS
60 lines • 2.78 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { tool } from '../mcp/decorators/tool.js';
import { z } from 'zod';
import { Result } from '../utils/common.js';
import { listResources, loadDevice, ResourceType } from '../utils/browser-utils.js';
class BrowserTools {
async listResources({ type }) {
return await listResources(type);
}
async loadItem({ device_id, track_id }) {
await loadDevice(device_id, track_id);
return Result.ok();
}
}
__decorate([
tool({
name: 'list_resources',
description: 'List Ableton live Browser resources of specified type',
paramsSchema: {
type: z.enum([
ResourceType.AUDIO_EFFECTS,
ResourceType.INSTRUMENTS,
ResourceType.PLUGINS,
ResourceType.SAMPLES,
ResourceType.DRUMS,
ResourceType.MIDI_EFFECTS,
ResourceType.SOUNDS
]).describe('[string] resources type')
}
}),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", Promise)
], BrowserTools.prototype, "listResources", null);
__decorate([
tool({
name: 'load_device',
description: `Load a resource which is loadable (audio effect/instrument/plugin/drums/midi effect/sounds) into a track.
If track_id is not provided, will load to currently selected track.
If no track is selected, instruments will be loaded to the last MIDI track,
and audio effects will be loaded to the last MIDI or audio track.`,
paramsSchema: {
device_id: z.string().describe('[string] id of device to load'),
track_id: z.string().optional().describe('[string] track id to load item to'),
}
}),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", Promise)
], BrowserTools.prototype, "loadItem", null);
export default BrowserTools;
//# sourceMappingURL=browser-tools.js.map