mythos-code 1.9.0 → 1.10.14
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 +47 -21
- package/package.json +1 -1
package/bin/mythos.js
CHANGED
|
@@ -192,6 +192,12 @@ 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
|
+
"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)**.",
|
|
196
|
+
"Ö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. " +
|
|
197
|
+
"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). " +
|
|
198
|
+
"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. " +
|
|
199
|
+
"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.",
|
|
200
|
+
"",
|
|
195
201
|
"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
202
|
"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
203
|
"",
|
|
@@ -1034,8 +1040,8 @@ let goal = "";
|
|
|
1034
1040
|
const SYSTEM = () => "Du bist Mythos Code, ein autonomer Coding-Agent im Terminal des Nutzers (OS: " + process.platform + ", Projektordner: " + ROOT + ").\n" +
|
|
1035
1041
|
TOOL_PROMPT + memoryPrompt(readMemory(ROOT)) + goalPrompt(goal);
|
|
1036
1042
|
|
|
1037
|
-
const SITE = process.env.MYTHOS_SITE_URL || "https://mythos-ai-final-
|
|
1038
|
-
const VERSION = "1.
|
|
1043
|
+
const SITE = process.env.MYTHOS_SITE_URL || "https://mythos-ai-final-vers.lovable.app";
|
|
1044
|
+
const VERSION = "1.10.14";
|
|
1039
1045
|
const PKG = "mythos-code";
|
|
1040
1046
|
|
|
1041
1047
|
// ---------- Auto-Update über npm ----------
|
|
@@ -1071,27 +1077,44 @@ async function autoUpdate(force = false) {
|
|
|
1071
1077
|
await new Promise(() => {}); // hier nicht weiterlaufen – der neue Prozess übernimmt
|
|
1072
1078
|
}
|
|
1073
1079
|
|
|
1074
|
-
// ---------- Startbildschirm
|
|
1075
|
-
//
|
|
1080
|
+
// ---------- Startbildschirm im Claude-Code-Stil: Maskottchen „Myth“ links, Infos rechts ----------
|
|
1081
|
+
// Farben aus dem Mythos-Logo (Magenta → Violett → Blau → Türkis), 24-Bit-Farbe wenn möglich.
|
|
1082
|
+
const TRUE = process.env.COLORTERM === "truecolor" || process.env.COLORTERM === "24bit" || process.platform === "win32" || !!process.env.WT_SESSION;
|
|
1083
|
+
const rgb = (r, g, b) => (TRUE ? `\x1b[38;2;${r};${g};${b}m` : "\x1b[35m");
|
|
1084
|
+
const GRAD = [[217, 70, 239], [168, 85, 247], [99, 102, 241], [59, 130, 246], [34, 211, 238]];
|
|
1085
|
+
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))); };
|
|
1086
|
+
// Myth: kleiner Kristall-Geist mit Augen – 11 Zeichen breit, 4 Zeilen
|
|
1076
1087
|
const MASCOT = [
|
|
1077
|
-
"
|
|
1078
|
-
"
|
|
1088
|
+
" ▄█▄ ",
|
|
1089
|
+
" ▄█▀█▀█▄ ",
|
|
1079
1090
|
" ▀███████▀ ",
|
|
1080
|
-
"
|
|
1091
|
+
" ▀▄ ▄▀ ",
|
|
1081
1092
|
];
|
|
1093
|
+
const paintMascot = (line, row) => [...line].map((ch, i) => (ch === " " ? ch : grad((i + row) / 13) + ch)).join("") + C.x;
|
|
1094
|
+
const modelLabel = () => { const m = (typeof MODELS !== "undefined" ? MODELS : []).find((x) => x.id === (cfg.model || "mythos-code")); return m ? m.label : "MythosCode"; };
|
|
1082
1095
|
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;
|
|
1096
|
+
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
1097
|
const right = [
|
|
1087
1098
|
C.b + "Mythos Code" + C.x + C.d + " v" + VERSION + C.x,
|
|
1099
|
+
C.d + modelLabel() + " · " + (cfg.name ? cfg.name : "Mythoscraft") + C.x,
|
|
1088
1100
|
C.d + info.dir + C.x,
|
|
1089
|
-
|
|
1090
|
-
C.c + "✦ " + C.x + C.d + tip + C.x,
|
|
1101
|
+
"",
|
|
1091
1102
|
];
|
|
1092
|
-
console.log("
|
|
1093
|
-
MASCOT.forEach((m, i) => console.log(
|
|
1094
|
-
console.log(
|
|
1103
|
+
console.log("");
|
|
1104
|
+
MASCOT.forEach((m, i) => console.log(" " + paintMascot(m, i) + " " + (right[i] || "")));
|
|
1105
|
+
console.log("");
|
|
1106
|
+
console.log(" " + grad(0.15) + "✦" + C.x + " " + C.d + tips[Math.floor(Math.random() * tips.length)] + (info.extra ? " · " + info.extra : "") + C.x + "\n");
|
|
1107
|
+
}
|
|
1108
|
+
// Eingabe wie bei Claude Code: Hinweis links + Modell rechts, Linie, dann „❯“.
|
|
1109
|
+
// (Unter der Eingabe zeichnen geht nicht – readline löscht beim Tippen alles unterhalb.)
|
|
1110
|
+
async function framedAsk(goal) {
|
|
1111
|
+
const w = Math.max(30, (process.stdout.columns || 80) - 1);
|
|
1112
|
+
const leftTxt = autoYes ? "▸▸ Vollzugriff an" : "? fragt vor Befehlen · /hilfe";
|
|
1113
|
+
const left = autoYes ? rgb(250, 204, 21) + leftTxt + C.x : C.d + leftTxt + C.x;
|
|
1114
|
+
const rightTxt = "● " + modelLabel() + " · /modell";
|
|
1115
|
+
const gap = Math.max(1, w - leftTxt.length - rightTxt.length);
|
|
1116
|
+
process.stdout.write("\n" + left + " ".repeat(gap) + C.d + rightTxt + C.x + "\n" + C.d + "─".repeat(w) + C.x + "\n");
|
|
1117
|
+
return ask((goal ? "🎯 " : "") + C.b + "❯ " + C.x);
|
|
1095
1118
|
}
|
|
1096
1119
|
const FN = process.env.MYTHOS_FN_URL || API.replace(/\/v1-messages$/, "");
|
|
1097
1120
|
const authPost = async (body) => (await fetch(FN + "/cli-auth", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) })).json();
|
|
@@ -1135,12 +1158,15 @@ const fmt = (ms) => { const s = Math.floor(ms / 1000); return (s >= 60 ? Math.fl
|
|
|
1135
1158
|
let T0 = 0, tick = null, activity = "";
|
|
1136
1159
|
const clearLine = () => process.stdout.write("\r\x1b[K");
|
|
1137
1160
|
// Zeigt live, was Mythos gerade tut (z. B. „✍ schreibt src/main.js · 12 KB“) – auf Terminalbreite gekürzt.
|
|
1161
|
+
const SPIN = ["✦", "✧", "✶", "✷", "✸", "✹", "✸", "✷", "✶", "✧"];
|
|
1162
|
+
let spinI = 0;
|
|
1138
1163
|
const tickLine = () => {
|
|
1139
|
-
const
|
|
1140
|
-
const
|
|
1164
|
+
const what = activity ? activity.charAt(0).toUpperCase() + activity.slice(1) : "Arbeitet…";
|
|
1165
|
+
const s = what + " (" + fmt(Date.now() - T0) + " · Strg+C zum Stoppen)";
|
|
1166
|
+
const w = (process.stdout.columns || 100) - 4;
|
|
1141
1167
|
return s.length > w ? s.slice(0, w - 1) + "…" : s;
|
|
1142
1168
|
};
|
|
1143
|
-
const startTick = () => { if (tick || !working) return; tick = setInterval(() => process.stdout.write("\r\x1b[K" + C.
|
|
1169
|
+
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
1170
|
const stopTick = () => { if (tick) { clearInterval(tick); tick = null; } clearLine(); };
|
|
1145
1171
|
let adN = 0, adTier = null, adAdminDay = "";
|
|
1146
1172
|
async function maybeAd() {
|
|
@@ -1154,9 +1180,9 @@ async function maybeAd() {
|
|
|
1154
1180
|
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
1181
|
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
1182
|
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-
|
|
1183
|
+
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
1184
|
}
|
|
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-
|
|
1185
|
+
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
1186
|
} catch {}
|
|
1161
1187
|
}
|
|
1162
1188
|
const say = (s) => { const was = !!tick; stopTick(); console.log(s); if (was) startTick(); };
|
|
@@ -1679,7 +1705,7 @@ async function main() {
|
|
|
1679
1705
|
const history = [];
|
|
1680
1706
|
if (args.length) { const { text, images } = extractImages(args.join(" ")); await turn(history, text, images); }
|
|
1681
1707
|
while (true) {
|
|
1682
|
-
const q = (await
|
|
1708
|
+
const q = (await framedAsk(goal)).trim();
|
|
1683
1709
|
if (!q) continue;
|
|
1684
1710
|
if (q === "/exit") break;
|
|
1685
1711
|
if (q.startsWith("/")) { await command(q, history); continue; }
|