fix: sửa các tools của AI

This commit is contained in:
2026-07-22 09:59:43 +07:00
parent 108943ae81
commit 6fd9db54cf
5 changed files with 188 additions and 14 deletions
+11
View File
@@ -166,6 +166,17 @@ const AIGateway = (function() {
length_bars: { type: 'number', description: 'Độ dài vùng chọn (bar). Dùng cùng start_bar thay cho end_bar.' }
}
}
}, {
name: 'select_item',
description: 'Chọn một item/clip/sample cụ thể trên track. Nếu không có track_id và item_name thì chọn toàn bộ timeline.',
parameters: {
type: 'object',
properties: {
track_id: { type: 'string', description: 'ID của track. Nếu không có thì dùng track đang chọn.' },
item_name: { type: 'string', description: 'Tên của clip/sample cần chọn. VD: "Cut_Cartoon Capers Loop.mp3". Nếu không có thì chọn toàn bộ track.' },
select_all: { type: 'boolean', description: 'Chọn toàn bộ timeline (bỏ qua track_id và item_name)' }
}
}
}, {
name: 'cut_audio',
description: 'Cắt đoạn audio đang được chọn từ track nguồn, snap zero-crossing, tạo track mới chứa đoạn cắt',
@@ -63,6 +63,7 @@ const DAWCommandDispatcher = (function() {
register('SET_SELECTION', (args) => api.setSelection(args));
register('SET_BPM', (args) => api.setBpm(args));
register('SET_PLAYHEAD', (args) => api.setPlayhead(args));
register('SELECT_ITEM', (args) => api.selectItem(args));
register('ADD_MARKER', (args) => api.addMarker(args));
register('CREATE_MIDI_ITEM', (args) => AIGateway.createMidiItem(args));
register('MODIFY_MIDI_NOTES', (args) => AIGateway.modifyMidiNotes(args));