obsbot-mcp 0.1.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/LICENSE +21 -0
- package/README.md +170 -0
- package/dist/capture/ffmpeg-args.d.ts +17 -0
- package/dist/capture/ffmpeg-args.js +48 -0
- package/dist/capture/ffmpeg-args.js.map +1 -0
- package/dist/capture/manager.d.ts +60 -0
- package/dist/capture/manager.js +159 -0
- package/dist/capture/manager.js.map +1 -0
- package/dist/codec/commands.d.ts +63 -0
- package/dist/codec/commands.js +185 -0
- package/dist/codec/commands.js.map +1 -0
- package/dist/codec/crc.d.ts +2 -0
- package/dist/codec/crc.js +11 -0
- package/dist/codec/crc.js.map +1 -0
- package/dist/codec/encoding.d.ts +7 -0
- package/dist/codec/encoding.js +8 -0
- package/dist/codec/encoding.js.map +1 -0
- package/dist/codec/frame.d.ts +20 -0
- package/dist/codec/frame.js +73 -0
- package/dist/codec/frame.js.map +1 -0
- package/dist/codec/opcodes.d.ts +32 -0
- package/dist/codec/opcodes.js +509 -0
- package/dist/codec/opcodes.js.map +1 -0
- package/dist/codec/types.d.ts +13 -0
- package/dist/codec/types.js +2 -0
- package/dist/codec/types.js.map +1 -0
- package/dist/device/manager.d.ts +9 -0
- package/dist/device/manager.js +20 -0
- package/dist/device/manager.js.map +1 -0
- package/dist/device/session.d.ts +22 -0
- package/dist/device/session.js +37 -0
- package/dist/device/session.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/framing.d.ts +31 -0
- package/dist/mcp/framing.js +45 -0
- package/dist/mcp/framing.js.map +1 -0
- package/dist/mcp/ready.d.ts +31 -0
- package/dist/mcp/ready.js +71 -0
- package/dist/mcp/ready.js.map +1 -0
- package/dist/mcp/render.d.ts +3 -0
- package/dist/mcp/render.js +14 -0
- package/dist/mcp/render.js.map +1 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.js +49 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +12 -0
- package/dist/mcp/tools.js +580 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/transport/helper-process.d.ts +39 -0
- package/dist/transport/helper-process.js +140 -0
- package/dist/transport/helper-process.js.map +1 -0
- package/dist/transport/transport.d.ts +62 -0
- package/dist/transport/transport.js +8 -0
- package/dist/transport/transport.js.map +1 -0
- package/dist/transport/windows.d.ts +34 -0
- package/dist/transport/windows.js +68 -0
- package/dist/transport/windows.js.map +1 -0
- package/native/prebuilt/win32-x64/obsbot-helper.exe +0 -0
- package/package.json +33 -0
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { encodeSetRunStatus, encodePtzMoveAngle, encodePtzMoveSpeed, encodeRecenter, zoomRatioToUnits, encodeAiTrackSpeed, encodeAiTracking, encodeVendorProbe, encodeZoomWithSpeed, encodeFaceFocus, decodeStatus, encodeFov, encodeHdr, percentToRange, AI_FRAMING_MODES, AI_TRACK_SPEEDS, FOV_TYPES, UVC_XU_SELECTOR, CAMERA_CONTROL_PAN, CAMERA_CONTROL_TILT, CAMERA_CONTROL_FOCUS, CAMERA_CONTROL_EXPOSURE, VIDEO_PROCAMP_WHITE_BALANCE, IMAGE_CONTROL_PROP, IMAGE_CONTROLS, UVC_FLAG_AUTO, UVC_FLAG_MANUAL, } from "../codec/commands.js";
|
|
3
|
+
import { verifyFraming } from "./framing.js";
|
|
4
|
+
import { parseFrame } from "../codec/frame.js";
|
|
5
|
+
import { CameraBusyError } from "../transport/transport.js";
|
|
6
|
+
import { ensureReady } from "./ready.js";
|
|
7
|
+
import { CaptureError } from "../capture/manager.js";
|
|
8
|
+
const clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
9
|
+
// Some MCP clients serialize numbers and booleans as strings when the advertised
|
|
10
|
+
// inputSchema lacks type info. We now advertise a proper JSON Schema (see
|
|
11
|
+
// mcp/server.ts), but also accept string-encoded values defensively so the tools
|
|
12
|
+
// work with any client. Booleans are coerced EXPLICITLY — z.coerce.boolean()
|
|
13
|
+
// maps any non-empty string (including "false") to true, which would be a bug.
|
|
14
|
+
const num = () => z.preprocess((v) => (typeof v === "string" && v.trim() !== "" && !Number.isNaN(Number(v)) ? Number(v) : v), z.number());
|
|
15
|
+
const bool = () => z.preprocess((v) => (v === "true" ? true : v === "false" ? false : v), z.boolean());
|
|
16
|
+
const listDevicesSchema = z.object({});
|
|
17
|
+
const setRunStatusSchema = z.object({ state: z.enum(["run", "sleep"]) });
|
|
18
|
+
const ptzMoveAngleSchema = z.object({
|
|
19
|
+
yaw: num(),
|
|
20
|
+
pitch: num(),
|
|
21
|
+
roll: num().default(0),
|
|
22
|
+
});
|
|
23
|
+
const ptzMoveSpeedSchema = z.object({
|
|
24
|
+
yaw: num(),
|
|
25
|
+
pitch: num(),
|
|
26
|
+
roll: num().default(0),
|
|
27
|
+
autoStopMs: num().default(800),
|
|
28
|
+
});
|
|
29
|
+
const gimbalRecenterSchema = z.object({});
|
|
30
|
+
const zoomAbsoluteSchema = z.object({ ratio: num() });
|
|
31
|
+
const aiTrackingSchema = z.object({
|
|
32
|
+
enabled: bool(),
|
|
33
|
+
mode: z.enum(AI_FRAMING_MODES).default("normal"),
|
|
34
|
+
});
|
|
35
|
+
const aiTrackSpeedSchema = z.object({
|
|
36
|
+
speed: z.enum(AI_TRACK_SPEEDS),
|
|
37
|
+
});
|
|
38
|
+
const zoomSpeedSchema = z.object({
|
|
39
|
+
ratio: num(),
|
|
40
|
+
speed: num().default(0),
|
|
41
|
+
});
|
|
42
|
+
const faceFocusSchema = z.object({ enabled: bool() });
|
|
43
|
+
const getStatusSchema = z.object({});
|
|
44
|
+
// Generic RE/spelunking primitive: raw send-bytes / get-bytes on any XU selector,
|
|
45
|
+
// plus a `query` convenience that frames a table opcode and reads the reply.
|
|
46
|
+
const probeSchema = z.object({
|
|
47
|
+
mode: z.enum(["get", "set", "query"]),
|
|
48
|
+
selector: num().pipe(z.number().int().min(0).max(255)).optional(),
|
|
49
|
+
length: num().pipe(z.number().int().min(1).max(1024)).optional(),
|
|
50
|
+
hex: z.string().optional(), // raw bytes for mode "set"
|
|
51
|
+
opcode: z.string().optional(), // table opcode name for mode "query"
|
|
52
|
+
payloadHex: z.string().optional(), // nested payload for mode "query"
|
|
53
|
+
});
|
|
54
|
+
const fovSchema = z.object({ fov: z.enum(FOV_TYPES) });
|
|
55
|
+
const hdrSchema = z.object({ enabled: bool() });
|
|
56
|
+
const focusSchema = z.object({
|
|
57
|
+
mode: z.enum(["auto", "manual"]),
|
|
58
|
+
position: num().pipe(z.number().min(0).max(100)).default(50),
|
|
59
|
+
});
|
|
60
|
+
const whiteBalanceSchema = z.object({
|
|
61
|
+
mode: z.enum(["auto", "manual"]),
|
|
62
|
+
temperature: num().default(5000),
|
|
63
|
+
});
|
|
64
|
+
const imageControlSchema = z.object({
|
|
65
|
+
control: z.enum(IMAGE_CONTROLS),
|
|
66
|
+
level: num().pipe(z.number().min(0).max(100)),
|
|
67
|
+
});
|
|
68
|
+
const exposureSchema = z.object({
|
|
69
|
+
mode: z.enum(["auto", "manual"]),
|
|
70
|
+
level: num().pipe(z.number().min(0).max(100)).default(50),
|
|
71
|
+
});
|
|
72
|
+
const gimbalPositionSchema = z.object({});
|
|
73
|
+
const snapshotSchema = z.object({
|
|
74
|
+
maxDim: num().pipe(z.number().min(256).max(1920)).default(1024),
|
|
75
|
+
quality: num().pipe(z.number().min(1).max(100)).default(80),
|
|
76
|
+
settleMs: num().pipe(z.number().min(0).max(5000)).default(600),
|
|
77
|
+
source: z.enum(["device", "virtual", "ndi"]).default("device"),
|
|
78
|
+
});
|
|
79
|
+
const captureSourceEnum = z.enum(["device", "virtual", "ndi"]);
|
|
80
|
+
const recordStartSchema = z.object({
|
|
81
|
+
durationSec: num().pipe(z.number().positive()).optional(),
|
|
82
|
+
audio: bool().default(true),
|
|
83
|
+
outputPath: z.string().optional(),
|
|
84
|
+
source: captureSourceEnum.default("device"),
|
|
85
|
+
});
|
|
86
|
+
const previewStartSchema = z.object({ source: captureSourceEnum.default("device") });
|
|
87
|
+
const captureStopSchema = z.object({ sessionId: z.string() });
|
|
88
|
+
const captureListSchema = z.object({});
|
|
89
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
90
|
+
export function createTools(getTransport, mgr, capture, session, debug = false) {
|
|
91
|
+
// Readiness gate for gimbal/AI commands: probe presence + auto-wake if asleep,
|
|
92
|
+
// self-heal (invalidate + re-open) on a mid-session disconnect. Returns the
|
|
93
|
+
// ready transport or an { ok:false } error the handler passes straight through.
|
|
94
|
+
const gate = () => ensureReady(getTransport, session);
|
|
95
|
+
const needCapture = () => {
|
|
96
|
+
if (!capture)
|
|
97
|
+
throw new Error("capture manager not configured");
|
|
98
|
+
return capture;
|
|
99
|
+
};
|
|
100
|
+
const captureErrorText = (e) => {
|
|
101
|
+
if (e instanceof CaptureError)
|
|
102
|
+
return { content: [{ type: "text", text: e.message }] };
|
|
103
|
+
throw e;
|
|
104
|
+
};
|
|
105
|
+
const toolDefs = [
|
|
106
|
+
{
|
|
107
|
+
name: "obsbot_list_devices",
|
|
108
|
+
description: "List connected OBSBOT-compatible video capture devices.",
|
|
109
|
+
schema: listDevicesSchema,
|
|
110
|
+
handler: async (args) => {
|
|
111
|
+
listDevicesSchema.parse(args);
|
|
112
|
+
return { devices: await mgr.list() };
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "obsbot_set_run_status",
|
|
117
|
+
description: "Wake (\"run\") or sleep the camera/gimbal.",
|
|
118
|
+
schema: setRunStatusSchema,
|
|
119
|
+
handler: async (args) => {
|
|
120
|
+
const { state } = setRunStatusSchema.parse(args);
|
|
121
|
+
const t = await getTransport();
|
|
122
|
+
await t.sendVendor(encodeSetRunStatus(state).buildFrame(t.nextSeq()));
|
|
123
|
+
return { ok: true, state };
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "obsbot_ptz_move_angle",
|
|
128
|
+
description: "Move the gimbal to an absolute yaw/pitch angle (degrees); positive yaw pans to the " +
|
|
129
|
+
"camera's left, positive pitch tilts down. Yaw is clamped to [-150,150], pitch to " +
|
|
130
|
+
"[-90,90]. Absolute positioning (1:1 degrees), verified on hardware.",
|
|
131
|
+
schema: ptzMoveAngleSchema,
|
|
132
|
+
handler: async (args) => {
|
|
133
|
+
const parsed = ptzMoveAngleSchema.parse(args);
|
|
134
|
+
const yaw = clamp(parsed.yaw, -150, 150);
|
|
135
|
+
const pitch = clamp(parsed.pitch, -90, 90);
|
|
136
|
+
const roll = parsed.roll;
|
|
137
|
+
const ready = await gate();
|
|
138
|
+
if (!ready.ok)
|
|
139
|
+
return ready;
|
|
140
|
+
const t = ready.transport;
|
|
141
|
+
// Vendor gimbal frame AI_SET_GIM_MOTOR_DEG. The wire payload order is [roll, pitch,
|
|
142
|
+
// yaw] — see encodePtzMoveAngle / gimbal3. Absolute, 1:1 degrees, HW-confirmed. (The
|
|
143
|
+
// earlier UVC pan/tilt/roll experiment was abandoned: it's flaky on the OBSBOT
|
|
144
|
+
// DirectShow driver, so PTZ rides the vendor frame instead.)
|
|
145
|
+
await t.sendVendor(encodePtzMoveAngle(yaw, pitch, roll).buildFrame(t.nextSeq()));
|
|
146
|
+
return ready.reconnected ? { yaw, pitch, roll, reconnected: true } : { yaw, pitch, roll };
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "obsbot_ptz_move_speed",
|
|
151
|
+
description: "Drive the gimbal at a yaw/pitch speed (positive yaw pans to the camera's left, matching " +
|
|
152
|
+
"obsbot_ptz_move_angle), then automatically stop after autoStopMs (default 800ms) so it can't run away.",
|
|
153
|
+
schema: ptzMoveSpeedSchema,
|
|
154
|
+
handler: async (args) => {
|
|
155
|
+
const { yaw, pitch, roll, autoStopMs } = ptzMoveSpeedSchema.parse(args);
|
|
156
|
+
const ready = await gate();
|
|
157
|
+
if (!ready.ok)
|
|
158
|
+
return ready;
|
|
159
|
+
const t = ready.transport;
|
|
160
|
+
// Firmware velocity-yaw is inverted relative to position-yaw (AI_SET_GIM_SPEED +yaw
|
|
161
|
+
// drives right, AI_SET_GIM_MOTOR_DEG +yaw drives left — HW-observed). Negate so the
|
|
162
|
+
// tool contract is consistent: +yaw pans to the camera's left on both PTZ tools.
|
|
163
|
+
await t.sendVendor(encodePtzMoveSpeed(-yaw, pitch, roll).buildFrame(t.nextSeq()));
|
|
164
|
+
if (autoStopMs > 0) {
|
|
165
|
+
await sleep(autoStopMs);
|
|
166
|
+
await t.sendVendor(encodePtzMoveSpeed(0, 0, 0).buildFrame(t.nextSeq()));
|
|
167
|
+
}
|
|
168
|
+
return { ok: true, stopped: autoStopMs > 0, ...(ready.reconnected && { reconnected: true }) };
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "obsbot_gimbal_recenter",
|
|
173
|
+
description: "Recenter the gimbal.",
|
|
174
|
+
schema: gimbalRecenterSchema,
|
|
175
|
+
handler: async (args) => {
|
|
176
|
+
gimbalRecenterSchema.parse(args);
|
|
177
|
+
const ready = await gate();
|
|
178
|
+
if (!ready.ok)
|
|
179
|
+
return ready;
|
|
180
|
+
const t = ready.transport;
|
|
181
|
+
// Vendor recenter GIM_SET_MOTOR (0x00C3 + 6 zero bytes). HW-confirmed to recenter
|
|
182
|
+
// the gimbal.
|
|
183
|
+
await t.sendVendor(encodeRecenter().buildFrame(t.nextSeq()));
|
|
184
|
+
return { ok: true, ...(ready.reconnected && { reconnected: true }) };
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "obsbot_zoom_absolute",
|
|
189
|
+
description: "Set absolute zoom ratio, clamped to [1.0, 2.0].",
|
|
190
|
+
schema: zoomAbsoluteSchema,
|
|
191
|
+
handler: async (args) => {
|
|
192
|
+
const parsed = zoomAbsoluteSchema.parse(args);
|
|
193
|
+
const ratio = clamp(parsed.ratio, 1.0, 2.0);
|
|
194
|
+
const t = await getTransport();
|
|
195
|
+
const { min, max } = await t.zoomRange();
|
|
196
|
+
await t.zoomSet(zoomRatioToUnits(ratio, min, max));
|
|
197
|
+
return { ok: true, ratio };
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "obsbot_ai_tracking",
|
|
202
|
+
description: "Enable or disable AI subject tracking, and choose the framing sub-mode. When " +
|
|
203
|
+
"enabled the camera follows the subject; disabling stops tracking. `mode` forces " +
|
|
204
|
+
"the composition: normal | upper-body | close-up | headless | lower-body. After " +
|
|
205
|
+
"writing, the tool polls the status block until the framing settles and returns " +
|
|
206
|
+
"{ verified, matched } — the aiMode the device actually landed on (matched:false " +
|
|
207
|
+
"means no subject was being tracked, so the framing could not take effect yet).",
|
|
208
|
+
schema: aiTrackingSchema,
|
|
209
|
+
handler: async (args) => {
|
|
210
|
+
const { enabled, mode } = aiTrackingSchema.parse(args);
|
|
211
|
+
const ready = await gate();
|
|
212
|
+
if (!ready.ok)
|
|
213
|
+
return ready;
|
|
214
|
+
const t = ready.transport;
|
|
215
|
+
const readAiMode = async () => {
|
|
216
|
+
try {
|
|
217
|
+
return decodeStatus(await t.recvStatus()).aiMode;
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
return "unknown"; // transient read mid-switch — keep polling
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
// Snapshot the framing before the write so verify can tell a real change
|
|
224
|
+
// from the pre-write value (and skip the m=6 transient). See verifyFraming.
|
|
225
|
+
const before = await readAiMode();
|
|
226
|
+
// OBSBOT Center toggles tracking + framing with a raw uvcExt write to selector 6,
|
|
227
|
+
// NOT a framed V3 command (which the Tiny 2 ACKs but ignores). byte[3] is the
|
|
228
|
+
// framing sub-mode. See encodeAiTracking.
|
|
229
|
+
await t.xuRaw(UVC_XU_SELECTOR, encodeAiTracking(enabled, mode));
|
|
230
|
+
// Verify by readback: aiMode settles to (m=2, n=framing) after a brief m=6
|
|
231
|
+
// transient. want == the requested framing (or no-tracking on disable).
|
|
232
|
+
const want = enabled ? mode : "no-tracking";
|
|
233
|
+
const { verified, matched } = await verifyFraming(readAiMode, want, before);
|
|
234
|
+
return { ok: true, enabled, mode, verified, matched, ...(ready.reconnected && { reconnected: true }) };
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "obsbot_ai_track_speed",
|
|
239
|
+
description: "Set the AI tracking-speed preset (OBSBOT Center's Standard/Sport). " +
|
|
240
|
+
"speed: standard (slower follow) | sport (snappier follow).",
|
|
241
|
+
schema: aiTrackSpeedSchema,
|
|
242
|
+
handler: async (args) => {
|
|
243
|
+
const { speed } = aiTrackSpeedSchema.parse(args);
|
|
244
|
+
const t = await getTransport();
|
|
245
|
+
await t.sendVendor(encodeAiTrackSpeed(speed).buildFrame(t.nextSeq()));
|
|
246
|
+
return { ok: true, speed };
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "obsbot_zoom_speed",
|
|
251
|
+
description: "Zoom to an absolute ratio at a chosen speed. ratio is clamped to [1.0,2.0]; " +
|
|
252
|
+
"speed 0=device default, 1-10 slow→fast, 255=maximum.",
|
|
253
|
+
schema: zoomSpeedSchema,
|
|
254
|
+
handler: async (args) => {
|
|
255
|
+
const parsed = zoomSpeedSchema.parse(args);
|
|
256
|
+
const ratio = clamp(parsed.ratio, 1.0, 2.0);
|
|
257
|
+
const speed = clamp(Math.round(parsed.speed), 0, 255);
|
|
258
|
+
const t = await getTransport();
|
|
259
|
+
await t.sendVendor(encodeZoomWithSpeed(Math.round(ratio * 100), speed).buildFrame(t.nextSeq()));
|
|
260
|
+
return { ok: true, ratio, speed };
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "obsbot_face_focus",
|
|
265
|
+
description: "Enable or disable face-priority autofocus.",
|
|
266
|
+
schema: faceFocusSchema,
|
|
267
|
+
handler: async (args) => {
|
|
268
|
+
const { enabled } = faceFocusSchema.parse(args);
|
|
269
|
+
const t = await getTransport();
|
|
270
|
+
await t.sendVendor(encodeFaceFocus(enabled).buildFrame(t.nextSeq()));
|
|
271
|
+
return { ok: true, enabled };
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: "obsbot_get_status",
|
|
276
|
+
description: "Read the camera's live status block. Returns { awake, hdr, aiMode, trackSpeed }: " +
|
|
277
|
+
"aiMode is the current AI framing (no-tracking|normal|upper-body|close-up|headless|" +
|
|
278
|
+
"lower-body|desk|whiteboard|hand|group|unknown); trackSpeed is standard|sport|unknown. " +
|
|
279
|
+
"Under --debug the result also carries `raw`: the full 60-byte status block as hex " +
|
|
280
|
+
"(for reverse-engineering undecoded offsets).",
|
|
281
|
+
schema: getStatusSchema,
|
|
282
|
+
handler: async (args) => {
|
|
283
|
+
getStatusSchema.parse(args);
|
|
284
|
+
const t = await getTransport();
|
|
285
|
+
try {
|
|
286
|
+
const block = await t.recvStatus();
|
|
287
|
+
return { ok: true, ...decodeStatus(block), ...(debug ? { raw: block.toString("hex") } : {}) };
|
|
288
|
+
}
|
|
289
|
+
catch (e) {
|
|
290
|
+
return { ok: false, error: `could not read camera status: ${e.message}` };
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "obsbot_probe",
|
|
296
|
+
description: "RE/diagnostics only — generic XU byte access for reverse-engineering the feedback surface. " +
|
|
297
|
+
"mode 'get': GET_CUR read `length` bytes from XU `selector` (default selector 6; use a large " +
|
|
298
|
+
"length to probe the status block's true size, or sweep other selectors). " +
|
|
299
|
+
"mode 'set': SET_CUR write raw `hex` bytes to XU `selector` (e.g. replay a captured frame). " +
|
|
300
|
+
"mode 'query': frame table `opcode` (default AI_GET_QUICK_STATUS) with optional `payloadHex`, " +
|
|
301
|
+
"send on the vendor selector, then read the reply frame. Returns raw hex. Not for normal use.",
|
|
302
|
+
schema: probeSchema,
|
|
303
|
+
handler: async (args) => {
|
|
304
|
+
const { mode, selector, length, hex, opcode, payloadHex } = probeSchema.parse(args);
|
|
305
|
+
const t = await getTransport();
|
|
306
|
+
try {
|
|
307
|
+
if (mode === "get") {
|
|
308
|
+
const sel = selector ?? 0x06;
|
|
309
|
+
const block = await t.xuGetRaw(sel, length ?? 128);
|
|
310
|
+
return { ok: true, selector: sel, len: block.length, raw: block.toString("hex") };
|
|
311
|
+
}
|
|
312
|
+
if (mode === "set") {
|
|
313
|
+
if (selector === undefined || !hex) {
|
|
314
|
+
return { ok: false, error: "mode 'set' requires selector and hex" };
|
|
315
|
+
}
|
|
316
|
+
await t.xuRaw(selector, Buffer.from(hex, "hex"));
|
|
317
|
+
return { ok: true, selector, sent: hex };
|
|
318
|
+
}
|
|
319
|
+
// mode "query": build a framed V3 command, send it, read the reply frame.
|
|
320
|
+
const payload = payloadHex ? Buffer.from(payloadHex, "hex") : Buffer.alloc(0);
|
|
321
|
+
const name = opcode ?? "AI_GET_QUICK_STATUS";
|
|
322
|
+
const frame = encodeVendorProbe(name, payload).buildFrame(t.nextSeq());
|
|
323
|
+
const reply = await t.recvVendor(frame, length ?? 60);
|
|
324
|
+
let parsed;
|
|
325
|
+
try {
|
|
326
|
+
const p = parseFrame(reply);
|
|
327
|
+
parsed = {
|
|
328
|
+
cmd: "0x" + p.cmd.toString(16).padStart(4, "0"),
|
|
329
|
+
receiver: p.receiver,
|
|
330
|
+
payloadHex: p.payload.toString("hex"),
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
catch (e) {
|
|
334
|
+
parsed = { parseError: e.message };
|
|
335
|
+
}
|
|
336
|
+
return {
|
|
337
|
+
ok: true,
|
|
338
|
+
opcode: name,
|
|
339
|
+
sentFrame: frame.toString("hex"),
|
|
340
|
+
replyHex: reply.toString("hex"),
|
|
341
|
+
parsed,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
catch (e) {
|
|
345
|
+
return { ok: false, error: e.message };
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: "obsbot_fov",
|
|
351
|
+
description: "Set the field of view. fov: wide (86°) | medium (78°) | narrow (65°).",
|
|
352
|
+
schema: fovSchema,
|
|
353
|
+
handler: async (args) => {
|
|
354
|
+
const { fov } = fovSchema.parse(args);
|
|
355
|
+
const t = await getTransport();
|
|
356
|
+
await t.xuRaw(UVC_XU_SELECTOR, encodeFov(fov));
|
|
357
|
+
return { ok: true, fov };
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: "obsbot_hdr",
|
|
362
|
+
description: "Toggle HDR/WDR imaging on or off.",
|
|
363
|
+
schema: hdrSchema,
|
|
364
|
+
handler: async (args) => {
|
|
365
|
+
const { enabled } = hdrSchema.parse(args);
|
|
366
|
+
const t = await getTransport();
|
|
367
|
+
await t.xuRaw(UVC_XU_SELECTOR, encodeHdr(enabled));
|
|
368
|
+
return { ok: true, enabled };
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
name: "obsbot_focus",
|
|
373
|
+
description: "Set focus. mode 'auto' enables continuous autofocus; mode 'manual' sets the " +
|
|
374
|
+
"focus motor to position (0-100, near→far), mapped onto the device range.",
|
|
375
|
+
schema: focusSchema,
|
|
376
|
+
handler: async (args) => {
|
|
377
|
+
const { mode, position } = focusSchema.parse(args);
|
|
378
|
+
const t = await getTransport();
|
|
379
|
+
if (mode === "auto") {
|
|
380
|
+
await t.camCtrlSet(CAMERA_CONTROL_FOCUS, 0, UVC_FLAG_AUTO);
|
|
381
|
+
return { ok: true, mode };
|
|
382
|
+
}
|
|
383
|
+
const { min, max } = await t.camCtrlRange(CAMERA_CONTROL_FOCUS);
|
|
384
|
+
const value = percentToRange(position, min, max);
|
|
385
|
+
await t.camCtrlSet(CAMERA_CONTROL_FOCUS, value, UVC_FLAG_MANUAL);
|
|
386
|
+
return { ok: true, mode, position, value };
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: "obsbot_gimbal_position",
|
|
391
|
+
description: "Read the gimbal's current absolute yaw/pitch in degrees (positive yaw = camera's " +
|
|
392
|
+
"left, positive pitch = down) via the standard UVC Pan/Tilt controls. Reports the " +
|
|
393
|
+
"actual position, which may lag a move that is still in progress.",
|
|
394
|
+
schema: gimbalPositionSchema,
|
|
395
|
+
handler: async (args) => {
|
|
396
|
+
gimbalPositionSchema.parse(args);
|
|
397
|
+
const t = await getTransport();
|
|
398
|
+
const pan = await t.camCtrlGet(CAMERA_CONTROL_PAN);
|
|
399
|
+
const tilt = await t.camCtrlGet(CAMERA_CONTROL_TILT);
|
|
400
|
+
// UVC pan value is degrees, same sign as our yaw (+ = camera-left). UVC tilt
|
|
401
|
+
// is degrees but positive = up, so negate to match our +pitch = down convention.
|
|
402
|
+
return { yaw: pan.value, pitch: -tilt.value };
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
name: "obsbot_white_balance",
|
|
407
|
+
description: "Set white balance. mode 'auto' enables auto white balance; mode 'manual' sets a " +
|
|
408
|
+
"colour temperature in Kelvin (clamped to the device's supported range).",
|
|
409
|
+
schema: whiteBalanceSchema,
|
|
410
|
+
handler: async (args) => {
|
|
411
|
+
const { mode, temperature } = whiteBalanceSchema.parse(args);
|
|
412
|
+
const t = await getTransport();
|
|
413
|
+
const { min, max } = await t.procAmpRange(VIDEO_PROCAMP_WHITE_BALANCE);
|
|
414
|
+
if (mode === "auto") {
|
|
415
|
+
await t.procAmpSet(VIDEO_PROCAMP_WHITE_BALANCE, min, UVC_FLAG_AUTO);
|
|
416
|
+
return { ok: true, mode };
|
|
417
|
+
}
|
|
418
|
+
const value = clamp(Math.round(temperature), min, max);
|
|
419
|
+
await t.procAmpSet(VIDEO_PROCAMP_WHITE_BALANCE, value, UVC_FLAG_MANUAL);
|
|
420
|
+
return { ok: true, mode, temperature: value };
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
name: "obsbot_image_control",
|
|
425
|
+
description: "Adjust a standard image control: control is brightness | contrast | hue | " +
|
|
426
|
+
"saturation | sharpness | gain | backlight-compensation; level 0-100 is mapped onto " +
|
|
427
|
+
"the device's supported range for that control. Standard UVC (IAMVideoProcAmp), no auto.",
|
|
428
|
+
schema: imageControlSchema,
|
|
429
|
+
handler: async (args) => {
|
|
430
|
+
const { control, level } = imageControlSchema.parse(args);
|
|
431
|
+
const property = IMAGE_CONTROL_PROP[control];
|
|
432
|
+
const t = await getTransport();
|
|
433
|
+
const { min, max } = await t.procAmpRange(property);
|
|
434
|
+
const value = percentToRange(level, min, max);
|
|
435
|
+
await t.procAmpSet(property, value, UVC_FLAG_MANUAL);
|
|
436
|
+
return { ok: true, control, level, value };
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
name: "obsbot_exposure",
|
|
441
|
+
description: "Set exposure. mode 'auto' enables auto-exposure; mode 'manual' sets level 0-100 " +
|
|
442
|
+
"(0 darkest → 100 brightest), mapped onto the device's exposure range. Standard UVC " +
|
|
443
|
+
"(IAMCameraControl).",
|
|
444
|
+
schema: exposureSchema,
|
|
445
|
+
handler: async (args) => {
|
|
446
|
+
const { mode, level } = exposureSchema.parse(args);
|
|
447
|
+
const t = await getTransport();
|
|
448
|
+
if (mode === "auto") {
|
|
449
|
+
await t.camCtrlSet(CAMERA_CONTROL_EXPOSURE, 0, UVC_FLAG_AUTO);
|
|
450
|
+
return { ok: true, mode };
|
|
451
|
+
}
|
|
452
|
+
const { min, max } = await t.camCtrlRange(CAMERA_CONTROL_EXPOSURE);
|
|
453
|
+
const value = percentToRange(level, min, max);
|
|
454
|
+
await t.camCtrlSet(CAMERA_CONTROL_EXPOSURE, value, UVC_FLAG_MANUAL);
|
|
455
|
+
return { ok: true, mode, level, value };
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "obsbot_snapshot",
|
|
460
|
+
description: "Grab one still frame from the camera and return it as an image (for you to see " +
|
|
461
|
+
"and for framing/lighting/exposure checks). source: device (default) | virtual | ndi. " +
|
|
462
|
+
"If the camera is in use by another app, returns a message instead of an image.",
|
|
463
|
+
schema: snapshotSchema,
|
|
464
|
+
handler: async (args) => {
|
|
465
|
+
const { maxDim, quality, settleMs, source } = snapshotSchema.parse(args);
|
|
466
|
+
const t = await getTransport();
|
|
467
|
+
let path;
|
|
468
|
+
if (source !== "device") {
|
|
469
|
+
const devices = await mgr.list();
|
|
470
|
+
const re = source === "virtual" ? /OBSBOT Virtual Camera/i : /NDI Webcam/i;
|
|
471
|
+
const match = devices.find((d) => re.test(d.name));
|
|
472
|
+
if (!match) {
|
|
473
|
+
return {
|
|
474
|
+
content: [
|
|
475
|
+
{
|
|
476
|
+
type: "text",
|
|
477
|
+
text: `No '${source}' video source found (is OBSBOT Center / NDI running?).`,
|
|
478
|
+
},
|
|
479
|
+
],
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
path = match.path;
|
|
483
|
+
}
|
|
484
|
+
try {
|
|
485
|
+
const snap = await t.snapshot({ path, maxDim, quality, settleMs });
|
|
486
|
+
return {
|
|
487
|
+
content: [
|
|
488
|
+
{ type: "image", data: snap.base64, mimeType: snap.mime },
|
|
489
|
+
{
|
|
490
|
+
type: "text",
|
|
491
|
+
text: JSON.stringify({ width: snap.width, height: snap.height, source }),
|
|
492
|
+
},
|
|
493
|
+
],
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
catch (e) {
|
|
497
|
+
if (e instanceof CameraBusyError) {
|
|
498
|
+
return {
|
|
499
|
+
content: [
|
|
500
|
+
{
|
|
501
|
+
type: "text",
|
|
502
|
+
text: "Camera is in use by another application. Close it (or try source:'virtual' " +
|
|
503
|
+
"or 'ndi' if OBSBOT Center is running), then retry.",
|
|
504
|
+
},
|
|
505
|
+
],
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
throw e;
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
name: "obsbot_record_start",
|
|
514
|
+
description: "Start recording the camera to an MP4 (for the user). durationSec optional (open-ended " +
|
|
515
|
+
"recordings auto-stop after 60 min); audio defaults to on (the OBSBOT mic); outputPath " +
|
|
516
|
+
"optional (defaults under Videos\\OBSBOT). source: device|virtual|ndi. Returns a sessionId " +
|
|
517
|
+
"for obsbot_capture_stop.",
|
|
518
|
+
schema: recordStartSchema,
|
|
519
|
+
handler: async (args) => {
|
|
520
|
+
const parsed = recordStartSchema.parse(args);
|
|
521
|
+
try {
|
|
522
|
+
const s = await needCapture().startRecord({
|
|
523
|
+
source: parsed.source, durationSec: parsed.durationSec,
|
|
524
|
+
audio: parsed.audio, outputPath: parsed.outputPath,
|
|
525
|
+
});
|
|
526
|
+
return { ok: true, sessionId: s.id, outputPath: s.outputPath, durationSec: s.durationSec };
|
|
527
|
+
}
|
|
528
|
+
catch (e) {
|
|
529
|
+
return captureErrorText(e);
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
name: "obsbot_preview_start",
|
|
535
|
+
description: "Open a live preview window of the camera (for the user to watch). source: device|virtual|ndi. " +
|
|
536
|
+
"Returns a sessionId for obsbot_capture_stop.",
|
|
537
|
+
schema: previewStartSchema,
|
|
538
|
+
handler: async (args) => {
|
|
539
|
+
const { source } = previewStartSchema.parse(args);
|
|
540
|
+
try {
|
|
541
|
+
const s = await needCapture().startPreview({ source });
|
|
542
|
+
return { ok: true, sessionId: s.id };
|
|
543
|
+
}
|
|
544
|
+
catch (e) {
|
|
545
|
+
return captureErrorText(e);
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
name: "obsbot_capture_stop",
|
|
551
|
+
description: "Stop a recording or preview session by its sessionId. Recordings are stopped gracefully so " +
|
|
552
|
+
"the MP4 finalizes correctly.",
|
|
553
|
+
schema: captureStopSchema,
|
|
554
|
+
handler: async (args) => {
|
|
555
|
+
const { sessionId } = captureStopSchema.parse(args);
|
|
556
|
+
try {
|
|
557
|
+
const r = await needCapture().stop(sessionId);
|
|
558
|
+
return { ok: true, ...r };
|
|
559
|
+
}
|
|
560
|
+
catch (e) {
|
|
561
|
+
return captureErrorText(e);
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
name: "obsbot_capture_list",
|
|
567
|
+
description: "List active recording/preview sessions (id, kind, source, output path, start time).",
|
|
568
|
+
schema: captureListSchema,
|
|
569
|
+
handler: async (args) => {
|
|
570
|
+
captureListSchema.parse(args);
|
|
571
|
+
return { sessions: needCapture().list() };
|
|
572
|
+
},
|
|
573
|
+
},
|
|
574
|
+
];
|
|
575
|
+
// obsbot_probe is an RE/diagnostics-only tool (raw XU byte access); expose it only
|
|
576
|
+
// under --debug so normal deployments don't advertise it. get_status's raw block is
|
|
577
|
+
// gated the same way, inside its handler.
|
|
578
|
+
return debug ? toolDefs : toolDefs.filter((t) => t.name !== "obsbot_probe");
|
|
579
|
+
}
|
|
580
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,SAAS,EACT,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,EAClB,cAAc,EACd,aAAa,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