@xiaolaa2/ableton-copilot-mcp
Version:
Ableton Live MCP depend on Ableton JS
65 lines • 2.85 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 { z } from 'zod';
import { tool } from '../mcp/decorators/tool.js';
import { Result } from '../utils/common.js';
import { getOperationHistoriesPage, getSnapShotByHistoryId, rollbackByHistoryId } from '../utils/snapshot-utils.js';
class HistoryTools {
async getOperationHistories({ page, page_size }) {
return getOperationHistoriesPage(page, page_size);
}
async getSnapshotById({ history_id }) {
return getSnapShotByHistoryId(history_id);
}
async rollbackByHistoryId({ history_id }) {
await rollbackByHistoryId(history_id);
return Result.ok();
}
}
__decorate([
tool({
name: 'get_operation_histories',
description: 'get mcp tools operation histories by page',
paramsSchema: {
page: z.number(),
page_size: z.number(),
}
}),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", Promise)
], HistoryTools.prototype, "getOperationHistories", null);
__decorate([
tool({
name: 'get_snapshot_by_history_id',
description: 'get snapshot by history id',
paramsSchema: {
history_id: z.number().describe('The id of the operation history. Must be a value greater than 0.'),
}
}),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", Promise)
], HistoryTools.prototype, "getSnapshotById", null);
__decorate([
tool({
name: 'rollback_by_history_id',
description: `rollback to the state before the operation corresponding to the history_id was executed,
currently supports Note operations`,
paramsSchema: {
history_id: z.number().describe('The id of the operation history.'),
}
}),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", Promise)
], HistoryTools.prototype, "rollbackByHistoryId", null);
export default HistoryTools;
//# sourceMappingURL=history-tools.js.map