@sajou/mcp-server 0.6.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 +78 -0
- package/dist/app.d.ts +32 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +76 -0
- package/dist/app.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/transport.d.ts +18 -0
- package/dist/mcp/transport.d.ts.map +1 -0
- package/dist/mcp/transport.js +56 -0
- package/dist/mcp/transport.js.map +1 -0
- package/dist/middleware.d.ts +14 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +14 -0
- package/dist/middleware.js.map +1 -0
- package/dist/routes/discovery.d.ts +8 -0
- package/dist/routes/discovery.d.ts.map +1 -0
- package/dist/routes/discovery.js +155 -0
- package/dist/routes/discovery.js.map +1 -0
- package/dist/routes/proxy.d.ts +10 -0
- package/dist/routes/proxy.d.ts.map +1 -0
- package/dist/routes/proxy.js +84 -0
- package/dist/routes/proxy.js.map +1 -0
- package/dist/routes/scene.d.ts +10 -0
- package/dist/routes/scene.d.ts.map +1 -0
- package/dist/routes/scene.js +298 -0
- package/dist/routes/scene.js.map +1 -0
- package/dist/routes/signals.d.ts +12 -0
- package/dist/routes/signals.d.ts.map +1 -0
- package/dist/routes/signals.js +61 -0
- package/dist/routes/signals.js.map +1 -0
- package/dist/routes/tap.d.ts +10 -0
- package/dist/routes/tap.d.ts.map +1 -0
- package/dist/routes/tap.js +115 -0
- package/dist/routes/tap.js.map +1 -0
- package/dist/server.d.ts +12 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +103 -0
- package/dist/server.js.map +1 -0
- package/dist/state/mutations.d.ts +53 -0
- package/dist/state/mutations.d.ts.map +1 -0
- package/dist/state/mutations.js +409 -0
- package/dist/state/mutations.js.map +1 -0
- package/dist/state/store.d.ts +51 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/store.js +149 -0
- package/dist/state/store.js.map +1 -0
- package/dist/tools/create-binding.d.ts +45 -0
- package/dist/tools/create-binding.d.ts.map +1 -0
- package/dist/tools/create-binding.js +82 -0
- package/dist/tools/create-binding.js.map +1 -0
- package/dist/tools/create-choreography.d.ts +76 -0
- package/dist/tools/create-choreography.d.ts.map +1 -0
- package/dist/tools/create-choreography.js +118 -0
- package/dist/tools/create-choreography.js.map +1 -0
- package/dist/tools/create-shader.d.ts +117 -0
- package/dist/tools/create-shader.d.ts.map +1 -0
- package/dist/tools/create-shader.js +150 -0
- package/dist/tools/create-shader.js.map +1 -0
- package/dist/tools/create-sketch.d.ts +96 -0
- package/dist/tools/create-sketch.d.ts.map +1 -0
- package/dist/tools/create-sketch.js +130 -0
- package/dist/tools/create-sketch.js.map +1 -0
- package/dist/tools/create-wire.d.ts +32 -0
- package/dist/tools/create-wire.d.ts.map +1 -0
- package/dist/tools/create-wire.js +84 -0
- package/dist/tools/create-wire.js.map +1 -0
- package/dist/tools/describe-scene.d.ts +22 -0
- package/dist/tools/describe-scene.d.ts.map +1 -0
- package/dist/tools/describe-scene.js +194 -0
- package/dist/tools/describe-scene.js.map +1 -0
- package/dist/tools/emit-signal.d.ts +36 -0
- package/dist/tools/emit-signal.d.ts.map +1 -0
- package/dist/tools/emit-signal.js +60 -0
- package/dist/tools/emit-signal.js.map +1 -0
- package/dist/tools/get-catalog.d.ts +27 -0
- package/dist/tools/get-catalog.d.ts.map +1 -0
- package/dist/tools/get-catalog.js +37 -0
- package/dist/tools/get-catalog.js.map +1 -0
- package/dist/tools/get-choreographies.d.ts +21 -0
- package/dist/tools/get-choreographies.d.ts.map +1 -0
- package/dist/tools/get-choreographies.js +70 -0
- package/dist/tools/get-choreographies.js.map +1 -0
- package/dist/tools/get-scene-state.d.ts +21 -0
- package/dist/tools/get-scene-state.d.ts.map +1 -0
- package/dist/tools/get-scene-state.js +48 -0
- package/dist/tools/get-scene-state.js.map +1 -0
- package/dist/tools/get-shaders.d.ts +16 -0
- package/dist/tools/get-shaders.d.ts.map +1 -0
- package/dist/tools/get-shaders.js +38 -0
- package/dist/tools/get-shaders.js.map +1 -0
- package/dist/tools/get-sketches.d.ts +16 -0
- package/dist/tools/get-sketches.d.ts.map +1 -0
- package/dist/tools/get-sketches.js +37 -0
- package/dist/tools/get-sketches.js.map +1 -0
- package/dist/tools/list-themes.d.ts +21 -0
- package/dist/tools/list-themes.d.ts.map +1 -0
- package/dist/tools/list-themes.js +32 -0
- package/dist/tools/list-themes.js.map +1 -0
- package/dist/tools/map-signals.d.ts +30 -0
- package/dist/tools/map-signals.d.ts.map +1 -0
- package/dist/tools/map-signals.js +44 -0
- package/dist/tools/map-signals.js.map +1 -0
- package/dist/tools/place-entity.d.ts +47 -0
- package/dist/tools/place-entity.d.ts.map +1 -0
- package/dist/tools/place-entity.js +85 -0
- package/dist/tools/place-entity.js.map +1 -0
- package/dist/tools/remove-item.d.ts +25 -0
- package/dist/tools/remove-item.d.ts.map +1 -0
- package/dist/tools/remove-item.js +55 -0
- package/dist/tools/remove-item.js.map +1 -0
- package/dist/tools/set-sketch-param.d.ts +29 -0
- package/dist/tools/set-sketch-param.d.ts.map +1 -0
- package/dist/tools/set-sketch-param.js +49 -0
- package/dist/tools/set-sketch-param.js.map +1 -0
- package/dist/tools/set-uniform.d.ts +29 -0
- package/dist/tools/set-uniform.d.ts.map +1 -0
- package/dist/tools/set-uniform.js +49 -0
- package/dist/tools/set-uniform.js.map +1 -0
- package/dist/tools/update-shader.d.ts +119 -0
- package/dist/tools/update-shader.d.ts.map +1 -0
- package/dist/tools/update-shader.js +81 -0
- package/dist/tools/update-shader.js.map +1 -0
- package/dist/tools/update-sketch.d.ts +99 -0
- package/dist/tools/update-sketch.d.ts.map +1 -0
- package/dist/tools/update-sketch.js +75 -0
- package/dist/tools/update-sketch.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* describe_scene tool — comprehensive human/AI-readable scene description.
|
|
3
|
+
*
|
|
4
|
+
* This is the first tool an AI agent should call to understand the current
|
|
5
|
+
* scene. It reads all state from the store and produces a structured text
|
|
6
|
+
* summary of entities, choreographies, signal sources, bindings, and wiring.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
/** Tool name. */
|
|
10
|
+
export declare const name = "describe_scene";
|
|
11
|
+
/** Tool description shown to the AI agent. */
|
|
12
|
+
export declare const description: string;
|
|
13
|
+
/** Input schema — no parameters needed. */
|
|
14
|
+
export declare const inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
15
|
+
/** Tool handler — reads all state from the store and builds a text description. */
|
|
16
|
+
export declare function handler(): Promise<{
|
|
17
|
+
content: Array<{
|
|
18
|
+
type: "text";
|
|
19
|
+
text: string;
|
|
20
|
+
}>;
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=describe-scene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-scene.d.ts","sourceRoot":"","sources":["../../src/tools/describe-scene.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,iBAAiB;AACjB,eAAO,MAAM,IAAI,mBAAmB,CAAC;AAErC,8CAA8C;AAC9C,eAAO,MAAM,WAAW,QAIwC,CAAC;AAEjE,2CAA2C;AAC3C,eAAO,MAAM,WAAW,gDAAe,CAAC;AAyDxC,mFAAmF;AACnF,wBAAsB,OAAO,IAAI,OAAO,CAAC;IACvC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD,CAAC,CA0ID"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* describe_scene tool — comprehensive human/AI-readable scene description.
|
|
3
|
+
*
|
|
4
|
+
* This is the first tool an AI agent should call to understand the current
|
|
5
|
+
* scene. It reads all state from the store and produces a structured text
|
|
6
|
+
* summary of entities, choreographies, signal sources, bindings, and wiring.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { getSceneSnapshot, getChoreographies, getBindings, getSignalSources, getWiring, getEditor, } from "../state/store.js";
|
|
10
|
+
/** Tool name. */
|
|
11
|
+
export const name = "describe_scene";
|
|
12
|
+
/** Tool description shown to the AI agent. */
|
|
13
|
+
export const description = "Get a comprehensive, human-readable description of the current sajou scene. " +
|
|
14
|
+
"Returns a structured summary of all placed entities, choreographies, signal " +
|
|
15
|
+
"sources, bindings, and wiring. This is the best first tool to call to " +
|
|
16
|
+
"understand what the scene contains and how it is configured.";
|
|
17
|
+
/** Input schema — no parameters needed. */
|
|
18
|
+
export const inputSchema = z.object({});
|
|
19
|
+
/** Format an entity for the description. */
|
|
20
|
+
function describeEntity(e) {
|
|
21
|
+
const label = e["semanticId"] ? `"${e["semanticId"]}" (${e["entityId"]})` : e["entityId"];
|
|
22
|
+
const pos = `at (${Math.round(e["x"])}, ${Math.round(e["y"])})`;
|
|
23
|
+
const vis = e["visible"] ? "" : " [hidden]";
|
|
24
|
+
const lock = e["locked"] ? " [locked]" : "";
|
|
25
|
+
const topology = e["topology"];
|
|
26
|
+
const topo = topology
|
|
27
|
+
? `, topology: home=${topology["home"] ?? "none"}, waypoints=[${(topology["waypoints"] ?? []).join(", ")}]`
|
|
28
|
+
: "";
|
|
29
|
+
return ` - ${label} ${pos}${vis}${lock}, layer=${e["layerId"]}, state=${e["activeState"]}${topo}`;
|
|
30
|
+
}
|
|
31
|
+
/** Format a choreography for the description. */
|
|
32
|
+
function describeChoreography(c) {
|
|
33
|
+
const wiredSignalTypes = (c["wiredSignalTypes"] ?? []);
|
|
34
|
+
const trigger = wiredSignalTypes.length > 0
|
|
35
|
+
? `wired to: [${wiredSignalTypes.join(", ")}]`
|
|
36
|
+
: `on: "${c["on"]}"`;
|
|
37
|
+
const when = c["when"] ? `, when: ${JSON.stringify(c["when"])}` : "";
|
|
38
|
+
const target = c["defaultTargetEntityId"] ? `, default target: "${c["defaultTargetEntityId"]}"` : "";
|
|
39
|
+
const stepCount = c["stepCount"];
|
|
40
|
+
const stepTypes = (c["stepTypes"] ?? []);
|
|
41
|
+
const steps = stepCount > 0
|
|
42
|
+
? `, ${stepCount} steps: [${stepTypes.join(" → ")}]`
|
|
43
|
+
: ", no steps";
|
|
44
|
+
const sources = (c["sources"] ?? []);
|
|
45
|
+
const sourcesStr = sources.length > 0
|
|
46
|
+
? `\n sources: ${sources.map((s) => `${s["sourceId"]} via "${s["signalType"]}"`).join(", ")}`
|
|
47
|
+
: "";
|
|
48
|
+
return ` - ${c["id"]}: ${trigger}${when}${target}${steps}${sourcesStr}`;
|
|
49
|
+
}
|
|
50
|
+
/** Format a binding for the description. */
|
|
51
|
+
function describeBinding(b) {
|
|
52
|
+
const mapping = b["mapping"] ? `, mapping: ${JSON.stringify(b["mapping"])}` : "";
|
|
53
|
+
const action = b["action"] ? `, action: ${JSON.stringify(b["action"])}` : "";
|
|
54
|
+
const field = b["sourceField"] ? `, field: "${b["sourceField"]}"` : "";
|
|
55
|
+
const transition = b["transition"] ? `, transition: ${JSON.stringify(b["transition"])}` : "";
|
|
56
|
+
return ` - "${b["targetEntityId"]}".${b["property"]} ← choreo "${b["sourceChoreographyId"]}" (${b["sourceType"]})${field}${mapping}${transition}${action}`;
|
|
57
|
+
}
|
|
58
|
+
/** Format a signal source for the description. */
|
|
59
|
+
function describeSource(s) {
|
|
60
|
+
const statusStr = s["status"];
|
|
61
|
+
const status = statusStr === "connected" ? "CONNECTED" : statusStr.toUpperCase();
|
|
62
|
+
const err = s["error"] ? ` (error: ${s["error"]})` : "";
|
|
63
|
+
return ` - ${s["name"]} [${s["protocol"]}] ${status}${err} — ${s["category"]}`;
|
|
64
|
+
}
|
|
65
|
+
/** Format a wire for the description. */
|
|
66
|
+
function describeWire(w) {
|
|
67
|
+
return ` - ${w["fromZone"]}:${w["fromId"]} → ${w["toZone"]}:${w["toId"]}`;
|
|
68
|
+
}
|
|
69
|
+
/** Tool handler — reads all state from the store and builds a text description. */
|
|
70
|
+
export async function handler() {
|
|
71
|
+
// Read all state synchronously from the store
|
|
72
|
+
const sceneState = getSceneSnapshot();
|
|
73
|
+
const choreosState = getChoreographies();
|
|
74
|
+
const bindingsState = getBindings();
|
|
75
|
+
const sourcesState = getSignalSources();
|
|
76
|
+
const wiringState = getWiring();
|
|
77
|
+
const editor = getEditor();
|
|
78
|
+
const entities = (sceneState["entities"] ?? []);
|
|
79
|
+
const positions = (sceneState["positions"] ?? []);
|
|
80
|
+
const routes = (sceneState["routes"] ?? []);
|
|
81
|
+
const rawChoreos = (choreosState["choreographies"] ?? []);
|
|
82
|
+
const bindings = (bindingsState["bindings"] ?? []);
|
|
83
|
+
const sources = (sourcesState["sources"] ?? []);
|
|
84
|
+
const wires = (wiringState["wires"] ?? []);
|
|
85
|
+
// Enrich choreographies with wiring info
|
|
86
|
+
const enrichedChoreos = rawChoreos.map((c) => {
|
|
87
|
+
const id = c["id"];
|
|
88
|
+
const steps = (c["steps"] ?? []);
|
|
89
|
+
const incomingWires = wires.filter((w) => w["toZone"] === "choreographer" && w["toId"] === id);
|
|
90
|
+
const wiredSignalTypes = incomingWires
|
|
91
|
+
.filter((w) => w["fromZone"] === "signal-type")
|
|
92
|
+
.map((w) => w["fromId"]);
|
|
93
|
+
const choreoSources = [];
|
|
94
|
+
for (const signalType of wiredSignalTypes) {
|
|
95
|
+
const sourceWires = wires.filter((w) => w["fromZone"] === "signal" && w["toZone"] === "signal-type" && w["toId"] === signalType);
|
|
96
|
+
for (const sw of sourceWires) {
|
|
97
|
+
choreoSources.push({
|
|
98
|
+
sourceId: sw["fromId"],
|
|
99
|
+
signalType,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
...c,
|
|
105
|
+
stepCount: steps.length,
|
|
106
|
+
stepTypes: steps.map((s) => s["action"]),
|
|
107
|
+
wiredSignalTypes,
|
|
108
|
+
sources: choreoSources,
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
// Build the description
|
|
112
|
+
const lines = [];
|
|
113
|
+
// Scene overview
|
|
114
|
+
lines.push("# Scene Description");
|
|
115
|
+
lines.push("");
|
|
116
|
+
const d = sceneState["dimensions"];
|
|
117
|
+
lines.push(`## Canvas: ${d?.["width"] ?? "?"}×${d?.["height"] ?? "?"} px, mode: ${editor["mode"] ?? "unknown"}, view: ${editor["viewMode"] ?? "unknown"}`);
|
|
118
|
+
lines.push("");
|
|
119
|
+
// Entities
|
|
120
|
+
if (entities.length > 0) {
|
|
121
|
+
lines.push(`## Entities (${entities.length})`);
|
|
122
|
+
for (const e of entities) {
|
|
123
|
+
lines.push(describeEntity(e));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
lines.push("## Entities: none placed");
|
|
128
|
+
}
|
|
129
|
+
lines.push("");
|
|
130
|
+
// Positions
|
|
131
|
+
if (positions.length > 0) {
|
|
132
|
+
lines.push(`## Positions (${positions.length})`);
|
|
133
|
+
for (const p of positions) {
|
|
134
|
+
lines.push(` - "${p["name"]}" at (${Math.round(p["x"])}, ${Math.round(p["y"])}), type=${p["typeHint"]}${p["entityBinding"] ? `, bound to "${p["entityBinding"]}"` : ""}`);
|
|
135
|
+
}
|
|
136
|
+
lines.push("");
|
|
137
|
+
}
|
|
138
|
+
// Routes
|
|
139
|
+
if (routes.length > 0) {
|
|
140
|
+
lines.push(`## Routes (${routes.length})`);
|
|
141
|
+
for (const r of routes) {
|
|
142
|
+
const points = (r["points"] ?? []);
|
|
143
|
+
lines.push(` - "${r["name"]}" (${points.length} points, ${r["style"]}, ${r["bidirectional"] ? "bidirectional" : "one-way"})`);
|
|
144
|
+
}
|
|
145
|
+
lines.push("");
|
|
146
|
+
}
|
|
147
|
+
// Choreographies
|
|
148
|
+
if (enrichedChoreos.length > 0) {
|
|
149
|
+
lines.push(`## Choreographies (${enrichedChoreos.length})`);
|
|
150
|
+
for (const c of enrichedChoreos) {
|
|
151
|
+
lines.push(describeChoreography(c));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
lines.push("## Choreographies: none defined");
|
|
156
|
+
}
|
|
157
|
+
lines.push("");
|
|
158
|
+
// Signal sources
|
|
159
|
+
if (sources.length > 0) {
|
|
160
|
+
lines.push(`## Signal Sources (${sources.length})`);
|
|
161
|
+
for (const s of sources) {
|
|
162
|
+
lines.push(describeSource(s));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
lines.push("## Signal Sources: none configured");
|
|
167
|
+
}
|
|
168
|
+
lines.push("");
|
|
169
|
+
// Bindings
|
|
170
|
+
if (bindings.length > 0) {
|
|
171
|
+
lines.push(`## Bindings (${bindings.length})`);
|
|
172
|
+
for (const b of bindings) {
|
|
173
|
+
lines.push(describeBinding(b));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
lines.push("## Bindings: none");
|
|
178
|
+
}
|
|
179
|
+
lines.push("");
|
|
180
|
+
// Wiring
|
|
181
|
+
if (wires.length > 0) {
|
|
182
|
+
lines.push(`## Wiring (${wires.length} connections)`);
|
|
183
|
+
for (const w of wires) {
|
|
184
|
+
lines.push(describeWire(w));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
lines.push("## Wiring: no connections");
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
content: [{ type: "text", text: lines.join("\n") }],
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=describe-scene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-scene.js","sourceRoot":"","sources":["../../src/tools/describe-scene.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,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K,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,SAAS;IACT,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,cAAc,KAAK,CAAC,MAAM,eAAe,CAAC,CAAC;QACtD,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;KAC7D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* emit_signal tool — sends a signal to the scene-builder via the bridge.
|
|
3
|
+
*
|
|
4
|
+
* This is the primary runtime tool: the agent emits signals and sajou
|
|
5
|
+
* translates them into choreographed animations.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** Tool name. */
|
|
9
|
+
export declare const name = "emit_signal";
|
|
10
|
+
/** Tool description shown to the AI agent. */
|
|
11
|
+
export declare const description: string;
|
|
12
|
+
/** Input schema validated by the MCP SDK via Zod. */
|
|
13
|
+
export declare const inputSchema: z.ZodObject<{
|
|
14
|
+
type: z.ZodString;
|
|
15
|
+
from: z.ZodString;
|
|
16
|
+
to: z.ZodOptional<z.ZodString>;
|
|
17
|
+
payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
type: string;
|
|
20
|
+
from: string;
|
|
21
|
+
payload?: Record<string, unknown> | undefined;
|
|
22
|
+
to?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
type: string;
|
|
25
|
+
from: string;
|
|
26
|
+
payload?: Record<string, unknown> | undefined;
|
|
27
|
+
to?: string | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
/** Tool handler — called when the agent invokes emit_signal. */
|
|
30
|
+
export declare function handler(params: z.infer<typeof inputSchema>): Promise<{
|
|
31
|
+
content: Array<{
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}>;
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=emit-signal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit-signal.d.ts","sourceRoot":"","sources":["../../src/tools/emit-signal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,iBAAiB;AACjB,eAAO,MAAM,IAAI,gBAAgB,CAAC;AAElC,8CAA8C;AAC9C,eAAO,MAAM,WAAW,QAGC,CAAC;AAE1B,qDAAqD;AACrD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAiBtB,CAAC;AAEH,gEAAgE;AAChE,wBAAsB,OAAO,CAC3B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAClC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA2B7D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* emit_signal tool — sends a signal to the scene-builder via the bridge.
|
|
3
|
+
*
|
|
4
|
+
* This is the primary runtime tool: the agent emits signals and sajou
|
|
5
|
+
* translates them into choreographed animations.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { broadcastSignal, getSignalClientCount } from "../routes/signals.js";
|
|
9
|
+
/** Tool name. */
|
|
10
|
+
export const name = "emit_signal";
|
|
11
|
+
/** Tool description shown to the AI agent. */
|
|
12
|
+
export const description = "Emit a signal to the sajou scene. Signals trigger choreographies that animate entities. " +
|
|
13
|
+
"Use well-known types (task_dispatch, tool_call, tool_result, agent_state_change, error, completion) " +
|
|
14
|
+
"or any custom string.";
|
|
15
|
+
/** Input schema validated by the MCP SDK via Zod. */
|
|
16
|
+
export const inputSchema = z.object({
|
|
17
|
+
type: z
|
|
18
|
+
.string()
|
|
19
|
+
.describe("Signal type. Well-known: task_dispatch, tool_call, tool_result, token_usage, agent_state_change, error, completion, text_delta, thinking. Custom types are also accepted."),
|
|
20
|
+
from: z
|
|
21
|
+
.string()
|
|
22
|
+
.describe("Entity ID of the signal sender (e.g. 'orchestrator', 'agent-1')."),
|
|
23
|
+
to: z
|
|
24
|
+
.string()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("Entity ID of the signal receiver, if applicable."),
|
|
27
|
+
payload: z
|
|
28
|
+
.record(z.unknown())
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("Additional payload data for the signal."),
|
|
31
|
+
});
|
|
32
|
+
/** Tool handler — called when the agent invokes emit_signal. */
|
|
33
|
+
export async function handler(params) {
|
|
34
|
+
const payload = { ...params.payload };
|
|
35
|
+
if (params.from)
|
|
36
|
+
payload["from"] = params.from;
|
|
37
|
+
if (params.to)
|
|
38
|
+
payload["to"] = params.to;
|
|
39
|
+
const envelope = {
|
|
40
|
+
id: crypto.randomUUID(),
|
|
41
|
+
type: params.type,
|
|
42
|
+
source: "mcp",
|
|
43
|
+
timestamp: Date.now(),
|
|
44
|
+
payload,
|
|
45
|
+
};
|
|
46
|
+
broadcastSignal(JSON.stringify(envelope));
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: "text",
|
|
51
|
+
text: JSON.stringify({
|
|
52
|
+
signal_id: envelope.id,
|
|
53
|
+
ok: true,
|
|
54
|
+
clients: getSignalClientCount(),
|
|
55
|
+
}),
|
|
56
|
+
},
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M,CAAC,EAAE,CAAC;IAEzC,MAAM,QAAQ,GAAG;QACf,EAAE,EAAE,MAAM,CAAC,UAAU,EAAE;QACvB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,OAAO;KACR,CAAC;IAEF,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE1C,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,SAAS,EAAE,QAAQ,CAAC,EAAE;oBACtB,EAAE,EAAE,IAAI;oBACR,OAAO,EAAE,oBAAoB,EAAE;iBAChC,CAAC;aACH;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_catalog tool — returns entity catalog for a theme.
|
|
3
|
+
*
|
|
4
|
+
* Theme catalog system is not yet implemented. Returns a stub response
|
|
5
|
+
* directing agents to use scene-level tools instead.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** Tool name. */
|
|
9
|
+
export declare const name = "get_catalog";
|
|
10
|
+
/** Tool description shown to the AI agent. */
|
|
11
|
+
export declare const description: string;
|
|
12
|
+
/** Input schema. */
|
|
13
|
+
export declare const inputSchema: z.ZodObject<{
|
|
14
|
+
theme: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
theme: string;
|
|
17
|
+
}, {
|
|
18
|
+
theme: string;
|
|
19
|
+
}>;
|
|
20
|
+
/** Tool handler — returns stub until theme catalog is implemented. */
|
|
21
|
+
export declare function handler(params: z.infer<typeof inputSchema>): Promise<{
|
|
22
|
+
content: Array<{
|
|
23
|
+
type: "text";
|
|
24
|
+
text: string;
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=get-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-catalog.d.ts","sourceRoot":"","sources":["../../src/tools/get-catalog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iBAAiB;AACjB,eAAO,MAAM,IAAI,gBAAgB,CAAC;AAElC,8CAA8C;AAC9C,eAAO,MAAM,WAAW,QAG2B,CAAC;AAEpD,oBAAoB;AACpB,eAAO,MAAM,WAAW;;;;;;EAItB,CAAC;AAEH,sEAAsE;AACtE,wBAAsB,OAAO,CAC3B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAClC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAgB7D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_catalog tool — returns entity catalog for a theme.
|
|
3
|
+
*
|
|
4
|
+
* Theme catalog system is not yet implemented. Returns a stub response
|
|
5
|
+
* directing agents to use scene-level tools instead.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** Tool name. */
|
|
9
|
+
export const name = "get_catalog";
|
|
10
|
+
/** Tool description shown to the AI agent. */
|
|
11
|
+
export const description = "Get the entity catalog for a theme. " +
|
|
12
|
+
"NOTE: Theme catalog is under development. Use get_scene_state to see " +
|
|
13
|
+
"entities in the currently loaded scene instead.";
|
|
14
|
+
/** Input schema. */
|
|
15
|
+
export const inputSchema = z.object({
|
|
16
|
+
theme: z
|
|
17
|
+
.string()
|
|
18
|
+
.describe("Theme ID to get the catalog for."),
|
|
19
|
+
});
|
|
20
|
+
/** Tool handler — returns stub until theme catalog is implemented. */
|
|
21
|
+
export async function handler(params) {
|
|
22
|
+
return {
|
|
23
|
+
content: [
|
|
24
|
+
{
|
|
25
|
+
type: "text",
|
|
26
|
+
text: JSON.stringify({
|
|
27
|
+
status: "not_yet_available",
|
|
28
|
+
theme: params.theme,
|
|
29
|
+
message: "Theme catalog is under development. Use get_scene_state to see " +
|
|
30
|
+
"entities in the currently loaded scene.",
|
|
31
|
+
catalog: {},
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=get-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-catalog.js","sourceRoot":"","sources":["../../src/tools/get-catalog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iBAAiB;AACjB,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC;AAElC,8CAA8C;AAC9C,MAAM,CAAC,MAAM,WAAW,GACtB,sCAAsC;IACtC,uEAAuE;IACvE,iDAAiD,CAAC;AAEpD,oBAAoB;AACpB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,CAAC,kCAAkC,CAAC;CAChD,CAAC,CAAC;AAEH,sEAAsE;AACtE,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,MAAmC;IAEnC,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,MAAM,EAAE,mBAAmB;oBAC3B,KAAK,EAAE,MAAM,CAAC,KAAK;oBACnB,OAAO,EACL,iEAAiE;wBACjE,yCAAyC;oBAC3C,OAAO,EAAE,EAAE;iBACZ,CAAC;aACH;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_choreographies tool — lists choreographies defined in the current scene.
|
|
3
|
+
*
|
|
4
|
+
* Reads the server-authoritative state directly. Returns all
|
|
5
|
+
* choreography definitions with their signal triggers, steps, and wiring info.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** Tool name. */
|
|
9
|
+
export declare const name = "get_choreographies";
|
|
10
|
+
/** Tool description shown to the AI agent. */
|
|
11
|
+
export declare const description: string;
|
|
12
|
+
/** Input schema — no parameters needed. */
|
|
13
|
+
export declare const inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
14
|
+
/** Tool handler — reads choreographies from the store and enriches with wiring. */
|
|
15
|
+
export declare function handler(): Promise<{
|
|
16
|
+
content: Array<{
|
|
17
|
+
type: "text";
|
|
18
|
+
text: string;
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=get-choreographies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-choreographies.d.ts","sourceRoot":"","sources":["../../src/tools/get-choreographies.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,iBAAiB;AACjB,eAAO,MAAM,IAAI,uBAAuB,CAAC;AAEzC,8CAA8C;AAC9C,eAAO,MAAM,WAAW,QAI6B,CAAC;AAEtD,2CAA2C;AAC3C,eAAO,MAAM,WAAW,gDAAe,CAAC;AAExC,mFAAmF;AACnF,wBAAsB,OAAO,IAAI,OAAO,CAAC;IACvC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD,CAAC,CA6DD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_choreographies tool — lists choreographies defined in the current scene.
|
|
3
|
+
*
|
|
4
|
+
* Reads the server-authoritative state directly. Returns all
|
|
5
|
+
* choreography definitions with their signal triggers, steps, and wiring info.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { getChoreographies, getWiring } from "../state/store.js";
|
|
9
|
+
/** Tool name. */
|
|
10
|
+
export const name = "get_choreographies";
|
|
11
|
+
/** Tool description shown to the AI agent. */
|
|
12
|
+
export const description = "List all choreographies in the current scene. Returns each choreography's " +
|
|
13
|
+
"trigger signal type, when-conditions, step count, step types, and wiring " +
|
|
14
|
+
"info (which signal sources feed into it). Use this to understand what " +
|
|
15
|
+
"animations are available before emitting signals.";
|
|
16
|
+
/** Input schema — no parameters needed. */
|
|
17
|
+
export const inputSchema = z.object({});
|
|
18
|
+
/** Tool handler — reads choreographies from the store and enriches with wiring. */
|
|
19
|
+
export async function handler() {
|
|
20
|
+
const choreosState = getChoreographies();
|
|
21
|
+
const wiringState = getWiring();
|
|
22
|
+
const rawChoreos = (choreosState["choreographies"] ?? []);
|
|
23
|
+
const wires = (wiringState["wires"] ?? []);
|
|
24
|
+
// Enrich choreographies with wiring info
|
|
25
|
+
const choreographies = rawChoreos.map((c) => {
|
|
26
|
+
const id = c["id"];
|
|
27
|
+
const steps = (c["steps"] ?? []);
|
|
28
|
+
// Find wires targeting this choreography
|
|
29
|
+
const incomingWires = wires.filter((w) => w["toZone"] === "choreographer" && w["toId"] === id);
|
|
30
|
+
// Signal types wired to this choreography
|
|
31
|
+
const wiredSignalTypes = incomingWires
|
|
32
|
+
.filter((w) => w["fromZone"] === "signal-type")
|
|
33
|
+
.map((w) => w["fromId"]);
|
|
34
|
+
// Sources feeding into this choreography (via signal-type wires)
|
|
35
|
+
const sources = [];
|
|
36
|
+
for (const signalType of wiredSignalTypes) {
|
|
37
|
+
const sourceWires = wires.filter((w) => w["fromZone"] === "signal" && w["toZone"] === "signal-type" && w["toId"] === signalType);
|
|
38
|
+
for (const sw of sourceWires) {
|
|
39
|
+
sources.push({
|
|
40
|
+
sourceId: sw["fromId"],
|
|
41
|
+
signalType,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
id,
|
|
47
|
+
on: c["on"],
|
|
48
|
+
when: c["when"] ?? null,
|
|
49
|
+
interrupts: c["interrupts"] ?? false,
|
|
50
|
+
defaultTargetEntityId: c["defaultTargetEntityId"] ?? null,
|
|
51
|
+
stepCount: steps.length,
|
|
52
|
+
stepTypes: steps.map((s) => s["action"]),
|
|
53
|
+
wiredSignalTypes,
|
|
54
|
+
sources,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: "text",
|
|
61
|
+
text: JSON.stringify({
|
|
62
|
+
ok: true,
|
|
63
|
+
choreographies,
|
|
64
|
+
count: choreographies.length,
|
|
65
|
+
}),
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=get-choreographies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-choreographies.js","sourceRoot":"","sources":["../../src/tools/get-choreographies.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,iBAAiB;AACjB,MAAM,CAAC,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAEzC,8CAA8C;AAC9C,MAAM,CAAC,MAAM,WAAW,GACtB,4EAA4E;IAC5E,2EAA2E;IAC3E,wEAAwE;IACxE,mDAAmD,CAAC;AAEtD,2CAA2C;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExC,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,OAAO;IAG3B,MAAM,YAAY,GAAG,iBAAiB,EAAE,CAAC;IACzC,MAAM,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,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAW;oBAChC,UAAU;iBACX,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO;YACL,EAAE;YACF,EAAE,EAAE,CAAC,CAAC,IAAI,CAAW;YACrB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI;YACvB,UAAU,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,KAAK;YACpC,qBAAqB,EAAE,CAAC,CAAC,uBAAuB,CAAC,IAAI,IAAI;YACzD,SAAS,EAAE,KAAK,CAAC,MAAM;YACvB,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAW,CAAC;YAClD,gBAAgB;YAChB,OAAO;SACR,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,EAAE,EAAE,IAAI;oBACR,cAAc;oBACd,KAAK,EAAE,cAAc,CAAC,MAAM;iBAC7B,CAAC;aACH;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_scene_state tool — returns the current scene state from the store.
|
|
3
|
+
*
|
|
4
|
+
* Reads the server-authoritative state directly. Returns all placed
|
|
5
|
+
* entities with their positions, topology, and scene metadata.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** Tool name. */
|
|
9
|
+
export declare const name = "get_scene_state";
|
|
10
|
+
/** Tool description shown to the AI agent. */
|
|
11
|
+
export declare const description: string;
|
|
12
|
+
/** Input schema — no parameters needed. */
|
|
13
|
+
export declare const inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
14
|
+
/** Tool handler — reads scene state from the store. */
|
|
15
|
+
export declare function handler(): Promise<{
|
|
16
|
+
content: Array<{
|
|
17
|
+
type: "text";
|
|
18
|
+
text: string;
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=get-scene-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-scene-state.d.ts","sourceRoot":"","sources":["../../src/tools/get-scene-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,iBAAiB;AACjB,eAAO,MAAM,IAAI,oBAAoB,CAAC;AAEtC,8CAA8C;AAC9C,eAAO,MAAM,WAAW,QAIkC,CAAC;AAE3D,2CAA2C;AAC3C,eAAO,MAAM,WAAW,gDAAe,CAAC;AAExC,uDAAuD;AACvD,wBAAsB,OAAO,IAAI,OAAO,CAAC;IACvC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD,CAAC,CA8BD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_scene_state tool — returns the current scene state from the store.
|
|
3
|
+
*
|
|
4
|
+
* Reads the server-authoritative state directly. Returns all placed
|
|
5
|
+
* entities with their positions, topology, and scene metadata.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { getSceneSnapshot, getEditor } from "../state/store.js";
|
|
9
|
+
/** Tool name. */
|
|
10
|
+
export const name = "get_scene_state";
|
|
11
|
+
/** Tool description shown to the AI agent. */
|
|
12
|
+
export const description = "Get the current state of the sajou scene. Returns all placed entities with " +
|
|
13
|
+
"their id, semanticId, asset type, position, visibility, and topology. Also " +
|
|
14
|
+
"includes scene dimensions, positions, routes, layers, and current editor mode. " +
|
|
15
|
+
"Use this to inspect the scene before emitting signals.";
|
|
16
|
+
/** Input schema — no parameters needed. */
|
|
17
|
+
export const inputSchema = z.object({});
|
|
18
|
+
/** Tool handler — reads scene state from the store. */
|
|
19
|
+
export async function handler() {
|
|
20
|
+
const sceneState = getSceneSnapshot();
|
|
21
|
+
const editor = getEditor();
|
|
22
|
+
const entities = (sceneState["entities"] ?? []);
|
|
23
|
+
const positions = (sceneState["positions"] ?? []);
|
|
24
|
+
const routes = (sceneState["routes"] ?? []);
|
|
25
|
+
return {
|
|
26
|
+
content: [
|
|
27
|
+
{
|
|
28
|
+
type: "text",
|
|
29
|
+
text: JSON.stringify({
|
|
30
|
+
ok: true,
|
|
31
|
+
dimensions: sceneState["dimensions"],
|
|
32
|
+
background: sceneState["background"],
|
|
33
|
+
layers: sceneState["layers"],
|
|
34
|
+
entities,
|
|
35
|
+
positions,
|
|
36
|
+
routes,
|
|
37
|
+
zoneTypes: sceneState["zoneTypes"],
|
|
38
|
+
mode: editor["mode"] ?? null,
|
|
39
|
+
viewMode: editor["viewMode"] ?? null,
|
|
40
|
+
entityCount: entities.length,
|
|
41
|
+
positionCount: positions.length,
|
|
42
|
+
routeCount: routes.length,
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=get-scene-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-scene-state.js","sourceRoot":"","sources":["../../src/tools/get-scene-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEhE,iBAAiB;AACjB,MAAM,CAAC,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAEtC,8CAA8C;AAC9C,MAAM,CAAC,MAAM,WAAW,GACtB,6EAA6E;IAC7E,6EAA6E;IAC7E,iFAAiF;IACjF,wDAAwD,CAAC;AAE3D,2CAA2C;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExC,uDAAuD;AACvD,MAAM,CAAC,KAAK,UAAU,OAAO;IAG3B,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,QAAQ,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,CAAmC,CAAC;IAClF,MAAM,SAAS,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,CAAmC,CAAC;IACpF,MAAM,MAAM,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAmC,CAAC;IAE9E,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,EAAE,EAAE,IAAI;oBACR,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC;oBACpC,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC;oBACpC,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC;oBAC5B,QAAQ;oBACR,SAAS;oBACT,MAAM;oBACN,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC;oBAClC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI;oBAC5B,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,IAAI;oBACpC,WAAW,EAAE,QAAQ,CAAC,MAAM;oBAC5B,aAAa,EAAE,SAAS,CAAC,MAAM;oBAC/B,UAAU,EAAE,MAAM,CAAC,MAAM;iBAC1B,CAAC;aACH;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool: get_shaders
|
|
3
|
+
*
|
|
4
|
+
* Lists all shader definitions with full details (code, uniforms, objects).
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
export declare const name = "get_shaders";
|
|
8
|
+
export declare const description: string;
|
|
9
|
+
export declare const inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
10
|
+
export declare function handler(): Promise<{
|
|
11
|
+
content: Array<{
|
|
12
|
+
type: "text";
|
|
13
|
+
text: string;
|
|
14
|
+
}>;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=get-shaders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-shaders.d.ts","sourceRoot":"","sources":["../../src/tools/get-shaders.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,IAAI,gBAAgB,CAAC;AAElC,eAAO,MAAM,WAAW,QAG2D,CAAC;AAEpF,eAAO,MAAM,WAAW,gDAAe,CAAC;AAExC,wBAAsB,OAAO,IAAI,OAAO,CAAC;IACvC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD,CAAC,CAyBD"}
|