creavit-studio-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.
@@ -0,0 +1,104 @@
1
+ // MCP araçları — uygulama durumu, kayıt akışı, cihazlar ve olay akışı.
2
+
3
+ import { bridgeTool, schema, S, textResult } from "./defineTool.mjs";
4
+ import { callCommand } from "../bridgeClient.mjs";
5
+
6
+ export function systemTools() {
7
+ return [
8
+ bridgeTool({
9
+ name: "creavit_app_info",
10
+ description:
11
+ "Returns app state: version, open windows, agent-connected renderers, project folder path, recording state. Start every session with this — confirm the app is running and see which windows are open.",
12
+ command: "app.info",
13
+ inputSchema: schema(),
14
+ }),
15
+
16
+ bridgeTool({
17
+ name: "creavit_app_window",
18
+ command: "app.focusWindow",
19
+ description:
20
+ "Brings an app window to the front and focuses it. Get window IDs from creavit_app_info.",
21
+ inputSchema: schema({ windowId: S.number("Window ID") }, ["windowId"]),
22
+ }),
23
+
24
+ bridgeTool({
25
+ name: "creavit_devices_list",
26
+ command: "devices.list",
27
+ description:
28
+ "Lists recording sources: displays, windows, cameras, audio input devices. The IDs required by creavit_recording_start come from here.",
29
+ inputSchema: schema({
30
+ kinds: S.array("Which kinds to fetch: screens, windows, cameras, audio (default: all)", {
31
+ type: "string",
32
+ enum: ["screens", "windows", "cameras", "audio"],
33
+ }),
34
+ }),
35
+ timeoutMs: 60_000,
36
+ }),
37
+
38
+ bridgeTool({
39
+ name: "creavit_recording_status",
40
+ command: "recording.status",
41
+ description: "Whether a recording is in progress, and which devices are selected.",
42
+ inputSchema: schema(),
43
+ }),
44
+
45
+ bridgeTool({
46
+ name: "creavit_recording_start",
47
+ command: "recording.start",
48
+ description:
49
+ "Starts a screen recording. Get source IDs from creavit_devices_list first. Monitor with creavit_recording_status, and finish with creavit_recording_stop.",
50
+ inputSchema: schema({
51
+ options: S.object(
52
+ "Recording options: {sourceType:'display'|'window'|'area', sourceId, cameraEnabled, micEnabled, systemAudioEnabled, delayMs, area:{x,y,width,height}}",
53
+ ),
54
+ }),
55
+ timeoutMs: 180_000,
56
+ mapParams: (args) => ({ options: args.options || {} }),
57
+ }),
58
+
59
+ bridgeTool({
60
+ name: "creavit_recording_stop",
61
+ command: "recording.stop",
62
+ description:
63
+ "Stops the recording. Processing can take a few minutes; the editor opens automatically when it finishes. Track progress with creavit_events (watch for recording.stopped and project.loaded).",
64
+ inputSchema: schema(),
65
+ timeoutMs: 600_000,
66
+ }),
67
+
68
+ bridgeTool({
69
+ name: "creavit_permissions",
70
+ command: "permissions.check",
71
+ description:
72
+ "Returns macOS screen recording / camera / microphone permission states. Check here first when recording fails to start.",
73
+ inputSchema: schema(),
74
+ }),
75
+
76
+ bridgeTool({
77
+ name: "creavit_events",
78
+ command: "events.tail",
79
+ description:
80
+ "Reads the app event stream: recording and export lifecycle, project loads, errors. To follow a long operation, call repeatedly passing `since` set to the highest seq you have already seen.",
81
+ inputSchema: schema({
82
+ since: S.number("Return events after this seq number (use 0 on the first call)"),
83
+ limit: S.number("Maximum events to return (default 200)"),
84
+ }),
85
+ }),
86
+
87
+ {
88
+ name: "creavit_app_mode",
89
+ description:
90
+ "Switches the app between recording mode and an empty editor. To open a specific project, use creavit_project_open instead.",
91
+ inputSchema: schema(
92
+ { mode: S.string("record or editor", { enum: ["record", "editor"] }) },
93
+ ["mode"],
94
+ ),
95
+ run: async ({ mode }) => {
96
+ if (mode !== "record" && mode !== "editor") {
97
+ throw new Error("`mode` must be either 'record' or 'editor'");
98
+ }
99
+ const command = mode === "record" ? "app.openRecordMode" : "app.openEditor";
100
+ return textResult(await callCommand(command, {}, 60_000));
101
+ },
102
+ },
103
+ ];
104
+ }