mythos-code 1.9.0 → 1.10.15
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/bin/mythos.js +48 -21
- package/package.json +1 -1
package/bin/mythos.js
CHANGED
|
@@ -192,6 +192,13 @@ const TOOL_PROMPT = [
|
|
|
192
192
|
"4. Prüfen (PFLICHT, bevor du „fertig“ sagst): verify ausführen und jedes ✗ beheben. Bei Webseiten/Web-Apps zusätzlich starten (serve für statische Seiten, start für Dev-Server/Backends) und mit check prüfen; Fehler beheben und erneut prüfen, bis check „ERGEBNIS: ✓“ meldet. Behaupte nie, dass etwas funktioniert, das du nicht geprüft hast.",
|
|
193
193
|
"5. Erst dann die Abschlussantwort.",
|
|
194
194
|
"",
|
|
195
|
+
"GRAFIKEN: Du hast keinen Bildgenerator. Bilder, Logos, Icons, Hintergründe zeichnest du selbst als SVG (write oder ```datei:name.svg), Minecraft-Texturen als PNG (z. B. per Python/Pillow-Skript, das du schreibst und ausführst).",
|
|
196
|
+
"ADRESSEN: Läuft etwas (Server, Webseite, Vorschau), nenne die Adresse in der Abschlussantwort ganz oben als klickbaren Link, z. B. **[http://localhost:3000](http://localhost:3000)**.",
|
|
197
|
+
"ÖFFNEN/STARTEN ≠ BAUEN: „öffne/starte/mach auf/führ aus <Programm/Spiel/Datei>“ heißt: das VORHANDENE Programm auf dem PC finden und starten – NIEMALS Code schreiben, ändern oder ein Projekt umbauen. " +
|
|
198
|
+
"Suche (Windows, mit Teilen des Namens, z. B. launcher oder mythos) nacheinander: 1) Startmenü-Apps per PowerShell: Get-StartApps | Where-Object Name -like '*launcher*' – starten mit Start-Process ('shell:AppsFolder\\' + AppID). " +
|
|
199
|
+
"2) Verknüpfungen (.lnk) auf dem Desktop und im Startmenü (%APPDATA% und %PROGRAMDATA% \\Microsoft\\Windows\\Start Menu) per dir /s /b. 3) .exe-Dateien in %LOCALAPPDATA%\\Programs und %PROGRAMFILES% per where /r. " +
|
|
200
|
+
"Gefunden → mit start \"\" \"<voller Pfad>\" starten und nur kurz melden („✓ Mythos Launcher gestartet“). Nichts gefunden → kurz sagen, wo du gesucht hast, und nach dem Ort fragen. Gebaut oder geändert wird nur, wenn der Nutzer es ausdrücklich will.",
|
|
201
|
+
"",
|
|
195
202
|
"HANDELN STATT ERKLÄREN: Du hast vollen Zugriff auf den PC des Nutzers. Wenn er etwas haben will (eine .exe, ein Programm, eine Webseite, ein Skript, eine Datei, ein Build), dann BAUST du es selbst mit deinen Werkzeugen und lieferst das fertige Ergebnis mit Pfad – schreibe NIE nur eine Anleitung, Befehle zum Abtippen oder „so geht's“. Fehlt ein Programm (z. B. pyinstaller, electron-builder, pkg, dotnet), installiere es selbst. Anleitungen nur, wenn der Nutzer ausdrücklich danach fragt.",
|
|
196
203
|
"Beispiele: „mach eine exe“ → Python: run \"pip install pyinstaller\", dann run \"pyinstaller --onefile --noconfirm main.py\" → dist\\main.exe; Node-Skript: run \"npx --yes @yao-pkg/pkg . --targets node18-win-x64 --output dist/app.exe\"; Electron-App: run \"npx --yes electron-builder --win portable\"; C#: run \"dotnet publish -c Release -r win-x64 --self-contained -p:PublishSingleFile=true\". Danach mit ls/run prüfen, dass die .exe existiert (und wenn möglich startet), und den vollen Pfad nennen.",
|
|
197
204
|
"",
|
|
@@ -1034,8 +1041,8 @@ let goal = "";
|
|
|
1034
1041
|
const SYSTEM = () => "Du bist Mythos Code, ein autonomer Coding-Agent im Terminal des Nutzers (OS: " + process.platform + ", Projektordner: " + ROOT + ").\n" +
|
|
1035
1042
|
TOOL_PROMPT + memoryPrompt(readMemory(ROOT)) + goalPrompt(goal);
|
|
1036
1043
|
|
|
1037
|
-
const SITE = process.env.MYTHOS_SITE_URL || "https://mythos-ai-final-
|
|
1038
|
-
const VERSION = "1.
|
|
1044
|
+
const SITE = process.env.MYTHOS_SITE_URL || "https://mythos-ai-final-vers.lovable.app";
|
|
1045
|
+
const VERSION = "1.10.15";
|
|
1039
1046
|
const PKG = "mythos-code";
|
|
1040
1047
|
|
|
1041
1048
|
// ---------- Auto-Update über npm ----------
|
|
@@ -1071,27 +1078,44 @@ async function autoUpdate(force = false) {
|
|
|
1071
1078
|
await new Promise(() => {}); // hier nicht weiterlaufen – der neue Prozess übernimmt
|
|
1072
1079
|
}
|
|
1073
1080
|
|
|
1074
|
-
// ---------- Startbildschirm
|
|
1075
|
-
//
|
|
1081
|
+
// ---------- Startbildschirm im Claude-Code-Stil: Maskottchen „Myth“ links, Infos rechts ----------
|
|
1082
|
+
// Farben aus dem Mythos-Logo (Magenta → Violett → Blau → Türkis), 24-Bit-Farbe wenn möglich.
|
|
1083
|
+
const TRUE = process.env.COLORTERM === "truecolor" || process.env.COLORTERM === "24bit" || process.platform === "win32" || !!process.env.WT_SESSION;
|
|
1084
|
+
const rgb = (r, g, b) => (TRUE ? `\x1b[38;2;${r};${g};${b}m` : "\x1b[35m");
|
|
1085
|
+
const GRAD = [[217, 70, 239], [168, 85, 247], [99, 102, 241], [59, 130, 246], [34, 211, 238]];
|
|
1086
|
+
const grad = (t) => { const x = Math.max(0, Math.min(1, t)) * (GRAD.length - 1), i = Math.min(GRAD.length - 2, Math.floor(x)), f = x - i; const [a, b] = [GRAD[i], GRAD[i + 1]]; return rgb(...a.map((v, k) => Math.round(v + (b[k] - v) * f))); };
|
|
1087
|
+
// Myth: kleiner Kristall-Geist mit Augen – 11 Zeichen breit, 4 Zeilen
|
|
1076
1088
|
const MASCOT = [
|
|
1077
|
-
"
|
|
1078
|
-
"
|
|
1089
|
+
" ▄█▄ ",
|
|
1090
|
+
" ▄█▀█▀█▄ ",
|
|
1079
1091
|
" ▀███████▀ ",
|
|
1080
|
-
"
|
|
1092
|
+
" ▀▄ ▄▀ ",
|
|
1081
1093
|
];
|
|
1094
|
+
const paintMascot = (line, row) => [...line].map((ch, i) => (ch === " " ? ch : grad((i + row) / 13) + ch)).join("") + C.x;
|
|
1095
|
+
const modelLabel = () => { const m = (typeof MODELS !== "undefined" ? MODELS : []).find((x) => x.id === (cfg.model || "mythos-code")); return m ? m.label : "MythosCode"; };
|
|
1082
1096
|
function banner(info) {
|
|
1083
|
-
const
|
|
1084
|
-
const w = Math.min((process.stdout.columns || 80) - 4, 64);
|
|
1085
|
-
const line = C.d + "─".repeat(w) + C.x;
|
|
1097
|
+
const tips = ["/hilfe zeigt alle Befehle", "Dateien mit @name anhängen", "Bilder einfach ins Terminal ziehen", "/goal <ziel> – Mythos bleibt dran, bis es fertig ist", "/modell wechselt das Modell"];
|
|
1086
1098
|
const right = [
|
|
1087
1099
|
C.b + "Mythos Code" + C.x + C.d + " v" + VERSION + C.x,
|
|
1100
|
+
C.d + modelLabel() + " · " + (cfg.name ? cfg.name : "Mythoscraft") + C.x,
|
|
1088
1101
|
C.d + info.dir + C.x,
|
|
1089
|
-
|
|
1090
|
-
C.c + "✦ " + C.x + C.d + tip + C.x,
|
|
1102
|
+
"",
|
|
1091
1103
|
];
|
|
1092
|
-
console.log("
|
|
1093
|
-
MASCOT.forEach((m, i) => console.log(
|
|
1094
|
-
console.log(
|
|
1104
|
+
console.log("");
|
|
1105
|
+
MASCOT.forEach((m, i) => console.log(" " + paintMascot(m, i) + " " + (right[i] || "")));
|
|
1106
|
+
console.log("");
|
|
1107
|
+
console.log(" " + grad(0.15) + "✦" + C.x + " " + C.d + tips[Math.floor(Math.random() * tips.length)] + (info.extra ? " · " + info.extra : "") + C.x + "\n");
|
|
1108
|
+
}
|
|
1109
|
+
// Eingabe wie bei Claude Code: Hinweis links + Modell rechts, Linie, dann „❯“.
|
|
1110
|
+
// (Unter der Eingabe zeichnen geht nicht – readline löscht beim Tippen alles unterhalb.)
|
|
1111
|
+
async function framedAsk(goal) {
|
|
1112
|
+
const w = Math.max(30, (process.stdout.columns || 80) - 1);
|
|
1113
|
+
const leftTxt = autoYes ? "▸▸ Vollzugriff an" : "? fragt vor Befehlen · /hilfe";
|
|
1114
|
+
const left = autoYes ? rgb(250, 204, 21) + leftTxt + C.x : C.d + leftTxt + C.x;
|
|
1115
|
+
const rightTxt = "● " + modelLabel() + " · /modell";
|
|
1116
|
+
const gap = Math.max(1, w - leftTxt.length - rightTxt.length);
|
|
1117
|
+
process.stdout.write("\n" + left + " ".repeat(gap) + C.d + rightTxt + C.x + "\n" + C.d + "─".repeat(w) + C.x + "\n");
|
|
1118
|
+
return ask((goal ? "🎯 " : "") + C.b + "❯ " + C.x);
|
|
1095
1119
|
}
|
|
1096
1120
|
const FN = process.env.MYTHOS_FN_URL || API.replace(/\/v1-messages$/, "");
|
|
1097
1121
|
const authPost = async (body) => (await fetch(FN + "/cli-auth", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) })).json();
|
|
@@ -1135,12 +1159,15 @@ const fmt = (ms) => { const s = Math.floor(ms / 1000); return (s >= 60 ? Math.fl
|
|
|
1135
1159
|
let T0 = 0, tick = null, activity = "";
|
|
1136
1160
|
const clearLine = () => process.stdout.write("\r\x1b[K");
|
|
1137
1161
|
// Zeigt live, was Mythos gerade tut (z. B. „✍ schreibt src/main.js · 12 KB“) – auf Terminalbreite gekürzt.
|
|
1162
|
+
const SPIN = ["✦", "✧", "✶", "✷", "✸", "✹", "✸", "✷", "✶", "✧"];
|
|
1163
|
+
let spinI = 0;
|
|
1138
1164
|
const tickLine = () => {
|
|
1139
|
-
const
|
|
1140
|
-
const
|
|
1165
|
+
const what = activity ? activity.charAt(0).toUpperCase() + activity.slice(1) : "Arbeitet…";
|
|
1166
|
+
const s = what + " (" + fmt(Date.now() - T0) + " · Strg+C zum Stoppen)";
|
|
1167
|
+
const w = (process.stdout.columns || 100) - 4;
|
|
1141
1168
|
return s.length > w ? s.slice(0, w - 1) + "…" : s;
|
|
1142
1169
|
};
|
|
1143
|
-
const startTick = () => { if (tick || !working) return; tick = setInterval(() => process.stdout.write("\r\x1b[K" + C.
|
|
1170
|
+
const startTick = () => { if (tick || !working) return; tick = setInterval(() => { spinI = (spinI + 1) % SPIN.length; process.stdout.write("\r\x1b[K" + grad((spinI % 5) / 4) + SPIN[spinI] + C.x + " " + rgb(203, 213, 225) + tickLine() + C.x); }, 120); };
|
|
1144
1171
|
const stopTick = () => { if (tick) { clearInterval(tick); tick = null; } clearLine(); };
|
|
1145
1172
|
let adN = 0, adTier = null, adAdminDay = "";
|
|
1146
1173
|
async function maybeAd() {
|
|
@@ -1154,9 +1181,9 @@ async function maybeAd() {
|
|
|
1154
1181
|
let ads = []; try { ads = (await (await fetch(fnBase + "/ad-review", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ action: "list" }) })).json()).ads || []; } catch {}
|
|
1155
1182
|
const pool = [{ house: true, weight: 3 }].concat(ads); let r = Math.random() * pool.reduce((t, a) => t + Math.max(1, a.weight), 0); let ad = pool[0];
|
|
1156
1183
|
for (const a of pool) { r -= Math.max(1, a.weight); if (r <= 0) { ad = a; break; } }
|
|
1157
|
-
if (!ad.house) { console.log("\x1b[2m📣 Werbung\x1b[0m \x1b[1m" + ad.product + "\x1b[0m – " + ad.ad_text + ": " + ad.link + "\n\x1b[2m Buche deine eigene Werbung: https://mythos-ai-final-
|
|
1184
|
+
if (!ad.house) { console.log("\x1b[2m📣 Werbung\x1b[0m \x1b[1m" + ad.product + "\x1b[0m – " + ad.ad_text + ": " + ad.link + "\n\x1b[2m Buche deine eigene Werbung: https://mythos-ai-final-vers.lovable.app/werbung\x1b[0m\n"); return; }
|
|
1158
1185
|
}
|
|
1159
|
-
if (due) console.log("\x1b[2m📣 Werbung\x1b[0m \x1b[1m@at\x1b[0m – dein Feed voller Vibes: https://at-feed-vibes.lovable.app/\n\x1b[2m Buche deine eigene Werbung: https://mythos-ai-final-
|
|
1186
|
+
if (due) console.log("\x1b[2m📣 Werbung\x1b[0m \x1b[1m@at\x1b[0m – dein Feed voller Vibes: https://at-feed-vibes.lovable.app/\n\x1b[2m Buche deine eigene Werbung: https://mythos-ai-final-vers.lovable.app/werbung\x1b[0m\n");
|
|
1160
1187
|
} catch {}
|
|
1161
1188
|
}
|
|
1162
1189
|
const say = (s) => { const was = !!tick; stopTick(); console.log(s); if (was) startTick(); };
|
|
@@ -1679,7 +1706,7 @@ async function main() {
|
|
|
1679
1706
|
const history = [];
|
|
1680
1707
|
if (args.length) { const { text, images } = extractImages(args.join(" ")); await turn(history, text, images); }
|
|
1681
1708
|
while (true) {
|
|
1682
|
-
const q = (await
|
|
1709
|
+
const q = (await framedAsk(goal)).trim();
|
|
1683
1710
|
if (!q) continue;
|
|
1684
1711
|
if (q === "/exit") break;
|
|
1685
1712
|
if (q.startsWith("/")) { await command(q, history); continue; }
|