dodraw-mcp-server 0.1.6 → 0.1.7
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.
|
@@ -211,8 +211,6 @@ exports.toolDefinitions = [
|
|
|
211
211
|
required: ["name", "type"]
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
|
-
x: { type: "number" },
|
|
215
|
-
y: { type: "number" },
|
|
216
214
|
id: { type: "string", description: "Optional explicit ID" },
|
|
217
215
|
referenceNodeId: { type: "string", description: "Optional. ID of an existing node to place this new table relative to." },
|
|
218
216
|
direction: { type: "string", enum: ["UP", "DOWN", "LEFT", "RIGHT"], description: "Optional. Direction to place relative to referenceNodeId." },
|
|
@@ -598,9 +596,9 @@ async function handleToolCall(name, args) {
|
|
|
598
596
|
const estimatedHeight = 0.8 + cols.length * 0.4;
|
|
599
597
|
const height = Math.max(2, estimatedHeight);
|
|
600
598
|
const width = 3;
|
|
601
|
-
// Auto-placement logic
|
|
602
|
-
let x =
|
|
603
|
-
let z =
|
|
599
|
+
// Auto-placement logic (defaults to 0,0 for first node)
|
|
600
|
+
let x = 0;
|
|
601
|
+
let z = 0;
|
|
604
602
|
// Relative Placement Logic
|
|
605
603
|
if (args.referenceNodeId && args.direction) {
|
|
606
604
|
const sourceNode = state.nodes.find(n => n.id === args.referenceNodeId);
|
|
@@ -646,16 +644,8 @@ async function handleToolCall(name, args) {
|
|
|
646
644
|
return dx < combinedHalfWidth && dz < combinedHalfHeight;
|
|
647
645
|
});
|
|
648
646
|
};
|
|
649
|
-
let iterations = 0;
|
|
650
|
-
while (checkCollision(x, z) && iterations < 50) {
|
|
651
|
-
iterations++;
|
|
652
|
-
if (dirX !== 0)
|
|
653
|
-
z += shiftStepZ;
|
|
654
|
-
else
|
|
655
|
-
x += shiftStepX;
|
|
656
|
-
}
|
|
657
647
|
}
|
|
658
|
-
else if (
|
|
648
|
+
else if (state.nodes.length > 0) {
|
|
659
649
|
// Fallback to "next to last" if no explicit relative info
|
|
660
650
|
const lastNode = state.nodes[state.nodes.length - 1];
|
|
661
651
|
x = lastNode.x + 5;
|
package/package.json
CHANGED
|
@@ -210,10 +210,9 @@ export const toolDefinitions: Tool[] = [
|
|
|
210
210
|
isFk: { type: "boolean" }
|
|
211
211
|
},
|
|
212
212
|
required: ["name", "type"]
|
|
213
|
-
}
|
|
213
|
+
}
|
|
214
214
|
},
|
|
215
|
-
|
|
216
|
-
y: { type: "number" },
|
|
215
|
+
|
|
217
216
|
id: { type: "string", description: "Optional explicit ID" },
|
|
218
217
|
referenceNodeId: { type: "string", description: "Optional. ID of an existing node to place this new table relative to." },
|
|
219
218
|
direction: { type: "string", enum: ["UP", "DOWN", "LEFT", "RIGHT"], description: "Optional. Direction to place relative to referenceNodeId." },
|
|
@@ -621,9 +620,9 @@ export async function handleToolCall(name: string, args: any): Promise<any> {
|
|
|
621
620
|
|
|
622
621
|
const width = 3;
|
|
623
622
|
|
|
624
|
-
// Auto-placement logic
|
|
625
|
-
let x =
|
|
626
|
-
let z =
|
|
623
|
+
// Auto-placement logic (defaults to 0,0 for first node)
|
|
624
|
+
let x = 0;
|
|
625
|
+
let z = 0;
|
|
627
626
|
|
|
628
627
|
// Relative Placement Logic
|
|
629
628
|
if (args.referenceNodeId && args.direction) {
|
|
@@ -666,13 +665,7 @@ export async function handleToolCall(name: string, args: any): Promise<any> {
|
|
|
666
665
|
});
|
|
667
666
|
};
|
|
668
667
|
|
|
669
|
-
|
|
670
|
-
while (checkCollision(x, z) && iterations < 50) {
|
|
671
|
-
iterations++;
|
|
672
|
-
if (dirX !== 0) z += shiftStepZ;
|
|
673
|
-
else x += shiftStepX;
|
|
674
|
-
}
|
|
675
|
-
} else if (args.x === undefined && args.y === undefined && state.nodes.length > 0) {
|
|
668
|
+
} else if (state.nodes.length > 0) {
|
|
676
669
|
// Fallback to "next to last" if no explicit relative info
|
|
677
670
|
const lastNode = state.nodes[state.nodes.length - 1];
|
|
678
671
|
x = lastNode.x + 5;
|