c220f223c8
- Add cookbook/examples/external-capability/ with word-count-optimizer - Add manifest fixture in docs/contracts/ocla/capability-manifests/example/ - Update master execution plan: WS-4.2–4.7 done, progress 80% - Conformance test passes with the new manifest Co-authored-by: Cursor <cursoragent@cursor.com>
LeanCTX Cookbook
Praktische, echte Beispiele (ohne Mock-Daten), die gegen einen laufenden lean-ctx serve arbeiten.
Voraussetzungen
- Node.js 22+
- Ein laufender LeanCTX HTTP Server:
lean-ctx serve --host 127.0.0.1 --port 8080 --project-root /path/to/project
Wenn du lean-ctx noch nicht installiert hast:
cd ../rust
cargo run --release --bin lean-ctx -- serve --host 127.0.0.1 --port 8080 --project-root ..
Setup
cd cookbook
npm ci
Konfiguration (ENV)
LEANCTX_BASE_URL(default:http://127.0.0.1:8080)LEANCTX_BEARER_TOKEN(optional)- Nur nötig, wenn du den Server mit
--auth-token <token>startest oder non-loopback bindest.
- Nur nötig, wenn du den Server mit
Beispiele
Quickstart CLI
cd cookbook
npm run quickstart
Memory Policy Playground (T1/T3/T4)
Erzeugt echte Facts, gibt Feedback, verknüpft Facts und zeigt das Mermaid-Diagramm.
cd cookbook
npm run memory-playground
Knowledge Graph Explorer (Web)
Lokale Web-UI, die Facts und Relations (Mermaid) über Tool-Calls anzeigt.
cd cookbook
npm run graph-explorer
Die App nutzt einen Dev-Proxy (/leanctx), damit im Browser kein CORS-Setup nötig ist.
Falls dein lean-ctx serve nicht auf http://127.0.0.1:8080 läuft:
cd cookbook
VITE_LEANCTX_BASE_URL="http://127.0.0.1:8080" npm run graph-explorer
Troubleshooting
ECONNREFUSED: Server läuft nicht oder falschesLEANCTX_BASE_URL.401 Unauthorized:LEANCTX_BEARER_TOKENsetzen (und Server mit--auth-tokenstarten).