openmagic 0.27.0 → 0.28.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/dist/cli.js +14 -13
- package/dist/cli.js.map +1 -1
- package/dist/toolbar/index.global.js +33 -33
- package/dist/toolbar/index.global.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -902,16 +902,17 @@ You MUST respond with valid JSON in this exact format:
|
|
|
902
902
|
- \`delete\`: Delete a file. No search/replace/content needed.
|
|
903
903
|
|
|
904
904
|
## Rules
|
|
905
|
-
1.
|
|
906
|
-
2.
|
|
907
|
-
3.
|
|
908
|
-
4.
|
|
909
|
-
5.
|
|
910
|
-
6.
|
|
911
|
-
7.
|
|
912
|
-
8.
|
|
913
|
-
9.
|
|
914
|
-
10.
|
|
905
|
+
1. If the user is asking a QUESTION (not requesting a change), respond with {"modifications":[],"explanation":"your answer here"}. Only propose modifications when the user explicitly wants something changed.
|
|
906
|
+
2. NEVER use delete+create to modify an existing file. Always use edit with search/replace. Only use create for genuinely new files that don't exist yet.
|
|
907
|
+
3. Copy the search string EXACTLY from the grounded source files \u2014 do not retype, reformat, or change whitespace/indentation
|
|
908
|
+
4. Include 3-5 lines of surrounding context in the search field to ensure uniqueness
|
|
909
|
+
5. Keep modifications minimal \u2014 change only what's needed. Do NOT rewrite entire files.
|
|
910
|
+
6. If the grounded files don't contain the code you need to modify, return: {"modifications":[],"explanation":"NEED_FILE: exact/relative/path/to/file.ext"}
|
|
911
|
+
7. For style changes: check the dependencies (package.json) to know if the project uses Tailwind, MUI, etc. Use the project's styling approach, not raw CSS
|
|
912
|
+
8. Use the selected element's cssSelector, className, parentContainerStyles, and siblings to understand the full layout context
|
|
913
|
+
9. Use the page URL route and componentHint to identify the correct source file to modify
|
|
914
|
+
10. Always preserve existing code style, conventions, and indentation
|
|
915
|
+
11. ALWAYS respond with valid JSON only \u2014 no text before or after the JSON object`;
|
|
915
916
|
function buildContextParts(context) {
|
|
916
917
|
const parts = {};
|
|
917
918
|
if (context.selectedElement) {
|
|
@@ -1447,7 +1448,7 @@ async function handleLlmChat(params, onChunk, onDone, onError) {
|
|
|
1447
1448
|
}
|
|
1448
1449
|
|
|
1449
1450
|
// src/server.ts
|
|
1450
|
-
var VERSION = "0.
|
|
1451
|
+
var VERSION = "0.28.0";
|
|
1451
1452
|
var __dirname = dirname2(fileURLToPath(import.meta.url));
|
|
1452
1453
|
function attachOpenMagic(httpServer, roots) {
|
|
1453
1454
|
function handleRequest(req, res) {
|
|
@@ -1989,7 +1990,7 @@ process.on("uncaughtException", (err) => {
|
|
|
1989
1990
|
});
|
|
1990
1991
|
var childProcesses = [];
|
|
1991
1992
|
var lastDetectedPort = null;
|
|
1992
|
-
var VERSION2 = "0.
|
|
1993
|
+
var VERSION2 = "0.28.0";
|
|
1993
1994
|
function ask(question) {
|
|
1994
1995
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
1995
1996
|
return new Promise((resolve3) => {
|
|
@@ -2097,7 +2098,7 @@ program.name("openmagic").description("AI-powered coding toolbar for any web app
|
|
|
2097
2098
|
).option(
|
|
2098
2099
|
"-r, --root <paths...>",
|
|
2099
2100
|
"Project root directories (defaults to cwd)"
|
|
2100
|
-
).option("--no-open", "Don't auto-open browser").option("--host <host>", "Dev server host", "
|
|
2101
|
+
).option("--no-open", "Don't auto-open browser").option("--host <host>", "Dev server host", "localhost").action(async (opts) => {
|
|
2101
2102
|
console.log("");
|
|
2102
2103
|
console.log(
|
|
2103
2104
|
" \u{1FA84} " + chalk.bold.hex("#6c5ce7")("OpenMagic") + chalk.dim(` v${VERSION2}`) + " \u2728"
|