record_safer_pro_mcp 1.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.
- package/README.md +205 -0
- package/dist/api-client.d.ts +159 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +991 -0
- package/dist/api-client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/index.d.ts +12 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +235 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/index.d.ts +7 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +59 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/mixing-guide-content.d.ts +8 -0
- package/dist/resources/mixing-guide-content.d.ts.map +1 -0
- package/dist/resources/mixing-guide-content.js +194 -0
- package/dist/resources/mixing-guide-content.js.map +1 -0
- package/dist/runtime.d.ts +39 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +320 -0
- package/dist/runtime.js.map +1 -0
- package/dist/telemetry-schema.d.ts +39 -0
- package/dist/telemetry-schema.d.ts.map +1 -0
- package/dist/telemetry-schema.js +15 -0
- package/dist/telemetry-schema.js.map +1 -0
- package/dist/tools/core.d.ts +4 -0
- package/dist/tools/core.d.ts.map +1 -0
- package/dist/tools/core.js +360 -0
- package/dist/tools/core.js.map +1 -0
- package/dist/tools/devices.d.ts +10 -0
- package/dist/tools/devices.d.ts.map +1 -0
- package/dist/tools/devices.js +53 -0
- package/dist/tools/devices.js.map +1 -0
- package/dist/tools/levels.d.ts +11 -0
- package/dist/tools/levels.d.ts.map +1 -0
- package/dist/tools/levels.js +25 -0
- package/dist/tools/levels.js.map +1 -0
- package/dist/tools/markers.d.ts +17 -0
- package/dist/tools/markers.d.ts.map +1 -0
- package/dist/tools/markers.js +142 -0
- package/dist/tools/markers.js.map +1 -0
- package/dist/tools/monitor.d.ts +19 -0
- package/dist/tools/monitor.d.ts.map +1 -0
- package/dist/tools/monitor.js +232 -0
- package/dist/tools/monitor.js.map +1 -0
- package/dist/tools/recording.d.ts +12 -0
- package/dist/tools/recording.d.ts.map +1 -0
- package/dist/tools/recording.js +85 -0
- package/dist/tools/recording.js.map +1 -0
- package/dist/tools/settings.d.ts +10 -0
- package/dist/tools/settings.d.ts.map +1 -0
- package/dist/tools/settings.js +43 -0
- package/dist/tools/settings.js.map +1 -0
- package/dist/tools/storage.d.ts +10 -0
- package/dist/tools/storage.d.ts.map +1 -0
- package/dist/tools/storage.js +20 -0
- package/dist/tools/storage.js.map +1 -0
- package/dist/tools/system.d.ts +10 -0
- package/dist/tools/system.d.ts.map +1 -0
- package/dist/tools/system.js +53 -0
- package/dist/tools/system.js.map +1 -0
- package/dist/tools/tool-metadata.d.ts +19 -0
- package/dist/tools/tool-metadata.d.ts.map +1 -0
- package/dist/tools/tool-metadata.js +25 -0
- package/dist/tools/tool-metadata.js.map +1 -0
- package/dist/types.d.ts +456 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +80 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +336 -0
- package/dist/utils.js.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RecordSaferClient } from "../api-client.js";
|
|
3
|
+
import { handleToolCall } from "../utils.js";
|
|
4
|
+
import { buildToolAnnotations, buildToolMeta } from "./tool-metadata.js";
|
|
5
|
+
export const CORE_TOOL_NAMES = [
|
|
6
|
+
"list_audio_devices",
|
|
7
|
+
"start_record_mcp",
|
|
8
|
+
"get_channels",
|
|
9
|
+
"get_mix",
|
|
10
|
+
"get_health",
|
|
11
|
+
"get_status",
|
|
12
|
+
"stop_recording",
|
|
13
|
+
"list_tracks",
|
|
14
|
+
"list_markers",
|
|
15
|
+
"add_marker",
|
|
16
|
+
"rename_channel",
|
|
17
|
+
];
|
|
18
|
+
const START_RECORD_INPUT = {
|
|
19
|
+
deviceId: z.string().min(1).describe("Input device ID"),
|
|
20
|
+
sampleRate: z.number().int().positive().optional().describe("Optional desired sample rate. If supplied, it must match the selected device's default/current rate because the current backend cannot switch hardware sample rate during MCP preparation."),
|
|
21
|
+
bitDepth: z.enum(["16-bit", "24-bit", "32-bit Float"]).optional().describe("Optional recording bit depth; defaults to 24-bit"),
|
|
22
|
+
audioFormat: z.enum(["wav", "caf"]).describe("Recording file format"),
|
|
23
|
+
channels: z.array(z.object({
|
|
24
|
+
id: z.number().int().positive().describe("1-based device channel ID"),
|
|
25
|
+
name: z.string().optional().describe("Optional post-console channel name to apply after initialization succeeds"),
|
|
26
|
+
armed: z.boolean().optional().describe("Defaults to true when omitted"),
|
|
27
|
+
})).min(1).describe("Channels to arm for the prepared session"),
|
|
28
|
+
outputPath: z.string().optional().describe("Optional output directory; defaults to ~/Desktop"),
|
|
29
|
+
sessionName: z.string().optional().describe("Optional session folder name"),
|
|
30
|
+
bufferSize: z.number().int().positive().optional().describe("Optional monitoring buffer size"),
|
|
31
|
+
userConfirmed: z.boolean().describe("Must be true only after the user explicitly confirms the resolved setup summary"),
|
|
32
|
+
};
|
|
33
|
+
const DEVICE_INFO_SCHEMA = z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
name: z.string(),
|
|
36
|
+
channels: z.number().int().nonnegative(),
|
|
37
|
+
sampleRates: z.array(z.number().int().positive()),
|
|
38
|
+
defaultSampleRate: z.number().int().positive(),
|
|
39
|
+
channelLabels: z.array(z.string()).optional(),
|
|
40
|
+
});
|
|
41
|
+
const START_RECORD_OUTPUT = {
|
|
42
|
+
success: z.boolean(),
|
|
43
|
+
page: z.literal("RECORDING"),
|
|
44
|
+
pageStep: z.number().int(),
|
|
45
|
+
consoleReady: z.boolean(),
|
|
46
|
+
usedDefaultOutputPath: z.boolean(),
|
|
47
|
+
usedDeviceDefaultSampleRate: z.boolean(),
|
|
48
|
+
usedDefaultBitDepth: z.boolean(),
|
|
49
|
+
appliedChannelRenames: z.number().int().nonnegative(),
|
|
50
|
+
outputPath: z.string(),
|
|
51
|
+
deviceId: z.string(),
|
|
52
|
+
requestedSampleRate: z.number().int().positive().nullable(),
|
|
53
|
+
requestedBitDepth: z.enum(["16-bit", "24-bit", "32-bit Float"]),
|
|
54
|
+
effectiveSampleRate: z.number().int().positive(),
|
|
55
|
+
effectiveBitDepth: z.string(),
|
|
56
|
+
audioFormat: z.enum(["wav", "caf"]),
|
|
57
|
+
sessionName: z.string().nullable().optional(),
|
|
58
|
+
channels: z.array(z.object({
|
|
59
|
+
id: z.number().int().positive(),
|
|
60
|
+
name: z.string(),
|
|
61
|
+
armed: z.boolean(),
|
|
62
|
+
deviceChannelLabel: z.string().optional(),
|
|
63
|
+
color: z.string().optional(),
|
|
64
|
+
})),
|
|
65
|
+
};
|
|
66
|
+
const MCP_CHANNELS_OUTPUT = {
|
|
67
|
+
ready: z.boolean(),
|
|
68
|
+
recording: z.boolean(),
|
|
69
|
+
deviceName: z.string().optional(),
|
|
70
|
+
channels: z.array(z.object({
|
|
71
|
+
id: z.number().int().positive(),
|
|
72
|
+
name: z.string(),
|
|
73
|
+
deviceChannelLabel: z.string().optional(),
|
|
74
|
+
})).optional(),
|
|
75
|
+
};
|
|
76
|
+
const MCP_MIX_OUTPUT = {
|
|
77
|
+
ready: z.boolean(),
|
|
78
|
+
recording: z.boolean(),
|
|
79
|
+
safeMode: z.boolean(),
|
|
80
|
+
channels: z.array(z.object({
|
|
81
|
+
id: z.number().int().positive(),
|
|
82
|
+
name: z.string(),
|
|
83
|
+
volume: z.number(),
|
|
84
|
+
pan: z.number(),
|
|
85
|
+
mute: z.boolean(),
|
|
86
|
+
solo: z.boolean(),
|
|
87
|
+
phaseInvert: z.boolean(),
|
|
88
|
+
msProcess: z.boolean().optional(),
|
|
89
|
+
})).optional(),
|
|
90
|
+
};
|
|
91
|
+
const MCP_HEALTH_OUTPUT = {
|
|
92
|
+
ready: z.boolean(),
|
|
93
|
+
recording: z.boolean(),
|
|
94
|
+
duration: z.number().nonnegative(),
|
|
95
|
+
cpuLoad: z.number(),
|
|
96
|
+
diskFreeGB: z.number(),
|
|
97
|
+
bufferHealth: z.string(),
|
|
98
|
+
deviceAlive: z.boolean(),
|
|
99
|
+
safeMode: z.boolean(),
|
|
100
|
+
alerts: z.array(z.string()),
|
|
101
|
+
};
|
|
102
|
+
const MCP_STATUS_OUTPUT = {
|
|
103
|
+
ready: z.boolean(),
|
|
104
|
+
recording: z.boolean(),
|
|
105
|
+
duration: z.number().nonnegative(),
|
|
106
|
+
};
|
|
107
|
+
const TRACK_INFO_SCHEMA = z.object({
|
|
108
|
+
id: z.string(),
|
|
109
|
+
name: z.string(),
|
|
110
|
+
status: z.string(),
|
|
111
|
+
});
|
|
112
|
+
const MARKER_INFO_SCHEMA = z.object({
|
|
113
|
+
id: z.number().int().nonnegative(),
|
|
114
|
+
label: z.string(),
|
|
115
|
+
timestamp: z.number().nonnegative(),
|
|
116
|
+
});
|
|
117
|
+
export function registerCoreTools(server) {
|
|
118
|
+
const client = new RecordSaferClient();
|
|
119
|
+
server.registerTool("start_record_mcp", {
|
|
120
|
+
title: "Prepare Recording Console",
|
|
121
|
+
description: `Use this when the user has approved a complete recording setup and you need to initialize a session and jump the app into the recording console.
|
|
122
|
+
|
|
123
|
+
This prepares the recording console for manual record-start. It does NOT start recording.
|
|
124
|
+
Always present the fully resolved setup summary first, then call this tool only after explicit user confirmation.
|
|
125
|
+
|
|
126
|
+
Required before execution:
|
|
127
|
+
- deviceId: input device ID
|
|
128
|
+
- audioFormat: wav or caf
|
|
129
|
+
- channels: non-empty array of armed channel objects
|
|
130
|
+
- userConfirmed: must be true only after the user explicitly confirms the final setup summary
|
|
131
|
+
|
|
132
|
+
Optional with user-approved defaults:
|
|
133
|
+
- sampleRate: when omitted, the device's default/current rate is used
|
|
134
|
+
- bitDepth: defaults to 24-bit when omitted
|
|
135
|
+
- outputPath: defaults to ~/Desktop when omitted
|
|
136
|
+
- sessionName: recording folder name prefix
|
|
137
|
+
- bufferSize: studio-mode buffer hint
|
|
138
|
+
|
|
139
|
+
Important sequencing note:
|
|
140
|
+
- If channels[].name is provided, MCP must initialize the session first and only then apply channel renames after the recording console is ready.`,
|
|
141
|
+
inputSchema: START_RECORD_INPUT,
|
|
142
|
+
outputSchema: START_RECORD_OUTPUT,
|
|
143
|
+
annotations: buildToolAnnotations("write", {
|
|
144
|
+
title: "Prepare Recording Console",
|
|
145
|
+
destructive: false,
|
|
146
|
+
idempotent: false,
|
|
147
|
+
openWorld: false,
|
|
148
|
+
}),
|
|
149
|
+
_meta: buildToolMeta({
|
|
150
|
+
invoking: "Preparing console",
|
|
151
|
+
invoked: "Console ready",
|
|
152
|
+
}),
|
|
153
|
+
}, async (params) => handleToolCall("start_record_mcp", "write", () => client.startRecordMcp(params), client));
|
|
154
|
+
server.registerTool("list_audio_devices", {
|
|
155
|
+
title: "List Audio Devices",
|
|
156
|
+
description: `Use this when you need to resolve a device name into a deviceId before console preparation.
|
|
157
|
+
|
|
158
|
+
Lists currently available audio input devices only. This tool should not be used to start or initialize a recording session.`,
|
|
159
|
+
inputSchema: {},
|
|
160
|
+
outputSchema: {
|
|
161
|
+
devices: z.array(DEVICE_INFO_SCHEMA),
|
|
162
|
+
},
|
|
163
|
+
annotations: buildToolAnnotations("read", {
|
|
164
|
+
title: "List Audio Devices",
|
|
165
|
+
destructive: false,
|
|
166
|
+
openWorld: false,
|
|
167
|
+
}),
|
|
168
|
+
_meta: buildToolMeta({
|
|
169
|
+
invoking: "Listing devices",
|
|
170
|
+
invoked: "Devices listed",
|
|
171
|
+
}),
|
|
172
|
+
}, async () => handleToolCall("list_audio_devices", "read", async () => ({ devices: await client.listDevices({ allowAutoLaunch: false }) }), client));
|
|
173
|
+
server.registerTool("get_channels", {
|
|
174
|
+
title: "Get Channels",
|
|
175
|
+
description: `Use this when the recording console is ready and you need channel IDs or existing names before rename operations.
|
|
176
|
+
|
|
177
|
+
Returns the current session channel IDs, channel names, and device channel labels.`,
|
|
178
|
+
inputSchema: {},
|
|
179
|
+
outputSchema: MCP_CHANNELS_OUTPUT,
|
|
180
|
+
annotations: buildToolAnnotations("read", {
|
|
181
|
+
title: "Get Channels",
|
|
182
|
+
destructive: false,
|
|
183
|
+
openWorld: false,
|
|
184
|
+
}),
|
|
185
|
+
_meta: buildToolMeta({
|
|
186
|
+
invoking: "Loading channels",
|
|
187
|
+
invoked: "Channels ready",
|
|
188
|
+
}),
|
|
189
|
+
}, async () => handleToolCall("get_channels", "read", () => client.getMcpChannels({ allowAutoLaunch: false }), client));
|
|
190
|
+
server.registerTool("get_mix", {
|
|
191
|
+
title: "Get Mix Snapshot",
|
|
192
|
+
description: `Use this when you need a safe-mode aware mix snapshot before monitoring or mix decisions.
|
|
193
|
+
|
|
194
|
+
Returns whether the session is ready, whether recording is active, whether safe mode is enabled, and the current per-channel mix state.`,
|
|
195
|
+
inputSchema: {},
|
|
196
|
+
outputSchema: MCP_MIX_OUTPUT,
|
|
197
|
+
annotations: buildToolAnnotations("read", {
|
|
198
|
+
title: "Get Mix Snapshot",
|
|
199
|
+
destructive: false,
|
|
200
|
+
openWorld: false,
|
|
201
|
+
}),
|
|
202
|
+
_meta: buildToolMeta({
|
|
203
|
+
invoking: "Loading mix",
|
|
204
|
+
invoked: "Mix ready",
|
|
205
|
+
}),
|
|
206
|
+
}, async () => handleToolCall("get_mix", "read", () => client.getMcpMix({ allowAutoLaunch: false }), client));
|
|
207
|
+
server.registerTool("get_health", {
|
|
208
|
+
title: "Get Health Snapshot",
|
|
209
|
+
description: `Use this when you need a high-level recording-system health snapshot for troubleshooting or risk checks.
|
|
210
|
+
|
|
211
|
+
Returns duration, CPU load, disk space, buffer health, device health, safe-mode status, and alert codes.`,
|
|
212
|
+
inputSchema: {},
|
|
213
|
+
outputSchema: MCP_HEALTH_OUTPUT,
|
|
214
|
+
annotations: buildToolAnnotations("read", {
|
|
215
|
+
title: "Get Health Snapshot",
|
|
216
|
+
destructive: false,
|
|
217
|
+
openWorld: false,
|
|
218
|
+
}),
|
|
219
|
+
_meta: buildToolMeta({
|
|
220
|
+
invoking: "Checking health",
|
|
221
|
+
invoked: "Health ready",
|
|
222
|
+
}),
|
|
223
|
+
}, async () => handleToolCall("get_health", "read", () => client.getMcpHealth({ allowAutoLaunch: false }), client));
|
|
224
|
+
server.registerTool("get_status", {
|
|
225
|
+
title: "Get Recording Status",
|
|
226
|
+
description: `Use this before lightweight actions such as add_marker or stop_recording.
|
|
227
|
+
|
|
228
|
+
Returns the minimal recording-ready state without changing the session.`,
|
|
229
|
+
inputSchema: {},
|
|
230
|
+
outputSchema: MCP_STATUS_OUTPUT,
|
|
231
|
+
annotations: buildToolAnnotations("read", {
|
|
232
|
+
title: "Get Recording Status",
|
|
233
|
+
destructive: false,
|
|
234
|
+
openWorld: false,
|
|
235
|
+
}),
|
|
236
|
+
_meta: buildToolMeta({
|
|
237
|
+
invoking: "Checking status",
|
|
238
|
+
invoked: "Status ready",
|
|
239
|
+
}),
|
|
240
|
+
}, async () => handleToolCall("get_status", "read", () => client.getMcpStatus({ allowAutoLaunch: false }), client));
|
|
241
|
+
server.registerTool("stop_recording", {
|
|
242
|
+
title: "Stop Recording",
|
|
243
|
+
description: `Use this only when the user explicitly wants to stop the active recording.
|
|
244
|
+
|
|
245
|
+
This action stops the current recording and closes output files. It is irreversible and requires explicit user confirmation in the current turn.`,
|
|
246
|
+
inputSchema: {
|
|
247
|
+
userConfirmed: z.boolean().describe("Must be true only after the user explicitly confirms stopping the active recording"),
|
|
248
|
+
},
|
|
249
|
+
outputSchema: {
|
|
250
|
+
success: z.boolean(),
|
|
251
|
+
},
|
|
252
|
+
annotations: buildToolAnnotations("recording_control", {
|
|
253
|
+
title: "Stop Recording",
|
|
254
|
+
destructive: true,
|
|
255
|
+
idempotent: false,
|
|
256
|
+
openWorld: false,
|
|
257
|
+
}),
|
|
258
|
+
_meta: buildToolMeta({
|
|
259
|
+
invoking: "Stopping recording",
|
|
260
|
+
invoked: "Recording stopped",
|
|
261
|
+
}),
|
|
262
|
+
}, async ({ userConfirmed }) => handleToolCall("stop_recording", "recording_control", () => client.stopRecording({ userConfirmed }), client));
|
|
263
|
+
server.registerTool("list_tracks", {
|
|
264
|
+
title: "List Tracks",
|
|
265
|
+
description: `Use this when recording is in progress or finished and you need the available track list.
|
|
266
|
+
|
|
267
|
+
Prerequisite: the session is initialized and track metadata is available.`,
|
|
268
|
+
inputSchema: {},
|
|
269
|
+
outputSchema: {
|
|
270
|
+
tracks: z.array(TRACK_INFO_SCHEMA),
|
|
271
|
+
},
|
|
272
|
+
annotations: buildToolAnnotations("read", {
|
|
273
|
+
title: "List Tracks",
|
|
274
|
+
destructive: false,
|
|
275
|
+
openWorld: false,
|
|
276
|
+
}),
|
|
277
|
+
_meta: buildToolMeta({
|
|
278
|
+
invoking: "Listing tracks",
|
|
279
|
+
invoked: "Tracks listed",
|
|
280
|
+
}),
|
|
281
|
+
}, async () => handleToolCall("list_tracks", "read", async () => ({ tracks: await client.listTracks({ allowAutoLaunch: false }) }), client));
|
|
282
|
+
server.registerTool("list_markers", {
|
|
283
|
+
title: "List Markers",
|
|
284
|
+
description: `Use this when you need all marker points from the current recording session.
|
|
285
|
+
|
|
286
|
+
Prerequisite: recording is in progress or marker metadata already exists for the session.`,
|
|
287
|
+
inputSchema: {},
|
|
288
|
+
outputSchema: {
|
|
289
|
+
markers: z.array(MARKER_INFO_SCHEMA),
|
|
290
|
+
},
|
|
291
|
+
annotations: buildToolAnnotations("read", {
|
|
292
|
+
title: "List Markers",
|
|
293
|
+
destructive: false,
|
|
294
|
+
openWorld: false,
|
|
295
|
+
}),
|
|
296
|
+
_meta: buildToolMeta({
|
|
297
|
+
invoking: "Listing markers",
|
|
298
|
+
invoked: "Markers listed",
|
|
299
|
+
}),
|
|
300
|
+
}, async () => handleToolCall("list_markers", "read", async () => ({ markers: await client.listMarkers({ allowAutoLaunch: false }) }), client));
|
|
301
|
+
server.registerTool("add_marker", {
|
|
302
|
+
title: "Add Marker",
|
|
303
|
+
description: `Use this when the user explicitly wants to add a marker at the current recording position.
|
|
304
|
+
|
|
305
|
+
label is optional; when provided, MCP first creates the marker at the current position and then immediately applies the requested label.`,
|
|
306
|
+
inputSchema: {
|
|
307
|
+
label: z.string().optional().describe("Optional marker label"),
|
|
308
|
+
},
|
|
309
|
+
outputSchema: {
|
|
310
|
+
success: z.boolean(),
|
|
311
|
+
id: z.number().int().nonnegative(),
|
|
312
|
+
timestamp: z.number().nonnegative(),
|
|
313
|
+
label: z.string(),
|
|
314
|
+
time: z.string().optional(),
|
|
315
|
+
},
|
|
316
|
+
annotations: buildToolAnnotations("write", {
|
|
317
|
+
title: "Add Marker",
|
|
318
|
+
destructive: false,
|
|
319
|
+
idempotent: false,
|
|
320
|
+
openWorld: false,
|
|
321
|
+
}),
|
|
322
|
+
_meta: buildToolMeta({
|
|
323
|
+
invoking: "Adding marker",
|
|
324
|
+
invoked: "Marker added",
|
|
325
|
+
}),
|
|
326
|
+
}, async ({ label }) => handleToolCall("add_marker", "write", () => client.addMarker(label), client));
|
|
327
|
+
server.registerTool("rename_channel", {
|
|
328
|
+
title: "Rename Channel",
|
|
329
|
+
description: `Use this when the recording console is ready and the user explicitly wants to rename a channel.
|
|
330
|
+
|
|
331
|
+
Call get_channels first, then use channels[].id as the required channel ID. Do not rename channels before the console is ready.`,
|
|
332
|
+
inputSchema: {
|
|
333
|
+
id: z.string().min(1).describe("Channel ID from get_channels"),
|
|
334
|
+
name: z.string().min(1).describe("New channel name"),
|
|
335
|
+
},
|
|
336
|
+
outputSchema: {
|
|
337
|
+
success: z.boolean(),
|
|
338
|
+
channelId: z.string(),
|
|
339
|
+
name: z.string(),
|
|
340
|
+
},
|
|
341
|
+
annotations: buildToolAnnotations("write", {
|
|
342
|
+
title: "Rename Channel",
|
|
343
|
+
destructive: false,
|
|
344
|
+
idempotent: false,
|
|
345
|
+
openWorld: false,
|
|
346
|
+
}),
|
|
347
|
+
_meta: buildToolMeta({
|
|
348
|
+
invoking: "Renaming channel",
|
|
349
|
+
invoked: "Channel renamed",
|
|
350
|
+
}),
|
|
351
|
+
}, async ({ id, name }) => handleToolCall("rename_channel", "write", async () => {
|
|
352
|
+
await client.renameChannel(id, name);
|
|
353
|
+
return {
|
|
354
|
+
success: true,
|
|
355
|
+
channelId: id,
|
|
356
|
+
name,
|
|
357
|
+
};
|
|
358
|
+
}, client));
|
|
359
|
+
}
|
|
360
|
+
//# sourceMappingURL=core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/tools/core.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,oBAAoB;IACpB,kBAAkB;IAClB,cAAc;IACd,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,gBAAgB;IAChB,aAAa;IACb,cAAc;IACd,YAAY;IACZ,gBAAgB;CACR,CAAC;AAEX,MAAM,kBAAkB,GAAG;IACzB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACvD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4LAA4L,CAAC;IACzP,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC,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,EAAE,kBAAkB;YAC5B,OAAO,EAAE,iBAAiB;SAC3B,CAAC;KACH,EACD,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CACrB,cAAc,CAAC,gBAAgB,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACrC,OAAO;YACL,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,EAAE;YACb,IAAI;SACL,CAAC;IACJ,CAAC,EAAE,MAAM,CAAC,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 设备管理 Tools — 音频设备查询与电平监控
|
|
3
|
+
* Device Management Tools — Audio device queries and level monitoring
|
|
4
|
+
*
|
|
5
|
+
* 这些是只读查询工具,无前置依赖,随时可调用。
|
|
6
|
+
* These are read-only query tools with no prerequisites.
|
|
7
|
+
*/
|
|
8
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
+
export declare function registerDeviceTools(server: McpServer): void;
|
|
10
|
+
//# sourceMappingURL=devices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../src/tools/devices.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,QAqFpD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 设备管理 Tools — 音频设备查询与电平监控
|
|
3
|
+
* Device Management Tools — Audio device queries and level monitoring
|
|
4
|
+
*
|
|
5
|
+
* 这些是只读查询工具,无前置依赖,随时可调用。
|
|
6
|
+
* These are read-only query tools with no prerequisites.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { RecordSaferClient } from "../api-client.js";
|
|
10
|
+
import { handleToolCall } from "../utils.js";
|
|
11
|
+
const deviceIdSchema = {
|
|
12
|
+
deviceId: z.string().min(1).describe("Device ID"),
|
|
13
|
+
};
|
|
14
|
+
export function registerDeviceTools(server) {
|
|
15
|
+
const client = new RecordSaferClient();
|
|
16
|
+
server.tool("list_audio_devices", `[Pre-Recording Phase] List all audio input devices [read].
|
|
17
|
+
|
|
18
|
+
Response fields:
|
|
19
|
+
- id: unique device identifier for subsequent device-specific calls
|
|
20
|
+
- name: user-facing device name (prefer this in responses)
|
|
21
|
+
- channels: available channel count
|
|
22
|
+
- defaultSampleRate: device default sample rate
|
|
23
|
+
- channelLabels: per-channel labels
|
|
24
|
+
|
|
25
|
+
Use cases:
|
|
26
|
+
- User asks which interfaces/devices are connected
|
|
27
|
+
- Need device selection input for setup-related tasks
|
|
28
|
+
- Troubleshooting device recognition issues`, {}, async () => handleToolCall("list_audio_devices", "read", () => client.listDevices(), client));
|
|
29
|
+
server.tool("list_output_devices", "List all audio output devices [read]. Returns monitor output devices with channelCount and isDefault flags.", {}, async () => handleToolCall("list_output_devices", "read", () => client.listOutputDevices(), client));
|
|
30
|
+
server.tool("get_buffer_sizes", `Get supported buffer sizes for a device [read].
|
|
31
|
+
Prerequisite: provide deviceId from list_audio_devices.
|
|
32
|
+
If sampleRate is supplied, latency is calculated against that rate.`, {
|
|
33
|
+
...deviceIdSchema,
|
|
34
|
+
sampleRate: z.number().int().positive().optional().describe("Optional sample rate used to calculate latencyMs"),
|
|
35
|
+
}, async ({ deviceId, sampleRate }) => handleToolCall("get_buffer_sizes", "read", () => client.getBufferSizes(deviceId, sampleRate), client));
|
|
36
|
+
server.tool("get_device_signals", `Get device signal information [read].
|
|
37
|
+
Prerequisite: provide deviceId from list_audio_devices.
|
|
38
|
+
Use case: troubleshooting whether the device has input signal.
|
|
39
|
+
If sampleRate is supplied, the backend uses it when probing the device.`, {
|
|
40
|
+
...deviceIdSchema,
|
|
41
|
+
sampleRate: z.number().int().positive().optional().describe("Optional probe sample rate"),
|
|
42
|
+
}, async ({ deviceId, sampleRate }) => handleToolCall("get_device_signals", "read", () => client.getDeviceSignals(deviceId, sampleRate), client));
|
|
43
|
+
server.tool("get_device_levels", `Get real-time device level data [read].
|
|
44
|
+
Prerequisite: provide deviceId from list_audio_devices.
|
|
45
|
+
Returns normalized hardware-order levels (0.0-1.0), not dBFS values.
|
|
46
|
+
Note: this starts level monitoring; call stop_level_monitoring afterward to release resources.`, {
|
|
47
|
+
...deviceIdSchema,
|
|
48
|
+
sampleRate: z.number().int().positive().optional().describe("Optional sample rate for engine setup"),
|
|
49
|
+
bufferSize: z.number().int().positive().optional().describe("Optional buffer size hint for engine setup"),
|
|
50
|
+
}, async ({ deviceId, sampleRate, bufferSize }) => handleToolCall("get_device_levels", "read", () => client.getDeviceLevels(deviceId, { sampleRate, bufferSize }), client));
|
|
51
|
+
server.tool("stop_level_monitoring", "Stop level monitoring [write]. ⚠️ This changes monitoring state and requires explicit user confirmation.", {}, async () => handleToolCall("stop_level_monitoring", "write", () => client.stopLevelMonitoring(), client));
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=devices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.js","sourceRoot":"","sources":["../../src/tools/devices.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;CAClD,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,MAAM,MAAM,GAAG,IAAI,iBAAiB,E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AU,CAAC,EAAE,MAAM,CAAC,CAC3D,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB;;;+FAG2F,EAC3F;QACE,GAAG,cAAc;QACjB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QACpG,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;KAC1G,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,CAC7C,cAAc,CAAC,mBAAmB,EAAE,MAAM,EAAE,GAAG,EAAE,CAC/C,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,CAAC,CAC1E,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,0GAA0G,EAC1G,EAAE,EACF,KAAK,IAAI,EAAE,CACT,cAAc,CAAC,uBAAuB,EAAE,OAAO,EAAE,GAAG,EAAE,CACpD,MAAM,CAAC,mBAAmB,EAAE,EAAE,MAAM,CAAC,CAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 电平监控 Tools — 电平订阅与回调控制
|
|
3
|
+
* Level Monitoring Tools — Level subscription and callback control
|
|
4
|
+
*
|
|
5
|
+
* 【说明】这些工具控制 WebSocket 电平数据流和电平计算引擎。
|
|
6
|
+
* 通常由前端 GUI 自动管理,MCP 场景下较少直接使用。
|
|
7
|
+
* 主要用于故障诊断或特殊需求(如安全模式下禁用电平计算以提升录音稳定性)。
|
|
8
|
+
*/
|
|
9
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
|
+
export declare function registerLevelTools(server: McpServer): void;
|
|
11
|
+
//# sourceMappingURL=levels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"levels.d.ts","sourceRoot":"","sources":["../../src/tools/levels.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,QA4CnD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 电平监控 Tools — 电平订阅与回调控制
|
|
3
|
+
* Level Monitoring Tools — Level subscription and callback control
|
|
4
|
+
*
|
|
5
|
+
* 【说明】这些工具控制 WebSocket 电平数据流和电平计算引擎。
|
|
6
|
+
* 通常由前端 GUI 自动管理,MCP 场景下较少直接使用。
|
|
7
|
+
* 主要用于故障诊断或特殊需求(如安全模式下禁用电平计算以提升录音稳定性)。
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { RecordSaferClient } from "../api-client.js";
|
|
11
|
+
import { handleToolCall } from "../utils.js";
|
|
12
|
+
export function registerLevelTools(server) {
|
|
13
|
+
const client = new RecordSaferClient();
|
|
14
|
+
server.tool("subscribe_levels", "Subscribe to WebSocket level updates [write]. ⚠️ This starts the level data stream and requires explicit user confirmation. The backend can infer session context, but you may also provide device/sample-rate details for pre-recording diagnostics.", {
|
|
15
|
+
deviceId: z.string().min(1).optional().describe("Optional device ID for pre-recording diagnostics"),
|
|
16
|
+
channelCount: z.number().int().positive().optional().describe("Optional channel count override"),
|
|
17
|
+
sampleRate: z.number().int().positive().optional().describe("Optional sample rate for engine setup"),
|
|
18
|
+
}, async ({ deviceId, channelCount, sampleRate }) => handleToolCall("subscribe_levels", "write", () => client.subscribeLevels({ deviceId, channelCount, sampleRate }), client));
|
|
19
|
+
server.tool("unsubscribe_levels", "Unsubscribe from level updates [write]. ⚠️ This stops the level data stream and requires explicit user confirmation.", {}, async () => handleToolCall("unsubscribe_levels", "write", () => client.unsubscribeLevels(), client));
|
|
20
|
+
server.tool("disable_level_callback", `Disable level calculation (Safe Mode) [write].
|
|
21
|
+
⚠️ This disables level calculation to improve recording stability and requires explicit user confirmation.
|
|
22
|
+
Use case: if recording stutters or buffer issues occur, disable level callbacks to reduce CPU load.`, {}, async () => handleToolCall("disable_level_callback", "write", () => client.disableLevelCallback(), client));
|
|
23
|
+
server.tool("enable_level_callback", "Enable level calculation [write]. ⚠️ This enables level callbacks and requires explicit user confirmation.", {}, async () => handleToolCall("enable_level_callback", "write", () => client.enableLevelCallback(), client));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=levels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"levels.js","sourceRoot":"","sources":["../../src/tools/levels.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,MAAM,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAEvC,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,uPAAuP,EACvP;QACE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;QACnG,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;QAChG,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;KACrG,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,EAAE,CAC/C,cAAc,CAAC,kBAAkB,EAAE,OAAO,EAAE,GAAG,EAAE,CAC/C,MAAM,CAAC,eAAe,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,CAAC,CAC5E,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,oBAAoB,EACpB,sHAAsH,EACtH,EAAE,EACF,KAAK,IAAI,EAAE,CACT,cAAc,CAAC,oBAAoB,EAAE,OAAO,EAAE,GAAG,EAAE,CACjD,MAAM,CAAC,iBAAiB,EAAE,EAAE,MAAM,CAAC,CACxC,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB;;oGAEgG,EAChG,EAAE,EACF,KAAK,IAAI,EAAE,CACT,cAAc,CAAC,wBAAwB,EAAE,OAAO,EAAE,GAAG,EAAE,CACrD,MAAM,CAAC,oBAAoB,EAAE,EAAE,MAAM,CAAC,CAC3C,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,4GAA4G,EAC5G,EAAE,EACF,KAAK,IAAI,EAAE,CACT,cAAc,CAAC,uBAAuB,EAAE,OAAO,EAAE,GAAG,EAAE,CACpD,MAAM,CAAC,mBAAmB,EAAE,EAAE,MAAM,CAAC,CAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 轨道与标记 Tools — 轨道管理与标记点操作
|
|
3
|
+
* Track & Marker Tools — Track management and marker operations
|
|
4
|
+
*
|
|
5
|
+
* 【MCP 高价值场景】
|
|
6
|
+
* 录音中添加标记是 MCP 最自然的使用场景之一:
|
|
7
|
+
* - 用户说"标记一下,这是副歌" → add_marker(label: "副歌")
|
|
8
|
+
* - 用户说"加个标记" → add_marker()(自动编号)
|
|
9
|
+
* 比在 GUI 上点击按钮再输入名称更快。
|
|
10
|
+
*
|
|
11
|
+
* 【前置依赖】标记操作需要录音正在进行中。
|
|
12
|
+
* 通道重命名和颜色设置需要会话已初始化。
|
|
13
|
+
*/
|
|
14
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
15
|
+
export declare function normalizeChannelColorInput(input: string): string;
|
|
16
|
+
export declare function registerMarkerTools(server: McpServer): void;
|
|
17
|
+
//# sourceMappingURL=markers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../src/tools/markers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAwBpE,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAuChE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,QAuIpD"}
|