mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-11 17:26:57 +02:00
Go: layout standard cmd/ + internal/ - tout le code dans internal/jean (package jean), cmd/jean = main() + ressources Windows (.syso/icone/versioninfo), ui/ demenage dans internal/jean/ui (go:embed inchange) ; racine GitHub epuree
This commit is contained in:
1 parent
79e8d322a9
commit
e3fe63ca24
68 files changed
+75
-62
No files matched your search
@@ -285,10 +285,10 @@ Nécessite Go 1.25+. Jean est un binaire 100 % Go (l'UI web est embarquée via `
|
||||
```bash
|
||||
git clone https://github.com/nathaninline/jean.git
|
||||
cd jean
|
||||
CGO_ENABLED=0 go build -o jean .
|
||||
CGO_ENABLED=0 go build -o jean ./cmd/jean
|
||||
|
||||
# cross-compilation, ex. Linux depuis n'importe quel hôte :
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o jean-linux-amd64 .
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o jean-linux-amd64 ./cmd/jean
|
||||
```
|
||||
|
||||
> Compiler **Jean** ne nécessite que Go. Compiler le **backend llama.cpp** (`jean llamacpp install`) nécessite `git`, `cmake`, et le toolkit de ton accélérateur (CUDA, ROCm, etc.).
|
||||
@@ -298,10 +298,12 @@ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o jean-linux-amd64 .
|
||||
- `jean serve` est l'`ExecStart` de systemd : il lit `config.env`, construit la liste d'arguments de `llama-server`, et fait un `exec` dessus pour que systemd supervise directement llama.cpp.
|
||||
- `jean llamacpp` gère le checkout llama.cpp à côté de l'endroit où pointe `BIN`, en gérant le piège classique du « dossier de build relocalisé » (cache CMake) et en arrêtant le service pendant la recompilation pour éviter le *Text file busy*.
|
||||
|
||||
## UI web (`ui/`)
|
||||
## Arborescence
|
||||
|
||||
`ui/index.html` est **généré** : les sources vivent dans `ui/src/` (`styles.css`, `js/NN-*.js` concaténés dans l'ordre alphabétique, `index.tmpl.html`). Pour modifier l'UI : éditer `ui/src/` puis lancer `ui/assemble.ps1` (le fichier assemblé reste committé car `go:embed` et `ajean-app/build-server-ui.ps1` le lisent tel quel).
|
||||
- `cmd/jean/` — point d'entrée (`main()`) + ressources Windows (.syso, icône, versioninfo).
|
||||
- `internal/jean/` — tout le code, fichiers préfixés par domaine (`web_*`, `chat_*`, `llm_*`, `backend_*`, `relay_*`, `sys_*` — carte dans `doc.go`).
|
||||
- `internal/jean/ui/` — UI web embarquée. `index.html` est **généré** : les sources vivent dans `ui/src/` (`styles.css`, `js/NN-*.js` concaténés dans l'ordre alphabétique, `index.tmpl.html`). Pour modifier l'UI : éditer `ui/src/` puis lancer `ui/assemble.ps1` (le fichier assemblé reste committé car `go:embed` et `ajean-app/build-server-ui.ps1` le lisent tel quel).
|
||||
|
||||
## Licence
|
||||
|
||||
[MIT](LICENSE). Le fichier `ui/marked.min.js` embarqué est [Marked](https://github.com/markedjs/marked), également MIT.
|
||||
[MIT](LICENSE). Le fichier `internal/jean/ui/marked.min.js` embarqué est [Marked](https://github.com/markedjs/marked), également MIT.
|
||||
File renamed without changes.
@@ -0,0 +1,16 @@
|
||||
// Point d'entrée du binaire jean. Tout le code vit dans internal/jean ; ce
|
||||
// dossier ne porte que le main() et les ressources Windows (.syso, icône,
|
||||
// versioninfo) qui doivent résider dans le dossier du package main.
|
||||
//
|
||||
// Les directives ci-dessous embarquent les métadonnées Windows (éditeur, version,
|
||||
// description) dans le .exe pour réduire les faux positifs antivirus. Régénère
|
||||
// les .syso après avoir bumpé la version : `go generate ./...`
|
||||
// (nécessite : go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest)
|
||||
//
|
||||
//go:generate goversioninfo -64 -icon=icon.ico -o resource_windows_amd64.syso versioninfo.json
|
||||
//go:generate goversioninfo -64 -arm -icon=icon.ico -o resource_windows_arm64.syso versioninfo.json
|
||||
package main
|
||||
|
||||
import "github.com/nathaninline/jean/internal/jean"
|
||||
|
||||
func main() { jean.Main() }
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import "testing"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
// backend_catalog.go — récupère la liste de modèles curatée servie par ajean.link et la
|
||||
// combine avec les infos matérielles locales, pour que l'écran d'accueil (à
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import "testing"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
// cli_app.go — expérience « application » de Jean.
|
||||
//
|
||||
@@ -1,4 +1,4 @@
|
||||
// Jean — binaire unique (package main). Les fichiers sont préfixés par domaine
|
||||
// Jean — cœur du binaire (package jean, appelé par cmd/jean). Les fichiers sont préfixés par domaine
|
||||
// (Go n'autorise pas de sous-dossiers dans un même package) :
|
||||
//
|
||||
// main.go point d'entrée : dispatch des sous-commandes, chemins (JeanHome…)
|
||||
@@ -15,4 +15,4 @@
|
||||
//
|
||||
// Les suffixes _windows/_linux/_darwin/_unix/_other portent les contraintes de
|
||||
// compilation par OS. ui/index.html est GÉNÉRÉ depuis ui/src/ (voir ui/assemble.ps1).
|
||||
package main
|
||||
package jean
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
// relay_e2e.go — chiffrement bout-en-bout du chat entre le NAVIGATEUR et CET agent, de
|
||||
// sorte que le relais (ajean.link) ne voie que de l'opaque : « boîte noire ».
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
// relay_e2eauth.go — authentification MUTUELLE + anti-rejeu du canal chiffré.
|
||||
//
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
// relay_link.go — `jean link <token>` : connecte ce serveur Jean au relais public
|
||||
// (ajean.link) par une connexion SORTANTE persistante, pour qu'un utilisateur
|
||||
@@ -1,13 +1,7 @@
|
||||
// jean — single-binary LLM server manager + web UI for llama.cpp deployments.
|
||||
//
|
||||
// Les directives ci-dessous embarquent les métadonnées Windows (éditeur, version,
|
||||
// description) dans le .exe pour réduire les faux positifs antivirus. Régénère
|
||||
// les .syso après avoir bumpé la version : `go generate ./...`
|
||||
// (nécessite : go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest)
|
||||
//
|
||||
//go:generate goversioninfo -64 -icon=icon.ico -o resource_windows_amd64.syso versioninfo.json
|
||||
//go:generate goversioninfo -64 -arm -icon=icon.ico -o resource_windows_arm64.syso versioninfo.json
|
||||
package main
|
||||
// Point d'entrée réel : Main(), appelé par cmd/jean (les métadonnées Windows
|
||||
// .syso/go:generate vivent là-bas, dans le dossier du package main).
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -18,7 +12,8 @@ import (
|
||||
|
||||
const Version = "0.4.4"
|
||||
|
||||
func main() {
|
||||
// Main est le vrai main() du binaire (cmd/jean ne fait que l'appeler).
|
||||
func Main() {
|
||||
// Migration one-shot des anciens skills (SKILLS/<nom>/SKILL.md) vers la
|
||||
// nouvelle mémoire (MEMORY/<nom>.md). Idempotente, silencieuse si rien à faire.
|
||||
migrateSkillsToMemory()
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build darwin
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build linux
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build unix
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build !windows
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
// sys_proc_other.go — hors Windows, pas de détachement (le mode app double-clic est
|
||||
// propre à Windows). Défini pour la compilation ; non appelé en pratique car
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
// sys_proc_windows.go — au double-clic, on relance Jean en processus DÉTACHÉ, sans
|
||||
// console. L'original (qui, lui, possède la console fraîche créée par Explorer)
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build darwin
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build linux
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build !windows
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
// sys_splash_other.go — pas de fenêtre de démarrage hors Windows (no-op).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
// sys_splash_windows.go — écran de démarrage « Lancement de Jean… ».
|
||||
//
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build !windows
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
// sys_tray_other.go — pas d'icône de zone de notification hors Windows (la demande
|
||||
// vise le tray Windows). On se contente d'ouvrir l'UI dans le navigateur et de
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
package jean
|
||||
|
||||
// sys_tray_windows.go — icône de Jean dans la zone de notification Windows (system
|
||||
// tray). Quand on lance l'app (double-clic ou `jean app`), l'UI web s'ouvre dans
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import "os"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package jean
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
Reference in new issue
Block a user