chore(typo): retire tous les tirets cadratins/demi-cadratins + garde CI
Some checks failed
CI / Build & test (Node 24) (push) Has been cancelled
CI / Pack & boot smoke (Node 22) (push) Has been cancelled
CI / No em/en dashes (push) Has been cancelled
CI / Build & test (Node 22) (push) Has been cancelled
Deploy site (production) / build-and-deploy (push) Successful in 20s
Some checks failed
CI / Build & test (Node 24) (push) Has been cancelled
CI / Pack & boot smoke (Node 22) (push) Has been cancelled
CI / No em/en dashes (push) Has been cancelled
CI / Build & test (Node 22) (push) Has been cancelled
Deploy site (production) / build-and-deploy (push) Successful in 20s
Remplace les 547 tirets cadratins (U+2014) et demi-cadratins (U+2013) des fichiers versionnés par la ponctuation contextuelle adaptée (point médian, deux-points, virgule, parenthèses ; tiret simple pour les plages), sur 122 fichiers (appli, vitrine, doc, tests, workflows, scripts). Ajoute le job CI « lint-dashes » (git grep -P) qui échoue si un tiret cadratin/demi-cadratin réapparaît, hors logo binaire et captures brutes du terminal (fidélité des fixtures de détection de dialogue).
This commit is contained in:
@@ -43,7 +43,7 @@ jobs:
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
# @arboretum/shared (paquet workspace NON publié) est INLINÉ dans dist/_shared au prepack
|
||||
# (scripts/inline-shared.mjs) : le tarball est 100 % autonome — aucun node_modules embarqué,
|
||||
# (scripts/inline-shared.mjs) : le tarball est 100 % autonome : aucun node_modules embarqué,
|
||||
# aucune bundleDependency, aucun symlink. On packe en mode workspace (-w), EXACTEMENT comme
|
||||
# le fait « npm publish » dans release.yml, puis on l'installe seul comme un vrai consommateur.
|
||||
- name: Pack tarball
|
||||
@@ -56,12 +56,12 @@ jobs:
|
||||
tgz=$(ls /tmp/tarballs/*.tgz)
|
||||
rm -rf /tmp/inspect && mkdir -p /tmp/inspect && tar -xzf "$tgz" -C /tmp/inspect
|
||||
test -f /tmp/inspect/package/dist/_shared/index.js \
|
||||
|| { echo "ERREUR: dist/_shared/index.js absent de $tgz — inline-shared n'a pas tourné ?"; exit 1; }
|
||||
|| { echo "ERREUR: dist/_shared/index.js absent de $tgz : inline-shared n'a pas tourné ?"; exit 1; }
|
||||
if grep -rq '@arboretum/shared' /tmp/inspect/package/dist; then
|
||||
echo "ERREUR: import bare '@arboretum/shared' encore présent dans le JS publié"
|
||||
grep -rn '@arboretum/shared' /tmp/inspect/package/dist; exit 1
|
||||
fi
|
||||
echo "OK: paquet autonome — shared inliné dans dist/_shared, aucun import externe"
|
||||
echo "OK: paquet autonome : shared inliné dans dist/_shared, aucun import externe"
|
||||
- name: Install tarball in an empty project
|
||||
run: |
|
||||
mkdir /tmp/smoke
|
||||
@@ -82,3 +82,20 @@ jobs:
|
||||
echo "GET /api/v1/sessions -> HTTP $code"
|
||||
kill "$server_pid" 2>/dev/null || true
|
||||
test "$code" = "401"
|
||||
|
||||
lint-dashes:
|
||||
# Interdit tout tiret cadratin (U+2014) ou demi-cadratin (U+2013) dans les fichiers suivis.
|
||||
# Utiliser a la place : point median, deux-points, virgule, ou tiret simple pour les plages.
|
||||
# Exclusions : logo binaire + captures brutes du terminal (fidelite des fixtures de dialogue).
|
||||
name: No em/en dashes
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Fail on U+2014 / U+2013 (outside allow-list)
|
||||
run: |
|
||||
if git grep -nP '[\x{2014}\x{2013}]' -- . \
|
||||
':(exclude)brand/arboretum-logo-source.png' \
|
||||
':(exclude)packages/server/test/fixtures/dialogs/*.raw'; then
|
||||
echo "::error::Tiret cadratin/demi-cadratin trouve. Utiliser point median, deux-points, virgule ou tiret simple (plages)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -5,7 +5,7 @@ name: Release
|
||||
on:
|
||||
push:
|
||||
# `v[0-9]*` (et non `v*`) : sinon ce workflow capture aussi les tags `vscode-v*` de l'extension
|
||||
# — il stripperait alors `v` (→ `scode-v0.1.0`) et échouerait contre la version du daemon.
|
||||
# : il stripperait alors `v` (→ `scode-v0.1.0`) et échouerait contre la version du daemon.
|
||||
tags: ['v[0-9]*']
|
||||
|
||||
permissions:
|
||||
@@ -39,12 +39,12 @@ jobs:
|
||||
echo "OK: tag $tag == version $pkg"
|
||||
# Publication idempotente : le signal faisant autorité d'une version déjà présente est le
|
||||
# 409 « already exists » renvoyé par npm publish lui-même (npm view est non fiable contre le
|
||||
# registre npm de Gitea — faux négatif masqué par >/dev/null). On tente toujours le publish ;
|
||||
# registre npm de Gitea : faux négatif masqué par >/dev/null). On tente toujours le publish ;
|
||||
# un 409 = succès idempotent, tout autre échec reste fatal. Le shell Actions tourne en
|
||||
# `bash -eo pipefail` : on isole l'échec attendu dans la condition d'un `if` pour ne pas
|
||||
# déclencher `set -e`. Le secret du registre est mappé sur NODE_AUTH_TOKEN lu par le .npmrc
|
||||
# de setup-node.
|
||||
- name: Publish (idempotent — tolère un 409 « already exists »)
|
||||
- name: Publish (idempotent : tolère un 409 « already exists »)
|
||||
run: |
|
||||
if out="$(npm publish -w @johanleroy/git-arboretum 2>&1)"; then
|
||||
printf '%s\n' "$out"
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
code=$?
|
||||
printf '%s\n' "$out"
|
||||
if printf '%s' "$out" | grep -qiE 'E409|409 Conflict|already exists'; then
|
||||
echo "::notice::Version déjà présente sur le registre (409) — publication idempotente, étape ignorée."
|
||||
echo "::notice::Version déjà présente sur le registre (409) : publication idempotente, étape ignorée."
|
||||
else
|
||||
echo "::error::Échec de la publication (code $code)."
|
||||
exit "$code"
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
name: vsix
|
||||
path: packages/vscode/*.vsix
|
||||
# Best-effort : attache le VSIX à la release Gitea du tag (crée la release si absente).
|
||||
# Réutilise le secret NPM_TOKEN (même token Gitea que la publication du daemon — droits
|
||||
# Réutilise le secret NPM_TOKEN (même token Gitea que la publication du daemon, droits
|
||||
# repository suffisants pour l'API release). Sans lui, l'étape est ignorée sans faire échouer
|
||||
# le job (continue-on-error) ; le VSIX reste disponible en artefact.
|
||||
- name: Attach VSIX to Gitea release
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
RELEASE_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: |
|
||||
if [ -z "$RELEASE_TOKEN" ]; then
|
||||
echo "::notice::NPM_TOKEN absent — VSIX disponible en artefact uniquement."
|
||||
echo "::notice::NPM_TOKEN absent : VSIX disponible en artefact uniquement."
|
||||
exit 0
|
||||
fi
|
||||
api="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -26,7 +26,7 @@ coverage/
|
||||
.vscode/
|
||||
.DS_Store
|
||||
|
||||
# Claude Code / agent tooling (local only — do not commit)
|
||||
# Claude Code / agent tooling (local only, do not commit)
|
||||
CLAUDE.md
|
||||
.claude/
|
||||
.remember/
|
||||
|
||||
88
README.fr.md
88
README.fr.md
@@ -3,7 +3,7 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
Un dashboard web auto-hébergé pour vos worktrees git et les sessions Claude Code qui tournent dessus — depuis n'importe quel appareil.
|
||||
Un dashboard web auto-hébergé pour vos worktrees git et les sessions Claude Code qui tournent dessus, depuis n'importe quel appareil.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
@@ -28,41 +28,41 @@ Travailler avec des agents de code IA a changé notre usage de git : une feature
|
||||
|
||||
Un unique daemon Node.js que vous lancez sur votre machine de dev (`npx @johanleroy/git-arboretum`), servant une interface web utilisable depuis votre ordinateur, téléphone ou tablette :
|
||||
|
||||
- **Dashboard worktree-first, multi-repo** — chaque worktree de chaque repo enregistré, avec son état git (branche, ahead/behind, fichiers modifiés) *et* l'état de sa session Claude Code (busy / en attente d'entrée / idle / reprenable).
|
||||
- **Cycle de vie complet des worktrees** — créer (avec des hooks post-création par repo : `npm ci`, copie de `.env`…), adopter des worktrees créés à la main, supprimer avec garde-fous, élaguer les orphelins.
|
||||
- **Découverte & reprise de sessions** — les sessions lancées dans votre propre terminal apparaissent automatiquement ; reprenez les sessions mortes, observez ou forkez les vivantes. Ne corrompt jamais une session vivante. Masquez les anciennes qui encombrent la liste (un clic efface tout l'historique externe ; elles restent reprenables).
|
||||
- **Terminal web** — terminal xterm.js complet vers chaque session managée, qui survit aux déconnexions du navigateur ; vraiment plein écran, avec l'invite ancrée en bas et tout l'historique défilable au-dessus.
|
||||
- **IDE worktree** — ouvrez n'importe quel worktree dans un espace de travail complet, dans le navigateur : un arbre de fichiers, un éditeur Monaco, un visualiseur de diff par fichier et le terminal de la session du worktree, côte à côte. Éditez les fichiers, indexez les changements sélectivement, committez (ou amendez), fetch/pull et push — sans quitter le dashboard. Un watcher de système de fichiers en temps réel garde la vue à jour au fil des éditions de l'agent.
|
||||
- **Supervision depuis votre téléphone** — PWA installable avec notifications push quand une session vous attend ; répondez à une demande (ses options, ou refusez) sans ouvrir de terminal.
|
||||
- **Groupes de travail** — regroupez des repos liés (ex. une API, son frontend web et sa doc) dans un groupe nommé, puis lancez **une seule session Claude qui les couvre tous à la fois** (via le flag `--add-dir` du CLI) : une conversation unique avec un contexte partagé travaillant à travers chaque repo, plus une vue unifiée de tous leurs worktrees et une grille multi-terminaux côte à côte. Une session de groupe peut d'abord créer le même worktree de branche dans chaque repo, ou tourner directement sur les checkouts principaux.
|
||||
- **Services git distants** — connectez vos comptes GitHub, GitLab ou Gitea (personal access token ou app password), stockés **chiffrés au repos** (AES-256-GCM) ; parcourez vos dépôts distants et clonez-les en HTTPS avec progression en direct, directement depuis le dashboard.
|
||||
- **Archivage automatique** — les sessions terminées sont archivées automatiquement après une fenêtre de rétention configurable (30 jours par défaut), pour que la liste reste centrée sur ce qui est vivant tandis que l'historique reste à un clic.
|
||||
- **Extension VS Code** — une extension native (pas un webview) qui amène l'arbre en direct, les terminaux de session natifs, les alertes d'attente et les actions git directement dans votre éditeur. Voir [Extension VS Code](#extension-vs-code).
|
||||
- **Dashboard worktree-first, multi-repo** : chaque worktree de chaque repo enregistré, avec son état git (branche, ahead/behind, fichiers modifiés) *et* l'état de sa session Claude Code (busy / en attente d'entrée / idle / reprenable).
|
||||
- **Cycle de vie complet des worktrees** : créer (avec des hooks post-création par repo : `npm ci`, copie de `.env`…), adopter des worktrees créés à la main, supprimer avec garde-fous, élaguer les orphelins.
|
||||
- **Découverte & reprise de sessions** : les sessions lancées dans votre propre terminal apparaissent automatiquement ; reprenez les sessions mortes, observez ou forkez les vivantes. Ne corrompt jamais une session vivante. Masquez les anciennes qui encombrent la liste (un clic efface tout l'historique externe ; elles restent reprenables).
|
||||
- **Terminal web** : terminal xterm.js complet vers chaque session managée, qui survit aux déconnexions du navigateur ; vraiment plein écran, avec l'invite ancrée en bas et tout l'historique défilable au-dessus.
|
||||
- **IDE worktree** : ouvrez n'importe quel worktree dans un espace de travail complet, dans le navigateur : un arbre de fichiers, un éditeur Monaco, un visualiseur de diff par fichier et le terminal de la session du worktree, côte à côte. Éditez les fichiers, indexez les changements sélectivement, committez (ou amendez), fetch/pull et push, sans quitter le dashboard. Un watcher de système de fichiers en temps réel garde la vue à jour au fil des éditions de l'agent.
|
||||
- **Supervision depuis votre téléphone** : PWA installable avec notifications push quand une session vous attend ; répondez à une demande (ses options, ou refusez) sans ouvrir de terminal.
|
||||
- **Groupes de travail** : regroupez des repos liés (ex. une API, son frontend web et sa doc) dans un groupe nommé, puis lancez **une seule session Claude qui les couvre tous à la fois** (via le flag `--add-dir` du CLI) : une conversation unique avec un contexte partagé travaillant à travers chaque repo, plus une vue unifiée de tous leurs worktrees et une grille multi-terminaux côte à côte. Une session de groupe peut d'abord créer le même worktree de branche dans chaque repo, ou tourner directement sur les checkouts principaux.
|
||||
- **Services git distants** : connectez vos comptes GitHub, GitLab ou Gitea (personal access token ou app password), stockés **chiffrés au repos** (AES-256-GCM) ; parcourez vos dépôts distants et clonez-les en HTTPS avec progression en direct, directement depuis le dashboard.
|
||||
- **Archivage automatique** : les sessions terminées sont archivées automatiquement après une fenêtre de rétention configurable (30 jours par défaut), pour que la liste reste centrée sur ce qui est vivant tandis que l'historique reste à un clic.
|
||||
- **Extension VS Code** : une extension native (pas un webview) qui amène l'arbre en direct, les terminaux de session natifs, les alertes d'attente et les actions git directement dans votre éditeur. Voir [Extension VS Code](#extension-vs-code).
|
||||
|
||||
---
|
||||
|
||||
## Prérequis
|
||||
|
||||
- **Node.js ≥ 22.16** — requis, pas seulement recommandé. Arboretum persiste son état avec `node:sqlite` (`DatabaseSync`), natif et stable seulement à partir de cette version. (`.nvmrc` fixe `22`.)
|
||||
- **Le CLI `claude`** sur votre `PATH` si vous voulez qu'Arboretum lance et gère des sessions Claude Code. Arboretum enveloppe le CLI interactif que vous utilisez déjà — installez-le et authentifiez-le comme d'habitude.
|
||||
- **Node.js ≥ 22.16** : requis, pas seulement recommandé. Arboretum persiste son état avec `node:sqlite` (`DatabaseSync`), natif et stable seulement à partir de cette version. (`.nvmrc` fixe `22`.)
|
||||
- **Le CLI `claude`** sur votre `PATH` si vous voulez qu'Arboretum lance et gère des sessions Claude Code. Arboretum enveloppe le CLI interactif que vous utilisez déjà, installez-le et authentifiez-le comme d'habitude.
|
||||
- Un **dépôt git** (ou plusieurs) que vous voulez gérer.
|
||||
|
||||
## Démarrage rapide
|
||||
|
||||
Deux chemins, selon ce que vous voulez :
|
||||
|
||||
- **Juste l'utiliser (la plupart des gens).** Arboretum est un paquet npm publié — vous **n'avez pas besoin de cloner ce dépôt**. Pointez npm vers le registre et lancez-le (ci-dessous). À faire sur la machine où tournent vos sessions Claude Code.
|
||||
- **Juste l'utiliser (la plupart des gens).** Arboretum est un paquet npm publié : vous **n'avez pas besoin de cloner ce dépôt**. Pointez npm vers le registre et lancez-le (ci-dessous). À faire sur la machine où tournent vos sessions Claude Code.
|
||||
- **Lancer depuis les sources.** Ne clonez le dépôt que pour développer Arboretum ou lancer une version non publiée.
|
||||
|
||||
### Le lancer (recommandé)
|
||||
|
||||
Arboretum est publié sur un registre npm Gitea auto-hébergé. Pointez le scope `@johanleroy` dessus une fois par machine — ajoutez à `~/.npmrc` :
|
||||
Arboretum est publié sur un registre npm Gitea auto-hébergé. Pointez le scope `@johanleroy` dessus une fois par machine, ajoutez à `~/.npmrc` :
|
||||
|
||||
```
|
||||
@johanleroy:registry=https://git.lidge.fr/api/packages/johanleroy/npm/
|
||||
```
|
||||
|
||||
Aucun token nécessaire — le paquet est en lecture publique. Puis lancez-le depuis n'importe où :
|
||||
Aucun token nécessaire, le paquet est en lecture publique. Puis lancez-le depuis n'importe où :
|
||||
|
||||
```bash
|
||||
npx @johanleroy/git-arboretum
|
||||
@@ -72,7 +72,7 @@ Au premier démarrage, Arboretum affiche un **token d'accès** unique et l'URL
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────────┐
|
||||
│ First start — your access token (shown once, store it safely): │
|
||||
│ First start · your access token (shown once, store it safely): │
|
||||
└──────────────────────────────────────────────────────────────────┘
|
||||
|
||||
<votre-token-ici>
|
||||
@@ -80,9 +80,9 @@ Au premier démarrage, Arboretum affiche un **token d'accès** unique et l'URL
|
||||
Login at: http://127.0.0.1:7317/
|
||||
```
|
||||
|
||||
Ouvrez l'URL, collez le token pour vous connecter, et c'est parti. Le token est stocké **hashé** — il n'est affiché qu'une seule fois, alors gardez-le en lieu sûr (un gestionnaire de mots de passe). Vous pourrez gérer vos tokens plus tard depuis les **Réglages**.
|
||||
Ouvrez l'URL, collez le token pour vous connecter, et c'est parti. Le token est stocké **hashé** : il n'est affiché qu'une seule fois, alors gardez-le en lieu sûr (un gestionnaire de mots de passe). Vous pourrez gérer vos tokens plus tard depuis les **Réglages**.
|
||||
|
||||
`npx` télécharge et lance la dernière version publiée à chaque fois. Pour l'installer une bonne fois — et obtenir la commande `arboretum` sur votre `PATH`, dont se sert le [service d'arrière-plan](#le-faire-tourner-en-service-darrière-plan) —, installez-le plutôt globalement :
|
||||
`npx` télécharge et lance la dernière version publiée à chaque fois. Pour l'installer une bonne fois (et obtenir la commande `arboretum` sur votre `PATH`, dont se sert le [service d'arrière-plan](#le-faire-tourner-en-service-darrière-plan)), installez-le plutôt globalement :
|
||||
|
||||
```bash
|
||||
npm i -g @johanleroy/git-arboretum
|
||||
@@ -91,7 +91,7 @@ arboretum # identique à la commande npx, depuis le binaire installé
|
||||
|
||||
### Lancer depuis les sources
|
||||
|
||||
Nécessaire uniquement pour **développer** Arboretum ou lancer une version non publiée — pas pour simplement l'utiliser. Clonez le dépôt, installez les dépendances, buildez, puis démarrez le daemon :
|
||||
Nécessaire uniquement pour **développer** Arboretum ou lancer une version non publiée, pas pour simplement l'utiliser. Clonez le dépôt, installez les dépendances, buildez, puis démarrez le daemon :
|
||||
|
||||
```bash
|
||||
git clone https://git.lidge.fr/johanleroy/arboretum.git
|
||||
@@ -106,31 +106,31 @@ node packages/server/dist/index.js
|
||||
|
||||
1. **Ajoutez un dépôt.** Depuis le dashboard, enregistrez un repo git local par son chemin. Configurez éventuellement des **hooks post-création** (ex. `npm ci`, `cp ../.env .env`) exécutés automatiquement à chaque création d'un nouveau worktree pour ce repo.
|
||||
2. **Créez ou adoptez des worktrees.** Créez un nouveau worktree + branche en un clic (les hooks s'exécutent pour vous), ou adoptez un worktree créé à la main. Chaque worktree affiche sa branche, son ahead/behind et son nombre de fichiers modifiés.
|
||||
3. **Démarrez ou reprenez une session.** Lancez une session Claude Code sur la branche principale du repo ou n'importe quel worktree, ou reprenez-en une démarrée dans votre terminal — Arboretum découvre les sessions existantes automatiquement et les reprend toujours dans leur répertoire de travail d'origine.
|
||||
3. **Démarrez ou reprenez une session.** Lancez une session Claude Code sur la branche principale du repo ou n'importe quel worktree, ou reprenez-en une démarrée dans votre terminal : Arboretum découvre les sessions existantes automatiquement et les reprend toujours dans leur répertoire de travail d'origine.
|
||||
4. **Suivez les états en direct.** Chaque session indique si elle est *busy*, *en attente de votre entrée* ou *idle*. Ouvrez le **terminal web** pour interagir directement ; il survit aux déconnexions du navigateur (fermer l'onglet ne tue pas la session).
|
||||
5. **Supervisez depuis votre téléphone.** Installez la PWA, et quand une session bascule en *attente*, vous recevez une notification push. Répondez à la demande — choisissez l'une de ses options ou refusez-la — directement depuis le dashboard, sans terminal.
|
||||
5. **Supervisez depuis votre téléphone.** Installez la PWA, et quand une session bascule en *attente*, vous recevez une notification push. Répondez à la demande (choisissez l'une de ses options ou refusez-la) directement depuis le dashboard, sans terminal.
|
||||
|
||||
## Espace de travail & opérations git
|
||||
|
||||
Au-delà de la supervision, Arboretum vous laisse vraiment *travailler* sur un worktree depuis le navigateur. Ouvrez l'**espace de travail** d'un worktree (`/workspace`) pour une vue façon IDE, en trois panneaux :
|
||||
|
||||
- **Arbre de fichiers & éditeur.** Parcourez le worktree, ouvrez un fichier dans un **éditeur Monaco** (coloration syntaxique, détection du langage), éditez-le et enregistrez-le. Les fichiers binaires et trop volumineux sont gérés proprement.
|
||||
- **Diffs par fichier.** Un visualiseur de diff unifié montre exactement ce qui a changé, ligne par ligne, pour l'arbre de travail ou l'index — ajouts et suppressions colorés, avec un refus de rendre les diffs binaires ou énormes.
|
||||
- **Staging sélectif & commit.** Indexez ou désindexez des fichiers individuels, jetez les changements non voulus, écrivez un message et **committez** — soit tout (`git add -A`), soit uniquement ce qui est indexé. **Amendez** le dernier commit (refusé une fois poussé), puis **fetch**, **pull** (fast-forward ou rebase) et **push**.
|
||||
- **Diffs par fichier.** Un visualiseur de diff unifié montre exactement ce qui a changé, ligne par ligne, pour l'arbre de travail ou l'index, ajouts et suppressions colorés, avec un refus de rendre les diffs binaires ou énormes.
|
||||
- **Staging sélectif & commit.** Indexez ou désindexez des fichiers individuels, jetez les changements non voulus, écrivez un message et **committez** : soit tout (`git add -A`), soit uniquement ce qui est indexé. **Amendez** le dernier commit (refusé une fois poussé), puis **fetch**, **pull** (fast-forward ou rebase) et **push**.
|
||||
- **Statut git détaillé.** Chaque worktree rapporte ses compteurs indexés / non indexés / conflits et son dernier commit, tenus à jour par un **watcher de système de fichiers en temps réel** : le diff et les compteurs s'actualisent dès qu'une session Claude touche un fichier.
|
||||
- **Terminal intégré.** Le terminal de la session Claude corrélée au worktree est juste à côté de l'éditeur, pour lire le diff et parler à l'agent au même endroit.
|
||||
|
||||
Comme toute action git dans Arboretum, ces opérations s'exécutent **en tant que vous** (le daemon tourne sous votre compte) — cohérent avec le modèle de sécurité : un terminal web, c'est de l'exécution de code à distance par conception.
|
||||
Comme toute action git dans Arboretum, ces opérations s'exécutent **en tant que vous** (le daemon tourne sous votre compte), cohérent avec le modèle de sécurité : un terminal web, c'est de l'exécution de code à distance par conception.
|
||||
|
||||
## Extension VS Code
|
||||
|
||||
Vous préférez rester dans votre éditeur ? Arboretum fournit une **extension VS Code native** (`packages/vscode`) — pas un webview. Elle se connecte au même daemon et l'expose avec les primitives natives de VS Code :
|
||||
Vous préférez rester dans votre éditeur ? Arboretum fournit une **extension VS Code native** (`packages/vscode`), pas un webview. Elle se connecte au même daemon et l'expose avec les primitives natives de VS Code :
|
||||
|
||||
- Un arbre **Repositories** et **Groups** en direct (repos → worktrees → sessions) dans l'Activity Bar, mis à jour en temps réel via le WebSocket du daemon.
|
||||
- **Terminaux natifs** : attachez-vous (ou observez) n'importe quelle session dans un vrai terminal VS Code — vous bénéficiez du rendu, du scrollback et du copier-coller de VS Code gratuitement.
|
||||
- **Terminaux natifs** : attachez-vous (ou observez) n'importe quelle session dans un vrai terminal VS Code, vous bénéficiez du rendu, du scrollback et du copier-coller de VS Code gratuitement.
|
||||
- Un compteur en **status bar** et des **notifications** natives quand une session attend, avec réponses Oui/Non sans ouvrir de terminal.
|
||||
- Les mutations git (créer un worktree, commit, push, promouvoir, **fetch / pull**) avec un **statut git détaillé** dans l'arbre (indexés / non indexés / conflits et dernier commit), et la **conscience du workspace** — le worktree de votre dossier ouvert est mis en évidence, avec « démarrer une session / créer un worktree ici » en un clic.
|
||||
- **Ouvrir dans l'IDE web** — sautez de n'importe quel worktree directement vers sa vue `/workspace` complète dans le navigateur. L'extension reste un gestionnaire de worktrees visuel et léger ; l'édition lourde vit dans l'IDE web.
|
||||
- Les mutations git (créer un worktree, commit, push, promouvoir, **fetch / pull**) avec un **statut git détaillé** dans l'arbre (indexés / non indexés / conflits et dernier commit), et la **conscience du workspace** : le worktree de votre dossier ouvert est mis en évidence, avec « démarrer une session / créer un worktree ici » en un clic.
|
||||
- **Ouvrir dans l'IDE web** : sautez de n'importe quel worktree directement vers sa vue `/workspace` complète dans le navigateur. L'extension reste un gestionnaire de worktrees visuel et léger ; l'édition lourde vit dans l'IDE web.
|
||||
|
||||
Elle est distribuée en **VSIX privé**. Buildez-la et packagez-la depuis le monorepo :
|
||||
|
||||
@@ -143,7 +143,7 @@ Puis installez-la via **Extensions : Installer à partir d'un VSIX…** (ou `cod
|
||||
|
||||
## Accès distant depuis votre téléphone
|
||||
|
||||
Arboretum se bind sur `127.0.0.1` par défaut et **refuse** de se binder sur une adresse non-loopback sans dérogation explicite. La façon recommandée (et sûre) de l'atteindre depuis d'autres appareils est **[Tailscale Serve](https://tailscale.com/kb/1242/tailscale-serve)** — HTTPS valide, identité tailnet, aucun port ouvert :
|
||||
Arboretum se bind sur `127.0.0.1` par défaut et **refuse** de se binder sur une adresse non-loopback sans dérogation explicite. La façon recommandée (et sûre) de l'atteindre depuis d'autres appareils est **[Tailscale Serve](https://tailscale.com/kb/1242/tailscale-serve)**, HTTPS valide, identité tailnet, aucun port ouvert :
|
||||
|
||||
```bash
|
||||
# Expose le daemon local en HTTPS dans votre tailnet
|
||||
@@ -162,7 +162,7 @@ Ouvrez `https://<machine>.<tailnet>.ts.net` depuis n'importe quel appareil de vo
|
||||
|
||||
## Le faire tourner en service d'arrière-plan
|
||||
|
||||
Le plus rapide pour faire tourner Arboretum en service qui survit à la déconnexion et redémarre au boot, c'est l'installeur intégré. Installez une version figée globalement, puis lancez `install` — il détecte votre OS, écrit le fichier de service, le démarre et affiche le token unique :
|
||||
Le plus rapide pour faire tourner Arboretum en service qui survit à la déconnexion et redémarre au boot, c'est l'installeur intégré. Installez une version figée globalement, puis lancez `install`. Il détecte votre OS, écrit le fichier de service, le démarre et affiche le token unique :
|
||||
|
||||
```bash
|
||||
npm i -g @johanleroy/git-arboretum
|
||||
@@ -185,7 +185,7 @@ Créez `~/.config/systemd/user/arboretum.service` :
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Arboretum — git worktree & Claude Code dashboard
|
||||
Description=Arboretum · git worktree & Claude Code dashboard
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
@@ -210,7 +210,7 @@ journalctl --user -u arboretum -f # logs
|
||||
```
|
||||
</details>
|
||||
|
||||
> Le **token d'accès** unique est affiché par `arboretum install` (et au tout premier lancement manuel sur base vierge). Le token est hashé et n'est jamais réaffiché — conservez-le en lieu sûr.
|
||||
> Le **token d'accès** unique est affiché par `arboretum install` (et au tout premier lancement manuel sur base vierge). Le token est hashé et n'est jamais réaffiché, conservez-le en lieu sûr.
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -222,11 +222,11 @@ Les options du daemon sont des flags CLI :
|
||||
|---|---|---|
|
||||
| `--port <n>` | `7317` | Port d'écoute. |
|
||||
| `--bind <addr>` | `127.0.0.1` | Adresse de bind. Une adresse non-loopback est refusée sauf si `--i-know-this-exposes-a-terminal` est défini. |
|
||||
| `--allow-origin <url>` | — | Origine `Origin` autorisée supplémentaire (répétable). Nécessaire pour l'accès Tailscale/HTTPS. |
|
||||
| `--allow-origin <url>` | aucun | Origine `Origin` autorisée supplémentaire (répétable). Nécessaire pour l'accès Tailscale/HTTPS. |
|
||||
| `--db <path>` | `<data>/arboretum.db` | Chemin de la base SQLite. |
|
||||
| `--vapid-contact <mailto/url>` | `mailto:arboretum@localhost` | Sujet de contact VAPID pour le Web Push. |
|
||||
| `--print-token` | `false` | Indication sur le réaffichage du token (les tokens sont hashés et ne peuvent pas être réaffichés). |
|
||||
| `--i-know-this-exposes-a-terminal` | `false` | Reconnaître le bind sur une adresse non-loopback. **À éviter** — préférez Tailscale Serve. |
|
||||
| `--i-know-this-exposes-a-terminal` | `false` | Reconnaître le bind sur une adresse non-loopback. **À éviter** : préférez Tailscale Serve. |
|
||||
|
||||
`arboretum install` accepte tous les flags du daemon ci-dessus (propagés tels quels au service), plus :
|
||||
|
||||
@@ -239,14 +239,14 @@ Les options du daemon sont des flags CLI :
|
||||
|
||||
L'état (la base SQLite) vit dans `$XDG_DATA_HOME/arboretum` (par défaut `~/.local/share/arboretum`).
|
||||
|
||||
Les réglages au-delà des flags CLI — les répertoires qu'Arboretum scanne pour trouver des repos et à quelle fréquence, le chemin et le home du binaire `claude`, et les fenêtres de rétention / purge des sessions — vivent dans les **Réglages** de l'UI. Ils sont diffusés via le WebSocket, donc chaque navigateur connecté reflète un changement en temps réel, sans rechargement.
|
||||
Les réglages au-delà des flags CLI (les répertoires qu'Arboretum scanne pour trouver des repos et à quelle fréquence, le chemin et le home du binaire `claude`, et les fenêtres de rétention / purge des sessions) vivent dans les **Réglages** de l'UI. Ils sont diffusés via le WebSocket, donc chaque navigateur connecté reflète un changement en temps réel, sans rechargement.
|
||||
|
||||
## Services git distants & clone
|
||||
|
||||
Arboretum peut se connecter à vos fournisseurs d'hébergement git pour parcourir et cloner des dépôts sans quitter le dashboard :
|
||||
|
||||
- **Fournisseurs & auth.** GitHub, GitLab et Gitea, authentifiés par un **personal access token** ou un **app password** (clés SSH et OAuth prévus). Ajoutez une connexion depuis **Réglages → Services git**, donnez-lui un libellé, et testez-la sur place — Arboretum rapporte `ok`, `auth failed`, `rate limited` ou `unreachable`.
|
||||
- **Les secrets restent secrets.** Les identifiants sont **chiffrés au repos** (AES-256-GCM, `SecretBox`) et **jamais** renvoyés en clair par l'API REST — les réponses ne portent qu'un indice `…last4` et un drapeau « a un secret ».
|
||||
- **Fournisseurs & auth.** GitHub, GitLab et Gitea, authentifiés par un **personal access token** ou un **app password** (clés SSH et OAuth prévus). Ajoutez une connexion depuis **Réglages → Services git**, donnez-lui un libellé, et testez-la sur place : Arboretum rapporte `ok`, `auth failed`, `rate limited` ou `unreachable`.
|
||||
- **Les secrets restent secrets.** Les identifiants sont **chiffrés au repos** (AES-256-GCM, `SecretBox`) et **jamais** renvoyés en clair par l'API REST : les réponses ne portent qu'un indice `…last4` et un drapeau « a un secret ».
|
||||
- **Parcourir & cloner.** Listez les dépôts qu'une connexion peut voir, choisissez-en un, et clonez-le en HTTPS vers la destination de votre choix. Le clone tourne comme une opération suivie, avec **progression et phase** poussées en direct via le WebSocket, et le nouveau repo est enregistré automatiquement une fois terminé.
|
||||
|
||||
## Modèle de sécurité
|
||||
@@ -254,12 +254,12 @@ Arboretum peut se connecter à vos fournisseurs d'hébergement git pour parcouri
|
||||
Un terminal web, c'est de l'exécution de code à distance *par conception*. Les garde-fous d'Arboretum sont structurants :
|
||||
|
||||
- Se bind sur `127.0.0.1` par défaut ; refuse les binds non-loopback sans flag explicite.
|
||||
- Authentifie **chaque** requête `/api/**` **et** chaque upgrade `/ws` avec des tokens révocables, et applique un **check `Origin` strict** (le cookie `SameSite=Strict` ne couvre pas les upgrades WebSocket — c'est le garde-fou anti cross-site hijacking).
|
||||
- Authentifie **chaque** requête `/api/**` **et** chaque upgrade `/ws` avec des tokens révocables, et applique un **check `Origin` strict** (le cookie `SameSite=Strict` ne couvre pas les upgrades WebSocket : c'est le garde-fou anti cross-site hijacking).
|
||||
- Les tokens sont stockés **hashés** (sha256) et comparés en temps constant ; le bootstrap token n'est affiché qu'une seule fois. Le cookie de session est un payload signé HMAC, `HttpOnly` et `SameSite=Strict`, et reçoit automatiquement le flag `Secure` quand la requête arrive en HTTPS (p. ex. derrière Tailscale Serve). Le login est rate-limité avec backoff exponentiel.
|
||||
- Envoie des en-têtes HTTP durcis (CSP, `X-Frame-Options`, `nosniff`, `Referrer-Policy`, HSTS conditionnel, `no-store` sur l'API), restreint le dossier de données à `0o700` et la base à `0o600`, et **chiffre les secrets sensibles au repos** (AES-256-GCM).
|
||||
- Tient un **journal d'audit** des opérations sensibles et offre l'**export/effacement RGPD** des données (Réglages → Sécurité & conformité).
|
||||
|
||||
Tailscale Serve est **la** façon d'atteindre Arboretum depuis d'autres appareils — pas seulement une recommandation : HTTPS valide, identité tailnet, aucun port ouvert. Le flag `--i-know-this-exposes-a-terminal` est une trappe de secours, pas un mode de déploiement ; n'exposez jamais Arboretum directement sur internet.
|
||||
Tailscale Serve est **la** façon d'atteindre Arboretum depuis d'autres appareils, pas seulement une recommandation : HTTPS valide, identité tailnet, aucun port ouvert. Le flag `--i-know-this-exposes-a-terminal` est une trappe de secours, pas un mode de déploiement ; n'exposez jamais Arboretum directement sur internet.
|
||||
|
||||
Voir [`SECURITY.md`](SECURITY.md) pour le modèle de menace complet et [`docs/ENTERPRISE_DEPLOYMENT.md`](docs/ENTERPRISE_DEPLOYMENT.md) pour le durcissement en environnement réglementé.
|
||||
|
||||
@@ -270,7 +270,7 @@ Voir [`SECURITY.md`](SECURITY.md) pour le modèle de menace complet et [`docs/EN
|
||||
| Interface web, tout appareil | ✅ | ❌ apps desktop | ✅ | ✅ |
|
||||
| Gestion visuelle des worktrees (multi-repo) | ✅ | ✅ (mono-repo, desktop) | ❌ | ❌ |
|
||||
| Découvre & reprend les sessions de terminal *existantes* | ✅ | ❌ | partiel | ❌ |
|
||||
| 100 % auto-hébergé — zéro trafic via des serveurs tiers | ✅ | ✅ | serveur relais | ❌ relayé via Anthropic |
|
||||
| 100 % auto-hébergé, zéro trafic via des serveurs tiers | ✅ | ✅ | serveur relais | ❌ relayé via Anthropic |
|
||||
| Linux-first | ✅ | variable | ✅ | l'app desktop n'a pas de build Linux |
|
||||
| Open source | MIT | ❌ / partiel | MIT / AGPL | ❌ |
|
||||
|
||||
@@ -278,11 +278,11 @@ Le Remote Control d'Anthropic est excellent pour piloter *une* session depuis vo
|
||||
|
||||
## Une note sur l'usage de Claude
|
||||
|
||||
Arboretum enveloppe le CLI Claude Code **interactif** dans un PTY — la même chose que vous lancez dans votre terminal, affichée dans votre navigateur. Il n'utilise pas l'Agent SDK ni le mode headless. Les politiques d'usage d'Anthropic autour de l'usage programmatique peuvent évoluer ; Arboretum suivra les sorties du CLI et documentera tout impact de façon transparente.
|
||||
Arboretum enveloppe le CLI Claude Code **interactif** dans un PTY : la même chose que vous lancez dans votre terminal, affichée dans votre navigateur. Il n'utilise pas l'Agent SDK ni le mode headless. Les politiques d'usage d'Anthropic autour de l'usage programmatique peuvent évoluer ; Arboretum suivra les sorties du CLI et documentera tout impact de façon transparente.
|
||||
|
||||
## Développement
|
||||
|
||||
Arboretum est un monorepo npm workspaces : `@arboretum/shared` (protocole WS/REST, source de vérité), `@johanleroy/git-arboretum` (le daemon Fastify, le paquet publié), `@arboretum/web` (la SPA Vue 3) et `git-arboretum` (l'extension VS Code — buildée séparément avec `npm run build:vscode`).
|
||||
Arboretum est un monorepo npm workspaces : `@arboretum/shared` (protocole WS/REST, source de vérité), `@johanleroy/git-arboretum` (le daemon Fastify, le paquet publié), `@arboretum/web` (la SPA Vue 3) et `git-arboretum` (l'extension VS Code, buildée séparément avec `npm run build:vscode`).
|
||||
|
||||
```bash
|
||||
npm run build # build shared → server → web (l'ordre compte)
|
||||
@@ -318,4 +318,4 @@ Arboretum est un projet personnel libre et auto-financé. S'il vous fait gagner
|
||||
|
||||
## Licence
|
||||
|
||||
MIT — voir [LICENSE](LICENSE).
|
||||
MIT, voir [LICENSE](LICENSE).
|
||||
|
||||
88
README.md
88
README.md
@@ -3,7 +3,7 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
A self-hosted web dashboard for your git worktrees and the Claude Code sessions running on them — from any device.
|
||||
A self-hosted web dashboard for your git worktrees and the Claude Code sessions running on them, from any device.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
@@ -28,41 +28,41 @@ Working with AI coding agents changed how we use git: one feature = one worktree
|
||||
|
||||
A single Node.js daemon you run on your dev machine (`npx @johanleroy/git-arboretum`), serving a web UI usable from your desktop, phone or tablet:
|
||||
|
||||
- **Worktree-first, multi-repo dashboard** — every worktree of every registered repo, with its git state (branch, ahead/behind, dirty files) *and* the state of its Claude Code session (busy / waiting for input / idle / resumable).
|
||||
- **Full worktree lifecycle** — create (with per-repo post-create hooks: `npm ci`, copy `.env`…), adopt worktrees created by hand, delete with guardrails, prune orphans.
|
||||
- **Session discovery & resume** — sessions you launched in your own terminal show up automatically; resume dead ones, observe or fork live ones. Never corrupts a live session. Hide the old ones that clutter the list (one click clears the whole external history; they stay resumable).
|
||||
- **Web terminal** — full xterm.js terminal to every managed session, surviving browser disconnects; truly fullscreen, with the prompt pinned to the bottom and full scrollback above.
|
||||
- **Worktree IDE** — open any worktree in a full in-browser workspace: a file tree, a Monaco editor, an inline per-file diff viewer and the worktree's session terminal, side by side. Edit files, stage changes selectively, commit (or amend), fetch/pull and push — all without leaving the dashboard. A real-time file-system watcher keeps the view live as the agent edits.
|
||||
- **Supervision from your phone** — installable PWA with push notifications when a session needs you; answer a prompt (its options, or deny) without opening a terminal.
|
||||
- **Work groups** — bundle related repos (e.g. an API, its web frontend and its docs) into a named group, then launch **one Claude session that spans all of them at once** (via the CLI's `--add-dir`): a single conversation with one shared context working across every repo, plus a unified view of all their worktrees and a side-by-side multi-terminal grid. Group sessions can either create the same branch worktree in each repo first, or run straight on the main checkouts.
|
||||
- **Remote git services** — connect your GitHub, GitLab or Gitea accounts (personal access token or app password), stored **encrypted at rest** (AES-256-GCM); browse your remote repositories and clone them over HTTPS with live progress, straight from the dashboard.
|
||||
- **Automatic archival** — finished sessions are archived automatically after a configurable retention window (30 days by default), so the list stays focused on what's live while the history is one toggle away.
|
||||
- **VS Code extension** — a native extension (not a webview) that brings the live tree, native session terminals, waiting alerts and git actions right into your editor. See [VS Code extension](#vs-code-extension).
|
||||
- **Worktree-first, multi-repo dashboard**: every worktree of every registered repo, with its git state (branch, ahead/behind, dirty files) *and* the state of its Claude Code session (busy / waiting for input / idle / resumable).
|
||||
- **Full worktree lifecycle**: create (with per-repo post-create hooks: `npm ci`, copy `.env`…), adopt worktrees created by hand, delete with guardrails, prune orphans.
|
||||
- **Session discovery & resume**: sessions you launched in your own terminal show up automatically; resume dead ones, observe or fork live ones. Never corrupts a live session. Hide the old ones that clutter the list (one click clears the whole external history; they stay resumable).
|
||||
- **Web terminal**: full xterm.js terminal to every managed session, surviving browser disconnects; truly fullscreen, with the prompt pinned to the bottom and full scrollback above.
|
||||
- **Worktree IDE**: open any worktree in a full in-browser workspace: a file tree, a Monaco editor, an inline per-file diff viewer and the worktree's session terminal, side by side. Edit files, stage changes selectively, commit (or amend), fetch/pull and push, all without leaving the dashboard. A real-time file-system watcher keeps the view live as the agent edits.
|
||||
- **Supervision from your phone**: installable PWA with push notifications when a session needs you; answer a prompt (its options, or deny) without opening a terminal.
|
||||
- **Work groups**: bundle related repos (e.g. an API, its web frontend and its docs) into a named group, then launch **one Claude session that spans all of them at once** (via the CLI's `--add-dir`): a single conversation with one shared context working across every repo, plus a unified view of all their worktrees and a side-by-side multi-terminal grid. Group sessions can either create the same branch worktree in each repo first, or run straight on the main checkouts.
|
||||
- **Remote git services**: connect your GitHub, GitLab or Gitea accounts (personal access token or app password), stored **encrypted at rest** (AES-256-GCM); browse your remote repositories and clone them over HTTPS with live progress, straight from the dashboard.
|
||||
- **Automatic archival**: finished sessions are archived automatically after a configurable retention window (30 days by default), so the list stays focused on what's live while the history is one toggle away.
|
||||
- **VS Code extension**: a native extension (not a webview) that brings the live tree, native session terminals, waiting alerts and git actions right into your editor. See [VS Code extension](#vs-code-extension).
|
||||
|
||||
---
|
||||
|
||||
## Requirements
|
||||
|
||||
- **Node.js ≥ 22.16** — required, not just recommended. Arboretum persists state with `node:sqlite` (`DatabaseSync`), which is native and stable only from this version. (`.nvmrc` pins `22`.)
|
||||
- **The `claude` CLI** on your `PATH` if you want Arboretum to launch and manage Claude Code sessions. Arboretum wraps the interactive CLI you already use — install and authenticate it as usual.
|
||||
- **Node.js ≥ 22.16**: required, not just recommended. Arboretum persists state with `node:sqlite` (`DatabaseSync`), which is native and stable only from this version. (`.nvmrc` pins `22`.)
|
||||
- **The `claude` CLI** on your `PATH` if you want Arboretum to launch and manage Claude Code sessions. Arboretum wraps the interactive CLI you already use, install and authenticate it as usual.
|
||||
- A **git** repository (or several) you want to manage.
|
||||
|
||||
## Quick start
|
||||
|
||||
Two paths, depending on what you want:
|
||||
|
||||
- **Just use it (most people).** Arboretum is a published npm package — you **don't need to clone this repo**. Point npm at the registry and run it (below). Do this on the machine where your Claude Code sessions run.
|
||||
- **Just use it (most people).** Arboretum is a published npm package: you **don't need to clone this repo**. Point npm at the registry and run it (below). Do this on the machine where your Claude Code sessions run.
|
||||
- **Run from source.** Clone the repo only to hack on Arboretum or run an unreleased build.
|
||||
|
||||
### Run it (recommended)
|
||||
|
||||
Arboretum is published to a self-hosted Gitea npm registry. Point the `@johanleroy` scope at it once per machine — add to `~/.npmrc`:
|
||||
Arboretum is published to a self-hosted Gitea npm registry. Point the `@johanleroy` scope at it once per machine, add to `~/.npmrc`:
|
||||
|
||||
```
|
||||
@johanleroy:registry=https://git.lidge.fr/api/packages/johanleroy/npm/
|
||||
```
|
||||
|
||||
No token needed — the package is publicly readable. Then run it from anywhere:
|
||||
No token needed, the package is publicly readable. Then run it from anywhere:
|
||||
|
||||
```bash
|
||||
npx @johanleroy/git-arboretum
|
||||
@@ -72,7 +72,7 @@ On first start, Arboretum prints a one-time **access token** and the URL to open
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────────┐
|
||||
│ First start — your access token (shown once, store it safely): │
|
||||
│ First start · your access token (shown once, store it safely): │
|
||||
└──────────────────────────────────────────────────────────────────┘
|
||||
|
||||
<your-token-here>
|
||||
@@ -80,9 +80,9 @@ On first start, Arboretum prints a one-time **access token** and the URL to open
|
||||
Login at: http://127.0.0.1:7317/
|
||||
```
|
||||
|
||||
Open the URL, paste the token to log in, and you're in. The token is stored **hashed** — it is shown only once, so save it somewhere safe (a password manager). You can manage tokens later from **Settings**.
|
||||
Open the URL, paste the token to log in, and you're in. The token is stored **hashed**: it is shown only once, so save it somewhere safe (a password manager). You can manage tokens later from **Settings**.
|
||||
|
||||
`npx` fetches and runs the latest published version each time. To install it once — and get the `arboretum` command on your `PATH`, which the [background service](#running-it-as-a-background-service) relies on — install it globally instead:
|
||||
`npx` fetches and runs the latest published version each time. To install it once (and get the `arboretum` command on your `PATH`, which the [background service](#running-it-as-a-background-service) relies on), install it globally instead:
|
||||
|
||||
```bash
|
||||
npm i -g @johanleroy/git-arboretum
|
||||
@@ -91,7 +91,7 @@ arboretum # identical to the npx command, from the installed binary
|
||||
|
||||
### Run from source
|
||||
|
||||
Only needed to **develop** Arboretum or run an unreleased build — not required just to use it. Clone the repo, install dependencies, build, then start the daemon:
|
||||
Only needed to **develop** Arboretum or run an unreleased build, not required just to use it. Clone the repo, install dependencies, build, then start the daemon:
|
||||
|
||||
```bash
|
||||
git clone https://git.lidge.fr/johanleroy/arboretum.git
|
||||
@@ -106,31 +106,31 @@ node packages/server/dist/index.js
|
||||
|
||||
1. **Add a repository.** From the dashboard, register a local git repo by its path. Optionally configure **post-create hooks** (e.g. `npm ci`, `cp ../.env .env`) that run automatically every time you create a new worktree for that repo.
|
||||
2. **Create or adopt worktrees.** Spin up a new worktree + branch in one click (hooks run for you), or adopt a worktree you created by hand. Each worktree shows its branch, ahead/behind, and dirty-file count.
|
||||
3. **Start or resume a session.** Launch a Claude Code session on the repo's main branch or any worktree, or resume one that was started in your terminal — Arboretum discovers existing sessions automatically and always resumes them in their original working directory.
|
||||
3. **Start or resume a session.** Launch a Claude Code session on the repo's main branch or any worktree, or resume one that was started in your terminal: Arboretum discovers existing sessions automatically and always resumes them in their original working directory.
|
||||
4. **Watch the live states.** Each session reports whether it's *busy*, *waiting for your input*, or *idle*. Open the **web terminal** to interact directly; it survives browser disconnects (closing the tab does not kill the session).
|
||||
5. **Supervise from your phone.** Install the PWA, and when a session flips to *waiting* you get a push notification. Answer the prompt — pick one of its options or deny it — straight from the dashboard, no terminal required.
|
||||
5. **Supervise from your phone.** Install the PWA, and when a session flips to *waiting* you get a push notification. Answer the prompt (pick one of its options or deny it) straight from the dashboard, no terminal required.
|
||||
|
||||
## Workspace & git operations
|
||||
|
||||
Beyond supervising, Arboretum lets you actually *work* on a worktree from the browser. Open any worktree's **workspace** (`/workspace`) for an IDE-like, three-pane view:
|
||||
|
||||
- **File tree & editor.** Browse the worktree, open a file in a **Monaco editor** (syntax highlighting, language detection), edit and save it. Binary and oversized files are handled gracefully.
|
||||
- **Per-file diffs.** A unified diff viewer shows exactly what changed, line by line, for the working tree or the index — additions and deletions colour-coded, with a refusal to render binary or huge diffs.
|
||||
- **Selective staging & commit.** Stage or unstage individual files, discard changes you don't want, write a message and **commit** — either everything (`git add -A`) or just what's staged. **Amend** the last commit (refused once it's been pushed), then **fetch**, **pull** (fast-forward or rebase) and **push**.
|
||||
- **Per-file diffs.** A unified diff viewer shows exactly what changed, line by line, for the working tree or the index, additions and deletions colour-coded, with a refusal to render binary or huge diffs.
|
||||
- **Selective staging & commit.** Stage or unstage individual files, discard changes you don't want, write a message and **commit**: either everything (`git add -A`) or just what's staged. **Amend** the last commit (refused once it's been pushed), then **fetch**, **pull** (fast-forward or rebase) and **push**.
|
||||
- **Detailed git status.** Every worktree reports staged / unstaged / conflict counts and its last commit, kept current by a **real-time file-system watcher** so the diff and counts update the moment a Claude session touches a file.
|
||||
- **Integrated terminal.** The worktree's correlated Claude session terminal sits right next to the editor, so you can read the diff and talk to the agent in one place.
|
||||
|
||||
Like every git action in Arboretum, these run **as you** (the daemon runs under your account) — consistent with the security model: a web terminal is remote code execution by design.
|
||||
Like every git action in Arboretum, these run **as you** (the daemon runs under your account), consistent with the security model: a web terminal is remote code execution by design.
|
||||
|
||||
## VS Code extension
|
||||
|
||||
Prefer to stay in your editor? Arboretum ships a **native VS Code extension** (`packages/vscode`) — not a webview. It connects to the same daemon and surfaces it with VS Code's own primitives:
|
||||
Prefer to stay in your editor? Arboretum ships a **native VS Code extension** (`packages/vscode`), not a webview. It connects to the same daemon and surfaces it with VS Code's own primitives:
|
||||
|
||||
- A live **Repositories** and **Groups** tree (repos → worktrees → sessions) in the Activity Bar, updated in real time over the daemon's WebSocket.
|
||||
- **Native terminals**: attach to (or observe) any session in a real VS Code terminal — you get VS Code's rendering, scrollback and copy/paste for free.
|
||||
- **Native terminals**: attach to (or observe) any session in a real VS Code terminal, you get VS Code's rendering, scrollback and copy/paste for free.
|
||||
- A **status-bar** counter and native **notifications** when a session is waiting, with Yes/No answers without opening a terminal.
|
||||
- Git mutations (create worktree, commit, push, promote, **fetch / pull**) with **detailed git status** in the tree (staged / unstaged / conflicts and the last commit), and **workspace awareness** — the worktree for your open folder is highlighted, with one-click "start session / create worktree here".
|
||||
- **Open in the web IDE** — jump from any worktree straight to its full `/workspace` view in the browser. The extension stays a lightweight, visual worktree manager; the heavy editing lives in the web IDE.
|
||||
- Git mutations (create worktree, commit, push, promote, **fetch / pull**) with **detailed git status** in the tree (staged / unstaged / conflicts and the last commit), and **workspace awareness**: the worktree for your open folder is highlighted, with one-click "start session / create worktree here".
|
||||
- **Open in the web IDE**: jump from any worktree straight to its full `/workspace` view in the browser. The extension stays a lightweight, visual worktree manager; the heavy editing lives in the web IDE.
|
||||
|
||||
It is distributed as a **private VSIX**. Build and package it from the monorepo:
|
||||
|
||||
@@ -143,7 +143,7 @@ Then install it via **Extensions: Install from VSIX…** (or `code --install-ext
|
||||
|
||||
## Remote access from your phone
|
||||
|
||||
Arboretum binds to `127.0.0.1` by default and **refuses** to bind to a non-loopback address without an explicit override. The recommended (and safe) way to reach it from other devices is **[Tailscale Serve](https://tailscale.com/kb/1242/tailscale-serve)** — valid HTTPS, tailnet identity, no open ports:
|
||||
Arboretum binds to `127.0.0.1` by default and **refuses** to bind to a non-loopback address without an explicit override. The recommended (and safe) way to reach it from other devices is **[Tailscale Serve](https://tailscale.com/kb/1242/tailscale-serve)**, valid HTTPS, tailnet identity, no open ports:
|
||||
|
||||
```bash
|
||||
# Expose the local daemon over HTTPS inside your tailnet
|
||||
@@ -162,7 +162,7 @@ Open `https://<machine>.<tailnet>.ts.net` from any device on your tailnet. **Web
|
||||
|
||||
## Running it as a background service
|
||||
|
||||
The quickest way to run Arboretum as a service that survives logout and restarts on boot is the built-in installer. Install a pinned version globally, then run `install` — it detects your OS, writes the service file, starts it, and prints the one-time token:
|
||||
The quickest way to run Arboretum as a service that survives logout and restarts on boot is the built-in installer. Install a pinned version globally, then run `install`. It detects your OS, writes the service file, starts it, and prints the one-time token:
|
||||
|
||||
```bash
|
||||
npm i -g @johanleroy/git-arboretum
|
||||
@@ -185,7 +185,7 @@ Create `~/.config/systemd/user/arboretum.service`:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Arboretum — git worktree & Claude Code dashboard
|
||||
Description=Arboretum · git worktree & Claude Code dashboard
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
@@ -210,7 +210,7 @@ journalctl --user -u arboretum -f # logs
|
||||
```
|
||||
</details>
|
||||
|
||||
> The one-time **access token is printed by `arboretum install`** (and on the very first manual run with an empty database). The token is hashed and never shown again — store it safely.
|
||||
> The one-time **access token is printed by `arboretum install`** (and on the very first manual run with an empty database). The token is hashed and never shown again, store it safely.
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -222,11 +222,11 @@ Daemon options are CLI flags:
|
||||
|---|---|---|
|
||||
| `--port <n>` | `7317` | Port to listen on. |
|
||||
| `--bind <addr>` | `127.0.0.1` | Bind address. Non-loopback is refused unless `--i-know-this-exposes-a-terminal` is set. |
|
||||
| `--allow-origin <url>` | — | Additional allowed `Origin` (repeatable). Needed for Tailscale/HTTPS access. |
|
||||
| `--allow-origin <url>` | none | Additional allowed `Origin` (repeatable). Needed for Tailscale/HTTPS access. |
|
||||
| `--db <path>` | `<data>/arboretum.db` | SQLite database path. |
|
||||
| `--vapid-contact <mailto/url>` | `mailto:arboretum@localhost` | VAPID contact subject for Web Push. |
|
||||
| `--print-token` | `false` | Hint about token re-printing (tokens are hashed and cannot be re-shown). |
|
||||
| `--i-know-this-exposes-a-terminal` | `false` | Acknowledge binding to a non-loopback address. **Avoid** — prefer Tailscale Serve. |
|
||||
| `--i-know-this-exposes-a-terminal` | `false` | Acknowledge binding to a non-loopback address. **Avoid**: prefer Tailscale Serve. |
|
||||
|
||||
`arboretum install` accepts every daemon flag above (propagated verbatim to the service) plus:
|
||||
|
||||
@@ -239,14 +239,14 @@ Daemon options are CLI flags:
|
||||
|
||||
State (the SQLite database) lives in `$XDG_DATA_HOME/arboretum` (default `~/.local/share/arboretum`).
|
||||
|
||||
Settings beyond CLI flags — the directories Arboretum scans for repos and how often, the `claude` binary path and home, and the session retention / purge windows — live in **Settings** in the UI. They are broadcast over the WebSocket, so every connected browser reflects a change in real time, no reload needed.
|
||||
Settings beyond CLI flags (the directories Arboretum scans for repos and how often, the `claude` binary path and home, and the session retention / purge windows) live in **Settings** in the UI. They are broadcast over the WebSocket, so every connected browser reflects a change in real time, no reload needed.
|
||||
|
||||
## Remote git services & clone
|
||||
|
||||
Arboretum can connect to your git hosting providers so you can browse and clone repositories without leaving the dashboard:
|
||||
|
||||
- **Providers & auth.** GitHub, GitLab and Gitea, authenticated with a **personal access token** or an **app password** (SSH keys and OAuth are planned). Add a connection from **Settings → Git services**, give it a label, and test it in place — Arboretum reports `ok`, `auth failed`, `rate limited` or `unreachable`.
|
||||
- **Secrets stay secret.** Credentials are **encrypted at rest** (AES-256-GCM, `SecretBox`) and **never** returned in clear by the REST API — responses carry only a `…last4` hint and a "has secret" flag.
|
||||
- **Providers & auth.** GitHub, GitLab and Gitea, authenticated with a **personal access token** or an **app password** (SSH keys and OAuth are planned). Add a connection from **Settings → Git services**, give it a label, and test it in place: Arboretum reports `ok`, `auth failed`, `rate limited` or `unreachable`.
|
||||
- **Secrets stay secret.** Credentials are **encrypted at rest** (AES-256-GCM, `SecretBox`) and **never** returned in clear by the REST API: responses carry only a `…last4` hint and a "has secret" flag.
|
||||
- **Browse & clone.** List the repositories a connection can see, pick one, and clone it over HTTPS into a destination of your choice. The clone runs as a tracked operation with live **progress and phase** pushed over the WebSocket, and the new repo is registered automatically when it completes.
|
||||
|
||||
## Security model
|
||||
@@ -254,12 +254,12 @@ Arboretum can connect to your git hosting providers so you can browse and clone
|
||||
A web terminal is remote code execution *by design*. Arboretum's guardrails are structural:
|
||||
|
||||
- Binds to `127.0.0.1` by default; refuses non-loopback binds without an explicit flag.
|
||||
- Authenticates **every** `/api/**` request **and** every `/ws` upgrade with revocable tokens, and applies a **strict `Origin` check** (the `SameSite=Strict` cookie does not cover WebSocket upgrades — this is the anti cross-site hijacking guard).
|
||||
- Authenticates **every** `/api/**` request **and** every `/ws` upgrade with revocable tokens, and applies a **strict `Origin` check** (the `SameSite=Strict` cookie does not cover WebSocket upgrades: this is the anti cross-site hijacking guard).
|
||||
- Tokens are stored **hashed** (sha256) and compared in constant time; the bootstrap token is shown only once. The session cookie is an HMAC-signed payload, `HttpOnly` and `SameSite=Strict`, and it automatically gains the `Secure` flag when the request arrives over HTTPS (e.g. behind Tailscale Serve). Login is rate-limited with exponential backoff.
|
||||
- Sends hardened HTTP headers (CSP, `X-Frame-Options`, `nosniff`, `Referrer-Policy`, conditional HSTS, `no-store` on the API), restricts the data directory to `0o700` and the database to `0o600`, and **encrypts sensitive secrets at rest** (AES-256-GCM).
|
||||
- Keeps an **audit log** of sensitive operations and offers **GDPR** data export/erasure (Settings → Security & compliance).
|
||||
|
||||
Tailscale Serve is **the** way to reach Arboretum from other devices — not just a recommendation: valid HTTPS, tailnet identity, no open ports. The `--i-know-this-exposes-a-terminal` flag is an escape hatch, not a deployment mode; never expose Arboretum directly to the internet.
|
||||
Tailscale Serve is **the** way to reach Arboretum from other devices, not just a recommendation: valid HTTPS, tailnet identity, no open ports. The `--i-know-this-exposes-a-terminal` flag is an escape hatch, not a deployment mode; never expose Arboretum directly to the internet.
|
||||
|
||||
See [`SECURITY.md`](SECURITY.md) for the full threat model and [`docs/ENTERPRISE_DEPLOYMENT.md`](docs/ENTERPRISE_DEPLOYMENT.md) for hardening in regulated environments.
|
||||
|
||||
@@ -270,7 +270,7 @@ See [`SECURITY.md`](SECURITY.md) for the full threat model and [`docs/ENTERPRISE
|
||||
| Web UI, any device | ✅ | ❌ desktop apps | ✅ | ✅ |
|
||||
| Visual worktree management (multi-repo) | ✅ | ✅ (single repo, desktop) | ❌ | ❌ |
|
||||
| Discovers & resumes *existing* terminal sessions | ✅ | ❌ | partial | ❌ |
|
||||
| 100% self-hosted — zero traffic through third-party servers | ✅ | ✅ | relay server | ❌ relayed through Anthropic |
|
||||
| 100% self-hosted, zero traffic through third-party servers | ✅ | ✅ | relay server | ❌ relayed through Anthropic |
|
||||
| Linux-first | ✅ | varies | ✅ | Desktop app has no Linux build |
|
||||
| Open source | MIT | ❌ / partial | MIT / AGPL | ❌ |
|
||||
|
||||
@@ -278,11 +278,11 @@ Anthropic's Remote Control is great at piloting *one* session from your phone. A
|
||||
|
||||
## A note on Claude usage
|
||||
|
||||
Arboretum wraps the **interactive** Claude Code CLI in a PTY — the same thing you run in your terminal, displayed in your browser. It does not use the Agent SDK or headless mode. Anthropic's usage policies around programmatic use may evolve; Arboretum will track CLI releases and document any impact transparently.
|
||||
Arboretum wraps the **interactive** Claude Code CLI in a PTY: the same thing you run in your terminal, displayed in your browser. It does not use the Agent SDK or headless mode. Anthropic's usage policies around programmatic use may evolve; Arboretum will track CLI releases and document any impact transparently.
|
||||
|
||||
## Development
|
||||
|
||||
Arboretum is an npm-workspaces monorepo: `@arboretum/shared` (WS/REST protocol, source of truth), `@johanleroy/git-arboretum` (the Fastify daemon, the published package), `@arboretum/web` (the Vue 3 SPA), and `git-arboretum` (the VS Code extension — built separately with `npm run build:vscode`).
|
||||
Arboretum is an npm-workspaces monorepo: `@arboretum/shared` (WS/REST protocol, source of truth), `@johanleroy/git-arboretum` (the Fastify daemon, the published package), `@arboretum/web` (the Vue 3 SPA), and `git-arboretum` (the VS Code extension, built separately with `npm run build:vscode`).
|
||||
|
||||
```bash
|
||||
npm run build # build shared → server → web (order matters)
|
||||
@@ -318,4 +318,4 @@ Arboretum is a free, self-funded side project. If it saves you time, you can sup
|
||||
|
||||
## License
|
||||
|
||||
MIT — see [LICENSE](LICENSE).
|
||||
MIT, see [LICENSE](LICENSE).
|
||||
|
||||
10
SECURITY.md
10
SECURITY.md
@@ -1,7 +1,7 @@
|
||||
# Security Policy
|
||||
|
||||
Arboretum is a self-hosted daemon that serves a web dashboard to drive git worktrees and the
|
||||
Claude Code sessions running on them. **A web terminal is remote code execution by design** — that
|
||||
Claude Code sessions running on them. **A web terminal is remote code execution by design**: that
|
||||
is the product, not a bug. Arboretum's security model is therefore built on *structural* guards
|
||||
(loopback-only binding, authenticated access, strict Origin checks) far more than on cryptography
|
||||
alone.
|
||||
@@ -13,7 +13,7 @@ environment, see [`docs/ENTERPRISE_DEPLOYMENT.md`](docs/ENTERPRISE_DEPLOYMENT.md
|
||||
## Threat model
|
||||
|
||||
- **Single-user by design.** Arboretum runs on the owner's machine and is meant for one operator.
|
||||
There is no multi-tenant isolation and no RBAC — and none is claimed.
|
||||
There is no multi-tenant isolation and no RBAC, and none is claimed.
|
||||
- **Loopback by default.** The server binds `127.0.0.1`; `config.ts` *refuses* any non-loopback bind
|
||||
unless you pass `--i-know-this-exposes-a-terminal`. Remote access is expected via **Tailscale Serve**
|
||||
(TLS + tailnet identity), never by opening a port.
|
||||
@@ -31,7 +31,7 @@ environment, see [`docs/ENTERPRISE_DEPLOYMENT.md`](docs/ENTERPRISE_DEPLOYMENT.md
|
||||
| Sessions | Cookie is an HMAC-SHA256 signed payload, `HttpOnly` + `SameSite=Strict`, `Secure` when HTTPS | `packages/server/src/routes/auth.ts` |
|
||||
| CSRF / WS | Strict `Origin` check on every `/api/**` and `/ws` request (anti cross-site WS hijacking) | `packages/server/src/app.ts` |
|
||||
| CSRF | Mutations carrying a body must be `application/json` | `packages/server/src/app.ts` |
|
||||
| Rate limit | Global login rate limit with exponential backoff (not per-IP — Tailscale fronts everything as 127.0.0.1) | `packages/server/src/auth/service.ts` |
|
||||
| Rate limit | Global login rate limit with exponential backoff (not per-IP, Tailscale fronts everything as 127.0.0.1) | `packages/server/src/auth/service.ts` |
|
||||
| HTTP headers | CSP, `X-Frame-Options: DENY`, `X-Content-Type-Options: nosniff`, `Referrer-Policy`, `Permissions-Policy`, conditional HSTS, `Cache-Control: no-store` on API; `Server` header stripped | `packages/server/src/app.ts` |
|
||||
| Injection | All SQL is parameterized; all git calls use `execFile` (no shell); path-traversal guards | `packages/server/src/**` |
|
||||
| Data at rest | DB file/dir forced to `0o600`/`0o700`; sensitive secrets (server secret, VAPID private key) encrypted with AES-256-GCM | `packages/server/src/db/index.ts`, `core/secret-box.ts` |
|
||||
@@ -44,7 +44,7 @@ environment, see [`docs/ENTERPRISE_DEPLOYMENT.md`](docs/ENTERPRISE_DEPLOYMENT.md
|
||||
- **Long-lived API tokens.** Tokens do not expire by age (CLI automation stability) but can be revoked
|
||||
instantly, and `last_used_at` is tracked. Review and rotate tokens periodically.
|
||||
- **Encryption-at-rest key management.** With no `ARBORETUM_SECRET_KEY` set, the encryption key lives in
|
||||
`dataDir/secret.key` (`0o600`) next to the database — this protects a leaked database *copy* (backup,
|
||||
`dataDir/secret.key` (`0o600`) next to the database: this protects a leaked database *copy* (backup,
|
||||
WAL) but not a full `dataDir` compromise. For strong protection, set `ARBORETUM_SECRET_KEY` and store it
|
||||
separately from database backups. Full-DB SQLCipher is intentionally avoided (it breaks the `npx`
|
||||
prebuilt portability).
|
||||
@@ -52,7 +52,7 @@ environment, see [`docs/ENTERPRISE_DEPLOYMENT.md`](docs/ENTERPRISE_DEPLOYMENT.md
|
||||
|
||||
## Reporting a vulnerability
|
||||
|
||||
Please report security issues **privately** — do not open a public issue.
|
||||
Please report security issues **privately**: do not open a public issue.
|
||||
|
||||
- Email: **security@johanleroy.fr** (or `contact@johanleroy.fr`).
|
||||
- Include a description, affected version, and reproduction steps.
|
||||
|
||||
@@ -7,8 +7,8 @@ branches, cyan session nodes, a `>_` prompt at the base) on a dark background.
|
||||
| --- | --- |
|
||||
| `arboretum-logo-source.png` | Master artwork (opaque dark background). Keep; everything else derives from it. |
|
||||
| `arboretum-logo.png` | Full logo, **transparent**. Best on dark surfaces (the wordmark is light). |
|
||||
| `arboretum-logo-on-dark.png` | Full logo on the app background `#09090b`. Safe on any theme — used in the README. |
|
||||
| `arboretum-mark.png` | Square, **transparent**, tree only (no wordmark). Ideal **Gitea repo avatar** — reads on both light and dark. |
|
||||
| `arboretum-logo-on-dark.png` | Full logo on the app background `#09090b`. Safe on any theme, used in the README. |
|
||||
| `arboretum-mark.png` | Square, **transparent**, tree only (no wordmark). Ideal **Gitea repo avatar**, reads on both light and dark. |
|
||||
|
||||
The transparent versions are extracted by luminance (alpha ∝ brightness), the clean
|
||||
way to lift glow-on-black artwork: the dark background becomes fully transparent, the
|
||||
@@ -26,11 +26,11 @@ when the surrounding background might be light.
|
||||
|
||||
The web-facing assets live in `packages/web/public/` and are wired into the SPA:
|
||||
|
||||
- `icon.svg` — scalable favicon, redrawn to match the brand (vector, glow, `>_`).
|
||||
- `icon-192.png` / `icon-512.png` — maskable PWA icons (tree on `#09090b`, content in the safe zone).
|
||||
- `apple-touch-icon.png` — iOS home-screen icon (180×180).
|
||||
- `favicon.ico` — multi-size favicon (16/32/48), transparent.
|
||||
- `logo.png` — transparent full logo for in-app use.
|
||||
- `icon.svg`: scalable favicon, redrawn to match the brand (vector, glow, `>_`).
|
||||
- `icon-192.png` / `icon-512.png`: maskable PWA icons (tree on `#09090b`, content in the safe zone).
|
||||
- `apple-touch-icon.png`: iOS home-screen icon (180×180).
|
||||
- `favicon.ico`: multi-size favicon (16/32/48), transparent.
|
||||
- `logo.png`: transparent full logo for in-app use.
|
||||
|
||||
## Regenerate
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ Source : un PNG « néon sur fond sombre » (arbre-circuit + texte « Arboretum
|
||||
On extrait l'alpha par luminance (méthode propre pour ce type d'artwork glow-on-black) :
|
||||
chaque pixel reçoit une transparence proportionnelle à sa luminosité, ce qui rend le
|
||||
fond sombre totalement transparent, garde le cœur des traits opaque et conserve le halo
|
||||
en semi-transparent — donc lisible sur n'importe quel fond.
|
||||
en semi-transparent, donc lisible sur n'importe quel fond.
|
||||
|
||||
Sorties :
|
||||
brand/arboretum-logo.png logo complet transparent (haute déf) — Gitea / README
|
||||
brand/arboretum-mark.png marque carrée transparente (arbre seul) — avatar Gitea
|
||||
brand/arboretum-logo.png logo complet transparent (haute déf) : Gitea / README
|
||||
brand/arboretum-mark.png marque carrée transparente (arbre seul) : avatar Gitea
|
||||
brand/arboretum-logo-on-dark.png logo complet sur fond #09090b (fallback fond clair)
|
||||
packages/web/public/logo.png logo complet transparent, optimisé pour l'UI
|
||||
packages/web/public/icon-192.png icône PWA maskable (arbre, fond #09090b)
|
||||
@@ -24,7 +24,7 @@ import numpy as np
|
||||
from PIL import Image
|
||||
|
||||
SRC = sys.argv[1] if len(sys.argv) > 1 else "brand/arboretum-logo-source.png"
|
||||
BG = (9, 9, 11) # #09090b — couleur de fond du dashboard (manifest background_color/theme_color)
|
||||
BG = (9, 9, 11) # #09090b : couleur de fond du dashboard (manifest background_color/theme_color)
|
||||
|
||||
# Découpe verticale arbre / texte (mesurée sur la source)
|
||||
TREE_Y = (130, 930) # arbre + curseur >_
|
||||
|
||||
@@ -25,7 +25,7 @@ is **never** a deployment mode and is never injected automatically by `arboretum
|
||||
## 2. Encryption at rest
|
||||
|
||||
Sensitive secrets (the HMAC server secret and the VAPID private key) are encrypted with AES-256-GCM
|
||||
before being stored in SQLite. Token values are never stored — only their SHA-256 hashes.
|
||||
before being stored in SQLite. Token values are never stored, only their SHA-256 hashes.
|
||||
|
||||
For **strong** protection (key not co-located with the database), provide a passphrase via the
|
||||
environment instead of the on-disk key file:
|
||||
@@ -64,7 +64,7 @@ curl -s -H "Authorization: Bearer $TOKEN" \
|
||||
'http://127.0.0.1:7317/api/v1/audit-logs?limit=100'
|
||||
```
|
||||
|
||||
The audit log never contains secret values — only non-sensitive metadata (ids, labels, counters). It is
|
||||
The audit log never contains secret values, only non-sensitive metadata (ids, labels, counters). It is
|
||||
also visible in the dashboard under **Settings → Security & compliance**.
|
||||
|
||||
## 5. GDPR (data subject requests)
|
||||
@@ -72,14 +72,14 @@ also visible in the dashboard under **Settings → Security & compliance**.
|
||||
- **Export**: `GET /api/v1/data/export` returns every record tied to the authenticated token (token
|
||||
metadata, push subscriptions, session history, settings) as JSON. Also available as a one-click
|
||||
download in **Settings → Security & compliance**.
|
||||
- **Erasure**: `POST /api/v1/data/delete-my-data` is a two-step call — the first response returns a
|
||||
- **Erasure**: `POST /api/v1/data/delete-my-data` is a two-step call: the first response returns a
|
||||
`confirm` code that must be POSTed back to execute. It purges the token's push subscriptions and
|
||||
revokes the token (unless it is the last active one).
|
||||
|
||||
## 6. Backups & retention
|
||||
|
||||
- Back up the SQLite database (`arboretum.db`) with the WAL checkpointed. Treat backups as sensitive.
|
||||
- If you use `ARBORETUM_SECRET_KEY`, back the key up **separately** — a database backup is useless (and
|
||||
- If you use `ARBORETUM_SECRET_KEY`, back the key up **separately**: a database backup is useless (and
|
||||
safe) without it, which is the point.
|
||||
- Session history is retained until the database is reset. To start clean, stop the service and remove
|
||||
the database file.
|
||||
|
||||
@@ -19,7 +19,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-'));
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Vrai daemon + faux binaire `claude` (echo+sleep, comme p2) + 2e connexion sqlite (WAL) pour fabriquer
|
||||
// des sessions managées terminées avec un ended_at ancien. Couvre : sweep archive-now (archived_at posé,
|
||||
// event WS session_archived), exclusion par défaut + inclusion via ?includeArchived, archive/unarchive
|
||||
// manuels, rétention=0 (no-op), et — preuve clé « pas de perte » — resume d'une session ARCHIVÉE → 201.
|
||||
// manuels, rétention=0 (no-op), et, preuve clé « pas de perte », resume d'une session ARCHIVÉE → 201.
|
||||
import { spawn } from 'node:child_process';
|
||||
import { mkdtempSync, mkdirSync, rmSync, writeFileSync, chmodSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
@@ -23,7 +23,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p10-'));
|
||||
|
||||
@@ -20,7 +20,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p11-'));
|
||||
|
||||
@@ -22,7 +22,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p12-'));
|
||||
|
||||
@@ -22,7 +22,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p2-'));
|
||||
|
||||
@@ -19,7 +19,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p3-'));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Acceptation P4 (sans navigateur, sans quota Claude) : Web Push + commande WS `answer`.
|
||||
// Vrai daemon. Couvre : garde auth + Origin sur les routes push, clé VAPID exposée, subscribe
|
||||
// idempotent / malformé / unsubscribe, et la commande `answer` (rejets INVALID_ANSWER /
|
||||
// NOT_CONTROLLING — la validation fine `select` vit dans les tests vitest sur fixtures).
|
||||
// NOT_CONTROLLING : la validation fine `select` vit dans les tests vitest sur fixtures).
|
||||
import { spawn } from 'node:child_process';
|
||||
import { mkdtempSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
@@ -20,7 +20,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p4-'));
|
||||
|
||||
@@ -20,7 +20,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p5-'));
|
||||
|
||||
@@ -20,7 +20,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p7-'));
|
||||
|
||||
@@ -16,7 +16,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p8-'));
|
||||
|
||||
@@ -16,7 +16,7 @@ const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const results = [];
|
||||
const check = (name, ok, detail = '') => {
|
||||
results.push({ name, ok, detail });
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? ` — ${detail}` : ''}`);
|
||||
console.log(`${ok ? '✅' : '❌'} ${name}${detail ? `: ${detail}` : ''}`);
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p9-'));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
// Embarque la SPA buildée (packages/web/dist) dans public/ du package server,
|
||||
// pour que le tarball npm soit autonome. Branché sur le hook "prepack".
|
||||
// ARBORETUM_PACK_NO_WEB=1 : mode tolérant (CI/smoke) — placeholder à la place du front.
|
||||
// ARBORETUM_PACK_NO_WEB=1 : mode tolérant (CI/smoke), placeholder à la place du front.
|
||||
import { cpSync, existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
||||
import { join, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
@@ -19,10 +19,10 @@ if (!existsSync(webDist)) {
|
||||
'<!doctype html>\n<html lang="en">\n<head><meta charset="utf-8"><title>Arboretum</title></head>\n' +
|
||||
'<body><p>Arboretum server is running, but this package was built without the web UI.</p></body>\n</html>\n',
|
||||
);
|
||||
console.log('copy-web: ARBORETUM_PACK_NO_WEB=1 — wrote placeholder public/index.html');
|
||||
console.log('copy-web: ARBORETUM_PACK_NO_WEB=1: wrote placeholder public/index.html');
|
||||
process.exit(0);
|
||||
}
|
||||
console.error(`copy-web: ${webDist} not found — run npm run build -w @arboretum/web first`);
|
||||
console.error(`copy-web: ${webDist} not found: run npm run build -w @arboretum/web first`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// Pourquoi PAS bundleDependencies : embarquer une dépendance qui est aussi un *workspace* via
|
||||
// bundleDependencies est instable selon l'environnement npm (mode -w, exécution en root sur un
|
||||
// runner CI, version d'arborist) — npm voit le nœud comme un lien workspace et n'embarque parfois
|
||||
// runner CI, version d'arborist) : npm voit le nœud comme un lien workspace et n'embarque parfois
|
||||
// AUCUN fichier ("bundled files: 0"), produisant un paquet cassé chez le consommateur. On élimine
|
||||
// donc toute magie de bundling : on copie le JS compilé de shared dans dist/_shared et on réécrit
|
||||
// l'import bare '@arboretum/shared' du serveur vers ce chemin relatif. Zéro node_modules embarqué,
|
||||
@@ -20,7 +20,7 @@ const inlineDir = join(serverDist, '_shared');
|
||||
|
||||
for (const [label, p] of [['dist serveur', serverDist], ['dist shared', sharedDist]]) {
|
||||
if (!existsSync(p)) {
|
||||
console.error(`inline-shared: ${label} introuvable (${p}) — lance "npm run build" avant le pack.`);
|
||||
console.error(`inline-shared: ${label} introuvable (${p}) : lance "npm run build" avant le pack.`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ for (const name of readdirSync(sharedDist)) {
|
||||
}
|
||||
}
|
||||
if (copied === 0) {
|
||||
console.error(`inline-shared: aucun .js dans ${sharedDist} — shared n'est pas compilé.`);
|
||||
console.error(`inline-shared: aucun .js dans ${sharedDist} : shared n'est pas compilé.`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ for (const file of walk(serverDist)) {
|
||||
}
|
||||
}
|
||||
if (rewritten === 0) {
|
||||
console.error(`inline-shared: aucun import '@arboretum/shared' réécrit dans ${serverDist} — build manquant ?`);
|
||||
console.error(`inline-shared: aucun import '@arboretum/shared' réécrit dans ${serverDist} : build manquant ?`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ export function buildApp(config: Config, db: Db, serverVersion: string): AppBund
|
||||
projectsDir: config.claudeProjectsDir,
|
||||
sessionsDir: config.claudeSessionsDir,
|
||||
});
|
||||
// Archivage auto des sessions terminées (P10). Démarré dans runDaemon() — jamais ici (tests).
|
||||
// Archivage auto des sessions terminées (P10). Démarré dans runDaemon() : jamais ici (tests).
|
||||
const sessionArchive = new SessionArchiveService({ db });
|
||||
// Watcher FS temps réel (P7) : armé à la demande sur les worktrees regardés via les commandes
|
||||
// WS watch/unwatch. closeAll() au drain (libération des descripteurs).
|
||||
@@ -112,9 +112,9 @@ export function buildApp(config: Config, db: Db, serverVersion: string): AppBund
|
||||
// Démarré dans runDaemon() (jamais ici) → le scan ne tourne pas pendant les tests qui appellent buildApp.
|
||||
const repoDiscovery = new RepoDiscoveryService(db, worktrees);
|
||||
const groups = new GroupManager(db);
|
||||
// P11 — bus de diffusion des réglages : PATCH /settings émet, la gateway relaie au topic 'settings'.
|
||||
// P11 · bus de diffusion des réglages : PATCH /settings émet, la gateway relaie au topic 'settings'.
|
||||
const settingsBus = new SettingsBus();
|
||||
// P12 — services git distants : `box` (SecretBox) câblé ici pour chiffrer les secrets des credentials.
|
||||
// P12 · services git distants : `box` (SecretBox) câblé ici pour chiffrer les secrets des credentials.
|
||||
const gitCredentials = new GitCredentialsManager(db, box);
|
||||
const clones = new CloneManager(db, worktrees, gitCredentials);
|
||||
|
||||
@@ -176,7 +176,7 @@ export function buildApp(config: Config, db: Db, serverVersion: string): AppBund
|
||||
};
|
||||
|
||||
// Garde globale : auth sur tout /api/** et /ws ; check Origin strict quand l'en-tête est présent
|
||||
// (anti cross-site WebSocket hijacking — le cookie SameSite=Strict ne suffit pas pour les upgrades).
|
||||
// (anti cross-site WebSocket hijacking : le cookie SameSite=Strict ne suffit pas pour les upgrades).
|
||||
app.addHook('preValidation', async (req, reply) => {
|
||||
const isApi = req.url.startsWith('/api/');
|
||||
const isWs = req.url.startsWith('/ws');
|
||||
@@ -207,12 +207,12 @@ export function buildApp(config: Config, db: Db, serverVersion: string): AppBund
|
||||
registerAuditRoutes(app, db);
|
||||
registerDataRoutes(app, db, auth);
|
||||
// La route websocket doit être déclarée APRÈS le chargement du plugin (contexte
|
||||
// encapsulé) — sinon le handler reçoit la signature REST (request, reply).
|
||||
// encapsulé) : sinon le handler reçoit la signature REST (request, reply).
|
||||
void app.register(async (scoped) => {
|
||||
registerWsGateway(scoped, manager, discovery, sessionArchive, worktrees, groups, settingsBus, clones, serverVersion);
|
||||
});
|
||||
|
||||
// SPA buildée embarquée dans le paquet npm (public/) — absente en dev (vite dev sert le front)
|
||||
// SPA buildée embarquée dans le paquet npm (public/) : absente en dev (vite dev sert le front)
|
||||
const publicDir = join(dirname(fileURLToPath(import.meta.url)), '..', 'public');
|
||||
if (existsSync(publicDir)) {
|
||||
void app.register(fastifyStatic, { root: publicDir, wildcard: false });
|
||||
|
||||
@@ -131,7 +131,7 @@ export function renderSystemdUnit(input: { exec: string; scriptArgs: string[]; p
|
||||
const pathLine = input.pathEnv ? `\nEnvironment="PATH=${input.pathEnv}"` : '';
|
||||
// KillSignal=SIGTERM + TimeoutStopSec=10 collent au drain de runDaemon (SIGTERM → drain 1s → close).
|
||||
return `[Unit]
|
||||
Description=Arboretum — git worktree & Claude Code dashboard
|
||||
Description=Arboretum · git worktree & Claude Code dashboard
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
@@ -195,14 +195,14 @@ ${args}
|
||||
|
||||
export function printTokenBanner(token: string, url: string): void {
|
||||
console.log('\n┌──────────────────────────────────────────────────────────────────┐');
|
||||
console.log('│ First start — your access token (shown once, store it safely): │');
|
||||
console.log('│ First start : your access token (shown once, store it safely): │');
|
||||
console.log('└──────────────────────────────────────────────────────────────────┘');
|
||||
console.log(`\n ${token}\n`);
|
||||
console.log(` Login at: ${url}/\n`);
|
||||
}
|
||||
|
||||
export function printUsage(version: string): void {
|
||||
console.log(`Arboretum v${version} — git worktree & Claude Code dashboard
|
||||
console.log(`Arboretum v${version} · git worktree & Claude Code dashboard
|
||||
|
||||
Usage:
|
||||
arboretum [flags] Start the daemon (default)
|
||||
@@ -218,7 +218,7 @@ Daemon flags:
|
||||
--allow-origin <url> Additional allowed Origin (repeatable)
|
||||
--db <path> SQLite database path
|
||||
--vapid-contact <mailto|url> VAPID contact subject for Web Push
|
||||
--i-know-this-exposes-a-terminal Acknowledge a non-loopback bind (avoid — prefer Tailscale Serve)
|
||||
--i-know-this-exposes-a-terminal Acknowledge a non-loopback bind (avoid, prefer Tailscale Serve)
|
||||
|
||||
Install flags (daemon flags above are propagated to the service):
|
||||
--bin-path <path> Use this binary in the service instead of node + script
|
||||
@@ -257,7 +257,7 @@ function bootstrapToken(serviceArgs: string[]): void {
|
||||
try {
|
||||
const token = new AuthService(db).ensureBootstrapToken();
|
||||
if (token) printTokenBanner(token, url);
|
||||
else console.log('\nAn access token already exists in this database — manage tokens from Settings.\n');
|
||||
else console.log('\nAn access token already exists in this database. Manage tokens from Settings.\n');
|
||||
} finally {
|
||||
db.close();
|
||||
}
|
||||
@@ -294,7 +294,7 @@ export async function runInstall(argv: string[]): Promise<void> {
|
||||
run('systemctl', ['--user', 'enable', '--now', SERVICE_NAME], { check: true });
|
||||
// enable-linger best-effort : absent en CI / sans session loginctl, non bloquant.
|
||||
if (run('loginctl', ['enable-linger', process.env.USER ?? '']) !== 0) {
|
||||
console.warn('Warning: could not enable linger — the service may not start at boot.');
|
||||
console.warn('Warning: could not enable linger. The service may not start at boot.');
|
||||
}
|
||||
}
|
||||
console.log(`\nArboretum service installed. Logs: journalctl --user -u ${SERVICE_NAME} -f`);
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface Config {
|
||||
claudeHome: string;
|
||||
/** true si --claude-home a été passé explicitement → a priorité sur le réglage claude_home. */
|
||||
claudeHomeFromFlag: boolean;
|
||||
/** ~/.claude/projects (transcripts JSONL) — surchargeable via --claude-home (tests). */
|
||||
/** ~/.claude/projects (transcripts JSONL) : surchargeable via --claude-home (tests). */
|
||||
claudeProjectsDir: string;
|
||||
/** ~/.claude/sessions (registre des sessions CLI vivantes). */
|
||||
claudeSessionsDir: string;
|
||||
@@ -35,11 +35,11 @@ export function loadConfig(argv = process.argv.slice(2)): Config {
|
||||
'allow-origin': { type: 'string', multiple: true },
|
||||
'print-token': { type: 'boolean', default: false },
|
||||
'i-know-this-exposes-a-terminal': { type: 'boolean', default: false },
|
||||
// racine de l'install Claude (~/.claude par défaut) — surchargée par les tests d'acceptation.
|
||||
// racine de l'install Claude (~/.claude par défaut) : surchargée par les tests d'acceptation.
|
||||
'claude-home': { type: 'string' },
|
||||
// sujet VAPID des notifications push (contact requis par la spec Web Push).
|
||||
'vapid-contact': { type: 'string' },
|
||||
// désactive la découverte auto des repos (boot + périodique) — utilisé par les tests d'acceptation.
|
||||
// désactive la découverte auto des repos (boot + périodique) : utilisé par les tests d'acceptation.
|
||||
'no-discover': { type: 'boolean', default: false },
|
||||
},
|
||||
strict: true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Journal d'audit : trace persistante des opérations sensibles (création/révocation de tokens,
|
||||
// changements de réglages, génération de secrets, abonnements push, CRUD groupes). Exigence de
|
||||
// conformité entreprise (GDPR/SOX/ISO 27001). Règle ABSOLUE : ne JAMAIS journaliser un secret en
|
||||
// clair — `details` ne contient que des métadonnées non sensibles (ids, labels, compteurs).
|
||||
// clair : `details` ne contient que des métadonnées non sensibles (ids, labels, compteurs).
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import type { AuditLogEntry } from '@arboretum/shared';
|
||||
import type { Db } from '../db/index.js';
|
||||
|
||||
@@ -49,7 +49,7 @@ function isExecutable(path: string): boolean {
|
||||
|
||||
/**
|
||||
* Résout le binaire `claude`. Si `configuredPath` est fourni (réglage UI), il est utilisé tel quel
|
||||
* — validé exécutable, message clair sinon — et JAMAIS mis en cache (modifiable à chaud). Sinon :
|
||||
* (validé exécutable, message clair sinon) et JAMAIS mis en cache (modifiable à chaud). Sinon :
|
||||
* `which claude`, mis en cache. Un service systemd/launchd démarre avec un PATH minimal sans
|
||||
* ~/.local/bin → `which claude` y échoue ; d'où le réglage de chemin explicite (et le PATH figé par
|
||||
* `arboretum install`).
|
||||
@@ -93,7 +93,7 @@ export function buildSpawnSpec(opts: SpawnOptions): SpawnSpec {
|
||||
}
|
||||
const args: string[] = [];
|
||||
if (opts.resume) {
|
||||
// `--resume` doit toujours s'exécuter dans le cwd d'origine (garanti par l'appelant — spike S1).
|
||||
// `--resume` doit toujours s'exécuter dans le cwd d'origine (garanti par l'appelant, spike S1).
|
||||
args.push('--resume', opts.resume.claudeSessionId);
|
||||
if (opts.resume.fork) args.push('--fork-session');
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Typage de dialogue à partir de l'écran reconstruit (ScreenReader) — fonctions PURES.
|
||||
// Typage de dialogue à partir de l'écran reconstruit (ScreenReader) : fonctions PURES.
|
||||
// L'écran sert à TYPER le dialogue et extraire ses options ; l'état (waiting vrai/faux) vient du
|
||||
// registre (source primaire). Tolérant aux variations de rendu inter-versions (texte aplati + regex).
|
||||
import type { DialogKind, DialogOption } from '@arboretum/shared';
|
||||
@@ -23,7 +23,7 @@ export function parseOptions(lines: string[]): DialogOption[] {
|
||||
/**
|
||||
* Retourne le dialogue typé visible à l'écran, ou null si aucun. `trust` et `question` priment sur
|
||||
* `permission` (un écran AskUserQuestion contient aussi « Esc to cancel »). Un écran numéroté non
|
||||
* typé est traité en `permission` générique (best-effort — le fallback reste le terminal web).
|
||||
* typé est traité en `permission` générique (best-effort, le fallback reste le terminal web).
|
||||
*/
|
||||
export function classifyDialog(lines: string[]): ClassifiedDialog | null {
|
||||
const text = lines.join('\n');
|
||||
|
||||
@@ -64,13 +64,13 @@ export class DiscoveryService extends EventEmitter<DiscoveryServiceEvents> {
|
||||
return this.cache;
|
||||
}
|
||||
|
||||
/** Session découverte (avec son cwd d'origine lu sur disque) — pour resume/fork. null si absente. */
|
||||
/** Session découverte (avec son cwd d'origine lu sur disque) : pour resume/fork. null si absente. */
|
||||
getDiscovered(claudeSessionId: string): DiscoveredJsonl | null {
|
||||
return this.byId.get(claudeSessionId) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vivacité FRAÎCHE d'une session (relit le registre, ne se fie pas au cache) — garde-fou
|
||||
* Vivacité FRAÎCHE d'une session (relit le registre, ne se fie pas au cache) : garde-fou
|
||||
* anti-corruption : la route /resume doit refuser une session devenue vivante depuis le dernier scan.
|
||||
*/
|
||||
isClaudeSessionLive(claudeSessionId: string): boolean {
|
||||
|
||||
@@ -23,7 +23,7 @@ interface WatchEntry {
|
||||
refCount: number;
|
||||
/** nombre de sessions vivantes épinglant ce worktree. */
|
||||
sessionPins: number;
|
||||
/** épingle « permanente » (checkout principal d'un repo enregistré) — jamais évincée (P11). */
|
||||
/** épingle « permanente » (checkout principal d'un repo enregistré) : jamais évincée (P11). */
|
||||
repoPins: number;
|
||||
lastUsed: number;
|
||||
debounce: NodeJS.Timeout | null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Clients des services git distants (Gitea / GitLab / GitHub) — P12. Uniquement `fetch` global
|
||||
// Clients des services git distants (Gitea / GitLab / GitHub) : P12. Uniquement `fetch` global
|
||||
// (Node ≥ 22), AUCUNE dépendance (pas d'octokit/gitbeaker). Chaque client expose verify() (test de
|
||||
// connectivité/auth) et listRepos() (paginé). Erreurs typées : AUTH_FAILED / RATE_LIMITED / UNREACHABLE.
|
||||
import type { GitAuthType, GitService, RemoteRepoSummary } from '@arboretum/shared';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Gestion des credentials des services git distants (P12). Les secrets (PAT/app password) sont
|
||||
// chiffrés par SecretBox AVANT insertion et ne ressortent JAMAIS via l'API (résumés sans secret).
|
||||
// getSecret()/authFor() sont INTERNES (clone, listRepos, test) — jamais routés.
|
||||
// getSecret()/authFor() sont INTERNES (clone, listRepos, test) : jamais routés.
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import type {
|
||||
CreateGitCredentialRequest,
|
||||
@@ -137,7 +137,7 @@ export class GitCredentialsManager {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Secret déchiffré — INTERNE (clone/listRepos/test). Jamais exposé par une route. */
|
||||
/** Secret déchiffré : INTERNE (clone/listRepos/test). Jamais exposé par une route. */
|
||||
getSecret(id: string): string | null {
|
||||
const row = this.getRow(id);
|
||||
if (!row?.secret_encrypted) return null;
|
||||
|
||||
@@ -199,7 +199,7 @@ export async function branchExists(repoPath: string, branch: string): Promise<{
|
||||
return { local, remote };
|
||||
}
|
||||
|
||||
/** Branches locales + suivies de `origin` (noms courts) + branche par défaut — pour un sélecteur de base. */
|
||||
/** Branches locales + suivies de `origin` (noms courts) + branche par défaut : pour un sélecteur de base. */
|
||||
export async function listBranches(repoPath: string): Promise<{ local: string[]; remote: string[]; default: string | null }> {
|
||||
const local: string[] = [];
|
||||
const remote: string[] = [];
|
||||
@@ -476,7 +476,7 @@ export async function fetchRemote(worktreePath: string): Promise<void> {
|
||||
await git(worktreePath, ['fetch', '--all', '--prune'], GIT_PUSH_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
/** `git pull` — `ff-only` par défaut (jamais de merge surprise) ; `rebase` optionnel. */
|
||||
/** `git pull` : `ff-only` par défaut (jamais de merge surprise) ; `rebase` optionnel. */
|
||||
export async function pull(worktreePath: string, mode: 'ff-only' | 'rebase' = 'ff-only'): Promise<void> {
|
||||
const args = mode === 'rebase' ? ['-c', 'rebase.autoStash=false', 'pull', '--rebase'] : ['pull', '--ff-only'];
|
||||
await git(worktreePath, args, GIT_PUSH_TIMEOUT_MS);
|
||||
@@ -532,7 +532,7 @@ async function resolveStartPoint(repoPath: string, baseRef?: string): Promise<st
|
||||
/**
|
||||
* Crée un worktree en résolvant la branche selon `mode` (voir `WorktreeBranchMode`). Renvoie l'action
|
||||
* effective. En mode `auto`, on choisit checkout / suivi-remote / création selon l'existence réelle de
|
||||
* la branche — indispensable pour les groupes hétérogènes (branche présente dans certains dépôts seulement).
|
||||
* la branche : indispensable pour les groupes hétérogènes (branche présente dans certains dépôts seulement).
|
||||
*/
|
||||
export async function addWorktree(
|
||||
repoPath: string,
|
||||
@@ -583,7 +583,7 @@ export async function push(repoPath: string): Promise<void> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Crée/bascule une branche dans le checkout (worktree) en `repoPath` — utilisé pour démarrer une
|
||||
* Crée/bascule une branche dans le checkout (worktree) en `repoPath` : utilisé pour démarrer une
|
||||
* session sur la branche principale sans worktree dédié. `create` → `git switch -c <branch>` (échoue
|
||||
* si la branche existe) ; sinon `git switch <branch>` (branche existante). Pas de `--` : l'argument
|
||||
* est une réf (pas un pathspec) et le nom est déjà filtré en amont par `isValidBranchName` (anti-flag).
|
||||
@@ -610,13 +610,13 @@ const GIT_CLONE_TIMEOUT_MS = 10 * 60_000; // 10 min : un clone réseau peut êtr
|
||||
|
||||
export interface CloneProgress {
|
||||
phase: string;
|
||||
/** pourcentage 0–100 si git le rapporte, sinon null. */
|
||||
/** pourcentage 0-100 si git le rapporte, sinon null. */
|
||||
percent: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone un dépôt via `git clone --progress` (P12). `spawn` (et non execFile) pour streamer la
|
||||
* progression depuis stderr. `env` éphémère (cf. withGitAuth) porte l'auth — JAMAIS dans l'URL.
|
||||
* progression depuis stderr. `env` éphémère (cf. withGitAuth) porte l'auth : JAMAIS dans l'URL.
|
||||
* `--` sépare l'URL/dest des options. L'appelant valide `dest` (sous scanRoots, non existant).
|
||||
*/
|
||||
export function cloneRepo(opts: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Gestion des groupes de travail (P5) : un groupe = collection nommée de repos (many-to-many).
|
||||
// Membership légère et persistée ; les worktrees/sessions du groupe ne sont PAS stockés ici —
|
||||
// Membership légère et persistée ; les worktrees/sessions du groupe ne sont PAS stockés ici :
|
||||
// ils restent servis par WorktreeManager/PtyManager et filtrés côté client par repoId.
|
||||
// Tout est synchrone : aucune I/O git/fs, node:sqlite est synchrone.
|
||||
import { EventEmitter } from 'node:events';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { parse, resolve, sep } from 'node:path';
|
||||
|
||||
/**
|
||||
* Plus long ancêtre commun d'un ensemble de chemins absolus (par segments, jamais par préfixe
|
||||
* de chaîne — `/a/bc` n'est PAS un ancêtre de `/a/bcd`). Pour un seul chemin, renvoie ce chemin.
|
||||
* de chaîne : `/a/bc` n'est PAS un ancêtre de `/a/bcd`). Pour un seul chemin, renvoie ce chemin.
|
||||
*/
|
||||
export function commonAncestorDir(paths: string[]): string {
|
||||
const first = paths[0];
|
||||
|
||||
@@ -10,7 +10,7 @@ const HEAD_BYTES = 256 * 1024;
|
||||
const TAIL_BYTES = 64 * 1024;
|
||||
const TITLE_MAX = 120;
|
||||
|
||||
/** Reproduit le nom de dossier ~/.claude/projects à partir d'un cwd (validé 100 % — spike S4). */
|
||||
/** Reproduit le nom de dossier ~/.claude/projects à partir d'un cwd (validé 100 %, spike S4). */
|
||||
export function munge(cwd: string): string {
|
||||
return cwd.replace(/[^A-Za-z0-9]/g, '-');
|
||||
}
|
||||
@@ -82,7 +82,7 @@ function extractMeta(objs: Array<Record<string, unknown>>, meta: Meta): void {
|
||||
setOnce('cwd', o.cwd);
|
||||
setOnce('gitBranch', o.gitBranch);
|
||||
setOnce('version', o.version);
|
||||
// Titre : on retient la dernière valeur vue (la plus récente) — head puis tail → la queue gagne.
|
||||
// Titre : on retient la dernière valeur vue (la plus récente) : head puis tail → la queue gagne.
|
||||
const ai = asString(o.aiTitle);
|
||||
if (ai) meta.aiTitle = ai;
|
||||
const sum = asString(o.summary);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Création d'un nouveau projet : un dossier `<root>/<name>` créé sous une racine existante, dans
|
||||
// lequel on lance ensuite une session. Couche PURE (testable sans fs) — la création réelle du
|
||||
// lequel on lance ensuite une session. Couche PURE (testable sans fs) : la création réelle du
|
||||
// dossier, le `git init` et le spawn vivent dans `routes/projects.ts`.
|
||||
import { join } from 'node:path';
|
||||
import { isSafeAbsolutePath } from './git.js';
|
||||
|
||||
/**
|
||||
* Valide un nom de projet : UN SEUL segment de dossier. Anti-traversal de base — refuse les noms
|
||||
* Valide un nom de projet : UN SEUL segment de dossier. Anti-traversal de base : refuse les noms
|
||||
* vides, trop longs, `.`/`..`, et tout caractère de séparation (`/`, `\`) ou NUL. La résolution du
|
||||
* chemin complet (et sa re-validation) est faite par {@link resolveProjectDir}.
|
||||
*/
|
||||
|
||||
@@ -129,7 +129,7 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
throw Object.assign(new Error(`Not a directory: ${dir}`), { statusCode: 400 });
|
||||
}
|
||||
}
|
||||
// Un resume/fork est toujours une session claude (le cwd d'origine est garanti par l'appelant — S1).
|
||||
// Un resume/fork est toujours une session claude (le cwd d'origine est garanti par l'appelant, S1).
|
||||
const command = opts.resume ? 'claude' : (opts.command ?? 'claude');
|
||||
// Override de chemin du binaire claude (réglage UI) lu à chaque spawn → effet sans redémarrage.
|
||||
const claudeBinPath = command === 'claude' ? readClaudeBinPath(this.db) : null;
|
||||
@@ -197,7 +197,7 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
return summary;
|
||||
}
|
||||
|
||||
/** Résout le claudeSessionId du CLI en pollant le registre par pid, puis le persiste (waitReady — S1). */
|
||||
/** Résout le claudeSessionId du CLI en pollant le registre par pid, puis le persiste (waitReady, S1). */
|
||||
private captureClaudeSessionId(s: ManagedSession): void {
|
||||
const deadline = Date.now() + CLAUDE_ID_TIMEOUT_MS;
|
||||
const tick = (): void => {
|
||||
@@ -307,7 +307,7 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Ré-émet un `session_update` pour une session historique (P10) — utilisé au dés-archivage pour
|
||||
* Ré-émet un `session_update` pour une session historique (P10) : utilisé au dés-archivage pour
|
||||
* que tous les clients rafraîchissent le row (le champ `archived` repasse à false). No-op si la
|
||||
* session est vivante (déjà couverte par le flux live) ou inconnue.
|
||||
*/
|
||||
@@ -345,7 +345,7 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Arrêt du daemon : SIGTERM à toutes les sessions (le CLI nettoie son registre sur SIGTERM — spike S1). */
|
||||
/** Arrêt du daemon : SIGTERM à toutes les sessions (le CLI nettoie son registre sur SIGTERM, spike S1). */
|
||||
shutdown(): void {
|
||||
for (const id of this.live.keys()) this.kill(id);
|
||||
}
|
||||
@@ -396,7 +396,7 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
/**
|
||||
* Répond à un dialogue Claude sans clavier (P4-A) : traduit une intention de haut
|
||||
* niveau en keystrokes PTY, validée contre l'état fin du tracker (P3-B).
|
||||
* - 'select' N : positionne le curseur sur l'option N puis confirme (`"N\r"`) — protocole acté spike S3.
|
||||
* - 'select' N : positionne le curseur sur l'option N puis confirme (`"N\r"`) : protocole acté spike S3.
|
||||
* - 'confirm' : valide l'option pré-sélectionnée (`"\r"`).
|
||||
* - 'deny' : refus universel (Esc).
|
||||
* Réutilise le chemin write (mono-utilisateur : tout interactif peut répondre, observers non).
|
||||
@@ -417,7 +417,7 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
s.proc.write(`${optionN}\r`);
|
||||
return 'ok';
|
||||
}
|
||||
// confirm/deny n'exigent qu'un état d'attente (le dialogue Trust précède le registre — S1).
|
||||
// confirm/deny n'exigent qu'un état d'attente (le dialogue Trust précède le registre, S1).
|
||||
if (act?.activity !== 'waiting') return 'invalid';
|
||||
s.proc.write(action === 'deny' ? '\x1b' : '\r');
|
||||
return 'ok';
|
||||
@@ -446,10 +446,10 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
// ---- interne ----
|
||||
|
||||
/**
|
||||
* Push P4-B : notifie sur le FRONT MONTANT vers un état qui requiert l'attention — `waiting`
|
||||
* Push P4-B : notifie sur le FRONT MONTANT vers un état qui requiert l'attention : `waiting`
|
||||
* (un dialogue bloque) ou `idle` atteint depuis `busy` (Claude a terminé sa réponse, la session
|
||||
* redevient disponible). Le tracker réémet souvent le même état → on ne réagit qu'au changement.
|
||||
* Debounce annulable : un état ultra-bref (Claude repart tout seul) ne déclenche pas de notif —
|
||||
* Debounce annulable : un état ultra-bref (Claude repart tout seul) ne déclenche pas de notif :
|
||||
* à l'échéance on revérifie l'état réel. Cible tous les abonnements (un seul utilisateur).
|
||||
*/
|
||||
private maybeNotify(s: ManagedSession, next: SessionActivity | null): void {
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { SecretBox } from './secret-box.js';
|
||||
import { recordAudit } from './audit-log.js';
|
||||
|
||||
// web-push est publié en CommonJS : on le charge via require (verbatimModuleSyntax + NodeNext),
|
||||
// typé par l'import type — même pattern que @xterm/headless dans screen-reader.ts.
|
||||
// typé par l'import type, même pattern que @xterm/headless dans screen-reader.ts.
|
||||
const require = createRequire(import.meta.url);
|
||||
const webpush = require('web-push') as typeof import('web-push');
|
||||
|
||||
@@ -33,7 +33,7 @@ interface SubRow {
|
||||
auth: string;
|
||||
}
|
||||
|
||||
/** Envoi d'une notif à un abonnement — injectable pour les tests ; défaut = web-push réel. */
|
||||
/** Envoi d'une notif à un abonnement : injectable pour les tests ; défaut = web-push réel. */
|
||||
export type PushSender = (
|
||||
subscription: { endpoint: string; keys: { p256dh: string; auth: string } },
|
||||
payload: string,
|
||||
@@ -70,7 +70,7 @@ export class PushService {
|
||||
this.vapidPrivate = priv;
|
||||
}
|
||||
|
||||
/** Clé publique VAPID — sûre à exposer (applicationServerKey côté navigateur). */
|
||||
/** Clé publique VAPID : sûre à exposer (applicationServerKey côté navigateur). */
|
||||
publicKey(): string {
|
||||
return this.vapidPublic;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Planificateur de la découverte auto des repos : scan au démarrage + re-scan périodique.
|
||||
// Calqué sur DiscoveryService (sessions) — start()/stop() avec timer .unref(). Démarré depuis
|
||||
// Calqué sur DiscoveryService (sessions) : start()/stop() avec timer .unref(). Démarré depuis
|
||||
// runDaemon() UNIQUEMENT (jamais buildApp), ce qui isole naturellement les tests vitest du scan.
|
||||
// Lui-même sans état : il lit les racines/l'intervalle dans `settings` et délègue à WorktreeManager.
|
||||
import type { Db } from '../db/index.js';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Découverte auto des dépôts git : marche bornée du système de fichiers à la recherche de `.git`.
|
||||
// Fonction PURE et tolérante (ne lève jamais) — testable isolément comme parseWorktreePorcelain.
|
||||
// Fonction PURE et tolérante (ne lève jamais) : testable isolément comme parseWorktreePorcelain.
|
||||
// N'appelle JAMAIS git (détection par présence de `.git`) : la validation réelle (isRepo) et la
|
||||
// résolution de default_branch se font paresseusement à l'enregistrement, pas par dépôt scanné.
|
||||
import { readdir } from 'node:fs/promises';
|
||||
@@ -39,7 +39,7 @@ interface Frame {
|
||||
* - un dossier contenant `.git` (fichier OU dossier → couvre les worktrees liés) est un repo :
|
||||
* on l'enregistre ; en profondeur on NE descend PAS dedans (sous-modules/worktrees imbriqués
|
||||
* ignorés). EXCEPTION : une racine fournie (depth 0) qui est elle-même un repo est aussi un
|
||||
* conteneur — on l'enregistre ET on continue de descendre pour trouver les repos internes ;
|
||||
* conteneur : on l'enregistre ET on continue de descendre pour trouver les repos internes ;
|
||||
* - on n'empile que les vrais sous-dossiers (`d.isDirectory()`), donc les symlinks ne sont PAS
|
||||
* suivis (anti-cycle + anti-sortie de racine), et on saute dotdirs + excludeDirs ;
|
||||
* - bornes : `maxDepth`, `maxRepos`, et un éventuel `signal` (timeout global) ;
|
||||
|
||||
@@ -50,7 +50,7 @@ export function normalizeScanRoots(raw: unknown): string[] | null {
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Valide un intervalle (entier 0–MAX_SCAN_INTERVAL_MIN). Retourne null si invalide. */
|
||||
/** Valide un intervalle (entier 0-MAX_SCAN_INTERVAL_MIN). Retourne null si invalide. */
|
||||
export function normalizeScanIntervalMin(raw: unknown): number | null {
|
||||
if (typeof raw !== 'number' || !Number.isInteger(raw)) return null;
|
||||
if (raw < 0 || raw > MAX_SCAN_INTERVAL_MIN) return null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Reconstruction d'écran via @xterm/headless : terminal headless PERSISTANT par session, alimenté
|
||||
// incrémentalement par le flux PTY. Remplace le strip ANSI naïf (qui « mange les espaces » et casse
|
||||
// la détection des dialogues — verdict S1/S3). Aucune dépendance DOM (usage Node).
|
||||
// la détection des dialogues, verdict S1/S3). Aucune dépendance DOM (usage Node).
|
||||
import { createRequire } from 'node:module';
|
||||
import type { Terminal as XtermTerminal } from '@xterm/headless';
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ export class SessionArchiveService extends EventEmitter<SessionArchiveEvents> {
|
||||
}
|
||||
}
|
||||
|
||||
/** Diffuse l'archivage d'une session (déjà archivée + auditée par l'appelant — ex. route manuelle). */
|
||||
/** Diffuse l'archivage d'une session (déjà archivée + auditée par l'appelant, ex. route manuelle). */
|
||||
emitArchived(id: string, archivedAt: string): void {
|
||||
this.emit('session_archived', { id, archivedAt });
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ export interface WorktreeManagerEvents {
|
||||
repo_removed: [string];
|
||||
worktree_update: [{ repoId: string; worktree: WorktreeSummary }];
|
||||
worktree_removed: [{ repoId: string; path: string }];
|
||||
/** P7 — le détail (liste des changements/diff) d'un worktree regardé a changé ; relayé en push
|
||||
/** P7 : le détail (liste des changements/diff) d'un worktree regardé a changé ; relayé en push
|
||||
* ciblé `worktree_changes` aux seules connexions ayant `watch`é cette clé. */
|
||||
worktree_changes: [{ repoId: string; path: string }];
|
||||
}
|
||||
@@ -136,7 +136,7 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
private readonly fsWatcher?: FsWatcherService,
|
||||
) {
|
||||
super();
|
||||
// P7 — un changement FS sur un worktree regardé invalide le cache, rediffuse le status frais
|
||||
// P7 : un changement FS sur un worktree regardé invalide le cache, rediffuse le status frais
|
||||
// (worktree_update : compteurs légers pour tout le dashboard) et signale aux clients qui le
|
||||
// regardent de re-fetcher le détail (worktree_changes ciblé). On résout repoId → row à la volée.
|
||||
this.fsWatcher?.on('worktree_fs_change', ({ repoId, path }) => {
|
||||
@@ -207,7 +207,7 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
}
|
||||
|
||||
/**
|
||||
* P11 — arme un watcher PERMANENT sur le checkout principal de chaque repo visible : un
|
||||
* P11 : arme un watcher PERMANENT sur le checkout principal de chaque repo visible : un
|
||||
* `git checkout`/`switch` en CLI sur le principal est ainsi rediffusé en temps réel sans qu'un
|
||||
* client ne l'ait « regardé ». Appelé depuis runDaemon (jamais buildApp → pas d'effet en tests purs).
|
||||
*/
|
||||
@@ -252,7 +252,7 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
|
||||
/**
|
||||
* Découvre les repos git sous `roots` et auto-enregistre les NOUVEAUX (path absent de la DB).
|
||||
* Idempotent et anti-résurrection : un path déjà présent — visible OU masqué — n'est jamais
|
||||
* Idempotent et anti-résurrection : un path déjà présent (visible OU masqué) n'est jamais
|
||||
* réécrit (INSERT ... ON CONFLICT DO NOTHING). Les scans concurrents sont coalescés. Tolérant :
|
||||
* ne lève pas (le scanner avale les erreurs FS). N'appelle aucun git pendant le scan
|
||||
* (default_branch=NULL, résolu paresseusement par rowToSummary à l'affichage).
|
||||
@@ -302,7 +302,7 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
|
||||
/**
|
||||
* Sessions (managées + découvertes) dont le cwd correspond à ce chemin de worktree.
|
||||
* Les sessions explicitement masquées (`hidden`) sont exclues — cohérent avec `/api/v1/sessions`
|
||||
* Les sessions explicitement masquées (`hidden`) sont exclues, cohérent avec `/api/v1/sessions`
|
||||
* (sans quoi le masquage était ignoré dans les fiches worktree). Le tri managées/externes est laissé
|
||||
* au client (interrupteur « afficher les externes »), qui dispose du champ `source`. La garde de
|
||||
* suppression réclame en revanche TOUTES les sessions vivantes (`includeHidden`) pour rester sûre.
|
||||
@@ -351,7 +351,7 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
// quand l'utilisateur active « afficher les masqués ».
|
||||
const rows = this.db.prepare('SELECT id FROM repos WHERE hidden = 0 ORDER BY created_at ASC').all() as Array<{ id: string }>;
|
||||
// Tolérance par repo : avec la découverte auto, un repo douteux (git en échec, chemin disparu,
|
||||
// permission) ne doit JAMAIS faire planter tout l'endpoint — il ne contribue alors aucun worktree.
|
||||
// permission) ne doit JAMAIS faire planter tout l'endpoint, il ne contribue alors aucun worktree.
|
||||
const lists = await Promise.all(rows.map((r) => this.listRepoWorktrees(r.id).catch(() => [])));
|
||||
return lists.flat();
|
||||
}
|
||||
@@ -420,7 +420,7 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
});
|
||||
}
|
||||
|
||||
/** Branches locales/remote + branche par défaut d'un repo — alimente le sélecteur de base côté UI. */
|
||||
/** Branches locales/remote + branche par défaut d'un repo : alimente le sélecteur de base côté UI. */
|
||||
async listRepoBranches(repoId: string): Promise<{ local: string[]; remote: string[]; default: string | null }> {
|
||||
const row = this.getRepoRow(repoId);
|
||||
if (!row) throw httpError(404, 'NOT_FOUND', 'No repo with this id');
|
||||
@@ -444,16 +444,16 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
const mode = opts.mode ?? 'all';
|
||||
return this.withLock(repoId, async () => {
|
||||
if (opts.amend && !(await isUnpushed(w.path))) {
|
||||
throw httpError(409, 'ALREADY_PUSHED', 'Last commit is already pushed — amend would rewrite shared history');
|
||||
throw httpError(409, 'ALREADY_PUSHED', 'Last commit is already pushed: amend would rewrite shared history');
|
||||
}
|
||||
const st = await worktreeStatus(w.path);
|
||||
// Garde-fou « rien à committer » (sauf amend, qui peut ne changer que le message).
|
||||
if (!opts.amend) {
|
||||
if (mode === 'all' && st.dirtyCount === 0) {
|
||||
throw httpError(409, 'NOTHING_TO_COMMIT', 'Nothing to commit — working tree is clean');
|
||||
throw httpError(409, 'NOTHING_TO_COMMIT', 'Nothing to commit: working tree is clean');
|
||||
}
|
||||
if (mode === 'staged' && (st.stagedCount ?? 0) === 0) {
|
||||
throw httpError(409, 'NOTHING_STAGED', 'Nothing staged — stage files first');
|
||||
throw httpError(409, 'NOTHING_STAGED', 'Nothing staged: stage files first');
|
||||
}
|
||||
}
|
||||
try {
|
||||
@@ -646,17 +646,17 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
return this.withLock(repoId, async () => {
|
||||
if (!force) {
|
||||
if ((await worktreeStatus(w.path)).dirtyCount > 0) {
|
||||
throw httpError(409, 'WORKTREE_DIRTY', 'Worktree has uncommitted changes — commit or pass force');
|
||||
throw httpError(409, 'WORKTREE_DIRTY', 'Worktree has uncommitted changes: commit or pass force');
|
||||
}
|
||||
if ((await worktreeStatus(row.path)).dirtyCount > 0) {
|
||||
throw httpError(409, 'DIRTY_TREE', 'Main checkout has uncommitted changes — commit/stash or pass force');
|
||||
throw httpError(409, 'DIRTY_TREE', 'Main checkout has uncommitted changes: commit/stash or pass force');
|
||||
}
|
||||
}
|
||||
try {
|
||||
await removeWorktree(row.path, w.path, force);
|
||||
} catch (err) {
|
||||
if (!force && isDirtyWorktreeError(err)) {
|
||||
throw httpError(409, 'WORKTREE_DIRTY', 'Worktree has uncommitted changes — pass force to promote anyway');
|
||||
throw httpError(409, 'WORKTREE_DIRTY', 'Worktree has uncommitted changes: pass force to promote anyway');
|
||||
}
|
||||
throw httpError(500, 'WORKTREE_REMOVE_FAILED', (err as Error).message);
|
||||
}
|
||||
@@ -672,7 +672,7 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Lance UNE session dans le checkout principal du repo (`repo.path`) — pour « bosser sur la branche
|
||||
* Lance UNE session dans le checkout principal du repo (`repo.path`) : pour « bosser sur la branche
|
||||
* principale » sans créer de worktree. Si `branch` est fourni, crée/bascule d'abord cette branche
|
||||
* dans ce checkout (`git switch[-c]`), refusé si l'arbre est sale (on n'écrase pas un HEAD modifié).
|
||||
* Volontairement SANS hooks ni pré-trust (contraste avec createWorktree) : le checkout principal
|
||||
@@ -691,7 +691,7 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
if (branch !== undefined) {
|
||||
// garde-fou : ne pas basculer le HEAD du checkout principal s'il a des changements non sauvegardés.
|
||||
if ((await worktreeStatus(row.path)).dirtyCount > 0) {
|
||||
throw httpError(409, 'DIRTY_TREE', 'Main checkout has uncommitted changes — commit or stash before switching branch');
|
||||
throw httpError(409, 'DIRTY_TREE', 'Main checkout has uncommitted changes: commit or stash before switching branch');
|
||||
}
|
||||
try {
|
||||
await switchBranch(row.path, { branch, create: req.newBranch ?? true });
|
||||
@@ -731,14 +731,14 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
if (resolve(w.path) === resolve(row.path)) throw httpError(400, 'IS_MAIN_WORKTREE', 'Cannot remove the main worktree');
|
||||
// garde-fou : une session vivante tourne dans ce worktree → exiger une confirmation explicite.
|
||||
if (!force && this.sessionsForCwd(w.path, { includeHidden: true }).some((s) => s.live)) {
|
||||
throw httpError(409, 'SESSION_LIVE_IN_WORKTREE', 'A live session runs in this worktree — pass force to delete anyway');
|
||||
throw httpError(409, 'SESSION_LIVE_IN_WORKTREE', 'A live session runs in this worktree: pass force to delete anyway');
|
||||
}
|
||||
return this.withLock(repoId, async () => {
|
||||
try {
|
||||
await removeWorktree(row.path, w.path, force);
|
||||
} catch (err) {
|
||||
if (!force && isDirtyWorktreeError(err)) {
|
||||
throw httpError(409, 'WORKTREE_DIRTY', 'Worktree has uncommitted changes — pass force to delete anyway');
|
||||
throw httpError(409, 'WORKTREE_DIRTY', 'Worktree has uncommitted changes: pass force to delete anyway');
|
||||
}
|
||||
throw httpError(500, 'WORKTREE_REMOVE_FAILED', (err as Error).message);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ const MIGRATIONS: Array<{ id: number; sql: string }> = [
|
||||
`,
|
||||
},
|
||||
{
|
||||
// P2 — découverte & reprise : corrélation avec les sessions Claude sur disque.
|
||||
// P2 : découverte & reprise : corrélation avec les sessions Claude sur disque.
|
||||
id: 2,
|
||||
sql: `
|
||||
ALTER TABLE sessions ADD COLUMN claude_session_id TEXT;
|
||||
@@ -38,7 +38,7 @@ const MIGRATIONS: Array<{ id: number; sql: string }> = [
|
||||
`,
|
||||
},
|
||||
{
|
||||
// P3 — repos enregistrés. Les worktrees sont dérivés à la volée de git (non persistés).
|
||||
// P3 : repos enregistrés. Les worktrees sont dérivés à la volée de git (non persistés).
|
||||
id: 3,
|
||||
sql: `
|
||||
CREATE TABLE repos (
|
||||
@@ -53,7 +53,7 @@ const MIGRATIONS: Array<{ id: number; sql: string }> = [
|
||||
`,
|
||||
},
|
||||
{
|
||||
// P4 — abonnements Web Push. Liés au token d'auth (token_id) ; clés VAPID en settings.
|
||||
// P4 : abonnements Web Push. Liés au token d'auth (token_id) ; clés VAPID en settings.
|
||||
id: 4,
|
||||
sql: `
|
||||
CREATE TABLE push_subscriptions (
|
||||
@@ -70,7 +70,7 @@ const MIGRATIONS: Array<{ id: number; sql: string }> = [
|
||||
`,
|
||||
},
|
||||
{
|
||||
// P5 — groupes de travail. Un groupe = collection de repos (many-to-many).
|
||||
// P5 : groupes de travail. Un groupe = collection de repos (many-to-many).
|
||||
// Worktrees/sessions NON persistés ici : servis par WorktreeManager/PtyManager
|
||||
// et filtrés côté client par repoId. CASCADE s'appuie sur PRAGMA foreign_keys = ON (cf. openDb).
|
||||
id: 5,
|
||||
@@ -103,7 +103,7 @@ const MIGRATIONS: Array<{ id: number; sql: string }> = [
|
||||
{
|
||||
// Journal d'audit (conformité entreprise : GDPR/SOX/ISO 27001). Trace les mutations
|
||||
// sensibles (tokens, réglages, secrets, abonnements push, groupes). Ne contient JAMAIS
|
||||
// de secret en clair — `details` est un JSON de métadonnées non sensibles.
|
||||
// de secret en clair, `details` est un JSON de métadonnées non sensibles.
|
||||
id: 7,
|
||||
sql: `
|
||||
CREATE TABLE audit_logs (
|
||||
@@ -119,7 +119,7 @@ const MIGRATIONS: Array<{ id: number; sql: string }> = [
|
||||
`,
|
||||
},
|
||||
{
|
||||
// P6 — session de groupe multi-repo. Une session peut couvrir plusieurs répertoires (--add-dir)
|
||||
// P6 : session de groupe multi-repo. Une session peut couvrir plusieurs répertoires (--add-dir)
|
||||
// et appartenir à un groupe. `added_dirs` : JSON array de chemins absolus (NULL si mono-repo).
|
||||
// `group_id` : pas de FK (ALTER ADD COLUMN sqlite n'en pose pas) ; nettoyé à la suppression du groupe.
|
||||
id: 8,
|
||||
@@ -143,7 +143,7 @@ const MIGRATIONS: Array<{ id: number; sql: string }> = [
|
||||
`,
|
||||
},
|
||||
{
|
||||
// P10 — archivage automatique des sessions terminées (rétention configurable, défaut 30 j).
|
||||
// P10 : archivage automatique des sessions terminées (rétention configurable, défaut 30 j).
|
||||
// `archived_at` NULL = active. Soft-archive : JAMAIS de DELETE (resume/fork restent intacts).
|
||||
// Sémantique distincte de hidden_sessions (#9) : `hidden` est manuel et indexé par
|
||||
// claude_session_id ; `archived` est automatique par ancienneté, indexé par `id`, et ne
|
||||
@@ -155,7 +155,7 @@ const MIGRATIONS: Array<{ id: number; sql: string }> = [
|
||||
`,
|
||||
},
|
||||
{
|
||||
// P12 — connexions aux services git distants (Gitea/GitLab/GitHub). Les SECRETS (PAT, app
|
||||
// P12 : connexions aux services git distants (Gitea/GitLab/GitHub). Les SECRETS (PAT, app
|
||||
// password, tokens OAuth) sont chiffrés par SecretBox AVANT insertion (colonnes *_encrypted) :
|
||||
// la base ne contient jamais de secret en clair. `ssh_key_path`/`oauth_*` sont posés dès
|
||||
// maintenant (schéma stable) mais exploités en P12b/P12c. `test_result` = dernier diagnostic.
|
||||
@@ -181,7 +181,7 @@ const MIGRATIONS: Array<{ id: number; sql: string }> = [
|
||||
`,
|
||||
},
|
||||
{
|
||||
// P12 — un repo enregistré peut provenir d'un clone : on retient sa source (remote_url),
|
||||
// P12 : un repo enregistré peut provenir d'un clone : on retient sa source (remote_url),
|
||||
// le service détecté et le credential utilisé. PAS de FK sur credential_id (cohérent avec
|
||||
// sessions.group_id #8) : la suppression d'un credential nullifie ce champ côté manager.
|
||||
id: 12,
|
||||
@@ -205,7 +205,7 @@ export function openDb(path: string): Db {
|
||||
}
|
||||
|
||||
/**
|
||||
* Restreint la base (et ses fichiers WAL/SHM) à 0o600 — proprio uniquement. La base contient des
|
||||
* Restreint la base (et ses fichiers WAL/SHM) à 0o600, proprio uniquement. La base contient des
|
||||
* secrets (server_secret, clé privée VAPID, hashs de tokens) : elle ne doit jamais être lisible par
|
||||
* d'autres utilisateurs du système. Best-effort : ignoré sur les FS sans permissions POSIX.
|
||||
*/
|
||||
@@ -268,7 +268,7 @@ export function unhideSession(db: Db, claudeSessionId: string): void {
|
||||
db.prepare('DELETE FROM hidden_sessions WHERE claude_session_id = ?').run(claudeSessionId);
|
||||
}
|
||||
|
||||
// ---- Archivage des sessions terminées (par id, soft-archive — P10) ----
|
||||
// ---- Archivage des sessions terminées (par id, soft-archive, P10) ----
|
||||
|
||||
/** Archive une session managée (idempotent : ne touche pas une session déjà archivée). */
|
||||
export function archiveSession(db: Db, id: string, archivedAt: string): void {
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function runDaemon(config: Config): Promise<void> {
|
||||
if (config.autoDiscover) repoDiscovery.start(); // découverte auto des repos : scan au boot + re-scan périodique
|
||||
|
||||
const url = `http://${config.bind === '0.0.0.0' ? '127.0.0.1' : config.bind}:${config.port}`;
|
||||
app.log.info(`Arboretum v${pkg.version} — ${url}`);
|
||||
app.log.info(`Arboretum v${pkg.version} : ${url}`);
|
||||
if (bootstrapToken) {
|
||||
// Affiché une seule fois : le hash seul est stocké.
|
||||
printTokenBanner(bootstrapToken, url);
|
||||
@@ -52,7 +52,7 @@ export async function runDaemon(config: Config): Promise<void> {
|
||||
const shutdown = (signal: string): void => {
|
||||
if (shuttingDown) return;
|
||||
shuttingDown = true;
|
||||
app.log.info(`${signal} received — draining sessions then exiting`);
|
||||
app.log.info(`${signal} received: draining sessions then exiting`);
|
||||
discovery.stop();
|
||||
sessionArchive.stop();
|
||||
repoDiscovery.stop();
|
||||
|
||||
@@ -80,7 +80,7 @@ export function registerAuthRoutes(
|
||||
const body = req.body as Partial<CreateTokenRequest> | null;
|
||||
const label = typeof body?.label === 'string' ? body.label.trim() : '';
|
||||
if (label.length < 1 || label.length > 64) {
|
||||
return reply.status(400).send({ error: { code: 'BAD_REQUEST', message: 'label must be 1–64 characters' } });
|
||||
return reply.status(400).send({ error: { code: 'BAD_REQUEST', message: 'label must be 1-64 characters' } });
|
||||
}
|
||||
const { id, token } = auth.createTokenRecord(label);
|
||||
recordAudit(db, { actor: req.authContext?.tokenId ?? 'unknown', action: 'token.create', resourceId: id, details: { label } });
|
||||
|
||||
@@ -101,7 +101,7 @@ export function registerGroupRoutes(
|
||||
});
|
||||
|
||||
// Session de groupe (P6) : UNE session Claude couvrant tous les repos du groupe (--add-dir).
|
||||
// Les répertoires sont résolus côté serveur depuis les propres worktrees du groupe — le client
|
||||
// Les répertoires sont résolus côté serveur depuis les propres worktrees du groupe : le client
|
||||
// ne passe jamais de chemin brut. `branch` présent → worktree de cette branche par repo ;
|
||||
// absent → le worktree principal de chaque repo.
|
||||
app.post('/api/v1/groups/:id/session', async (req, reply) => {
|
||||
|
||||
@@ -63,7 +63,7 @@ export function registerSessionRoutes(
|
||||
const claudeSessionId = managed ? managed.claudeSessionId : id;
|
||||
// Garde-fou anti-corruption : jamais de resume direct d'une session vivante (vérif FRAÎCHE).
|
||||
if (discovery.isClaudeSessionLive(claudeSessionId) || manager.findLiveByClaudeSessionId(claudeSessionId)) {
|
||||
return reply.status(409).send({ error: { code: 'SESSION_LIVE', message: 'Session is live — fork it instead' } });
|
||||
return reply.status(409).send({ error: { code: 'SESSION_LIVE', message: 'Session is live, fork it instead' } });
|
||||
}
|
||||
try {
|
||||
// Session de groupe (P6) : re-relie les mêmes répertoires (--add-dir) et son groupe au resume.
|
||||
@@ -104,7 +104,7 @@ export function registerSessionRoutes(
|
||||
});
|
||||
|
||||
// Masque une session découverte (ou managée morte) : exclue de la liste sauf ?includeHidden=true.
|
||||
// Reste reprenable/forkable — c'est un filtre d'affichage, pas une suppression.
|
||||
// Reste reprenable/forkable : c'est un filtre d'affichage, pas une suppression.
|
||||
app.post('/api/v1/sessions/:id/hide', async (req, reply) => {
|
||||
const { id } = req.params as { id: string };
|
||||
const sid = resolveClaudeSid(id);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Réglages exposés à l'UI (onglet Réglages). Frontière de sécurité CENTRALE : la table `settings`
|
||||
// contient aussi des SECRETS (server_secret, vapid_private). Ces routes n'exposent QUE des champs
|
||||
// non sensibles et n'écrivent QUE des clés explicitement allow-listées — jamais les secrets.
|
||||
// non sensibles et n'écrivent QUE des clés explicitement allow-listées : jamais les secrets.
|
||||
import type { FastifyInstance } from 'fastify';
|
||||
import type { ServerInfo, SettingsResponse, UpdateSettingsRequest } from '@arboretum/shared';
|
||||
import type { Config } from '../config.js';
|
||||
@@ -119,7 +119,7 @@ export function registerSettingsRoutes(
|
||||
details: { keys: Object.keys(body) },
|
||||
});
|
||||
const snap = snapshot();
|
||||
// P11 — diffuse le nouvel état non sensible à tous les clients abonnés au topic 'settings'.
|
||||
// P11 · diffuse le nouvel état non sensible à tous les clients abonnés au topic 'settings'.
|
||||
settingsBus.emit('settings_update', snap.settings);
|
||||
return reply.send(snap);
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ export function registerWorktreeRoutes(app: FastifyInstance, wt: WorktreeManager
|
||||
}
|
||||
});
|
||||
|
||||
// Branches du repo (locales + suivies de origin + défaut) — alimente le sélecteur de base côté UI.
|
||||
// Branches du repo (locales + suivies de origin + défaut) : alimente le sélecteur de base côté UI.
|
||||
app.get('/api/v1/repos/:id/branches', async (req, reply) => {
|
||||
const { id } = req.params as { id: string };
|
||||
try {
|
||||
|
||||
@@ -67,7 +67,7 @@ export function registerWsGateway(
|
||||
const onSessionExit = (e: { sessionId: string; exitCode: number | null; signal: number | null }): void => {
|
||||
if (subscribedSessions) send({ type: 'session_exit', ...e });
|
||||
};
|
||||
// P10 — une session managée vient d'être archivée (auto par ancienneté ou manuellement).
|
||||
// P10 · une session managée vient d'être archivée (auto par ancienneté ou manuellement).
|
||||
const onSessionArchived = (e: { id: string; archivedAt: string }): void => {
|
||||
if (subscribedSessions) send({ type: 'session_archived', sessionId: e.id });
|
||||
};
|
||||
@@ -93,15 +93,15 @@ export function registerWsGateway(
|
||||
const onGroupRemoved = (groupId: string): void => {
|
||||
if (subscribedGroups) send({ type: 'group_removed', groupId });
|
||||
};
|
||||
// P11 — un réglage a changé : relayé aux connexions abonnées au topic 'settings'.
|
||||
// P11 · un réglage a changé : relayé aux connexions abonnées au topic 'settings'.
|
||||
const onSettingsUpdate = (settings: SettingsBroadcast): void => {
|
||||
if (subscribedSettings) send({ type: 'settings_update', settings });
|
||||
};
|
||||
// P12 — progression d'un clone : relayée aux abonnés du topic 'clones'.
|
||||
// P12 · progression d'un clone : relayée aux abonnés du topic 'clones'.
|
||||
const onCloneUpdate = (operation: CloneOperation): void => {
|
||||
if (subscribedClones) send({ type: 'clone_update', operation });
|
||||
};
|
||||
// P7 — détail d'un worktree modifié : poussé UNIQUEMENT si cette connexion le regarde.
|
||||
// P7 · détail d'un worktree modifié : poussé UNIQUEMENT si cette connexion le regarde.
|
||||
const onWorktreeChanges = (e: { repoId: string; path: string }): void => {
|
||||
if (watched.has(watchKey(e.repoId, e.path))) send({ type: 'worktree_changes', ...e });
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ afterAll(async () => {
|
||||
rmSync(dir, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
describe('app e2e — auth, origin et sessions', () => {
|
||||
describe('app e2e · auth, origin et sessions', () => {
|
||||
let t: TestApp;
|
||||
let cookieValue: string;
|
||||
|
||||
@@ -277,7 +277,7 @@ describe('app e2e — auth, origin et sessions', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('app e2e — rate limit du login', () => {
|
||||
describe('app e2e · rate limit du login', () => {
|
||||
it('mauvais token et bodies invalides → 401, puis 429 dès le 4e essai (backoff après 3 échecs consécutifs)', async () => {
|
||||
const t = makeApp('ratelimit-failures');
|
||||
const bad = await t.bundle.app.inject({ method: 'POST', url: '/api/v1/auth/login', payload: { token: 'arb_badbadbadbad' } });
|
||||
@@ -309,7 +309,7 @@ describe('app e2e — rate limit du login', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('app e2e — découverte, resume & fork (P2)', () => {
|
||||
describe('app e2e · découverte, resume & fork (P2)', () => {
|
||||
let t: TestApp;
|
||||
let projectsDir: string;
|
||||
let sessionsDir: string;
|
||||
@@ -370,7 +370,7 @@ describe('app e2e — découverte, resume & fork (P2)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('app e2e — découverte auto des repos & masquage', () => {
|
||||
describe('app e2e · découverte auto des repos & masquage', () => {
|
||||
let t: TestApp;
|
||||
let scanRoot: string;
|
||||
const bearer = (): Record<string, string> => ({ authorization: `Bearer ${t.token}` });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Lot 5 — sécurité enterprise : en-têtes de sécurité, journal d'audit, RGPD (export/suppression),
|
||||
// Lot 5 · sécurité enterprise : en-têtes de sécurité, journal d'audit, RGPD (export/suppression),
|
||||
// garde Content-Type. Vérifie le câblage de bout en bout via buildApp + token bootstrap.
|
||||
import { mkdtempSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { buildSpawnSpec, diagnoseClaudeBin, resolveClaudeBin } from '../src/core
|
||||
// resolveClaudeBin() fait `which claude` : on le stub pour ne pas dépendre d'un claude réel en PATH.
|
||||
vi.mock('node:child_process', () => ({ execFileSync: () => '/usr/bin/claude\n' }));
|
||||
|
||||
describe('buildSpawnSpec — session de groupe multi-repo (P6)', () => {
|
||||
describe('buildSpawnSpec · session de groupe multi-repo (P6)', () => {
|
||||
it('émet un --add-dir par répertoire supplémentaire (claude)', () => {
|
||||
const spec = buildSpawnSpec({ command: 'claude', addDirs: ['/a', '/b', '/c'] });
|
||||
expect(spec.file).toBe('/usr/bin/claude');
|
||||
@@ -28,7 +28,7 @@ describe('buildSpawnSpec — session de groupe multi-repo (P6)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveClaudeBin / diagnoseClaudeBin — override de chemin (réglage UI)', () => {
|
||||
describe('resolveClaudeBin / diagnoseClaudeBin · override de chemin (réglage UI)', () => {
|
||||
// process.execPath (node) est un fichier exécutable réel garanti sur la machine de test.
|
||||
const realBin = process.execPath;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
launchAgentPlistPath,
|
||||
} from '../src/cli/install.js';
|
||||
|
||||
describe('cli install — detectPlatform', () => {
|
||||
describe('cli install · detectPlatform', () => {
|
||||
it('accepte linux et darwin', () => {
|
||||
expect(detectPlatform('linux')).toBe('linux');
|
||||
expect(detectPlatform('darwin')).toBe('darwin');
|
||||
@@ -26,7 +26,7 @@ describe('cli install — detectPlatform', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('cli install — buildServiceArgs', () => {
|
||||
describe('cli install · buildServiceArgs', () => {
|
||||
it('aucun flag → aucun argument (le service garde les défauts loopback)', () => {
|
||||
expect(buildServiceArgs(parseInstallArgs([]))).toEqual([]);
|
||||
});
|
||||
@@ -47,7 +47,7 @@ describe('cli install — buildServiceArgs', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('cli install — resolveBin', () => {
|
||||
describe('cli install · resolveBin', () => {
|
||||
it('par défaut : node (process.execPath) + dist/index.js', () => {
|
||||
const { exec, args } = resolveBin({});
|
||||
expect(exec).toBe(process.execPath);
|
||||
@@ -64,7 +64,7 @@ describe('cli install — resolveBin', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('cli install — renderSystemdUnit', () => {
|
||||
describe('cli install · renderSystemdUnit', () => {
|
||||
it('contient le ExecStart calculé et les directives clés', () => {
|
||||
const unit = renderSystemdUnit({ exec: '/usr/bin/node', scriptArgs: ['/opt/arboretum/index.js', '--port', '7317'] });
|
||||
expect(unit).toContain('ExecStart=/usr/bin/node /opt/arboretum/index.js --port 7317');
|
||||
@@ -101,7 +101,7 @@ describe('cli install — renderSystemdUnit', () => {
|
||||
});
|
||||
expect(unit).toMatchInlineSnapshot(`
|
||||
"[Unit]
|
||||
Description=Arboretum — git worktree & Claude Code dashboard
|
||||
Description=Arboretum · git worktree & Claude Code dashboard
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
@@ -120,7 +120,7 @@ describe('cli install — renderSystemdUnit', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('cli install — renderLaunchAgentPlist', () => {
|
||||
describe('cli install · renderLaunchAgentPlist', () => {
|
||||
const base = {
|
||||
label: 'fr.lidge.arboretum',
|
||||
programArguments: ['/usr/bin/node', '/opt/index.js', '--port', '7317'],
|
||||
@@ -163,13 +163,13 @@ describe('cli install — renderLaunchAgentPlist', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('cli install — xmlEscape', () => {
|
||||
describe('cli install · xmlEscape', () => {
|
||||
it('échappe &, < et >', () => {
|
||||
expect(xmlEscape('a & b < c > d')).toBe('a & b < c > d');
|
||||
});
|
||||
});
|
||||
|
||||
describe('cli install — chemins', () => {
|
||||
describe('cli install · chemins', () => {
|
||||
const savedXdg = process.env.XDG_CONFIG_HOME;
|
||||
afterEach(() => {
|
||||
if (savedXdg === undefined) delete process.env.XDG_CONFIG_HOME;
|
||||
|
||||
@@ -24,7 +24,7 @@ async function replay(fixture: string): Promise<Array<{ dialog: ClassifiedDialog
|
||||
return seen;
|
||||
}
|
||||
|
||||
describe('ScreenReader (@xterm/headless) — anti strip-ANSI naïf', () => {
|
||||
describe('ScreenReader (@xterm/headless) · anti strip-ANSI naïf', () => {
|
||||
it('préserve les espaces du dialogue (« Do you want to create », pas « Doyouwant »)', async () => {
|
||||
const seen = await replay('perm-write2.raw');
|
||||
expect(seen.length).toBeGreaterThan(0);
|
||||
@@ -32,7 +32,7 @@ describe('ScreenReader (@xterm/headless) — anti strip-ANSI naïf', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('classifyDialog — unitaire (lignes synthétiques)', () => {
|
||||
describe('classifyDialog · unitaire (lignes synthétiques)', () => {
|
||||
it('trust', () => {
|
||||
const d = classifyDialog(['Do you trust the files in this folder?', '❯ 1. Yes, I trust this folder', '2. No, exit']);
|
||||
expect(d?.kind).toBe('trust');
|
||||
@@ -81,7 +81,7 @@ describe('détection sur fixtures réelles S3 (replay headless)', () => {
|
||||
|
||||
// Campagne de fiabilité P4-C : chaque type de dialogue ciblé par la supervision mobile doit être
|
||||
// classifié de façon fiable (cf. « reste à faire P4 » du verdict S3 : couvrir le refus Esc et le plan).
|
||||
describe('campagne de fiabilité P4-C — tous les types de dialogue', () => {
|
||||
describe('campagne de fiabilité P4-C · tous les types de dialogue', () => {
|
||||
const realCaptures: Array<{ fixture: string; kind: DialogKind }> = [
|
||||
{ fixture: 'trust.raw', kind: 'trust' },
|
||||
{ fixture: 'perm-write2.raw', kind: 'permission' },
|
||||
@@ -101,7 +101,7 @@ describe('campagne de fiabilité P4-C — tous les types de dialogue', () => {
|
||||
expect(seen.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('plan (synthétique — pas de capture réelle) : « Would you like to proceed? »', () => {
|
||||
it('plan (synthétique, pas de capture réelle) : « Would you like to proceed? »', () => {
|
||||
const d = classifyDialog([
|
||||
'Here is my implementation plan:',
|
||||
' - step one',
|
||||
|
||||
@@ -184,7 +184,7 @@ describe('branche : existence, liste, courante, commit', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('P7 — parseurs purs (status v2 / numstat)', () => {
|
||||
describe('P7 · parseurs purs (status v2 / numstat)', () => {
|
||||
it('parsePorcelainV2 : modifié, untracked, renommé', () => {
|
||||
const z =
|
||||
'1 .M N... 100644 100644 100644 h1 h2 file.txt\x00' +
|
||||
@@ -217,7 +217,7 @@ describe('P7 — parseurs purs (status v2 / numstat)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('P7 — changes / diff / staging / commit sélectif (repo tmp)', () => {
|
||||
describe('P7 · changes / diff / staging / commit sélectif (repo tmp)', () => {
|
||||
it('listChanges : untracked + modifié non indexé + indexé', async () => {
|
||||
const repo = makeTmpRepo();
|
||||
writeFileSync(join(repo, 'untracked.txt'), 'x\n');
|
||||
|
||||
@@ -463,7 +463,7 @@ describe('PtyManager (pty mocké)', () => {
|
||||
manager.attach(summary.id, b, 80, 24);
|
||||
|
||||
const chunk = 'x'.repeat(200 * 1024); // 200 Kio ASCII
|
||||
pty.emitData(chunk); // a=200K, b=200K — sous HIGH (384K)
|
||||
pty.emitData(chunk); // a=200K, b=200K : sous HIGH (384K)
|
||||
expect(pty.pause).not.toHaveBeenCalled();
|
||||
|
||||
manager.ack(summary.id, b, 200 * 1024); // b rattrape tout
|
||||
@@ -516,7 +516,7 @@ describe('PtyManager (pty mocké)', () => {
|
||||
const chunks = ['A', 'B', 'C', 'D'].map((c) => c.repeat(mib));
|
||||
|
||||
pty.emitData(chunks[0]!); // outstanding 1 Mio
|
||||
pty.emitData(chunks[1]!); // outstanding 2 Mio — pas strictement > LAGGING_BYTES
|
||||
pty.emitData(chunks[1]!); // outstanding 2 Mio : pas strictement > LAGGING_BYTES
|
||||
expect(a.lagging).toBe(false);
|
||||
expect(a.sendOutput).toHaveBeenCalledTimes(2);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ function mulberry32(seed: number): () => number {
|
||||
|
||||
const buf = (s: string): Buffer => Buffer.from(s, 'ascii');
|
||||
|
||||
describe('RingBuffer — écriture simple', () => {
|
||||
describe('RingBuffer · écriture simple', () => {
|
||||
it('écrit puis relit sans wrap', () => {
|
||||
const ring = new RingBuffer(16);
|
||||
ring.write(buf('hello'));
|
||||
@@ -76,7 +76,7 @@ describe('RingBuffer — écriture simple', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('RingBuffer — wrap-around', () => {
|
||||
describe('RingBuffer · wrap-around', () => {
|
||||
it('wrap simple : le chunk chevauche la frontière du buffer', () => {
|
||||
const ring = new RingBuffer(8);
|
||||
ring.write(buf('01234')); // pos 0..5
|
||||
@@ -120,7 +120,7 @@ describe('RingBuffer — wrap-around', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('RingBuffer — chunk >= capacité', () => {
|
||||
describe('RingBuffer · chunk >= capacité', () => {
|
||||
it('chunk == capacité sur un ring vierge', () => {
|
||||
const ring = new RingBuffer(8);
|
||||
ring.write(buf('abcdefgh'));
|
||||
@@ -156,7 +156,7 @@ describe('RingBuffer — chunk >= capacité', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('RingBuffer — readFrom', () => {
|
||||
describe('RingBuffer · readFrom', () => {
|
||||
function filled(): RingBuffer {
|
||||
// total = 10, capacité 8 → fenêtre = offsets [2, 10)
|
||||
const ring = new RingBuffer(8);
|
||||
@@ -192,7 +192,7 @@ describe('RingBuffer — readFrom', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('RingBuffer — totalOffset monotone', () => {
|
||||
describe('RingBuffer · totalOffset monotone', () => {
|
||||
it('croît exactement de la taille de chaque chunk, jamais ne décroît', () => {
|
||||
const ring = new RingBuffer(8);
|
||||
const rand = mulberry32(0x5eed);
|
||||
@@ -207,7 +207,7 @@ describe('RingBuffer — totalOffset monotone', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('RingBuffer — équivalence avec le modèle de référence (property test)', () => {
|
||||
describe('RingBuffer · équivalence avec le modèle de référence (property test)', () => {
|
||||
it('tail et readFrom identiques au modèle pour 500 écritures aléatoires (chunks < capacité)', () => {
|
||||
const capacity = 64;
|
||||
const ring = new RingBuffer(capacity);
|
||||
|
||||
@@ -101,7 +101,7 @@ describe('GET /api/v1/settings', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('PATCH /api/v1/settings — sécurité', () => {
|
||||
describe('PATCH /api/v1/settings · sécurité', () => {
|
||||
it('ignore toute clé hors allow-list (ne touche pas aux secrets)', async () => {
|
||||
const before = getSetting(db, 'server_secret');
|
||||
await bundle.app.inject({ method: 'PATCH', url: '/api/v1/settings', headers: auth(), payload: { server_secret: 'pwned', vapid_private: 'pwned' } });
|
||||
@@ -115,7 +115,7 @@ describe('PATCH /api/v1/settings — sécurité', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('PATCH /api/v1/settings — découverte des dépôts', () => {
|
||||
describe('PATCH /api/v1/settings · découverte des dépôts', () => {
|
||||
it('enregistre des scanRoots et un intervalle valides et les renvoie', async () => {
|
||||
const res = await bundle.app.inject({
|
||||
method: 'PATCH',
|
||||
@@ -148,7 +148,7 @@ describe('PATCH /api/v1/settings — découverte des dépôts', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('PATCH /api/v1/settings — Claude CLI', () => {
|
||||
describe('PATCH /api/v1/settings · Claude CLI', () => {
|
||||
// process.execPath (node) est un fichier exécutable réel garanti sur la machine de test.
|
||||
const realBin = process.execPath;
|
||||
|
||||
@@ -191,7 +191,7 @@ describe('PATCH /api/v1/settings — Claude CLI', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('PATCH /api/v1/settings — rétention des sessions (P10)', () => {
|
||||
describe('PATCH /api/v1/settings · rétention des sessions (P10)', () => {
|
||||
it('enregistre une rétention valide et l’expose', async () => {
|
||||
const res = await bundle.app.inject({ method: 'PATCH', url: '/api/v1/settings', headers: auth(), payload: { retentionDays: 7 } });
|
||||
expect(res.statusCode).toBe(200);
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface LoginResponse {
|
||||
}
|
||||
export interface MeResponse {
|
||||
ok: true;
|
||||
/** id du token de la session courante — sert à marquer « courant » dans la liste des tokens. */
|
||||
/** id du token de la session courante : sert à marquer « courant » dans la liste des tokens. */
|
||||
tokenId: string;
|
||||
tokenLabel: string;
|
||||
serverVersion: string;
|
||||
@@ -38,18 +38,18 @@ export interface CreateTokenRequest {
|
||||
export interface CreateTokenResponse {
|
||||
id: string;
|
||||
label: string;
|
||||
/** valeur en clair — affichée une seule fois, jamais re-récupérable. */
|
||||
/** valeur en clair : affichée une seule fois, jamais re-récupérable. */
|
||||
token: string;
|
||||
}
|
||||
|
||||
export interface CreateSessionRequest {
|
||||
cwd: string;
|
||||
/** binaire à lancer — défaut "claude" ; "bash" sert aux tests d'acceptation sans quota */
|
||||
/** binaire à lancer : défaut "claude" ; "bash" sert aux tests d'acceptation sans quota */
|
||||
command?: 'claude' | 'bash';
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /api/v1/projects — crée un NOUVEAU dossier de projet `<root>/<name>` (le serveur ne crée
|
||||
* POST /api/v1/projects : crée un NOUVEAU dossier de projet `<root>/<name>` (le serveur ne crée
|
||||
* jamais de dossier ailleurs) puis y lance une session. Le `git init` est optionnel (case à cocher).
|
||||
* Réponse : `CreateProjectResponse`.
|
||||
*/
|
||||
@@ -60,7 +60,7 @@ export interface CreateProjectRequest {
|
||||
name: string;
|
||||
/** true → `git init` dans le nouveau dossier avant la session (défaut false). */
|
||||
gitInit?: boolean;
|
||||
/** binaire à lancer — défaut "claude" ; "bash" sert aux tests sans quota. */
|
||||
/** binaire à lancer : défaut "claude" ; "bash" sert aux tests sans quota. */
|
||||
command?: 'claude' | 'bash';
|
||||
}
|
||||
export interface CreateProjectResponse {
|
||||
@@ -76,13 +76,13 @@ export interface SessionsListResponse {
|
||||
export interface SessionResponse {
|
||||
session: SessionSummary;
|
||||
}
|
||||
/** POST /sessions/hide-discovered — masque tout l'historique de sessions externes visible. */
|
||||
/** POST /sessions/hide-discovered : masque tout l'historique de sessions externes visible. */
|
||||
export interface HideDiscoveredResponse {
|
||||
/** nombre de sessions effectivement masquées. */
|
||||
hidden: number;
|
||||
}
|
||||
|
||||
// POST /sessions/:id/resume et /sessions/:id/fork (P2) : aucun corps — cwd et command
|
||||
// POST /sessions/:id/resume et /sessions/:id/fork (P2) : aucun corps, cwd et command
|
||||
// sont TOUJOURS dérivés du :id (lu sur disque), jamais fournis par le client (cf. spike S1).
|
||||
export type ResumeSessionRequest = Record<string, never>;
|
||||
export type ForkSessionRequest = Record<string, never>;
|
||||
@@ -134,7 +134,7 @@ export interface HookRunResult {
|
||||
}
|
||||
/**
|
||||
* Stratégie de résolution de la branche d'un nouveau worktree :
|
||||
* - `auto` (défaut) : détecte l'existence de la branche — checkout si elle existe en local, suivi de
|
||||
* - `auto` (défaut) : détecte l'existence de la branche, checkout si elle existe en local, suivi de
|
||||
* `origin/<branch>` si elle n'existe que sur le remote, sinon création (`-b`). Robuste pour les
|
||||
* groupes hétérogènes où la branche peut déjà exister dans certains dépôts mais pas d'autres.
|
||||
* - `create` : force la création (`-b`), échoue si la branche existe déjà.
|
||||
@@ -167,7 +167,7 @@ export interface CreateWorktreeResponse {
|
||||
action: WorktreeBranchAction;
|
||||
}
|
||||
|
||||
/** GET /api/v1/repos/:id/branches — branches locales/remote pour alimenter un sélecteur de base. */
|
||||
/** GET /api/v1/repos/:id/branches : branches locales/remote pour alimenter un sélecteur de base. */
|
||||
export interface RepoBranchesResponse {
|
||||
local: string[];
|
||||
remote: string[];
|
||||
@@ -175,12 +175,12 @@ export interface RepoBranchesResponse {
|
||||
default: string | null;
|
||||
}
|
||||
|
||||
/** POST /api/v1/repos/:id/worktrees/commit — `git add -A` puis commit dans le worktree visé. */
|
||||
/** POST /api/v1/repos/:id/worktrees/commit : `git add -A` puis commit dans le worktree visé. */
|
||||
export interface CommitWorktreeRequest {
|
||||
path: string;
|
||||
message: string;
|
||||
/**
|
||||
* P7 — `all` (défaut, rétrocompat) : `git add -A` + commit (tout l'arbre) ; `staged` : commit
|
||||
* P7 : `all` (défaut, rétrocompat) : `git add -A` + commit (tout l'arbre) ; `staged` : commit
|
||||
* de l'index uniquement (staging sélectif préalable via /stage). `amend` réécrit le dernier
|
||||
* commit (refusé s'il est déjà poussé).
|
||||
*/
|
||||
@@ -214,7 +214,7 @@ export interface FileChange {
|
||||
/** ancien chemin pour un renommage/copie, sinon absent. */
|
||||
renamedFrom?: string;
|
||||
}
|
||||
/** GET /api/v1/repos/:id/worktrees/changes?path= — liste des fichiers modifiés d'un worktree. */
|
||||
/** GET /api/v1/repos/:id/worktrees/changes?path= : liste des fichiers modifiés d'un worktree. */
|
||||
export interface WorktreeChangesResponse {
|
||||
repoId: string;
|
||||
path: string;
|
||||
@@ -222,7 +222,7 @@ export interface WorktreeChangesResponse {
|
||||
/** true si la liste a été bornée (trop de changements). */
|
||||
truncated: boolean;
|
||||
}
|
||||
/** GET /api/v1/repos/:id/worktrees/diff?path=&file=&staged= — diff unifié d'un fichier. */
|
||||
/** GET /api/v1/repos/:id/worktrees/diff?path=&file=&staged= : diff unifié d'un fichier. */
|
||||
export interface FileDiffResponse {
|
||||
path: string;
|
||||
file: string;
|
||||
@@ -233,19 +233,19 @@ export interface FileDiffResponse {
|
||||
/** texte du diff unifié git (vide si binaire ou tooLarge). */
|
||||
diff: string;
|
||||
}
|
||||
/** GET /api/v1/repos/:id/files/content?wt=&path= — contenu d'un fichier (pour l'éditeur Monaco). */
|
||||
/** GET /api/v1/repos/:id/files/content?wt=&path= : contenu d'un fichier (pour l'éditeur Monaco). */
|
||||
export interface FileContentResponse {
|
||||
/** chemin relatif au worktree (POSIX). */
|
||||
path: string;
|
||||
content: string;
|
||||
encoding: 'utf-8';
|
||||
size: number;
|
||||
/** mtime du fichier en ms (st.mtimeMs) — base du garde-fou de conflit d'édition (P8). */
|
||||
/** mtime du fichier en ms (st.mtimeMs) : base du garde-fou de conflit d'édition (P8). */
|
||||
mtime: number;
|
||||
/** langage déduit de l'extension (pour Monaco), si reconnu. */
|
||||
language?: string;
|
||||
}
|
||||
/** PUT /api/v1/repos/:id/files/content — écriture d'un fichier (borné au worktree). */
|
||||
/** PUT /api/v1/repos/:id/files/content : écriture d'un fichier (borné au worktree). */
|
||||
export interface WriteFileRequest {
|
||||
/** chemin absolu du worktree. */
|
||||
wt: string;
|
||||
@@ -258,10 +258,10 @@ export interface WriteFileRequest {
|
||||
export interface WriteFileResponse {
|
||||
ok: true;
|
||||
size: number;
|
||||
/** mtime (ms) du fichier après écriture — le client le réutilise comme nouvelle base. */
|
||||
/** mtime (ms) du fichier après écriture : le client le réutilise comme nouvelle base. */
|
||||
mtime: number;
|
||||
}
|
||||
/** P7 — corps commun des mutations de staging/discard. */
|
||||
/** P7 : corps commun des mutations de staging/discard. */
|
||||
export interface WorktreeFilesRequest {
|
||||
path: string;
|
||||
/** chemins relatifs au worktree. */
|
||||
@@ -271,21 +271,21 @@ export interface WorktreeFilesRequest {
|
||||
export interface DiscardFilesRequest extends WorktreeFilesRequest {
|
||||
includeUntracked?: boolean;
|
||||
}
|
||||
/** POST /api/v1/repos/:id/worktrees/fetch — `git fetch --all --prune`. */
|
||||
/** POST /api/v1/repos/:id/worktrees/fetch : `git fetch --all --prune`. */
|
||||
export interface FetchWorktreeRequest {
|
||||
path: string;
|
||||
}
|
||||
/** POST /api/v1/repos/:id/worktrees/pull — `git pull` (ff-only par défaut). */
|
||||
/** POST /api/v1/repos/:id/worktrees/pull : `git pull` (ff-only par défaut). */
|
||||
export interface PullWorktreeRequest {
|
||||
path: string;
|
||||
mode?: 'ff-only' | 'rebase';
|
||||
}
|
||||
/** POST /api/v1/repos/:id/worktrees/push — pousse la branche du worktree (upstream auto si absent). */
|
||||
/** POST /api/v1/repos/:id/worktrees/push : pousse la branche du worktree (upstream auto si absent). */
|
||||
export interface PushWorktreeRequest {
|
||||
path: string;
|
||||
}
|
||||
/**
|
||||
* POST /api/v1/repos/:id/worktrees/promote — « passer en principal » : la branche du worktree devient
|
||||
* POST /api/v1/repos/:id/worktrees/promote : « passer en principal » : la branche du worktree devient
|
||||
* le checkout principal du dépôt (le worktree est supprimé, l'ancienne branche principale est conservée).
|
||||
*/
|
||||
export interface PromoteWorktreeRequest {
|
||||
@@ -300,12 +300,12 @@ export interface AdoptWorktreeRequest {
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /api/v1/repos/:id/session — lance UNE session dans le checkout principal du repo
|
||||
* POST /api/v1/repos/:id/session : lance UNE session dans le checkout principal du repo
|
||||
* (`repo.path`) pour « bosser sur la branche principale » sans créer de worktree.
|
||||
* Réponse : `SessionResponse`.
|
||||
*/
|
||||
export interface StartRepoSessionRequest {
|
||||
/** binaire à lancer — défaut "claude" ; "bash" sert aux tests sans quota. */
|
||||
/** binaire à lancer : défaut "claude" ; "bash" sert aux tests sans quota. */
|
||||
command?: 'claude' | 'bash';
|
||||
/** si fourni : crée/bascule cette branche dans le checkout principal avant la session. */
|
||||
branch?: string;
|
||||
@@ -360,15 +360,15 @@ export interface FsEntry {
|
||||
path: string;
|
||||
/** présent (true) uniquement en mode markRepos quand le dossier est un dépôt git */
|
||||
isRepo?: boolean;
|
||||
/** P7 — présent (true) en mode includeFiles quand l'entrée est un fichier (pas un dossier) */
|
||||
/** P7 : présent (true) en mode includeFiles quand l'entrée est un fichier (pas un dossier) */
|
||||
isFile?: boolean;
|
||||
}
|
||||
export interface FsListResponse {
|
||||
/** chemin absolu listé (normalisé) */
|
||||
path: string;
|
||||
/** parent (null à la racine `/`) — pour le bouton « remonter » */
|
||||
/** parent (null à la racine `/`) : pour le bouton « remonter » */
|
||||
parent: string | null;
|
||||
/** home de l'utilisateur côté serveur — point de départ par défaut */
|
||||
/** home de l'utilisateur côté serveur : point de départ par défaut */
|
||||
home: string;
|
||||
/** sous-dossiers uniquement, triés sans tenir compte de la casse */
|
||||
entries: FsEntry[];
|
||||
@@ -388,7 +388,7 @@ export interface PushUnsubscribeRequest {
|
||||
}
|
||||
|
||||
// ---- Réglages & info serveur (onglet Réglages) ----
|
||||
/** Config runtime non sensible du daemon — lecture seule (changée via flags CLI + redémarrage). */
|
||||
/** Config runtime non sensible du daemon : lecture seule (changée via flags CLI + redémarrage). */
|
||||
export interface ServerInfo {
|
||||
version: string;
|
||||
port: number;
|
||||
@@ -413,22 +413,22 @@ export interface ClaudeBinDiagnostic {
|
||||
ok: boolean;
|
||||
}
|
||||
export interface SettingsResponse {
|
||||
/** réglages modifiables à chaud (allow-list serveur — jamais les secrets). Cf. SettingsBroadcast. */
|
||||
/** réglages modifiables à chaud (allow-list serveur, jamais les secrets). Cf. SettingsBroadcast. */
|
||||
settings: SettingsBroadcast;
|
||||
server: ServerInfo;
|
||||
}
|
||||
export interface UpdateSettingsRequest {
|
||||
/** racines absolues à scanner (chemins normalisés, ≤ 16) ; remplace la liste. */
|
||||
scanRoots?: string[];
|
||||
/** intervalle du re-scan périodique en minutes (0–1440 ; 0 désactive). */
|
||||
/** intervalle du re-scan périodique en minutes (0-1440 ; 0 désactive). */
|
||||
scanIntervalMin?: number;
|
||||
/** chemin absolu du binaire `claude` (fichier exécutable) ; '' pour réinitialiser à l'auto-détection. */
|
||||
claudeBinPath?: string;
|
||||
/** override de la racine ~/.claude (répertoire existant) ; '' pour réinitialiser au défaut. */
|
||||
claudeHome?: string;
|
||||
/** auto-archivage des sessions terminées après N jours (0 = jamais ; sinon 1–3650). */
|
||||
/** auto-archivage des sessions terminées après N jours (0 = jamais ; sinon 1-3650). */
|
||||
retentionDays?: number;
|
||||
/** purge définitive après N jours (0 = désactivée ; sinon 1–3650). */
|
||||
/** purge définitive après N jours (0 = désactivée ; sinon 1-3650). */
|
||||
purgeDays?: number;
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ export interface CreateGitCredentialRequest {
|
||||
/** instance self-hosted (Gitea/GitLab) ; absent = service public (github.com / gitlab.com). */
|
||||
baseUrl?: string;
|
||||
username?: string;
|
||||
/** PAT ou app password — chiffré côté serveur (SecretBox), jamais relu. */
|
||||
/** PAT ou app password : chiffré côté serveur (SecretBox), jamais relu. */
|
||||
secret?: string;
|
||||
}
|
||||
export interface UpdateGitCredentialRequest {
|
||||
@@ -546,13 +546,13 @@ export interface CloneRequest {
|
||||
credentialId: string;
|
||||
/** URL HTTPS du dépôt à cloner. */
|
||||
remoteUrl: string;
|
||||
/** dossier de destination (sous une racine de scan) — créé par le clone, refus si existant. */
|
||||
/** dossier de destination (sous une racine de scan) : créé par le clone, refus si existant. */
|
||||
dest: string;
|
||||
}
|
||||
export interface CloneStartResponse {
|
||||
operationId: string;
|
||||
}
|
||||
/** État d'un clone (GET /repos/clone/:id) — même forme que le push WS clone_update. */
|
||||
/** État d'un clone (GET /repos/clone/:id) : même forme que le push WS clone_update. */
|
||||
export interface CloneStatusResponse {
|
||||
operation: CloneOperation;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Protocole WebSocket Arboretum — une connexion multiplexée par client.
|
||||
// Protocole WebSocket Arboretum : une connexion multiplexée par client.
|
||||
// Messages de contrôle : frames TEXTE JSON. Sortie terminal : frames BINAIRES
|
||||
// (un chunk PTY peut couper un caractère UTF-8 en frontière de frame ; le
|
||||
// décodage incombe à xterm.write(Uint8Array) côté client, jamais au transport).
|
||||
@@ -11,7 +11,7 @@ export const BINARY_FRAME = {
|
||||
HEADER_BYTES: 5,
|
||||
/** serveur → client : sortie terminal */
|
||||
OUTPUT: 0x01,
|
||||
/** serveur → client : resync — le client doit reset son terminal avant d'écrire le payload */
|
||||
/** serveur → client : resync, le client doit reset son terminal avant d'écrire le payload */
|
||||
RESYNC: 0x02,
|
||||
} as const;
|
||||
|
||||
@@ -53,7 +53,7 @@ export const FLOW = {
|
||||
|
||||
/**
|
||||
* Replay à l'attach : reset terminal + queue du ring (l'écran TUI se repeint en continu).
|
||||
* 1 Mo (≈ 10–15k lignes) pour permettre de remonter une vraie conversation Claude dans le terminal ;
|
||||
* 1 Mo (≈ 10-15k lignes) pour permettre de remonter une vraie conversation Claude dans le terminal ;
|
||||
* reste < LAGGING_BYTES (pas de faux lagging) et bien dans RING_CAPACITY.
|
||||
*/
|
||||
export const REPLAY_TAIL_BYTES = 1024 * 1024;
|
||||
@@ -160,7 +160,7 @@ export interface WorktreeGitStatus {
|
||||
behind: number;
|
||||
dirtyCount: number;
|
||||
upstream: string | null;
|
||||
// ---- Champs additifs P7 (optionnels, rétrocompat) — compteurs bon marché calculés dans le
|
||||
// ---- Champs additifs P7 (optionnels, rétrocompat) : compteurs bon marché calculés dans le
|
||||
// même passage `status --porcelain=v2` que dirtyCount. La liste détaillée des changements
|
||||
// (FileChange[]) n'est JAMAIS diffusée ici : elle est servie à la demande (REST) et poussée
|
||||
// uniquement aux clients qui « regardent » le worktree (voir `worktree_changes`).
|
||||
@@ -231,7 +231,7 @@ export type CloneState = 'pending' | 'running' | 'done' | 'error';
|
||||
export interface CloneOperation {
|
||||
id: string;
|
||||
state: CloneState;
|
||||
/** progression 0–100 si git la communique, sinon null. */
|
||||
/** progression 0-100 si git la communique, sinon null. */
|
||||
progress: number | null;
|
||||
/** phase courante rapportée par git (« Receiving objects », « Resolving deltas »…). */
|
||||
phase: string | null;
|
||||
@@ -255,7 +255,7 @@ export type ClientMessage =
|
||||
| { type: 'resize'; channel: number; cols: number; rows: number }
|
||||
| { type: 'ack'; channel: number; bytes: number }
|
||||
| { type: 'sub'; topics: Array<'sessions' | 'worktrees' | 'groups' | 'settings' | 'clones'> }
|
||||
// P7 — abonnement ciblé au détail d'un worktree (diff/statut fin) : on ne pousse le détail
|
||||
// P7 : abonnement ciblé au détail d'un worktree (diff/statut fin) : on ne pousse le détail
|
||||
// qu'aux connexions qui « regardent » ce worktree (clé = repoId + path), indépendamment du
|
||||
// topic global 'worktrees' (qui ne transporte que les compteurs légers).
|
||||
| { type: 'watch'; repoId: string; path: string }
|
||||
@@ -270,20 +270,20 @@ export type ServerMessage =
|
||||
| { type: 'control_changed'; channel: number; controlling: boolean }
|
||||
| { type: 'session_update'; session: SessionSummary }
|
||||
| { type: 'session_exit'; sessionId: string; exitCode: number | null; signal: number | null }
|
||||
// P10 — une session managée vient d'être archivée (auto par ancienneté ou manuellement). Signal
|
||||
// P10 : une session managée vient d'être archivée (auto par ancienneté ou manuellement). Signal
|
||||
// léger : le client met à jour son row (badge archived) et le retire si « Show archived » est off.
|
||||
| { type: 'session_archived'; sessionId: string }
|
||||
// P11 — un réglage a changé (PATCH /settings) : on diffuse le snapshot non sensible aux abonnés
|
||||
// P11 : un réglage a changé (PATCH /settings) : on diffuse le snapshot non sensible aux abonnés
|
||||
// du topic 'settings' pour que tous les clients (et onglets) se synchronisent sans polling.
|
||||
| { type: 'settings_update'; settings: SettingsBroadcast }
|
||||
// P12 — progression/fin/erreur d'un clone, poussé aux abonnés du topic 'clones'. L'état complet
|
||||
// P12 : progression/fin/erreur d'un clone, poussé aux abonnés du topic 'clones'. L'état complet
|
||||
// (state) discrimine progress/done/error en un seul message.
|
||||
| { type: 'clone_update'; operation: CloneOperation }
|
||||
| { type: 'repo_update'; repo: RepoSummary }
|
||||
| { type: 'repo_removed'; repoId: string }
|
||||
| { type: 'worktree_update'; repoId: string; worktree: WorktreeSummary }
|
||||
| { type: 'worktree_removed'; repoId: string; path: string }
|
||||
// P7 — signal léger « le détail (diff/fichiers modifiés) de ce worktree a changé, refais un
|
||||
// P7 : signal léger « le détail (diff/fichiers modifiés) de ce worktree a changé, refais un
|
||||
// GET /changes ou /diff ». Envoyé UNIQUEMENT aux connexions ayant `watch`é cette clé. On ne
|
||||
// pousse pas le diff complet dans la frame (taille/flow control) : le client re-fetch en REST.
|
||||
| { type: 'worktree_changes'; repoId: string; path: string }
|
||||
|
||||
@@ -69,7 +69,7 @@ function assertInvariants(msg: ClientMessage): void {
|
||||
}
|
||||
}
|
||||
|
||||
describe('parseClientMessage — cas valides', () => {
|
||||
describe('parseClientMessage · cas valides', () => {
|
||||
it('hello', () => {
|
||||
expect(parseClientMessage('{"type":"hello","protocol":1}')).toEqual({ type: 'hello', protocol: 1 });
|
||||
});
|
||||
@@ -144,7 +144,7 @@ describe('parseClientMessage — cas valides', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseClientMessage — cas malformés', () => {
|
||||
describe('parseClientMessage · cas malformés', () => {
|
||||
it('JSON invalide ou non-objet', () => {
|
||||
for (const raw of ['', 'not json', '{', '42', '"str"', 'null', 'true', '[]', '[1,2]']) {
|
||||
expect(parseClientMessage(raw)).toBeNull();
|
||||
@@ -218,7 +218,7 @@ describe('parseClientMessage — cas malformés', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseClientMessage — fuzz rapide', () => {
|
||||
describe('parseClientMessage · fuzz rapide', () => {
|
||||
it('ne lève jamais et tout message accepté respecte les invariants', () => {
|
||||
const rand = mulberry32(0xa5b0e7);
|
||||
const types = ['hello', 'attach', 'detach', 'stdin', 'answer', 'resize', 'ack', 'sub', 'ping', 'unknown', '', 'HELLO', 42, null];
|
||||
|
||||
@@ -6,31 +6,31 @@
|
||||
<meta name="color-scheme" content="dark" />
|
||||
<meta name="theme-color" content="#09090b" />
|
||||
|
||||
<title>Arboretum — Mission control for your AI coding agents</title>
|
||||
<title>Arboretum · Mission control for your AI coding agents</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Arboretum is a local-first daemon you launch with npx that serves a web IDE to run and supervise many Claude Code sessions across git worktrees — edit files, diff, stage and commit, connect git services, all from any device, even your phone."
|
||||
content="Arboretum is a local-first daemon you launch with npx that serves a web IDE to run and supervise many Claude Code sessions across git worktrees: edit files, diff, stage and commit, connect git services, all from any device, even your phone."
|
||||
/>
|
||||
<link rel="canonical" href="https://git-arboretum.com/" />
|
||||
|
||||
<!-- Open Graph / Twitter -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="https://git-arboretum.com/" />
|
||||
<meta property="og:title" content="Arboretum — Mission control for your AI coding agents" />
|
||||
<meta property="og:title" content="Arboretum · Mission control for your AI coding agents" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="Run and supervise many Claude Code sessions across every git worktree — a browser IDE to edit, diff, commit and clone, from any device, even your phone."
|
||||
content="Run and supervise many Claude Code sessions across every git worktree: a browser IDE to edit, diff, commit and clone, from any device, even your phone."
|
||||
/>
|
||||
<meta property="og:site_name" content="Arboretum" />
|
||||
<meta property="og:image" content="https://git-arboretum.com/assets/og-cover.png" />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
<meta property="og:image:alt" content="Arboretum — mission control for your AI coding agents" />
|
||||
<meta property="og:image:alt" content="Arboretum · mission control for your AI coding agents" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content="Arboretum — Mission control for your AI coding agents" />
|
||||
<meta name="twitter:title" content="Arboretum · Mission control for your AI coding agents" />
|
||||
<meta
|
||||
name="twitter:description"
|
||||
content="Run and supervise many Claude Code sessions across every git worktree — a browser IDE to edit, diff, commit and clone, from any device, even your phone."
|
||||
content="Run and supervise many Claude Code sessions across every git worktree: a browser IDE to edit, diff, commit and clone, from any device, even your phone."
|
||||
/>
|
||||
<meta name="twitter:image" content="https://git-arboretum.com/assets/og-cover.png" />
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<div id="app"></div>
|
||||
<noscript>
|
||||
<div style="padding: 24px; font-family: system-ui, sans-serif; color: #f4f4f5; text-align: center">
|
||||
Arboretum — mission control for your AI coding agents.
|
||||
Arboretum · mission control for your AI coding agents.
|
||||
<a href="https://git.lidge.fr/johanleroy/arboretum" style="color: #34d399">View on Gitea</a>.
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# git-arboretum.com — site vitrine statique (Vue 3 / Vite).
|
||||
# git-arboretum.com : site vitrine statique (Vue 3 / Vite).
|
||||
#
|
||||
# Google PageSpeed (mod_pagespeed) renvoie un corps HTML VIDE sur ce domaine Plesk
|
||||
# (la home répond 200 mais 0 octet → page blanche), alors que les assets statiques
|
||||
|
||||
@@ -26,7 +26,7 @@ watch(
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
// Grain de fond + halo emerald (décoratifs) — portés tels quels du design.
|
||||
// Grain de fond + halo emerald (décoratifs) : portés tels quels du design.
|
||||
const grainStyle = {
|
||||
position: 'fixed',
|
||||
inset: '0',
|
||||
|
||||
@@ -21,7 +21,7 @@ const { t } = useI18n();
|
||||
style="filter: grayscale(1) brightness(1.5); opacity: 0.4"
|
||||
/>
|
||||
<span class="font-mono text-sm text-zinc-300">git-arboretum.com</span>
|
||||
<span class="ml-1 text-[13px] text-zinc-600">— {{ t('footTag') }}</span>
|
||||
<span class="ml-1 text-[13px] text-zinc-600">· {{ t('footTag') }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-[22px] text-sm">
|
||||
<a :href="REPO" target="_blank" rel="noopener" class="inline-flex items-center gap-1.5 text-zinc-400 no-underline transition-colors hover:text-emerald-400">
|
||||
|
||||
@@ -34,7 +34,7 @@ const { t } = useI18n();
|
||||
</template>
|
||||
<span class="text-sky-300">{{ t('busy') }}</span> ·
|
||||
<span class="text-amber-300">{{ t('waiting') }}</span> ·
|
||||
<span class="text-emerald-400">{{ t('idle') }}</span> — {{ t('feat3Desc') }}
|
||||
<span class="text-emerald-400">{{ t('idle') }}</span> · {{ t('feat3Desc') }}
|
||||
</FeatureCard>
|
||||
|
||||
<FeatureCard :title="t('feat4Title')">
|
||||
|
||||
@@ -35,7 +35,7 @@ const termLines = computed(() =>
|
||||
anim.value.lines.map((l) => ({ text: l.text, color: LINE_COLORS[l.k] ?? '#d4d4d8' })),
|
||||
);
|
||||
|
||||
// Options du dialogue de permission — reproduit DialogPrompt (boutons numérotés + Deny).
|
||||
// Options du dialogue de permission : reproduit DialogPrompt (boutons numérotés + Deny).
|
||||
const dlgOptions = computed(() =>
|
||||
DLG_OPTS[locale.value as AppLocale].map((txt, i) => ({
|
||||
num: anim.value.ans === i ? '✓' : String(i + 1),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Listes structurées (FAQ, options de dialogue) — gardées hors des messages
|
||||
// Listes structurées (FAQ, options de dialogue) : gardées hors des messages
|
||||
// vue-i18n et indexées par locale, pour rester du texte pur typé (pas d'innerHTML).
|
||||
import type { AppLocale } from './index';
|
||||
|
||||
@@ -11,7 +11,7 @@ export const FAQS: Record<AppLocale, FaqItem[]> = {
|
||||
en: [
|
||||
{
|
||||
q: 'How is this different from running Claude Code in a terminal?',
|
||||
a: 'It runs the very same interactive claude CLI — Arboretum just wraps it in a managed terminal you reach from a browser. What you gain on top: a worktree-first dashboard across all your repos, live busy / waiting / available states, a multi-terminal grid, push notifications, and the ability to answer a prompt from your phone. It supervises your sessions; it does not change how Claude Code works.',
|
||||
a: 'It runs the very same interactive claude CLI. Arboretum just wraps it in a managed terminal you reach from a browser. What you gain on top: a worktree-first dashboard across all your repos, live busy / waiting / available states, a multi-terminal grid, push notifications, and the ability to answer a prompt from your phone. It supervises your sessions; it does not change how Claude Code works.',
|
||||
},
|
||||
{
|
||||
q: 'Does it need the cloud?',
|
||||
@@ -19,7 +19,7 @@ export const FAQS: Record<AppLocale, FaqItem[]> = {
|
||||
},
|
||||
{
|
||||
q: 'How do I access it remotely?',
|
||||
a: 'Through Tailscale Serve. Expose the dashboard to your tailnet and reach it securely from any device — no port forwarding, no public endpoint.',
|
||||
a: 'Through Tailscale Serve. Expose the dashboard to your tailnet and reach it securely from any device: no port forwarding, no public endpoint.',
|
||||
},
|
||||
{
|
||||
q: 'Does it work on mobile?',
|
||||
@@ -31,11 +31,11 @@ export const FAQS: Record<AppLocale, FaqItem[]> = {
|
||||
},
|
||||
{
|
||||
q: 'Can I edit files directly?',
|
||||
a: 'Yes. The /workspace view is a real IDE: a file tree, a full Monaco editor with inline diffs, and the correlated session terminal. Stage changes file by file, write a commit message, amend, then push — all from the browser, on any device.',
|
||||
a: 'Yes. The /workspace view is a real IDE: a file tree, a full Monaco editor with inline diffs, and the correlated session terminal. Stage changes file by file, write a commit message, amend, then push, all from the browser, on any device.',
|
||||
},
|
||||
{
|
||||
q: 'Can I connect GitHub, GitLab or Gitea and clone?',
|
||||
a: 'Yes. Add a connection with a personal access token or app password — credentials are encrypted at rest (AES-256-GCM) and never returned in clear by the API. Then browse remote repos and clone over HTTPS with live progress.',
|
||||
a: 'Yes. Add a connection with a personal access token or app password. Credentials are encrypted at rest (AES-256-GCM) and never returned in clear by the API. Then browse remote repos and clone over HTTPS with live progress.',
|
||||
},
|
||||
{
|
||||
q: 'What happens to old sessions?',
|
||||
@@ -45,7 +45,7 @@ export const FAQS: Record<AppLocale, FaqItem[]> = {
|
||||
fr: [
|
||||
{
|
||||
q: 'En quoi est-ce différent de lancer Claude Code dans un terminal ?',
|
||||
a: "C'est exactement le même CLI claude interactif — Arboretum l'enveloppe simplement dans un terminal managé accessible depuis un navigateur. Ce que vous gagnez en plus : un dashboard worktree-first sur tous vos repos, les états occupée / en attente / disponible en direct, une grille multi-terminaux, des notifications push, et la possibilité de répondre à une question depuis votre téléphone. Il supervise vos sessions ; il ne change rien au fonctionnement de Claude Code.",
|
||||
a: "C'est exactement le même CLI claude interactif. Arboretum l'enveloppe simplement dans un terminal managé accessible depuis un navigateur. Ce que vous gagnez en plus : un dashboard worktree-first sur tous vos repos, les états occupée / en attente / disponible en direct, une grille multi-terminaux, des notifications push, et la possibilité de répondre à une question depuis votre téléphone. Il supervise vos sessions ; il ne change rien au fonctionnement de Claude Code.",
|
||||
},
|
||||
{
|
||||
q: 'A-t-il besoin du cloud ?',
|
||||
@@ -53,7 +53,7 @@ export const FAQS: Record<AppLocale, FaqItem[]> = {
|
||||
},
|
||||
{
|
||||
q: 'Comment y accéder à distance ?',
|
||||
a: "Via Tailscale Serve. Exposez le dashboard à votre tailnet et accédez-y en sécurité depuis n'importe quel appareil — sans redirection de port ni endpoint public.",
|
||||
a: "Via Tailscale Serve. Exposez le dashboard à votre tailnet et accédez-y en sécurité depuis n'importe quel appareil : sans redirection de port ni endpoint public.",
|
||||
},
|
||||
{
|
||||
q: 'Fonctionne-t-il sur mobile ?',
|
||||
@@ -65,11 +65,11 @@ export const FAQS: Record<AppLocale, FaqItem[]> = {
|
||||
},
|
||||
{
|
||||
q: 'Puis-je éditer les fichiers directement ?',
|
||||
a: "Oui. La vue /workspace est un vrai IDE : un arbre de fichiers, un éditeur Monaco complet avec les diffs inline, et le terminal de la session corrélée. Indexez les changements fichier par fichier, rédigez un message de commit, amendez, puis poussez — le tout depuis le navigateur, sur n'importe quel appareil.",
|
||||
a: "Oui. La vue /workspace est un vrai IDE : un arbre de fichiers, un éditeur Monaco complet avec les diffs inline, et le terminal de la session corrélée. Indexez les changements fichier par fichier, rédigez un message de commit, amendez, puis poussez, le tout depuis le navigateur, sur n'importe quel appareil.",
|
||||
},
|
||||
{
|
||||
q: 'Puis-je connecter GitHub, GitLab ou Gitea et cloner ?',
|
||||
a: "Oui. Ajoutez une connexion avec un token d'accès personnel ou un app password — les identifiants sont chiffrés au repos (AES-256-GCM) et jamais renvoyés en clair par l'API. Parcourez ensuite les repos distants et clonez en HTTPS avec progression en direct.",
|
||||
a: "Oui. Ajoutez une connexion avec un token d'accès personnel ou un app password. Les identifiants sont chiffrés au repos (AES-256-GCM) et jamais renvoyés en clair par l'API. Parcourez ensuite les repos distants et clonez en HTTPS avec progression en direct.",
|
||||
},
|
||||
{
|
||||
q: "Qu'advient-il des anciennes sessions ?",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Messages EN — copie fidèle du dict() du design Arboretum.dc.html.
|
||||
// Messages EN : copie fidèle du dict() du design Arboretum.dc.html.
|
||||
export default {
|
||||
navFeatures: 'Features',
|
||||
navWorkspace: 'Workspace',
|
||||
@@ -9,16 +9,16 @@ export default {
|
||||
heroBadge: 'Mission control for AI coding agents',
|
||||
heroTitle: 'Mission control for your AI coding agents',
|
||||
heroSub:
|
||||
'Run many Claude Code sessions across every git worktree — and supervise them from any device, even your phone.',
|
||||
'Run many Claude Code sessions across every git worktree, and supervise them from any device, even your phone.',
|
||||
getStarted: 'Get started',
|
||||
probKicker: 'The problem',
|
||||
probTitle: "Many agents across worktrees is chaos — and you're chained to one terminal.",
|
||||
probTitle: "Many agents across worktrees is chaos, and you're chained to one terminal.",
|
||||
probBody:
|
||||
'Sessions scattered across tabs. No idea which agent is waiting on you. Step away from the desk and everything stalls. Arboretum is the single pane of glass.',
|
||||
featKicker: 'Everything in one view',
|
||||
featTitle: 'Built to supervise agents working in parallel',
|
||||
feat1Title: 'Worktree-first',
|
||||
feat1Desc: 'Work on your main branch or spin up an isolated worktree — then commit, push or promote a branch to main, without opening a terminal. Branches, not chaos.',
|
||||
feat1Desc: 'Work on your main branch or spin up an isolated worktree, then commit, push or promote a branch to main, without opening a terminal. Branches, not chaos.',
|
||||
feat2Title: 'Many sessions, one view',
|
||||
feat2Desc: 'Run parallel Claude Code agents side by side in a single live grid.',
|
||||
feat3Title: 'Fine-grained states',
|
||||
@@ -38,22 +38,22 @@ export default {
|
||||
feat10Title: 'New project in one click',
|
||||
feat10Desc: 'Create a project folder anywhere (optional git init) and start a Claude session in it, from any device.',
|
||||
scAKicker: 'Worktree-first dashboard',
|
||||
scATitle: 'See what needs you — before anything stalls',
|
||||
scATitle: 'See what needs you, before anything stalls',
|
||||
scABody:
|
||||
'A live list of every worktree and its session state. The Needs attention rail floats the agents waiting on a decision to the top, so nothing sits blocked while you are heads-down elsewhere. Commit, push or promote a branch to main straight from the card, and hide the noisy history left by past terminal sessions so the list stays actionable.',
|
||||
scBKicker: 'Multi-terminal grid',
|
||||
scBTitle: "Every agent's output, streaming live",
|
||||
scBBody:
|
||||
'Watch all your sessions at once — real terminal output, color-coded by state, updating in real time. Click any pane to take over in a fullscreen terminal — prompt pinned to the bottom, full scrollback above — answer a prompt, or stop a run.',
|
||||
'Watch all your sessions at once: real terminal output, color-coded by state, updating in real time. Click any pane to take over in a fullscreen terminal (prompt pinned to the bottom, full scrollback above), answer a prompt, or stop a run.',
|
||||
scCKicker: 'On your phone',
|
||||
scCTitle: 'Unblock an agent from the kitchen',
|
||||
scCBody:
|
||||
'Install the PWA and get a Web Push the second a session needs you. Tap the notification, read the prompt, answer the dialog — your agent keeps moving while you are away.',
|
||||
'Install the PWA and get a Web Push the second a session needs you. Tap the notification, read the prompt, answer the dialog. Your agent keeps moving while you are away.',
|
||||
grpHub: '1 session',
|
||||
grpKicker: 'Work groups · cross-repo',
|
||||
grpTitle: 'Drive every repo from one Claude session',
|
||||
grpBody:
|
||||
'Group the repos that move together — a service, its client, its docs. Launch a single Claude session that spans all of them at once: one conversation, one shared context working across every repo — instead of juggling one agent per repo.',
|
||||
'Group the repos that move together: a service, its client, its docs. Launch a single Claude session that spans all of them at once: one conversation, one shared context working across every repo, instead of juggling one agent per repo.',
|
||||
howKicker: 'How it works',
|
||||
howTitle: 'Zero install. Three steps.',
|
||||
step1Title: 'Launch the daemon',
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
step3Desc: 'Start Claude Code sessions on your main branch or any worktree, and watch them from anywhere.',
|
||||
secKicker: 'Security',
|
||||
secTitle: 'A web terminal you can actually trust',
|
||||
secIntro: 'Built local-first. Nothing is exposed unless you choose to — and even then, on your terms.',
|
||||
secIntro: 'Built local-first. Nothing is exposed unless you choose to, and even then, on your terms.',
|
||||
sec1Title: 'Localhost by default',
|
||||
sec1Desc: 'Binds to 127.0.0.1. Nothing leaves your machine unless you say so.',
|
||||
sec2Title: 'Hashed tokens',
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
sec3Title: 'Strict origin checks',
|
||||
sec3Desc: 'Every request is origin-validated. No cross-site surprises.',
|
||||
sec4Title: 'Remote via Tailscale',
|
||||
sec4Desc: 'Reach it over Tailscale Serve — no public port, no port forwarding.',
|
||||
sec4Desc: 'Reach it over Tailscale Serve: no public port, no port forwarding.',
|
||||
faqTitle: 'Questions, answered',
|
||||
ctaTitle: 'Take command of your agents',
|
||||
ctaBody: 'One command to launch. Supervise everything from one place.',
|
||||
@@ -110,21 +110,21 @@ export default {
|
||||
|
||||
// New feature cards (P7→P12: IDE worktree)
|
||||
feat11Title: 'A real IDE for every worktree',
|
||||
feat11Desc: 'Browse the file tree, edit in a full Monaco editor, and read changes as inline diffs — all in the /workspace view.',
|
||||
feat11Desc: 'Browse the file tree, edit in a full Monaco editor, and read changes as inline diffs, all in the /workspace view.',
|
||||
feat12Title: 'Diff & selective staging',
|
||||
feat12Desc: 'Stage, unstage or discard file by file, then commit (all or staged), amend, fetch and pull — without leaving the dashboard.',
|
||||
feat12Desc: 'Stage, unstage or discard file by file, then commit (all or staged), amend, fetch and pull, without leaving the dashboard.',
|
||||
feat13Title: 'Remote git services',
|
||||
feat13Desc: 'Connect GitHub, GitLab or Gitea with a PAT or app password — credentials encrypted at rest — and clone over HTTPS with live progress.',
|
||||
feat13Desc: 'Connect GitHub, GitLab or Gitea with a PAT or app password (credentials encrypted at rest) and clone over HTTPS with live progress.',
|
||||
feat14Title: 'Auto-archive sessions',
|
||||
feat14Desc: 'Finished sessions are archived automatically after a configurable retention window (30 days by default), keeping the list clean.',
|
||||
feat15Title: 'Real-time file sync',
|
||||
feat15Desc: 'A filesystem watcher streams changes the moment a file moves on disk — diffs and status update live, no refresh needed.',
|
||||
feat15Desc: 'A filesystem watcher streams changes the moment a file moves on disk: diffs and status update live, no refresh needed.',
|
||||
|
||||
// Workspace IDE showcase
|
||||
wsKicker: 'The worktree IDE',
|
||||
wsTitle: 'A full IDE for every worktree, in the browser',
|
||||
wsBody:
|
||||
'Open any worktree in /workspace: a file tree on the left, a Monaco editor and inline diff in the center, and the correlated session terminal on the right. Stage changes file by file, write a commit message, push — all without leaving the page, on any device.',
|
||||
'Open any worktree in /workspace: a file tree on the left, a Monaco editor and inline diff in the center, and the correlated session terminal on the right. Stage changes file by file, write a commit message, push, all without leaving the page, on any device.',
|
||||
wsEditor: 'Editor',
|
||||
wsDiff: 'Diff',
|
||||
wsFiles: 'Files',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Messages FR — copie fidèle du dict() du design Arboretum.dc.html.
|
||||
// Messages FR : copie fidèle du dict() du design Arboretum.dc.html.
|
||||
export default {
|
||||
navFeatures: 'Fonctionnalités',
|
||||
navWorkspace: 'Workspace',
|
||||
@@ -9,16 +9,16 @@ export default {
|
||||
heroBadge: 'Poste de commandement pour agents de code IA',
|
||||
heroTitle: 'Le poste de commandement de vos agents de code IA',
|
||||
heroSub:
|
||||
"Lancez plusieurs sessions Claude Code à travers chaque worktree git — et supervisez-les depuis n'importe quel appareil, même votre téléphone.",
|
||||
"Lancez plusieurs sessions Claude Code à travers chaque worktree git, et supervisez-les depuis n'importe quel appareil, même votre téléphone.",
|
||||
getStarted: 'Commencer',
|
||||
probKicker: 'Le problème',
|
||||
probTitle: "Plein d'agents à travers les worktrees, c'est le chaos — et vous êtes cloué à un seul terminal.",
|
||||
probTitle: "Plein d'agents à travers les worktrees, c'est le chaos, et vous êtes cloué à un seul terminal.",
|
||||
probBody:
|
||||
"Des sessions éparpillées dans des onglets. Aucune idée de quel agent vous attend. Vous quittez le bureau et tout se fige. Arboretum, c'est la vitre unique.",
|
||||
featKicker: 'Tout dans une seule vue',
|
||||
featTitle: 'Conçu pour superviser des agents qui travaillent en parallèle',
|
||||
feat1Title: "Worktree d'abord",
|
||||
feat1Desc: 'Travaillez sur votre branche principale ou créez un worktree isolé — puis commitez, poussez ou passez une branche en principal, sans ouvrir de terminal. Des branches, pas du chaos.',
|
||||
feat1Desc: 'Travaillez sur votre branche principale ou créez un worktree isolé, puis commitez, poussez ou passez une branche en principal, sans ouvrir de terminal. Des branches, pas du chaos.',
|
||||
feat2Title: 'Plusieurs sessions, une vue',
|
||||
feat2Desc: 'Lancez des agents Claude Code en parallèle, côte à côte dans une seule grille en direct.',
|
||||
feat3Title: 'États fins',
|
||||
@@ -38,22 +38,22 @@ export default {
|
||||
feat10Title: 'Nouveau projet en un clic',
|
||||
feat10Desc: "Créez un dossier de projet où vous voulez (git init optionnel) et lancez-y une session Claude, depuis n'importe quel appareil.",
|
||||
scAKicker: 'Dashboard worktree-first',
|
||||
scATitle: 'Voyez ce qui vous attend — avant que ça ne bloque',
|
||||
scATitle: 'Voyez ce qui vous attend, avant que ça ne bloque',
|
||||
scABody:
|
||||
"Une liste en direct de chaque worktree et de l'état de sa session. Le bandeau À traiter fait remonter les agents en attente d'une décision, pour que rien ne reste bloqué pendant que vous êtes concentré ailleurs. Commitez, poussez ou passez une branche en principal directement depuis la carte, et masquez l'historique encombrant laissé par vos anciennes sessions terminal pour garder la liste actionnable.",
|
||||
scBKicker: 'Grille multi-terminaux',
|
||||
scBTitle: 'La sortie de chaque agent, en direct',
|
||||
scBBody:
|
||||
"Surveillez toutes vos sessions en même temps — vraie sortie terminal, couleur selon l'état, mise à jour en temps réel. Cliquez sur un panneau pour reprendre la main dans un terminal plein écran — invite ancrée en bas, historique défilable au-dessus — répondre, ou arrêter une exécution.",
|
||||
"Surveillez toutes vos sessions en même temps : vraie sortie terminal, couleur selon l'état, mise à jour en temps réel. Cliquez sur un panneau pour reprendre la main dans un terminal plein écran (invite ancrée en bas, historique défilable au-dessus), répondre, ou arrêter une exécution.",
|
||||
scCKicker: 'Sur votre téléphone',
|
||||
scCTitle: 'Débloquez un agent depuis la cuisine',
|
||||
scCBody:
|
||||
"Installez la PWA et recevez un Web Push dès qu'une session a besoin de vous. Touchez la notification, lisez la question, répondez au dialogue — votre agent continue pendant que vous êtes loin du bureau.",
|
||||
"Installez la PWA et recevez un Web Push dès qu'une session a besoin de vous. Touchez la notification, lisez la question, répondez au dialogue. Votre agent continue pendant que vous êtes loin du bureau.",
|
||||
grpHub: '1 session',
|
||||
grpKicker: 'Work groups · cross-repo',
|
||||
grpTitle: 'Pilotez tous vos repos depuis une seule session Claude',
|
||||
grpBody:
|
||||
'Regroupez les repos qui avancent ensemble — un service, son client, sa doc. Lancez une seule session Claude qui les couvre tous à la fois : une conversation, un contexte partagé travaillant à travers chaque repo — au lieu de jongler avec un agent par repo.',
|
||||
'Regroupez les repos qui avancent ensemble : un service, son client, sa doc. Lancez une seule session Claude qui les couvre tous à la fois : une conversation, un contexte partagé travaillant à travers chaque repo, au lieu de jongler avec un agent par repo.',
|
||||
howKicker: 'Comment ça marche',
|
||||
howTitle: 'Zéro install. Trois étapes.',
|
||||
step1Title: 'Lancez le daemon',
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
step3Desc: "Démarrez des sessions Claude Code sur votre branche principale ou n'importe quel worktree, et surveillez-les de partout.",
|
||||
secKicker: 'Sécurité',
|
||||
secTitle: 'Un terminal web en qui vous pouvez avoir confiance',
|
||||
secIntro: "Conçu local-first. Rien n'est exposé sauf si vous le décidez — et toujours selon vos règles.",
|
||||
secIntro: "Conçu local-first. Rien n'est exposé sauf si vous le décidez, et toujours selon vos règles.",
|
||||
sec1Title: 'Localhost par défaut',
|
||||
sec1Desc: 'Se lie à 127.0.0.1. Rien ne quitte votre machine sans votre accord.',
|
||||
sec2Title: 'Tokens hashés',
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
sec3Title: "Vérification d'origine stricte",
|
||||
sec3Desc: 'Chaque requête est validée par origine. Pas de surprise cross-site.',
|
||||
sec4Title: 'Distant via Tailscale',
|
||||
sec4Desc: 'Accédez-y via Tailscale Serve — aucun port public, aucune redirection de port.',
|
||||
sec4Desc: 'Accédez-y via Tailscale Serve : aucun port public, aucune redirection de port.',
|
||||
faqTitle: 'Vos questions, les réponses',
|
||||
ctaTitle: 'Prenez le commandement de vos agents',
|
||||
ctaBody: 'Une commande pour lancer. Tout superviser depuis un seul endroit.',
|
||||
@@ -110,21 +110,21 @@ export default {
|
||||
|
||||
// Nouvelles cartes de fonctionnalités (P7→P12 : IDE worktree)
|
||||
feat11Title: 'Un vrai IDE pour chaque worktree',
|
||||
feat11Desc: "Parcourez l'arbre de fichiers, éditez dans un éditeur Monaco complet, et lisez les changements en diff inline — le tout dans la vue /workspace.",
|
||||
feat11Desc: "Parcourez l'arbre de fichiers, éditez dans un éditeur Monaco complet, et lisez les changements en diff inline, le tout dans la vue /workspace.",
|
||||
feat12Title: 'Diff & staging sélectif',
|
||||
feat12Desc: 'Indexez, désindexez ou annulez fichier par fichier, puis commitez (tout ou indexé), amendez, fetchez et pullez — sans quitter le dashboard.',
|
||||
feat12Desc: 'Indexez, désindexez ou annulez fichier par fichier, puis commitez (tout ou indexé), amendez, fetchez et pullez, sans quitter le dashboard.',
|
||||
feat13Title: 'Services git distants',
|
||||
feat13Desc: 'Connectez GitHub, GitLab ou Gitea avec un PAT ou un app password — identifiants chiffrés au repos — et clonez en HTTPS avec progression en direct.',
|
||||
feat13Desc: 'Connectez GitHub, GitLab ou Gitea avec un PAT ou un app password (identifiants chiffrés au repos) et clonez en HTTPS avec progression en direct.',
|
||||
feat14Title: 'Archivage auto des sessions',
|
||||
feat14Desc: 'Les sessions terminées sont archivées automatiquement après une rétention configurable (30 jours par défaut), pour garder la liste propre.',
|
||||
feat15Title: 'Synchro fichiers temps réel',
|
||||
feat15Desc: "Un watcher du système de fichiers pousse les changements dès qu'un fichier bouge sur le disque — diffs et statut se mettent à jour en direct, sans rafraîchir.",
|
||||
feat15Desc: "Un watcher du système de fichiers pousse les changements dès qu'un fichier bouge sur le disque : diffs et statut se mettent à jour en direct, sans rafraîchir.",
|
||||
|
||||
// Showcase IDE workspace
|
||||
wsKicker: "L'IDE worktree",
|
||||
wsTitle: 'Un IDE complet pour chaque worktree, dans le navigateur',
|
||||
wsBody:
|
||||
"Ouvrez n'importe quel worktree dans /workspace : un arbre de fichiers à gauche, un éditeur Monaco et le diff inline au centre, et le terminal de la session corrélée à droite. Indexez les changements fichier par fichier, rédigez un message de commit, poussez — sans quitter la page, depuis n'importe quel appareil.",
|
||||
"Ouvrez n'importe quel worktree dans /workspace : un arbre de fichiers à gauche, un éditeur Monaco et le diff inline au centre, et le terminal de la session corrélée à droite. Indexez les changements fichier par fichier, rédigez un message de commit, poussez, sans quitter la page, depuis n'importe quel appareil.",
|
||||
wsEditor: 'Éditeur',
|
||||
wsDiff: 'Diff',
|
||||
wsFiles: 'Fichiers',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// URLs externes du site vitrine — source unique de vérité.
|
||||
// URLs externes du site vitrine : source unique de vérité.
|
||||
// Le dépôt Gitea est « arboretum » (et non « git-arboretum », qui est le nom du
|
||||
// paquet npm `@johanleroy/git-arboretum`). Centralisé ici pour ne plus dériver.
|
||||
export const REPO = 'https://git.lidge.fr/johanleroy/arboretum';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createApp } from 'vue';
|
||||
// Polices self-host (subset latin) — bundlées par Vite, aucune requête Google Fonts.
|
||||
// Polices self-host (subset latin) : bundlées par Vite, aucune requête Google Fonts.
|
||||
import '@fontsource/jetbrains-mono/latin-400.css';
|
||||
import '@fontsource/jetbrains-mono/latin-500.css';
|
||||
import '@fontsource/jetbrains-mono/latin-600.css';
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
## 0.2.0
|
||||
|
||||
Follows the daemon's "worktree IDE" milestone (P7→P12), while keeping the extension a lightweight
|
||||
**visual worktree manager** — no editor/diff duplicated here, that lives in the web IDE:
|
||||
**visual worktree manager**: no editor/diff duplicated here, that lives in the web IDE:
|
||||
|
||||
- **Detailed git status** in the worktree tree: staged / unstaged / conflict counts and the last commit
|
||||
subject (from the daemon's enriched `WorktreeGitStatus`).
|
||||
- **Open Worktree IDE** command — deep-links to the web `/workspace/:repoId/:wt` view.
|
||||
- **Open Worktree IDE** command: deep-links to the web `/workspace/:repoId/:wt` view.
|
||||
- **Fetch** and **Pull** (fast-forward only or rebase) commands on worktrees, alongside commit/push.
|
||||
- **Archived sessions**: the `session_archived` event is handled live; finished, auto-archived sessions
|
||||
are badged and hidden by default, with a new `arboretum.showArchivedSessions` setting to reveal them.
|
||||
|
||||
## 0.1.0
|
||||
|
||||
Initial release — native VS Code integration for the Arboretum daemon:
|
||||
Initial release: native VS Code integration for the Arboretum daemon:
|
||||
|
||||
- Real-time **Repositories** and **Groups** trees (repos → worktrees → sessions) over the daemon WebSocket.
|
||||
- **Native terminals** (`Pseudoterminal`) to attach/observe any session, reusing VS Code's rendering and
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
# Arboretum for VS Code
|
||||
|
||||
Pilot your git **worktrees** and **Claude Code sessions** from inside VS Code — a real native
|
||||
Pilot your git **worktrees** and **Claude Code sessions** from inside VS Code: a real native
|
||||
integration on top of the [Arboretum](https://git.lidge.fr/johanleroy/arboretum) daemon, not a webview.
|
||||
|
||||
- **Live tree** of Repositories → Worktrees → Sessions (and a Groups view), updated in real time over
|
||||
the daemon's WebSocket.
|
||||
- **Native terminals**: attach to any session in a real VS Code terminal (a `Pseudoterminal` bridges the
|
||||
daemon's PTY) — you get VS Code's own rendering, scrollback, copy/paste and links for free.
|
||||
daemon's PTY): you get VS Code's own rendering, scrollback, copy/paste and links for free.
|
||||
- **Waiting alerts**: a status-bar counter and native notifications when a Claude session is waiting for
|
||||
input — answer **Yes/No** without even opening the terminal (uses the daemon's `answer` command).
|
||||
- **Git mutations** from the tree: create worktree, commit, push, fetch, pull, promote to main — with a
|
||||
input: answer **Yes/No** without even opening the terminal (uses the daemon's `answer` command).
|
||||
- **Git mutations** from the tree: create worktree, commit, push, fetch, pull, promote to main, with a
|
||||
**detailed git status** on each worktree (staged / unstaged / conflicts and the last commit subject).
|
||||
- **Open Worktree IDE**: jump from any worktree to its full `/workspace` view (file tree, Monaco editor,
|
||||
inline diffs, integrated terminal) in the browser. The extension stays a lightweight visual worktree
|
||||
manager — the heavy editing lives in the web IDE.
|
||||
manager: the heavy editing lives in the web IDE.
|
||||
- **Workspace-aware**: the worktree matching your open folder is highlighted; start a session or create a
|
||||
worktree for the current folder in one command.
|
||||
|
||||
## Requirements
|
||||
|
||||
- A running Arboretum daemon (`npx @johanleroy/git-arboretum`, or installed as a user service via
|
||||
`arboretum install`). The extension is a **client** — it does not start the daemon.
|
||||
`arboretum install`). The extension is a **client**: it does not start the daemon.
|
||||
- An access token. The bootstrap token is printed once on first daemon start; you can also create one in
|
||||
the Arboretum dashboard (**Settings → Tokens**).
|
||||
|
||||
@@ -41,7 +41,7 @@ integration on top of the [Arboretum](https://git.lidge.fr/johanleroy/arboretum)
|
||||
| `arboretum.notifyOnWaiting` | `true` | Native notification when a session starts waiting for input. |
|
||||
|
||||
The extension authenticates with `Authorization: Bearer <token>` on both REST and the WebSocket upgrade.
|
||||
For remote access, point `arboretum.url` at your Tailscale Serve URL (`https://…`) — the WebSocket is
|
||||
For remote access, point `arboretum.url` at your Tailscale Serve URL (`https://…`): the WebSocket is
|
||||
derived automatically (`wss://`).
|
||||
|
||||
## Building & packaging (private VSIX)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "git-arboretum",
|
||||
"displayName": "Arboretum",
|
||||
"description": "Pilot your git worktrees and Claude Code sessions from VS Code — native terminals, live tree, waiting alerts.",
|
||||
"description": "Pilot your git worktrees and Claude Code sessions from VS Code: native terminals, live tree, waiting alerts.",
|
||||
"version": "0.2.0",
|
||||
"private": true,
|
||||
"publisher": "johanleroy",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Client REST typé du daemon Arboretum — module pur (pas d'import vscode), testable.
|
||||
// Client REST typé du daemon Arboretum : module pur (pas d'import vscode), testable.
|
||||
// Auth par en-tête `Authorization: Bearer <token>` (le hook preValidation du serveur l'accepte
|
||||
// au même titre que le cookie). Un client Node n'envoie pas d'en-tête Origin → il passe le check
|
||||
// Origin strict côté serveur. Réutilise les types de `@arboretum/shared`.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Client WebSocket multiplexé Node — portage du client web (packages/web/src/lib/ws-client.ts).
|
||||
// Client WebSocket multiplexé Node : portage du client web (packages/web/src/lib/ws-client.ts).
|
||||
// UNE connexion, plusieurs canaux ; handshake hello/hello_ok, sub des topics, corrélation FIFO des
|
||||
// 'attached', flow control par ACK (cumul d'octets PAR CANAL, remis à 0 à chaque RESYNC), reconnexion
|
||||
// avec backoff. Différences vs web :
|
||||
@@ -39,7 +39,7 @@ export interface AttachOptions {
|
||||
sink: AttachmentSink;
|
||||
}
|
||||
|
||||
/** Transport minimal — abstrait pour les tests ; l'impl par défaut enveloppe `ws`. */
|
||||
/** Transport minimal : abstrait pour les tests ; l'impl par défaut enveloppe `ws`. */
|
||||
export interface RawSocket {
|
||||
send(data: string): void;
|
||||
close(): void;
|
||||
@@ -404,7 +404,7 @@ export class ArbWsClient {
|
||||
return;
|
||||
case 'error': {
|
||||
if (msg.channel !== undefined) {
|
||||
this.opts.log?.(`channel ${msg.channel}: ${msg.code} — ${msg.message}`);
|
||||
this.opts.log?.(`channel ${msg.channel}: ${msg.code}: ${msg.message}`);
|
||||
return;
|
||||
}
|
||||
if ((msg.code === 'NOT_FOUND' || msg.code === 'SESSION_EXITED') && this.awaitingAttached.length > 0) {
|
||||
@@ -420,7 +420,7 @@ export class ArbWsClient {
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.opts.log?.(`${msg.code} — ${msg.message}`);
|
||||
this.opts.log?.(`${msg.code}: ${msg.message}`);
|
||||
return;
|
||||
}
|
||||
case 'pong':
|
||||
|
||||
@@ -42,7 +42,7 @@ async function run(label: string, fn: () => Promise<void>): Promise<void> {
|
||||
await fn();
|
||||
} catch (err) {
|
||||
const msg = err instanceof RestError ? `${err.code}: ${err.message}` : (err as Error).message;
|
||||
void vscode.window.showErrorMessage(`Arboretum — ${label}: ${msg}`);
|
||||
void vscode.window.showErrorMessage(`Arboretum · ${label}: ${msg}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ async function promoteWorktreeFlow(deps: CommandDeps, repoId: string, worktree:
|
||||
return;
|
||||
}
|
||||
const msg = err instanceof RestError ? `${err.code}: ${err.message}` : (err as Error).message;
|
||||
void vscode.window.showErrorMessage(`Arboretum — promote: ${msg}`);
|
||||
void vscode.window.showErrorMessage(`Arboretum · promote: ${msg}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ async function startGroupSessionFlow(deps: CommandDeps, group: GroupSummary): Pr
|
||||
deps.terminals.open(res.session, 'interactive');
|
||||
if (res.skipped.length > 0) {
|
||||
void vscode.window.showWarningMessage(
|
||||
`Arboretum: ${res.skipped.length} repo(s) skipped — ${res.skipped.map((s) => s.reason).join('; ')}`,
|
||||
`Arboretum: ${res.skipped.length} repo(s) skipped: ${res.skipped.map((s) => s.reason).join('; ')}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Lecture des réglages `arboretum.*` — module pur (aucun import vscode) pour rester testable.
|
||||
// Lecture des réglages `arboretum.*` : module pur (aucun import vscode) pour rester testable.
|
||||
// L'extension fournit un `ConfigSnapshot` lu depuis workspace.getConfiguration ; ce module
|
||||
// normalise/dérive les valeurs (notamment l'URL WebSocket à partir de l'URL HTTP).
|
||||
|
||||
@@ -22,7 +22,7 @@ export function wsUrlFromBase(baseUrl: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construit l'URL de la vue IDE web d'un worktree — deep-link vers la route `/workspace/:repoId/:wt`
|
||||
* Construit l'URL de la vue IDE web d'un worktree : deep-link vers la route `/workspace/:repoId/:wt`
|
||||
* (le routeur web est en history mode). `repoId` et le chemin du worktree sont encodés par segment.
|
||||
*/
|
||||
export function workspaceUrl(baseUrl: string, repoId: string, worktreePath: string): string {
|
||||
|
||||
@@ -93,7 +93,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
|
||||
try {
|
||||
await probe.me();
|
||||
} catch (err) {
|
||||
void vscode.window.showErrorMessage(`Arboretum: sign in failed — ${(err as Error).message}`);
|
||||
void vscode.window.showErrorMessage(`Arboretum: sign in failed: ${(err as Error).message}`);
|
||||
return;
|
||||
}
|
||||
await auth.storeToken(token);
|
||||
|
||||
@@ -41,7 +41,7 @@ export class WaitingNotifier implements vscode.Disposable {
|
||||
|
||||
private notify(session: SessionSummary): void {
|
||||
const title = session.title?.trim() || session.command;
|
||||
const detail = session.waitingFor ? ` — ${session.waitingFor}` : '';
|
||||
const detail = session.waitingFor ? ` · ${session.waitingFor}` : '';
|
||||
void vscode.window
|
||||
.showInformationMessage(`Arboretum: "${title}" is waiting for input${detail}`, 'Open Terminal', 'Yes', 'No')
|
||||
.then((choice) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// État mémoire de l'extension — module pur (aucun import vscode), testable.
|
||||
// État mémoire de l'extension : module pur (aucun import vscode), testable.
|
||||
// Seedé via REST au (re)connect, puis patché par les events WS. Émet onDidChange à chaque mutation ;
|
||||
// les arbres / status bar / notifications s'y abonnent. Principe « groupe léger » : on ne corrèle pas
|
||||
// les worktrees aux sessions via la liste embarquée (potentiellement périmée) mais par `cwd`, exactement
|
||||
@@ -194,7 +194,7 @@ export class Store {
|
||||
.sort((a, b) => b.createdAt.localeCompare(a.createdAt));
|
||||
}
|
||||
|
||||
/** sessions en attente d'input (activity === 'waiting') — pour la status bar et les notifications. */
|
||||
/** sessions en attente d'input (activity === 'waiting') : pour la status bar et les notifications. */
|
||||
waitingSessions(): SessionSummary[] {
|
||||
return [...this.sessions.values()].filter((s) => s.live && s.activity === 'waiting');
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Pont d'une session vers un terminal — module pur (aucun import vscode), testable.
|
||||
// Pont d'une session vers un terminal : module pur (aucun import vscode), testable.
|
||||
// Le ws-client remet des octets BRUTS (un chunk PTY peut couper un caractère UTF-8 en frontière de
|
||||
// frame, exactement comme côté web où xterm.write(Uint8Array) gérait le décodage). Ici la cible est
|
||||
// un Pseudoterminal qui veut des `string` → on décode en streaming avec un TextDecoder, et on recrée
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Adaptateur vscode.Pseudoterminal : expose une session Arboretum comme un terminal NATIF de VS Code
|
||||
// (rendu, scrollback, copier/coller, liens gratuits). C'est la pièce maîtresse de l'intégration —
|
||||
// (rendu, scrollback, copier/coller, liens gratuits). C'est la pièce maîtresse de l'intégration :
|
||||
// pas de xterm-in-webview. Le pont WS/décodage vit dans SessionBridge (pur) ; cet adaptateur ne fait
|
||||
// que relier les events Pseudoterminal ↔ bridge.
|
||||
import * as vscode from 'vscode';
|
||||
@@ -45,13 +45,13 @@ export class SessionTerminalManager {
|
||||
},
|
||||
onControlChanged: (controlling) => {
|
||||
if (!controlling && mode === 'interactive') {
|
||||
writeEmitter.fire('\r\n\x1b[33m[arboretum: control lost — now observing]\x1b[0m\r\n');
|
||||
writeEmitter.fire('\r\n\x1b[33m[arboretum: control lost: now observing]\x1b[0m\r\n');
|
||||
}
|
||||
},
|
||||
});
|
||||
this.bridges.set(session.id, bridge);
|
||||
bridge.open(dims?.columns ?? 80, dims?.rows ?? 24).catch((err: Error) => {
|
||||
writeEmitter.fire(`\r\n\x1b[31m[arboretum: cannot attach — ${err.message}]\x1b[0m\r\n`);
|
||||
writeEmitter.fire(`\r\n\x1b[31m[arboretum: cannot attach: ${err.message}]\x1b[0m\r\n`);
|
||||
closeEmitter.fire();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -94,12 +94,12 @@ function sessionDescription(s: SessionSummary): string {
|
||||
if (s.archived) parts.push('archived');
|
||||
if (s.source === 'discovered') parts.push('external');
|
||||
if (s.groupId) parts.push('group');
|
||||
if (s.waitingFor) parts.push(`— ${s.waitingFor}`);
|
||||
if (s.waitingFor) parts.push(`· ${s.waitingFor}`);
|
||||
return parts.join(' ');
|
||||
}
|
||||
|
||||
function sessionTooltip(s: SessionSummary): string {
|
||||
const lines = [`${s.command} — ${s.cwd}`, `status: ${s.status}${s.live ? ' (live)' : ''}`];
|
||||
const lines = [`${s.command} · ${s.cwd}`, `status: ${s.status}${s.live ? ' (live)' : ''}`];
|
||||
if (s.activity) lines.push(`activity: ${s.activity}`);
|
||||
if (s.addedDirs && s.addedDirs.length > 0) lines.push(`added dirs: ${s.addedDirs.length}`);
|
||||
return lines.join('\n');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Service worker Arboretum (P4-C) : Web Push + clic de notification.
|
||||
// Volontairement minimal — pas de précache offline (hors périmètre P4) : son seul rôle est de
|
||||
// Volontairement minimal, pas de précache offline (hors périmètre P4) : son seul rôle est de
|
||||
// recevoir les push (session passée en `waiting`) et d'ouvrir/focus la vue session au clic.
|
||||
|
||||
self.addEventListener('push', (event) => {
|
||||
|
||||
@@ -157,7 +157,7 @@ watch(open, async (v) => {
|
||||
}
|
||||
});
|
||||
|
||||
// raccourci global ⌘K / Ctrl+K — en phase de capture pour passer devant xterm (SessionView).
|
||||
// raccourci global ⌘K / Ctrl+K : en phase de capture pour passer devant xterm (SessionView).
|
||||
function onKey(e: KeyboardEvent): void {
|
||||
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<script setup lang="ts">
|
||||
// P4-A : répondre à un dialogue Claude sans ouvrir le terminal. Le composant gère sa
|
||||
// propre attache interactive LÉGÈRE (sink no-op, sans xterm), créée à la demande au
|
||||
// premier clic et libérée au démontage — c'est ce qui réalise la réponse « mobile ».
|
||||
// premier clic et libérée au démontage : c'est ce qui réalise la réponse « mobile ».
|
||||
import { computed, onUnmounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type { SessionSummary } from '@arboretum/shared';
|
||||
|
||||
@@ -65,7 +65,7 @@ onMounted(async () => {
|
||||
try {
|
||||
const { WebglAddon } = await import('@xterm/addon-webgl');
|
||||
const webgl = new WebglAddon();
|
||||
// perte de contexte GPU : on dispose (retour au renderer DOM) PUIS on repeint — sinon l'écran
|
||||
// perte de contexte GPU : on dispose (retour au renderer DOM) PUIS on repeint, sinon l'écran
|
||||
// reste figé sur le dernier rendu WebGL jusqu'à la prochaine interaction (« texte qui ne s'affiche
|
||||
// que si ça bouge »).
|
||||
webgl.onContextLoss(() => {
|
||||
@@ -132,7 +132,7 @@ onMounted(async () => {
|
||||
resizeObserver = new ResizeObserver(refit);
|
||||
resizeObserver.observe(container.value);
|
||||
// Re-révélation RÉELLE du conteneur : cellule de grille démontée/remontée (maximize↔grille), scroll
|
||||
// hors/dans le viewport, ou navigation SPA — autant de cas que `visibilitychange` (onglet only) ne
|
||||
// hors/dans le viewport, ou navigation SPA : autant de cas que `visibilitychange` (onglet only) ne
|
||||
// couvre PAS. Au retour visible, on repeint (le rendu était gelé hors-écran) ET on flushe l'ACK pour
|
||||
// sortir d'une éventuelle pause serveur (le callback de xterm.write était throttlé tant que caché).
|
||||
intersectionObserver = new IntersectionObserver((entries) => {
|
||||
|
||||
@@ -191,7 +191,7 @@ async function onStart(): Promise<void> {
|
||||
}
|
||||
|
||||
const branchLabel = computed(() =>
|
||||
props.worktree.branch ?? (props.worktree.detached ? `${t('worktrees.detached')} ${props.worktree.head.slice(0, 7)}` : '—'),
|
||||
props.worktree.branch ?? (props.worktree.detached ? `${t('worktrees.detached')} ${props.worktree.head.slice(0, 7)}` : '·'),
|
||||
);
|
||||
|
||||
// --- actions git : commit / push / promotion en principal ---
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// État vide soigné (icône + titre + indice + CTA) — remplace les <p text-zinc-500> plats.
|
||||
// État vide soigné (icône + titre + indice + CTA) : remplace les <p text-zinc-500> plats.
|
||||
import type { Component } from 'vue';
|
||||
|
||||
defineProps<{ icon?: Component; title: string; hint?: string }>();
|
||||
|
||||
@@ -47,7 +47,7 @@ const error = ref<string | null>(null);
|
||||
const children = ref<FsEntry[]>([]);
|
||||
let loaded = false;
|
||||
|
||||
// chemin relatif au worktree (POSIX) — clé utilisée par l'API fichiers / diff.
|
||||
// chemin relatif au worktree (POSIX) : clé utilisée par l'API fichiers / diff.
|
||||
const relPath = computed(() => (props.entry.path.startsWith(props.wt) ? props.entry.path.slice(props.wt.length + 1) : props.entry.name));
|
||||
const isActive = computed(() => props.entry.isFile && props.active === relPath.value);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ref, watch, onUnmounted, getCurrentInstance, type Ref } from 'vue';
|
||||
|
||||
/**
|
||||
* Renvoie un miroir débouncé d'un ref source. Le ref source reste instantané (idéal pour un
|
||||
* v-model d'input) ; le miroir ne se met à jour qu'après `delay` ms de stabilité — c'est lui
|
||||
* v-model d'input) ; le miroir ne se met à jour qu'après `delay` ms de stabilité : c'est lui
|
||||
* que le pipeline de tri/filtre consomme, pour ne pas recalculer à chaque frappe.
|
||||
*/
|
||||
export function useDebouncedRef<T>(source: Ref<T>, delay = 150): Ref<T> {
|
||||
|
||||
@@ -38,7 +38,7 @@ export interface ListControlsOptions<T> {
|
||||
urlKey?: string;
|
||||
}
|
||||
|
||||
/** Sous-ensemble consommé par ListToolbar (sans pagination) — implémentable aussi par un store partagé. */
|
||||
/** Sous-ensemble consommé par ListToolbar (sans pagination) : implémentable aussi par un store partagé. */
|
||||
export interface ListToolbarControls<T> {
|
||||
search: Ref<string>;
|
||||
sortKey: Ref<string>;
|
||||
|
||||
@@ -12,7 +12,7 @@ export interface WorktreeView extends ListToolbarControls<WorktreeSummary> {
|
||||
|
||||
/**
|
||||
* État de tri/filtre/recherche des worktrees, PARTAGÉ entre toutes les RepoSection du dashboard
|
||||
* (une seule toolbar pilote toutes les sections). Singleton module-level — et non un store Pinia,
|
||||
* (une seule toolbar pilote toutes les sections). Singleton module-level, et non un store Pinia,
|
||||
* car Pinia déballe les refs, ce que ListToolbar attend justement comme refs. Pas de pagination
|
||||
* (liste groupée par repo) ; `apply()` filtre+trie le sous-ensemble d'un repo donné.
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user