diff --git a/README.md b/README.md index ac98442..ab7f00f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -# oxagenttwo +# agenttwo-tools + +> Fork von [agenttwo](https://github.com/Jeuners/agenttwo). Die Basis bleibt dort +> unverändert; hier kommen Tool-Calling und Vision dazu. Läuft auf eigenen Ports +> (Backend 8788, Frontend 5174), damit beide Projekte parallel laufen können. +> Fixes aus der Basis lassen sich per `git cherry-pick` aus dem Remote +> `upstream` übernehmen. Voice-Chat-Oberfläche für lokale und Cloud-LLMs: lokales Qwen3 über [Ollama](https://ollama.com), optionaler Fallback auf @@ -77,7 +83,7 @@ Weitere optionale Variablen mit ihren Defaults: | Variable | Default | |----------------------|--------------------------------------------------| -| `PORT` | `8787` | +| `PORT` | `8788` | | `OLLAMA_URL` | `http://localhost:11434` | | `MODEL` | `qwen3.5:latest` | | `WHISPER_MODEL` | `~/whisper-models/ggml-large-v3-turbo.bin` | @@ -92,12 +98,12 @@ Der Server hat **keine Authentifizierung** und lauscht deshalb bewusst nur auf Browser geöffnet ist, kann `localhost` per `fetch()` oder WebSocket erreichen. Deshalb prüfen sowohl die HTTP-Endpunkte als auch der WebSocket-Handshake die `Origin` gegen eine Allowlist (`server/src/security.ts`) — Standard sind -`localhost`/`127.0.0.1` auf Port 5173 und 8787. +`localhost`/`127.0.0.1` auf Port 5174 und 8788. Läuft das Frontend woanders, die Origin ergänzen: ```bash -ALLOWED_ORIGINS=http://192.168.1.50:5173 +ALLOWED_ORIGINS=http://192.168.1.50:5174 ``` Weitere Maßnahmen: Rate-Limits auf `/api/stt` (10/min) und `/api/tts` (30/min), @@ -111,7 +117,7 @@ echte Authentifizierung. ```bash npm install -npm run dev # Server (:8787) und Vite-Dev-Server (:5173) parallel +npm run dev # Server (:8788) und Vite-Dev-Server (:5174) parallel ``` Einzeln: diff --git a/package-lock.json b/package-lock.json index c5a030d..d0cbdd7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,19 @@ { - "name": "oxagenttwo", + "name": "agenttwo-tools", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "oxagenttwo", + "name": "agenttwo-tools", "version": "0.1.0", "workspaces": [ "server", "web" - ] + ], + "engines": { + "node": ">=22.5.0" + } }, "node_modules/@babel/code-frame": { "version": "7.29.7", @@ -4651,7 +4654,6 @@ "version": "8.21.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.3.tgz", "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==", - "dev": true, "license": "MIT", "engines": { "node": ">=10.0.0" @@ -4690,14 +4692,14 @@ "version": "0.1.0", "dependencies": { "@fastify/cors": "^10.0.1", - "fastify": "^5.2.1" + "fastify": "^5.2.1", + "ws": "^8.18.0" }, "devDependencies": { "@types/node": "^22.13.0", "@types/ws": "^8.5.14", "tsx": "^4.19.3", - "typescript": "^5.7.3", - "ws": "^8.18.0" + "typescript": "^5.7.3" } }, "web": { diff --git a/package.json b/package.json index 7883a72..3e987b3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "oxagenttwo", + "name": "agenttwo-tools", "private": true, "version": "0.1.0", "workspaces": [ diff --git a/server/src/index.ts b/server/src/index.ts index 89d93fe..eabb891 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -27,7 +27,7 @@ try { /* keine .env vorhanden */ } -const PORT = Number(process.env.PORT ?? 8787); +const PORT = Number(process.env.PORT ?? 8788); const OLLAMA_URL = process.env.OLLAMA_URL ?? "http://localhost:11434"; const app = Fastify({ logger: true, bodyLimit: MAX_AUDIO_BYTES }); diff --git a/server/src/openrouter.ts b/server/src/openrouter.ts index e8dd65b..ec5520c 100644 --- a/server/src/openrouter.ts +++ b/server/src/openrouter.ts @@ -50,8 +50,8 @@ export async function streamOpenRouter( headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", - "HTTP-Referer": "http://localhost:5173", - "X-Title": "oxagenttwo", + "HTTP-Referer": "http://localhost:5174", + "X-Title": "agenttwo-tools", }, body: JSON.stringify({ model: opts.model, diff --git a/server/src/security.ts b/server/src/security.ts index 280f175..e4cba24 100644 --- a/server/src/security.ts +++ b/server/src/security.ts @@ -8,10 +8,10 @@ */ const DEFAULT_ORIGINS = [ - "http://localhost:5173", - "http://127.0.0.1:5173", - "http://localhost:8787", - "http://127.0.0.1:8787", + "http://localhost:5174", + "http://127.0.0.1:5174", + "http://localhost:8788", + "http://127.0.0.1:8788", ]; /** Zusätzliche Origins via ALLOWED_ORIGINS="https://a.example,https://b.example". */ diff --git a/web/vite.config.ts b/web/vite.config.ts index 83438df..a2e8af8 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -4,11 +4,11 @@ import react from "@vitejs/plugin-react"; export default defineConfig({ plugins: [react()], server: { - port: 5173, + port: 5174, proxy: { - "/api": "http://127.0.0.1:8787", + "/api": "http://127.0.0.1:8788", "/ws": { - target: "ws://127.0.0.1:8787", + target: "ws://127.0.0.1:8788", ws: true, }, },