dominus-cli 0.5.1 → 0.5.2
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/dist/index.js +68 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +57 -0
- package/dist/mcp.js.map +1 -1
- package/package.json +1 -1
- package/plugin/Dominus.rbxm +0 -0
- package/plugin/src/UIBuilder.lua +27 -9
package/dist/index.js
CHANGED
|
@@ -629,6 +629,66 @@ var init_ws_client = __esm({
|
|
|
629
629
|
}
|
|
630
630
|
});
|
|
631
631
|
|
|
632
|
+
// src/agent/internal-memory.ts
|
|
633
|
+
var INTERNAL_MEMORY;
|
|
634
|
+
var init_internal_memory = __esm({
|
|
635
|
+
"src/agent/internal-memory.ts"() {
|
|
636
|
+
INTERNAL_MEMORY = `## Internal Memory \u2014 Known Quirks & Lessons
|
|
637
|
+
|
|
638
|
+
These are built-in lessons that ship with Dominus. Follow them exactly.
|
|
639
|
+
|
|
640
|
+
### create_ui \u2014 property format
|
|
641
|
+
- Each node accepts properties in **either** of two shapes:
|
|
642
|
+
- **Flattened (preferred)**: props as top-level keys next to \`ClassName\`, \`Name\`, \`Children\`.
|
|
643
|
+
\`\`\`json
|
|
644
|
+
{ "ClassName": "TextButton", "Name": "Btn", "Text": "OK", "Size": [0, 100, 0, 40] }
|
|
645
|
+
\`\`\`
|
|
646
|
+
- **Nested bag**: props grouped under \`properties\` / \`Properties\` / \`props\` / \`Props\`.
|
|
647
|
+
\`\`\`json
|
|
648
|
+
{ "ClassName": "TextButton", "Name": "Btn",
|
|
649
|
+
"properties": { "Text": "OK", "Size": [0, 100, 0, 40] } }
|
|
650
|
+
\`\`\`
|
|
651
|
+
- Do NOT mix a nested \`properties\` bag with flattened props of the same name \u2014 the bag wins.
|
|
652
|
+
- Reserved keys (never treated as instance properties): \`ClassName\`, \`className\`, \`Name\`, \`name\`, \`Children\`, \`children\`, \`properties\`, \`Properties\`, \`props\`, \`Props\`.
|
|
653
|
+
|
|
654
|
+
### build_multiple \u2014 schema is strict
|
|
655
|
+
- Top-level keys only: \`name\`, \`className\`, \`position\`, \`size\`, \`color\`, \`material\`, \`anchored\`, \`shape\`, \`transparency\`, \`parent\`, \`canCollide\`.
|
|
656
|
+
- Does NOT accept a nested \`properties\` bag. For anything outside those fields use \`insert_instance\` + \`set_properties\`.
|
|
657
|
+
- \`shape\` values: \`Block\`, \`Ball\`, \`Cylinder\`, \`Wedge\`.
|
|
658
|
+
|
|
659
|
+
### Color formats (accepted everywhere)
|
|
660
|
+
- Hex: \`"#RRGGBB"\`
|
|
661
|
+
- RGB string: \`"rgb(255, 128, 0)"\`
|
|
662
|
+
- BrickColor name: \`"Bright red"\`, \`"Institutional white"\`, \`"Really black"\`, etc.
|
|
663
|
+
- Array: \`[r, g, b]\` (0\u20131 floats) or \`[255, 128, 0]\` (auto-detected if any value > 1)
|
|
664
|
+
|
|
665
|
+
### UDim2 / UDim / Vector2 / Color3 coercion (create_ui)
|
|
666
|
+
- UDim2: \`[xScale, xOffset, yScale, yOffset]\` or \`{XScale, XOffset, YScale, YOffset}\`.
|
|
667
|
+
- UDim: \`[scale, offset]\` or a plain number (treated as pixels).
|
|
668
|
+
- Vector2 (e.g. \`AnchorPoint\`): \`[x, y]\` or \`{x, y}\`.
|
|
669
|
+
- 2-element arrays are auto-disambiguated by property name (\`AnchorPoint\` \u2192 Vector2, \`CornerRadius\` \u2192 UDim).
|
|
670
|
+
|
|
671
|
+
### Common GUI property names
|
|
672
|
+
- GUI uses \`Size\`/\`Position\` as **UDim2** \u2014 never Vector3.
|
|
673
|
+
- \`BackgroundColor3\`, \`TextColor3\`, \`BorderColor3\`, \`ImageColor3\` \u2192 Color3.
|
|
674
|
+
- \`Font\` accepts a string enum name like \`"GothamBold"\`, \`"SourceSans"\`.
|
|
675
|
+
- Enum properties take the string name: \`"Center"\`, \`"Left"\`, \`"Fit"\`.
|
|
676
|
+
|
|
677
|
+
### Tool selection cheat-sheet
|
|
678
|
+
- Single 3D part \u2192 \`create_part\`
|
|
679
|
+
- Many 3D parts (tree, building, vehicle) \u2192 \`build_multiple\` with \`groupName\`
|
|
680
|
+
- Full UI tree \u2192 \`create_ui\` (one call, never loop \`insert_instance\` for UI)
|
|
681
|
+
- Adjusting an existing instance \u2192 \`set_properties\` (not \`run_code\`)
|
|
682
|
+
- Anything exotic or procedural \u2192 \`run_code\` as last resort
|
|
683
|
+
|
|
684
|
+
### Verification habits
|
|
685
|
+
- After a build, call \`get_explorer\` or \`get_selection\` to confirm the tree looks right.
|
|
686
|
+
- After editing a script, read it back.
|
|
687
|
+
- After \`run_code\`, check \`get_output\` for errors.
|
|
688
|
+
`;
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
|
|
632
692
|
// src/memory/store.ts
|
|
633
693
|
var store_exports = {};
|
|
634
694
|
__export(store_exports, {
|
|
@@ -1518,7 +1578,7 @@ var init_create_ui = __esm({
|
|
|
1518
1578
|
},
|
|
1519
1579
|
tree: {
|
|
1520
1580
|
type: "object",
|
|
1521
|
-
description: 'The root UI node. Each node has: ClassName (string), Name (string),
|
|
1581
|
+
description: 'The root UI node. Each node has: ClassName (string), Name (string), Children (array of child nodes), and properties. Properties may be specified either flattened at the top level of the node, OR nested under a "properties" / "Properties" / "props" key \u2014 both work. Property values are auto-coerced:\n UDim2: [xScale, xOffset, yScale, yOffset] or {XScale, XOffset, YScale, YOffset}\n Color3: "#hex", "rgb(r,g,b)", [r,g,b], or BrickColor name\n UDim: [scale, offset] or number\n Vector2: [x, y] or {x, y} (auto-disambiguated from UDim by property name)\n NumberRange: [min, max] or number\n Rect: [minX, minY, maxX, maxY] or {MinX, MinY, MaxX, MaxY}\n Font: "GothamBold", "SourceSans", etc. (Enum.Font names)\n Enums: string name like "Center", "Left", "Fit"\n FontFace: {Family, Weight, Style}\n 2-element arrays are auto-disambiguated: AnchorPoint\u2192Vector2, CornerRadius/Padding\u2192UDim, etc.'
|
|
1522
1582
|
},
|
|
1523
1583
|
animate: {
|
|
1524
1584
|
type: "boolean",
|
|
@@ -2499,6 +2559,8 @@ async function startMcpServer() {
|
|
|
2499
2559
|
const mcp = new McpServer({
|
|
2500
2560
|
name: "dominus",
|
|
2501
2561
|
version: "0.2.1"
|
|
2562
|
+
}, {
|
|
2563
|
+
instructions: INTERNAL_MEMORY
|
|
2502
2564
|
});
|
|
2503
2565
|
mcp.tool(
|
|
2504
2566
|
"read_script",
|
|
@@ -2951,6 +3013,7 @@ var init_server = __esm({
|
|
|
2951
3013
|
init_protocol();
|
|
2952
3014
|
init_store();
|
|
2953
3015
|
init_config();
|
|
3016
|
+
init_internal_memory();
|
|
2954
3017
|
}
|
|
2955
3018
|
});
|
|
2956
3019
|
var CROWN_ART = ` \u25C6 \u25C6 \u25C6
|
|
@@ -4132,6 +4195,7 @@ function toolToOpenAI(tool29) {
|
|
|
4132
4195
|
}
|
|
4133
4196
|
|
|
4134
4197
|
// src/agent/system-prompt.ts
|
|
4198
|
+
init_internal_memory();
|
|
4135
4199
|
function buildSystemPrompt(opts) {
|
|
4136
4200
|
const parts = [];
|
|
4137
4201
|
parts.push(`You are Dominus, an expert AI agent for Roblox Studio development.
|
|
@@ -4290,7 +4354,9 @@ The \`get_class_info\` tool queries Roblox's ReflectionService to return the com
|
|
|
4290
4354
|
- All events with parameter types
|
|
4291
4355
|
- Superclass, creatability, serialization info
|
|
4292
4356
|
|
|
4293
|
-
Use it whenever you're unsure about property names or types. It's fast and cached
|
|
4357
|
+
Use it whenever you're unsure about property names or types. It's fast and cached.
|
|
4358
|
+
|
|
4359
|
+
${INTERNAL_MEMORY}`);
|
|
4294
4360
|
return parts.join("\n");
|
|
4295
4361
|
}
|
|
4296
4362
|
|