creavit-studio-mcp 1.3.0 → 1.3.1
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/package.json +1 -1
- package/src/bridgeClient.mjs +3 -0
- package/src/tools/index.mjs +2 -0
- package/src/tools/inputTools.mjs +134 -0
package/package.json
CHANGED
package/src/bridgeClient.mjs
CHANGED
|
@@ -12,6 +12,9 @@ import { ensureAppRunning, isAutoLaunchEnabled } from "./appLauncher.mjs";
|
|
|
12
12
|
const DEFAULT_ENDPOINT_DIRS = [
|
|
13
13
|
path.join(os.homedir(), "Library", "Application Support", "creavit-studio"),
|
|
14
14
|
path.join(os.homedir(), "Library", "Application Support", "Creavit Studio"),
|
|
15
|
+
// `npm run electron:dev` paketlenmemiş çalıştığı için userData "Electron"
|
|
16
|
+
// altına düşer. Bu olmadan MCP dev build'i hiç göremez.
|
|
17
|
+
path.join(os.homedir(), "Library", "Application Support", "Electron"),
|
|
15
18
|
];
|
|
16
19
|
|
|
17
20
|
export class BridgeUnavailableError extends Error {
|
package/src/tools/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import { editorTools } from "./editorTools.mjs";
|
|
|
5
5
|
import { motionTools } from "./motionTools.mjs";
|
|
6
6
|
import { systemTools } from "./systemTools.mjs";
|
|
7
7
|
import { browserTools } from "./browserTools.mjs";
|
|
8
|
+
import { inputTools } from "./inputTools.mjs";
|
|
8
9
|
import { escapeTools } from "./escapeTools.mjs";
|
|
9
10
|
import { errorResult } from "./defineTool.mjs";
|
|
10
11
|
import { BridgeUnavailableError } from "../bridgeClient.mjs";
|
|
@@ -19,6 +20,7 @@ function buildRegistry() {
|
|
|
19
20
|
...editorTools(),
|
|
20
21
|
...motionTools(),
|
|
21
22
|
...browserTools(),
|
|
23
|
+
...inputTools(),
|
|
22
24
|
...escapeTools(),
|
|
23
25
|
];
|
|
24
26
|
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// MCP araçları — sistem faresi ve klavyesi.
|
|
2
|
+
// browser_* araçlarından farkı: izole capture penceresine bağlı değiller,
|
|
3
|
+
// ekrandaki herhangi bir uygulamayı sürerler.
|
|
4
|
+
|
|
5
|
+
import { bridgeTool, schema, S } from "./defineTool.mjs";
|
|
6
|
+
|
|
7
|
+
const STEP_SCHEMA = S.object(
|
|
8
|
+
"One step: {action:'move',x,y,durationMs} | {action:'click',clickCount} | {action:'down'|'up'} | {action:'type',text,perCharMs} | {action:'key',key,modifiers} | {action:'wait',ms}",
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export function inputTools() {
|
|
12
|
+
return [
|
|
13
|
+
bridgeTool({
|
|
14
|
+
name: "creavit_input_click",
|
|
15
|
+
command: "input.click",
|
|
16
|
+
description:
|
|
17
|
+
"Moves the real system mouse to a screen coordinate and clicks. For a point inside a window use creavit_input_window_click instead — it does the coordinate math for you.",
|
|
18
|
+
inputSchema: schema(
|
|
19
|
+
{
|
|
20
|
+
x: S.number("Screen X"),
|
|
21
|
+
y: S.number("Screen Y"),
|
|
22
|
+
durationMs: S.number("Travel time for the move (default 450)"),
|
|
23
|
+
clickCount: S.number("1 = click, 2 = double-click"),
|
|
24
|
+
},
|
|
25
|
+
["x", "y"],
|
|
26
|
+
),
|
|
27
|
+
timeoutMs: 30_000,
|
|
28
|
+
}),
|
|
29
|
+
|
|
30
|
+
bridgeTool({
|
|
31
|
+
name: "creavit_input_move",
|
|
32
|
+
command: "input.moveMouse",
|
|
33
|
+
description: "Moves the real system mouse to a screen coordinate, without clicking.",
|
|
34
|
+
inputSchema: schema(
|
|
35
|
+
{
|
|
36
|
+
x: S.number("Screen X"),
|
|
37
|
+
y: S.number("Screen Y"),
|
|
38
|
+
durationMs: S.number("Travel time (default 450)"),
|
|
39
|
+
},
|
|
40
|
+
["x", "y"],
|
|
41
|
+
),
|
|
42
|
+
timeoutMs: 30_000,
|
|
43
|
+
}),
|
|
44
|
+
|
|
45
|
+
bridgeTool({
|
|
46
|
+
name: "creavit_input_window_click",
|
|
47
|
+
command: "input.windowClick",
|
|
48
|
+
description:
|
|
49
|
+
"Clicks inside a window from creavit_devices_list, using window-relative coordinates (or 0-1 with normalized:true). Brings the window's owner app to the front first — this is the click to use while recording a window.",
|
|
50
|
+
inputSchema: schema(
|
|
51
|
+
{
|
|
52
|
+
windowId: S.number("Window id from creavit_devices_list"),
|
|
53
|
+
x: S.number("Window-relative X (px, or 0-1 when normalized)"),
|
|
54
|
+
y: S.number("Window-relative Y"),
|
|
55
|
+
normalized: S.bool("Treat x/y as 0-1 fractions of the window (default false)"),
|
|
56
|
+
durationMs: S.number("Travel time (default 450)"),
|
|
57
|
+
clickCount: S.number("1 = click, 2 = double-click"),
|
|
58
|
+
activate: S.bool("Bring the owner app to the front first (default true)"),
|
|
59
|
+
},
|
|
60
|
+
["windowId", "x", "y"],
|
|
61
|
+
),
|
|
62
|
+
timeoutMs: 60_000,
|
|
63
|
+
}),
|
|
64
|
+
|
|
65
|
+
bridgeTool({
|
|
66
|
+
name: "creavit_input_type",
|
|
67
|
+
command: "input.type",
|
|
68
|
+
description:
|
|
69
|
+
"Types text into whatever is focused. Click the field first. perCharMs types character by character, which looks natural in a recording.",
|
|
70
|
+
inputSchema: schema(
|
|
71
|
+
{
|
|
72
|
+
text: S.string("Text to type (UTF-8; Turkish characters are fine)"),
|
|
73
|
+
perCharMs: S.number("Delay per character, 0 = all at once (default 0)"),
|
|
74
|
+
pressEnter: S.bool("Press Return afterwards (default false)"),
|
|
75
|
+
},
|
|
76
|
+
["text"],
|
|
77
|
+
),
|
|
78
|
+
timeoutMs: 120_000,
|
|
79
|
+
}),
|
|
80
|
+
|
|
81
|
+
bridgeTool({
|
|
82
|
+
name: "creavit_input_key",
|
|
83
|
+
command: "input.key",
|
|
84
|
+
description:
|
|
85
|
+
"Presses a single key with optional modifiers. Keys: return, tab, space, delete, escape, left/right/up/down, home, end, pageup, pagedown. Modifiers: cmd, shift, alt, ctrl.",
|
|
86
|
+
inputSchema: schema(
|
|
87
|
+
{
|
|
88
|
+
key: S.string("Key name"),
|
|
89
|
+
modifiers: S.array("Modifiers held down", S.string("cmd|shift|alt|ctrl")),
|
|
90
|
+
},
|
|
91
|
+
["key"],
|
|
92
|
+
),
|
|
93
|
+
timeoutMs: 30_000,
|
|
94
|
+
}),
|
|
95
|
+
|
|
96
|
+
bridgeTool({
|
|
97
|
+
name: "creavit_record_walkthrough",
|
|
98
|
+
command: "recording.walkthrough",
|
|
99
|
+
description:
|
|
100
|
+
"Records a walkthrough in ONE call: starts recording, runs the input steps, stops. USE THIS to record an interaction — the recorded length is leadMs + steps + tailMs and nothing else. Driving it by hand (start, then sequence, then stop) adds your own round-trip time to the video; measured, an 8.7s scenario became a 22.5s recording. With sourceType 'window' the step coordinates are window-relative by default.",
|
|
101
|
+
inputSchema: schema(
|
|
102
|
+
{
|
|
103
|
+
options: S.object(
|
|
104
|
+
"Recording options, same as creavit_recording_start: {sourceType:'display'|'window'|'area', sourceId, cameraEnabled, micEnabled, systemAudioEnabled, area}",
|
|
105
|
+
),
|
|
106
|
+
steps: S.array("Input steps, executed in order", STEP_SCHEMA),
|
|
107
|
+
leadMs: S.number("Idle time before the first step (default 800)"),
|
|
108
|
+
tailMs: S.number("Idle time after the last step (default 1200)"),
|
|
109
|
+
normalized: S.bool("Treat move x/y as 0-1 fractions of the window (default false)"),
|
|
110
|
+
windowRelative: S.bool("Step coordinates are window-relative (default true for window recordings)"),
|
|
111
|
+
},
|
|
112
|
+
["options", "steps"],
|
|
113
|
+
),
|
|
114
|
+
timeoutMs: 900_000,
|
|
115
|
+
}),
|
|
116
|
+
|
|
117
|
+
bridgeTool({
|
|
118
|
+
name: "creavit_input_sequence",
|
|
119
|
+
command: "input.sequence",
|
|
120
|
+
description:
|
|
121
|
+
"Runs a whole input scenario inside the app in ONE native process, so its wall-clock duration is exactly what you asked for. USE THIS WHILE RECORDING — driving a recording with separate click/type calls adds each round-trip to the recorded video. Pass windowId to write move steps in window-relative coordinates.",
|
|
122
|
+
inputSchema: schema(
|
|
123
|
+
{
|
|
124
|
+
steps: S.array("Steps, executed in order", STEP_SCHEMA),
|
|
125
|
+
windowId: S.number("Window id — makes move steps window-relative"),
|
|
126
|
+
normalized: S.bool("Treat move x/y as 0-1 fractions of the window (default false)"),
|
|
127
|
+
activate: S.bool("Bring the owner app to the front first (default true)"),
|
|
128
|
+
},
|
|
129
|
+
["steps"],
|
|
130
|
+
),
|
|
131
|
+
timeoutMs: 600_000,
|
|
132
|
+
}),
|
|
133
|
+
];
|
|
134
|
+
}
|