@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.
Files changed (130) hide show
  1. package/README.md +78 -0
  2. package/dist/app.d.ts +32 -0
  3. package/dist/app.d.ts.map +1 -0
  4. package/dist/app.js +76 -0
  5. package/dist/app.js.map +1 -0
  6. package/dist/index.d.ts +18 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +65 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/mcp/transport.d.ts +18 -0
  11. package/dist/mcp/transport.d.ts.map +1 -0
  12. package/dist/mcp/transport.js +56 -0
  13. package/dist/mcp/transport.js.map +1 -0
  14. package/dist/middleware.d.ts +14 -0
  15. package/dist/middleware.d.ts.map +1 -0
  16. package/dist/middleware.js +14 -0
  17. package/dist/middleware.js.map +1 -0
  18. package/dist/routes/discovery.d.ts +8 -0
  19. package/dist/routes/discovery.d.ts.map +1 -0
  20. package/dist/routes/discovery.js +155 -0
  21. package/dist/routes/discovery.js.map +1 -0
  22. package/dist/routes/proxy.d.ts +10 -0
  23. package/dist/routes/proxy.d.ts.map +1 -0
  24. package/dist/routes/proxy.js +84 -0
  25. package/dist/routes/proxy.js.map +1 -0
  26. package/dist/routes/scene.d.ts +10 -0
  27. package/dist/routes/scene.d.ts.map +1 -0
  28. package/dist/routes/scene.js +298 -0
  29. package/dist/routes/scene.js.map +1 -0
  30. package/dist/routes/signals.d.ts +12 -0
  31. package/dist/routes/signals.d.ts.map +1 -0
  32. package/dist/routes/signals.js +61 -0
  33. package/dist/routes/signals.js.map +1 -0
  34. package/dist/routes/tap.d.ts +10 -0
  35. package/dist/routes/tap.d.ts.map +1 -0
  36. package/dist/routes/tap.js +115 -0
  37. package/dist/routes/tap.js.map +1 -0
  38. package/dist/server.d.ts +12 -0
  39. package/dist/server.d.ts.map +1 -0
  40. package/dist/server.js +103 -0
  41. package/dist/server.js.map +1 -0
  42. package/dist/state/mutations.d.ts +53 -0
  43. package/dist/state/mutations.d.ts.map +1 -0
  44. package/dist/state/mutations.js +409 -0
  45. package/dist/state/mutations.js.map +1 -0
  46. package/dist/state/store.d.ts +51 -0
  47. package/dist/state/store.d.ts.map +1 -0
  48. package/dist/state/store.js +149 -0
  49. package/dist/state/store.js.map +1 -0
  50. package/dist/tools/create-binding.d.ts +45 -0
  51. package/dist/tools/create-binding.d.ts.map +1 -0
  52. package/dist/tools/create-binding.js +82 -0
  53. package/dist/tools/create-binding.js.map +1 -0
  54. package/dist/tools/create-choreography.d.ts +76 -0
  55. package/dist/tools/create-choreography.d.ts.map +1 -0
  56. package/dist/tools/create-choreography.js +118 -0
  57. package/dist/tools/create-choreography.js.map +1 -0
  58. package/dist/tools/create-shader.d.ts +117 -0
  59. package/dist/tools/create-shader.d.ts.map +1 -0
  60. package/dist/tools/create-shader.js +150 -0
  61. package/dist/tools/create-shader.js.map +1 -0
  62. package/dist/tools/create-sketch.d.ts +96 -0
  63. package/dist/tools/create-sketch.d.ts.map +1 -0
  64. package/dist/tools/create-sketch.js +130 -0
  65. package/dist/tools/create-sketch.js.map +1 -0
  66. package/dist/tools/create-wire.d.ts +32 -0
  67. package/dist/tools/create-wire.d.ts.map +1 -0
  68. package/dist/tools/create-wire.js +84 -0
  69. package/dist/tools/create-wire.js.map +1 -0
  70. package/dist/tools/describe-scene.d.ts +22 -0
  71. package/dist/tools/describe-scene.d.ts.map +1 -0
  72. package/dist/tools/describe-scene.js +194 -0
  73. package/dist/tools/describe-scene.js.map +1 -0
  74. package/dist/tools/emit-signal.d.ts +36 -0
  75. package/dist/tools/emit-signal.d.ts.map +1 -0
  76. package/dist/tools/emit-signal.js +60 -0
  77. package/dist/tools/emit-signal.js.map +1 -0
  78. package/dist/tools/get-catalog.d.ts +27 -0
  79. package/dist/tools/get-catalog.d.ts.map +1 -0
  80. package/dist/tools/get-catalog.js +37 -0
  81. package/dist/tools/get-catalog.js.map +1 -0
  82. package/dist/tools/get-choreographies.d.ts +21 -0
  83. package/dist/tools/get-choreographies.d.ts.map +1 -0
  84. package/dist/tools/get-choreographies.js +70 -0
  85. package/dist/tools/get-choreographies.js.map +1 -0
  86. package/dist/tools/get-scene-state.d.ts +21 -0
  87. package/dist/tools/get-scene-state.d.ts.map +1 -0
  88. package/dist/tools/get-scene-state.js +48 -0
  89. package/dist/tools/get-scene-state.js.map +1 -0
  90. package/dist/tools/get-shaders.d.ts +16 -0
  91. package/dist/tools/get-shaders.d.ts.map +1 -0
  92. package/dist/tools/get-shaders.js +38 -0
  93. package/dist/tools/get-shaders.js.map +1 -0
  94. package/dist/tools/get-sketches.d.ts +16 -0
  95. package/dist/tools/get-sketches.d.ts.map +1 -0
  96. package/dist/tools/get-sketches.js +37 -0
  97. package/dist/tools/get-sketches.js.map +1 -0
  98. package/dist/tools/list-themes.d.ts +21 -0
  99. package/dist/tools/list-themes.d.ts.map +1 -0
  100. package/dist/tools/list-themes.js +32 -0
  101. package/dist/tools/list-themes.js.map +1 -0
  102. package/dist/tools/map-signals.d.ts +30 -0
  103. package/dist/tools/map-signals.d.ts.map +1 -0
  104. package/dist/tools/map-signals.js +44 -0
  105. package/dist/tools/map-signals.js.map +1 -0
  106. package/dist/tools/place-entity.d.ts +47 -0
  107. package/dist/tools/place-entity.d.ts.map +1 -0
  108. package/dist/tools/place-entity.js +85 -0
  109. package/dist/tools/place-entity.js.map +1 -0
  110. package/dist/tools/remove-item.d.ts +25 -0
  111. package/dist/tools/remove-item.d.ts.map +1 -0
  112. package/dist/tools/remove-item.js +55 -0
  113. package/dist/tools/remove-item.js.map +1 -0
  114. package/dist/tools/set-sketch-param.d.ts +29 -0
  115. package/dist/tools/set-sketch-param.d.ts.map +1 -0
  116. package/dist/tools/set-sketch-param.js +49 -0
  117. package/dist/tools/set-sketch-param.js.map +1 -0
  118. package/dist/tools/set-uniform.d.ts +29 -0
  119. package/dist/tools/set-uniform.d.ts.map +1 -0
  120. package/dist/tools/set-uniform.js +49 -0
  121. package/dist/tools/set-uniform.js.map +1 -0
  122. package/dist/tools/update-shader.d.ts +119 -0
  123. package/dist/tools/update-shader.d.ts.map +1 -0
  124. package/dist/tools/update-shader.js +81 -0
  125. package/dist/tools/update-shader.js.map +1 -0
  126. package/dist/tools/update-sketch.d.ts +99 -0
  127. package/dist/tools/update-sketch.d.ts.map +1 -0
  128. package/dist/tools/update-sketch.js +75 -0
  129. package/dist/tools/update-sketch.js.map +1 -0
  130. package/package.json +55 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Server-authoritative in-memory state store.
3
+ *
4
+ * This is the single source of truth for the scene state. MCP tools read
5
+ * and mutate this store directly — no HTTP round-trip to a browser needed.
6
+ * Connected browsers receive updates via SSE.
7
+ */
8
+ /** Full server state — same shape as the client state-sync snapshot. */
9
+ export interface ServerState {
10
+ scene: Record<string, unknown>;
11
+ choreographies: Record<string, unknown>;
12
+ wiring: Record<string, unknown>;
13
+ bindings: Record<string, unknown>;
14
+ shaders: Record<string, unknown>;
15
+ p5: Record<string, unknown>;
16
+ signalSources: Record<string, unknown>;
17
+ editor: Record<string, unknown>;
18
+ }
19
+ /** Get the current state version. */
20
+ export declare function getStateVersion(): number;
21
+ /** Get the timestamp of the last mutation (or null if pristine). */
22
+ export declare function getLastMutationAt(): number | null;
23
+ /** Get a full snapshot of the entire state. */
24
+ export declare function getFullState(): Readonly<ServerState>;
25
+ /** Get the scene section. */
26
+ export declare function getSceneSnapshot(): Record<string, unknown>;
27
+ /** Get choreographies section. */
28
+ export declare function getChoreographies(): Record<string, unknown>;
29
+ /** Get wiring section. */
30
+ export declare function getWiring(): Record<string, unknown>;
31
+ /** Get bindings section. */
32
+ export declare function getBindings(): Record<string, unknown>;
33
+ /** Get shaders section. */
34
+ export declare function getShaders(): Record<string, unknown>;
35
+ /** Get p5 section. */
36
+ export declare function getP5(): Record<string, unknown>;
37
+ /** Get signal sources section. */
38
+ export declare function getSignalSources(): Record<string, unknown>;
39
+ /** Get editor section. */
40
+ export declare function getEditor(): Record<string, unknown>;
41
+ /** Replace the entire state (used when the browser pushes a full snapshot). */
42
+ export declare function setFullState(snapshot: Record<string, unknown>): void;
43
+ /** Replace a single section of the state. */
44
+ export declare function setSection(key: keyof ServerState, value: Record<string, unknown>): void;
45
+ /** Mutate the state in-place and notify. Used by mutations.ts. */
46
+ export declare function mutate(fn: (s: ServerState) => void): void;
47
+ /** Reset to empty state (e.g. "New scene"). */
48
+ export declare function resetState(): void;
49
+ /** Subscribe to state changes. Returns an unsubscribe function. */
50
+ export declare function subscribe(fn: (version: number) => void): () => void;
51
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/state/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,wEAAwE;AACxE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAmED,qCAAqC;AACrC,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAEjD;AAED,+CAA+C;AAC/C,wBAAgB,YAAY,IAAI,QAAQ,CAAC,WAAW,CAAC,CAEpD;AAED,6BAA6B;AAC7B,wBAAgB,gBAAgB,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is the single source of truth for the scene state. MCP tools read
5
+ * and mutate this store directly — no HTTP round-trip to a browser needed.
6
+ * Connected browsers receive updates via SSE.
7
+ */
8
+ // ---------------------------------------------------------------------------
9
+ // Module state
10
+ // ---------------------------------------------------------------------------
11
+ /** The in-memory state. Initialised with empty sections. */
12
+ let state = createEmptyState();
13
+ /** Monotonically increasing version counter. */
14
+ let stateVersion = 0;
15
+ /** Timestamp of last mutation. */
16
+ let lastMutationAt = null;
17
+ /** Subscriber callbacks notified on every mutation. */
18
+ const subscribers = new Set();
19
+ // ---------------------------------------------------------------------------
20
+ // Helpers
21
+ // ---------------------------------------------------------------------------
22
+ /** Create a fresh empty state. */
23
+ function createEmptyState() {
24
+ return {
25
+ scene: {
26
+ dimensions: { width: 960, height: 640 },
27
+ background: { color: "#1a1a2e" },
28
+ layers: [
29
+ { id: "background", name: "Background", order: 0, visible: true },
30
+ { id: "midground", name: "Midground", order: 1, visible: true },
31
+ { id: "foreground", name: "Foreground", order: 2, visible: true },
32
+ ],
33
+ entities: [],
34
+ positions: [],
35
+ routes: [],
36
+ zoneTypes: [],
37
+ lighting: null,
38
+ particles: [],
39
+ },
40
+ choreographies: { choreographies: [] },
41
+ wiring: { wires: [] },
42
+ bindings: { bindings: [] },
43
+ shaders: { shaders: [] },
44
+ p5: { sketches: [] },
45
+ signalSources: { sources: [] },
46
+ editor: {},
47
+ };
48
+ }
49
+ /** Increment version, update timestamp, notify subscribers. */
50
+ function notifyChange() {
51
+ stateVersion++;
52
+ lastMutationAt = Date.now();
53
+ for (const fn of subscribers) {
54
+ try {
55
+ fn(stateVersion);
56
+ }
57
+ catch {
58
+ // Subscriber errors must not crash the store.
59
+ }
60
+ }
61
+ }
62
+ // ---------------------------------------------------------------------------
63
+ // Public API — reads
64
+ // ---------------------------------------------------------------------------
65
+ /** Get the current state version. */
66
+ export function getStateVersion() {
67
+ return stateVersion;
68
+ }
69
+ /** Get the timestamp of the last mutation (or null if pristine). */
70
+ export function getLastMutationAt() {
71
+ return lastMutationAt;
72
+ }
73
+ /** Get a full snapshot of the entire state. */
74
+ export function getFullState() {
75
+ return state;
76
+ }
77
+ /** Get the scene section. */
78
+ export function getSceneSnapshot() {
79
+ return state.scene;
80
+ }
81
+ /** Get choreographies section. */
82
+ export function getChoreographies() {
83
+ return state.choreographies;
84
+ }
85
+ /** Get wiring section. */
86
+ export function getWiring() {
87
+ return state.wiring;
88
+ }
89
+ /** Get bindings section. */
90
+ export function getBindings() {
91
+ return state.bindings;
92
+ }
93
+ /** Get shaders section. */
94
+ export function getShaders() {
95
+ return state.shaders;
96
+ }
97
+ /** Get p5 section. */
98
+ export function getP5() {
99
+ return state.p5;
100
+ }
101
+ /** Get signal sources section. */
102
+ export function getSignalSources() {
103
+ return state.signalSources;
104
+ }
105
+ /** Get editor section. */
106
+ export function getEditor() {
107
+ return state.editor;
108
+ }
109
+ // ---------------------------------------------------------------------------
110
+ // Public API — writes
111
+ // ---------------------------------------------------------------------------
112
+ /** Replace the entire state (used when the browser pushes a full snapshot). */
113
+ export function setFullState(snapshot) {
114
+ state = {
115
+ scene: snapshot["scene"] ?? state.scene,
116
+ choreographies: snapshot["choreographies"] ?? state.choreographies,
117
+ wiring: snapshot["wiring"] ?? state.wiring,
118
+ bindings: snapshot["bindings"] ?? state.bindings,
119
+ shaders: snapshot["shaders"] ?? state.shaders,
120
+ p5: snapshot["p5"] ?? state.p5,
121
+ signalSources: snapshot["signalSources"] ?? state.signalSources,
122
+ editor: snapshot["editor"] ?? state.editor,
123
+ };
124
+ notifyChange();
125
+ }
126
+ /** Replace a single section of the state. */
127
+ export function setSection(key, value) {
128
+ state[key] = value;
129
+ notifyChange();
130
+ }
131
+ /** Mutate the state in-place and notify. Used by mutations.ts. */
132
+ export function mutate(fn) {
133
+ fn(state);
134
+ notifyChange();
135
+ }
136
+ /** Reset to empty state (e.g. "New scene"). */
137
+ export function resetState() {
138
+ state = createEmptyState();
139
+ notifyChange();
140
+ }
141
+ // ---------------------------------------------------------------------------
142
+ // Pub/sub
143
+ // ---------------------------------------------------------------------------
144
+ /** Subscribe to state changes. Returns an unsubscribe function. */
145
+ export function subscribe(fn) {
146
+ subscribers.add(fn);
147
+ return () => { subscribers.delete(fn); };
148
+ }
149
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/state/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkBH,8EAA8E;AAC9E,eAAe;AACf,8EAA8E;AAE9E,4DAA4D;AAC5D,IAAI,KAAK,GAAgB,gBAAgB,EAAE,CAAC;AAE5C,gDAAgD;AAChD,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB,kCAAkC;AAClC,IAAI,cAAc,GAAkB,IAAI,CAAC;AAEzC,uDAAuD;AACvD,MAAM,WAAW,GAAG,IAAI,GAAG,EAA6B,CAAC;AAEzD,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,kCAAkC;AAClC,SAAS,gBAAgB;IACvB,OAAO;QACL,KAAK,EAAE;YACL,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;YACvC,UAAU,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;YAChC,MAAM,EAAE;gBACN,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;gBACjE,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;gBAC/D,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;aAClE;YACD,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,EAAE;YACV,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,IAAI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AC;IACnB,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,MAAM,CAAC,EAA4B;IACjD,EAAE,CAAC,KAAK,CAAC,CAAC;IACV,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,UAAU;IACxB,KAAK,GAAG,gBAAgB,EAAE,CAAC;IAC3B,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,mEAAmE;AACnE,MAAM,UAAU,SAAS,CAAC,EAA6B;IACrD,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpB,OAAO,GAAG,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * MCP tool: create_binding
3
+ *
4
+ * Creates an entity binding — connects a choreography's output to an entity property.
5
+ * Bindings are the Level 2 dynamic wiring: they define how choreography results
6
+ * affect visual properties on placed entities.
7
+ */
8
+ import { z } from "zod";
9
+ export declare const name = "create_binding";
10
+ export declare const description: string;
11
+ export declare const inputSchema: z.ZodObject<{
12
+ targetEntityId: z.ZodString;
13
+ property: z.ZodString;
14
+ sourceChoreographyId: z.ZodString;
15
+ sourceType: z.ZodOptional<z.ZodEnum<["float", "point2D", "bool", "enum", "event", "color", "int"]>>;
16
+ sourceField: z.ZodOptional<z.ZodString>;
17
+ mapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
18
+ action: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
19
+ transition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ targetEntityId: string;
22
+ property: string;
23
+ sourceChoreographyId: string;
24
+ action?: Record<string, unknown> | undefined;
25
+ sourceType?: "float" | "point2D" | "bool" | "enum" | "event" | "color" | "int" | undefined;
26
+ mapping?: Record<string, unknown> | undefined;
27
+ sourceField?: string | undefined;
28
+ transition?: Record<string, unknown> | undefined;
29
+ }, {
30
+ targetEntityId: string;
31
+ property: string;
32
+ sourceChoreographyId: string;
33
+ action?: Record<string, unknown> | undefined;
34
+ sourceType?: "float" | "point2D" | "bool" | "enum" | "event" | "color" | "int" | undefined;
35
+ mapping?: Record<string, unknown> | undefined;
36
+ sourceField?: string | undefined;
37
+ transition?: Record<string, unknown> | undefined;
38
+ }>;
39
+ export declare function handler(params: z.infer<typeof inputSchema>): Promise<{
40
+ content: Array<{
41
+ type: "text";
42
+ text: string;
43
+ }>;
44
+ }>;
45
+ //# sourceMappingURL=create-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-binding.d.ts","sourceRoot":"","sources":["../../src/tools/create-binding.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,IAAI,mBAAmB,CAAC;AAErC,eAAO,MAAM,WAAW,QAKmG,CAAC;AAE5H,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDtB,CAAC;AAEH,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,CAsB7D"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * MCP tool: create_binding
3
+ *
4
+ * Creates an entity binding — connects a choreography's output to an entity property.
5
+ * Bindings are the Level 2 dynamic wiring: they define how choreography results
6
+ * affect visual properties on placed entities.
7
+ */
8
+ import { z } from "zod";
9
+ import { addBinding } from "../state/mutations.js";
10
+ export const name = "create_binding";
11
+ export const description = "Create a binding between a choreography and an entity property. " +
12
+ "Bindings connect choreography outputs to entity visual properties (position, rotation, opacity, animation state, etc.). " +
13
+ "Example: bind a 'tool_call' choreography's output to agent-1's 'animation.state' property, " +
14
+ "so when the choreography runs, the agent switches to a 'working' animation. " +
15
+ "The binding specifies which choreography provides the data, which entity receives it, and which property is controlled.";
16
+ export const inputSchema = z.object({
17
+ targetEntityId: z
18
+ .string()
19
+ .describe("The semanticId of the target entity (e.g. 'agent-1', 'door-kitchen'). " +
20
+ "This must match a placed entity's semanticId in the scene."),
21
+ property: z
22
+ .string()
23
+ .describe("The entity property to bind to. Available properties: " +
24
+ "'position' (point2D), 'position.x'/'position.y' (float), " +
25
+ "'rotation' (float, degrees), 'scale'/'scale.x'/'scale.y' (float), " +
26
+ "'opacity' (float, 0-1), 'visible' (bool), 'tint' (color), " +
27
+ "'animation.state' (enum — switches animation), 'animation.speed' (float), " +
28
+ "'zIndex' (int), " +
29
+ "'moveTo:waypoint' (event — move entity to a waypoint), " +
30
+ "'followRoute' (event — entity follows a route), " +
31
+ "'teleportTo' (event — instant move)."),
32
+ sourceChoreographyId: z
33
+ .string()
34
+ .describe("The ID of the choreography that provides the data for this binding."),
35
+ sourceType: z
36
+ .enum(["float", "point2D", "bool", "enum", "event", "color", "int"])
37
+ .optional()
38
+ .describe("The type of data the choreography outputs. Defaults to 'event'. " +
39
+ "Must be compatible with the target property's accepted types."),
40
+ sourceField: z
41
+ .string()
42
+ .optional()
43
+ .describe("Specific field to extract from the signal payload (e.g. 'velocity', 'value'). " +
44
+ "If omitted, auto-detected from context."),
45
+ mapping: z
46
+ .record(z.unknown())
47
+ .optional()
48
+ .describe("Optional value mapping function. Example: { fn: 'linear', inputRange: [0, 100], outputRange: [0, 1] }."),
49
+ action: z
50
+ .record(z.unknown())
51
+ .optional()
52
+ .describe("Optional action config for event→action bindings. " +
53
+ "Example for moveTo: { waypoint: 'workstation-1', animationDuring: 'walk', animationOnArrival: 'idle', duration: 1000 }."),
54
+ transition: z
55
+ .record(z.unknown())
56
+ .optional()
57
+ .describe("Optional transition config for smooth property changes. " +
58
+ "Example: { targetValue: 0.5, durationMs: 300, easing: 'easeOut' }."),
59
+ });
60
+ export async function handler(params) {
61
+ addBinding({
62
+ targetEntityId: params.targetEntityId,
63
+ property: params.property,
64
+ sourceChoreographyId: params.sourceChoreographyId,
65
+ sourceType: params.sourceType ?? "event",
66
+ sourceField: params.sourceField,
67
+ mapping: params.mapping,
68
+ action: params.action,
69
+ transition: params.transition,
70
+ });
71
+ return {
72
+ content: [
73
+ {
74
+ type: "text",
75
+ text: JSON.stringify({
76
+ ok: true,
77
+ }),
78
+ },
79
+ ],
80
+ };
81
+ }
82
+ //# sourceMappingURL=create-binding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-binding.js","sourceRoot":"","sources":["../../src/tools/create-binding.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC;AAErC,MAAM,CAAC,MAAM,WAAW,GACtB,kEAAkE;IAClE,0HAA0H;IAC1H,6FAA6F;IAC7F,8EAA8E;IAC9E,yHAAyH,CAAC;AAE5H,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,QAAQ,CACP,wEAAwE;QACxE,4DAA4D,CAC7D;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,CACP,wDAAwD;QACxD,2DAA2D;QAC3D,oEAAoE;QACpE,4DAA4D;QAC5D,4EAA4E;QAC5E,kBAAkB;QAClB,yDAAyD;QACzD,kDAAkD;QAClD,sCAAsC,CACvC;IACH,oBAAoB,EAAE,CAAC;SACpB,MAAM,EAAE;SACR,QAAQ,CAAC,qEAAqE,CAAC;IAClF,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I;iBACT,CAAC;aACH;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * MCP tool: create_choreography
3
+ *
4
+ * Creates a choreography definition with steps in the scene-builder.
5
+ * A choreography is a sequence of animation actions that execute when
6
+ * a matching signal arrives.
7
+ */
8
+ import { z } from "zod";
9
+ export declare const name = "create_choreography";
10
+ export declare const description: string;
11
+ export declare const inputSchema: z.ZodObject<{
12
+ on: z.ZodString;
13
+ steps: z.ZodArray<z.ZodObject<{
14
+ action: z.ZodEnum<["move", "fly", "flash", "spawn", "destroy", "wait", "playSound", "setAnimation", "parallel", "onArrive", "onInterrupt"]>;
15
+ entity: z.ZodOptional<z.ZodString>;
16
+ target: z.ZodOptional<z.ZodString>;
17
+ delay: z.ZodOptional<z.ZodNumber>;
18
+ duration: z.ZodOptional<z.ZodNumber>;
19
+ easing: z.ZodOptional<z.ZodString>;
20
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ action: "move" | "fly" | "flash" | "spawn" | "destroy" | "wait" | "playSound" | "setAnimation" | "parallel" | "onArrive" | "onInterrupt";
23
+ params?: Record<string, unknown> | undefined;
24
+ entity?: string | undefined;
25
+ duration?: number | undefined;
26
+ target?: string | undefined;
27
+ delay?: number | undefined;
28
+ easing?: string | undefined;
29
+ }, {
30
+ action: "move" | "fly" | "flash" | "spawn" | "destroy" | "wait" | "playSound" | "setAnimation" | "parallel" | "onArrive" | "onInterrupt";
31
+ params?: Record<string, unknown> | undefined;
32
+ entity?: string | undefined;
33
+ duration?: number | undefined;
34
+ target?: string | undefined;
35
+ delay?: number | undefined;
36
+ easing?: string | undefined;
37
+ }>, "many">;
38
+ defaultTargetEntityId: z.ZodOptional<z.ZodString>;
39
+ when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
40
+ interrupts: z.ZodOptional<z.ZodBoolean>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ on: string;
43
+ steps: {
44
+ action: "move" | "fly" | "flash" | "spawn" | "destroy" | "wait" | "playSound" | "setAnimation" | "parallel" | "onArrive" | "onInterrupt";
45
+ params?: Record<string, unknown> | undefined;
46
+ entity?: string | undefined;
47
+ duration?: number | undefined;
48
+ target?: string | undefined;
49
+ delay?: number | undefined;
50
+ easing?: string | undefined;
51
+ }[];
52
+ when?: Record<string, unknown> | undefined;
53
+ interrupts?: boolean | undefined;
54
+ defaultTargetEntityId?: string | undefined;
55
+ }, {
56
+ on: string;
57
+ steps: {
58
+ action: "move" | "fly" | "flash" | "spawn" | "destroy" | "wait" | "playSound" | "setAnimation" | "parallel" | "onArrive" | "onInterrupt";
59
+ params?: Record<string, unknown> | undefined;
60
+ entity?: string | undefined;
61
+ duration?: number | undefined;
62
+ target?: string | undefined;
63
+ delay?: number | undefined;
64
+ easing?: string | undefined;
65
+ }[];
66
+ when?: Record<string, unknown> | undefined;
67
+ interrupts?: boolean | undefined;
68
+ defaultTargetEntityId?: string | undefined;
69
+ }>;
70
+ export declare function handler(params: z.infer<typeof inputSchema>): Promise<{
71
+ content: Array<{
72
+ type: "text";
73
+ text: string;
74
+ }>;
75
+ }>;
76
+ //# sourceMappingURL=create-choreography.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-choreography.d.ts","sourceRoot":"","sources":["../../src/tools/create-choreography.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,IAAI,wBAAwB,CAAC;AAE1C,eAAO,MAAM,WAAW,QAMuC,CAAC;AAuDhE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BtB,CAAC;AAEH,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,CAgC7D"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * MCP tool: create_choreography
3
+ *
4
+ * Creates a choreography definition with steps in the scene-builder.
5
+ * A choreography is a sequence of animation actions that execute when
6
+ * a matching signal arrives.
7
+ */
8
+ import { z } from "zod";
9
+ import { addChoreography } from "../state/mutations.js";
10
+ export const name = "create_choreography";
11
+ export const description = "Create a choreography — a sequence of animation steps triggered by a signal. " +
12
+ "Choreographies are the core of sajou's animation system. When a signal of the matching type " +
13
+ "arrives, the choreography's steps execute in order, animating entities on the scene. " +
14
+ "After creating a choreography, wire it to a signal type using create_wire (signal-type → choreographer). " +
15
+ "Example: a 'tool_call' signal triggers a choreography that moves an agent entity to a workstation, " +
16
+ "plays a working animation, then flashes a result indicator.";
17
+ const stepSchema = z.object({
18
+ action: z
19
+ .enum(["move", "fly", "flash", "spawn", "destroy", "wait", "playSound", "setAnimation", "parallel", "onArrive", "onInterrupt"])
20
+ .describe("The animation action to perform. " +
21
+ "'move' — animate entity along a path to target position. " +
22
+ "'fly' — instant arc movement to target. " +
23
+ "'flash' — brief visual highlight on the entity. " +
24
+ "'spawn' — create a new entity instance at a position. " +
25
+ "'destroy' — remove an entity from the scene. " +
26
+ "'wait' — pause the sequence for a duration. " +
27
+ "'playSound' — trigger an audio cue. " +
28
+ "'setAnimation' — change the entity's animation state (e.g. 'idle' → 'walk'). " +
29
+ "'parallel' — run child steps simultaneously. " +
30
+ "'onArrive' — execute child steps when entity reaches destination. " +
31
+ "'onInterrupt' — execute child steps if choreography is interrupted."),
32
+ entity: z
33
+ .string()
34
+ .optional()
35
+ .describe("Target entity semanticId (e.g. 'agent-1', 'door-kitchen'). " +
36
+ "Can use signal references like 'signal.payload.from' to dynamically resolve. " +
37
+ "If omitted, uses the choreography's defaultTargetEntityId."),
38
+ target: z
39
+ .string()
40
+ .optional()
41
+ .describe("Target position or waypoint name for movement actions (e.g. 'workstation-1', 'patrol-route')."),
42
+ delay: z
43
+ .number()
44
+ .optional()
45
+ .describe("Delay in milliseconds before this step starts."),
46
+ duration: z
47
+ .number()
48
+ .optional()
49
+ .describe("Duration in milliseconds for timed actions (move, wait)."),
50
+ easing: z
51
+ .string()
52
+ .optional()
53
+ .describe("Easing function: 'linear', 'easeIn', 'easeOut', 'easeInOut', 'arc'."),
54
+ params: z
55
+ .record(z.unknown())
56
+ .optional()
57
+ .describe("Additional parameters specific to the action type. " +
58
+ "For 'flash': { color: '#ff0', intensity: 0.8 }. " +
59
+ "For 'setAnimation': { state: 'walk' }. " +
60
+ "For 'spawn': { entityId: 'arrow', x: 100, y: 200 }. " +
61
+ "For 'playSound': { sound: 'click' }."),
62
+ });
63
+ export const inputSchema = z.object({
64
+ on: z
65
+ .string()
66
+ .describe("Signal type that triggers this choreography (e.g. 'tool_call', 'agent_state_change', 'task_dispatch'). " +
67
+ "This is the default trigger — the actual wiring is done via create_wire."),
68
+ steps: z
69
+ .array(stepSchema)
70
+ .min(1)
71
+ .describe("Ordered list of animation steps to execute when triggered."),
72
+ defaultTargetEntityId: z
73
+ .string()
74
+ .optional()
75
+ .describe("Default entity semanticId for steps that don't specify their own entity. " +
76
+ "Useful when most steps target the same actor."),
77
+ when: z
78
+ .record(z.unknown())
79
+ .optional()
80
+ .describe("Optional payload filter — choreography only triggers when signal payload matches. " +
81
+ "Example: { field: 'toolName', operator: 'eq', value: 'Read' } triggers only for Read tool calls."),
82
+ interrupts: z
83
+ .boolean()
84
+ .optional()
85
+ .describe("If true, this choreography can interrupt a running one on the same entity. Default: false."),
86
+ });
87
+ export async function handler(params) {
88
+ const choreographyId = crypto.randomUUID();
89
+ addChoreography({
90
+ id: choreographyId,
91
+ on: params.on,
92
+ steps: params.steps.map((s) => ({
93
+ action: s.action,
94
+ entity: s.entity,
95
+ target: s.target,
96
+ delay: s.delay,
97
+ duration: s.duration,
98
+ easing: s.easing,
99
+ params: s.params ?? {},
100
+ })),
101
+ defaultTargetEntityId: params.defaultTargetEntityId,
102
+ when: params.when,
103
+ interrupts: params.interrupts ?? false,
104
+ });
105
+ return {
106
+ content: [
107
+ {
108
+ type: "text",
109
+ text: JSON.stringify({
110
+ ok: true,
111
+ choreographyId,
112
+ hint: `Choreography created. Wire it to a signal type with create_wire: { fromZone: 'signal-type', fromId: '${params.on}', toZone: 'choreographer', toId: '${choreographyId}' }`,
113
+ }),
114
+ },
115
+ ],
116
+ };
117
+ }
118
+ //# sourceMappingURL=create-choreography.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-choreography.js","sourceRoot":"","sources":["../../src/tools/create-choreography.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC;AAE1C,MAAM,CAAC,MAAM,WAAW,GACtB,+EAA+E;IAC/E,8FAA8F;IAC9F,uFAAuF;IACvF,2GAA2G;IAC3G,qGAAqG;IACrG,6DAA6D,CAAC;AAEhE,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;SAC9H,QAAQ,CACP,mCAAmC;QACnC,2DAA2D;QAC3D,0CAA0C;QAC1C,kDAAkD;QAClD,wDAAwD;QACxD,+CAA+C;QAC/C,8CAA8C;QAC9C,sCAAsC;QACtC,+EAA+E;QAC/E,+CAA+C;QAC/C,oEAAoE;QACpE,qEAAqE,CACtE;IACH,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;S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