feat(verbinden): verifizierter Zed-Guide + proxy-feste Engine-Adresse
- Zed als empfohlene IDE: fertige settings.json (language_models. openai_compatible.bosgame) mit available_models aus dem echten Stack, Vision-Modelle bekommen capabilities.images; API-Key-Hinweis (UI/Env, nicht in settings.json) — Struktur gegen Zed-Doku verifiziert. - baseUrl() nutzt jetzt fix http://<host>:8080/v1 (statt location.protocol), damit der Aufruf hinter einem Reverse-Proxy (NPM/HTTPS) nicht in eine kaputte https-:8080-URL kippt. - Erkennt Proxy-Zugriff (behindProxy) und warnt: Engine-API laeuft direkt am Bosgame auf :8080 ohne HTTPS -> rohe LAN-IP eintragen, nicht den Namen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,13 @@ window.mcCopyCode = btn => {
|
||||
};
|
||||
window.cnGo = v => document.querySelector(`.nav-item[data-view="${v}"]`)?.click();
|
||||
|
||||
function baseUrl() { return `${location.protocol}//${location.hostname}:8080/v1`; }
|
||||
// Die Engine-API spricht IMMER reines HTTP auf Port 8080 direkt am Bosgame.
|
||||
// Bewusst nicht location.protocol uebernehmen: wer MC hinter einem Reverse-Proxy
|
||||
// (NPM) ueber https://<name> aufruft, bekaeme sonst eine kaputte https-:8080-URL.
|
||||
function baseUrl() { return `http://${location.hostname}:8080/v1`; }
|
||||
function isLanIp(h) { return /^\d{1,3}(\.\d{1,3}){3}$/.test(h); }
|
||||
// true, wenn MC offenbar ueber einen Proxy/Namen aufgerufen wird (nicht direkt per IP).
|
||||
function behindProxy() { return location.protocol === "https:" || !isLanIp(location.hostname); }
|
||||
function models() { return S?.models || []; }
|
||||
|
||||
// Fertige opencode.json fuer einen OpenAI-kompatiblen Provider auf llama-swap.
|
||||
@@ -43,6 +49,30 @@ ${modelMap}
|
||||
}`;
|
||||
}
|
||||
|
||||
// Fertige Zed-settings.json fuer einen OpenAI-kompatiblen Provider auf llama-swap.
|
||||
// Vision-Modelle bekommen capabilities.images=true, sonst sieht Zed sie als reine Text-Modelle.
|
||||
function zedConfig(url) {
|
||||
const ms = models();
|
||||
const list = ms.length ? ms : [{ name: "coder" }];
|
||||
const entries = list.map(m => {
|
||||
const img = (m.meta?.caps || []).some(c => /Bild|Vision/i.test(c));
|
||||
const caps = img ? `, "capabilities": { "tools": true, "images": true }` : "";
|
||||
return ` { "name": "${m.name}", "display_name": "${m.name}", "max_tokens": 32768${caps} }`;
|
||||
}).join(",\n");
|
||||
return `{
|
||||
"language_models": {
|
||||
"openai_compatible": {
|
||||
"bosgame": {
|
||||
"api_url": "${url}",
|
||||
"available_models": [
|
||||
${entries}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}`;
|
||||
}
|
||||
|
||||
function field(label, value) {
|
||||
return `<label>${label}</label>
|
||||
<div class="flex gap-2" style="align-items:stretch;margin-bottom:12px">
|
||||
@@ -77,6 +107,11 @@ function render() {
|
||||
<div class="card-h"><h3>Verbindung zur Engine</h3></div>
|
||||
<div class="card-sub">Alle Tools nutzen diese OpenAI-kompatible Adresse. Das Auto-Swapping lädt das passende Modell je Anfrage automatisch.</div>
|
||||
${field("Basis-URL (OpenAI-kompatibel)", url)}
|
||||
${behindProxy() ? `<div class="alert warn" style="margin:0 0 12px"><span class="a-dot"></span><span>
|
||||
Du rufst Mission Control offenbar über einen <b>Proxy/Namen</b> auf (NPM o.ä.). Die <b>Engine-API</b> läuft aber
|
||||
direkt am Bosgame auf <b>Port 8080 ohne HTTPS</b> — ein Proxy davor stört nur. Trag in deinen Tools die
|
||||
<b>rohe LAN-Adresse</b> ein: <code>http://<Bosgame-IP>:8080/v1</code> (z.B. <code>http://192.168.178.151:8080/v1</code>),
|
||||
<b>nicht</b> den HTTPS-Namen.</span></div>` : ""}
|
||||
<div class="btn-row"><button class="primary" id="cn-test">Verbindung testen</button></div>
|
||||
<div id="cn-test-result" style="margin-top:12px"></div>
|
||||
</div>
|
||||
@@ -90,7 +125,8 @@ function render() {
|
||||
<div class="card">
|
||||
<div class="card-h"><h3>Empfohlene Tools (Juni 2026)</h3></div>
|
||||
<div class="card-sub">Diese verbinden sich nahtlos mit deinem Stack. Einrichtungs-Configs findest du darunter.</div>
|
||||
${toolRow("OpenCode", "Beliebtester Open-Source-Coding-Agent (MIT) — Terminal, Desktop & IDE.", "https://opencode.ai", "Empfohlen")}
|
||||
${toolRow("Zed", "Schneller nativer Editor mit eingebautem KI-Agenten — verbindet sich direkt mit deinem Stack.", "https://zed.dev", "Empfohlen")}
|
||||
${toolRow("OpenCode", "Open-Source-Coding-Agent (MIT) — Terminal, Desktop & IDE. Gute Alternative.", "https://opencode.ai")}
|
||||
${toolRow("Cline", "Bestes Erlebnis in VS Code, Bring-Your-Own-Key, Mensch-im-Loop.", "https://cline.bot")}
|
||||
${toolRow("Continue.dev", "Feinkörnige Kontrolle + bestes MCP-Ökosystem für Werkzeuge.", "https://continue.dev")}
|
||||
<div class="hint" style="margin-top:12px">Diese Tools sind <b>Agenten</b>: Sie lassen dein Modell selbst Dateien ändern und Befehle ausführen.
|
||||
@@ -100,6 +136,22 @@ function render() {
|
||||
|
||||
<div class="card" style="padding:0;overflow:hidden">
|
||||
<details class="guide-acc" open>
|
||||
<summary>Zed — settings.json (empfohlen)</summary>
|
||||
<div class="acc-body">
|
||||
<p>Zed konfigurierst du über seine <b>settings.json</b> (in Zed: <code>Cmd/Strg + ,</code>). Füge diesen Block ein —
|
||||
er meldet deine Modelle als eigenen Anbieter „bosgame" an:</p>
|
||||
<div style="position:relative;margin-top:12px">
|
||||
<button class="ghost" style="position:absolute;top:8px;right:8px;z-index:1" onclick="window.mcCopyCode(this)">Kopieren</button>
|
||||
<div class="log" style="max-height:none"><code>${esc(zedConfig(url))}</code></div>
|
||||
</div>
|
||||
<p style="margin-top:12px"><b>API-Key:</b> Zed speichert Keys <u>nicht</u> in der settings.json. Öffne den
|
||||
Agent-Panel → Anbieter <b>bosgame</b> → trag irgendeinen Wert ein (z.B. <code>local</code>) — llama-swap prüft ihn nicht.
|
||||
Alternativ als Umgebungsvariable <code>BOSGAME_API_KEY=local</code>.</p>
|
||||
<div class="hint" style="margin-top:8px">Danach im Agent-Panel oben das Modell <b>bosgame / ${esc(firstModel)}</b> wählen.
|
||||
Das Auto-Swapping lädt das passende Modell selbst. ${behindProxy() ? "<b>Achtung:</b> in <code>api_url</code> die LAN-IP des Bosgame nutzen (siehe Warnung oben), nicht den Proxy-Namen." : ""}</div>
|
||||
</div>
|
||||
</details>
|
||||
<details class="guide-acc">
|
||||
<summary>OpenCode — Config-Datei (JSON)</summary>
|
||||
<div class="acc-body">
|
||||
<p>OpenCode richtest du nicht über Felder ein, sondern über eine <b>Config-Datei</b>. Lege sie hier an:</p>
|
||||
|
||||
Reference in New Issue
Block a user