Compare commits
16 Commits
dcb6cd1ec7
...
v1.7.0
| Author | SHA1 | Date | |
|---|---|---|---|
| e84c6a7f6d | |||
| dacff2b98f | |||
| bf9c6ba8f3 | |||
| d02c1dabd4 | |||
| 86cdc1f597 | |||
| 1b57c3801c | |||
| 4e3b1f5604 | |||
| afe39ac072 | |||
| 5166b14d5c | |||
| 8036de2f0d | |||
| 08539f4ca6 | |||
| 915fdf185d | |||
| ea7b2fd278 | |||
| 4e1c5b2c33 | |||
| c6ea9f7930 | |||
| ca6700d6ce |
14
README.fr.md
14
README.fr.md
@@ -10,7 +10,7 @@
|
||||
<a href="README.md">English</a> · <strong>Français</strong>
|
||||
</p>
|
||||
|
||||
**Statut : MVP.** Le dashboard worktree-first, la découverte et la reprise de sessions, le cycle de vie des worktrees multi-repo, les états de session en temps réel, le terminal web, la supervision mobile (PWA installable, Web Push quand une session vous attend, valider/refuser sans ouvrir de terminal) et les groupes de travail (piloter plusieurs repos liés à la fois) sont implémentés et testés.
|
||||
**Statut : MVP.** Le dashboard worktree-first, la découverte et la reprise de sessions, le cycle de vie des worktrees multi-repo, le démarrage de sessions sur votre branche principale ou n'importe quel worktree, les états de session en temps réel, le terminal web, la supervision mobile (PWA installable, Web Push quand une session vous attend, répondre à une demande sans ouvrir de terminal) et les groupes de travail (piloter plusieurs repos liés depuis une seule session Claude) sont implémentés et testés.
|
||||
|
||||
---
|
||||
|
||||
@@ -28,10 +28,10 @@ Un unique daemon Node.js que vous lancez sur votre machine de dev (`npx @johanle
|
||||
|
||||
- **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.
|
||||
- **Terminal web** — terminal xterm.js complet vers chaque session managée, qui survit aux déconnexions du navigateur.
|
||||
- **Supervision depuis votre téléphone** — PWA installable avec notifications push quand une session vous attend ; validez ou refusez une demande sans ouvrir de terminal.
|
||||
- **Groupes de travail** — regroupez des repos liés (ex. une API, son frontend web et une lib partagée) dans un groupe nommé pour travailler sur tous à la fois : une vue unifiée de leurs worktrees et sessions, une grille multi-terminaux côte à côte, et une action « feature cross-repo » en un clic qui crée le même worktree de branche (et au besoin une session Claude) dans chaque repo du groupe.
|
||||
- **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.
|
||||
- **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.
|
||||
|
||||
---
|
||||
|
||||
@@ -100,9 +100,9 @@ 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 un 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. Validez ou refusez la demande directement depuis l'interface de notification — 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.
|
||||
|
||||
## Accès distant depuis votre téléphone
|
||||
|
||||
|
||||
14
README.md
14
README.md
@@ -10,7 +10,7 @@
|
||||
<strong>English</strong> · <a href="README.fr.md">Français</a>
|
||||
</p>
|
||||
|
||||
**Status: MVP.** The worktree-first dashboard, session discovery & resume, multi-repo worktree lifecycle, live session states, the web terminal, and mobile supervision (installable PWA, Web Push when a session needs you, approve/deny without opening a terminal), and work groups (run several related repos at once) are implemented and tested.
|
||||
**Status: MVP.** The worktree-first dashboard, session discovery & resume, multi-repo worktree lifecycle, sessions on your main branch or any worktree, live session states, the web terminal, mobile supervision (installable PWA, Web Push when a session needs you, answer a prompt without opening a terminal), and work groups (drive several related repos from a single Claude session) are implemented and tested.
|
||||
|
||||
---
|
||||
|
||||
@@ -28,10 +28,10 @@ A single Node.js daemon you run on your dev machine (`npx @johanleroy/git-arbore
|
||||
|
||||
- **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.
|
||||
- **Web terminal** — full xterm.js terminal to every managed session, surviving browser disconnects.
|
||||
- **Supervision from your phone** — installable PWA with push notifications when a session needs you; approve/deny a prompt without opening a terminal.
|
||||
- **Work groups** — bundle related repos (e.g. an API, its web frontend and a shared library) into a named group to work on them at once: a unified view of all their worktrees and sessions, a side-by-side multi-terminal grid, and a one-click "cross-repo feature" that creates the same branch worktree (and optionally a Claude session) across every repo in the group.
|
||||
- **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.
|
||||
- **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.
|
||||
|
||||
---
|
||||
|
||||
@@ -100,9 +100,9 @@ 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 a 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. Approve or deny the prompt straight from the notification UI — 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.
|
||||
|
||||
## Remote access from your phone
|
||||
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -4854,7 +4854,7 @@
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@johanleroy/git-arboretum",
|
||||
"version": "1.4.1",
|
||||
"version": "1.6.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fastify/cookie": "^11.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@johanleroy/git-arboretum",
|
||||
"version": "1.4.1",
|
||||
"version": "1.7.0",
|
||||
"description": "Self-hosted web dashboard for git worktrees and the Claude Code sessions running on them",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
||||
@@ -144,6 +144,37 @@ try {
|
||||
const out = c.state.outputs.get(att?.channel) ?? '';
|
||||
check('resume lance `--resume sid-dead` dans le bon cwd', out.includes('args=[--resume sid-dead]') && out.includes(`cwd=${workDir}`), out.replace(/\s+/g, ' ').slice(0, 120));
|
||||
|
||||
// --- Régression « Reprendre » : reprise d'une session MANAGÉE morte par son UUID Arboretum ---
|
||||
// (le bouton web envoie l'UUID managé, pas le claudeSessionId ; le serveur doit le résoudre en DB).
|
||||
const createManaged = await fetch(`${ORIGIN}/api/v1/sessions`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Origin: ORIGIN, Cookie: cookie },
|
||||
body: JSON.stringify({ cwd: workDir, command: 'claude' }),
|
||||
});
|
||||
const managed = (await createManaged.json()).session;
|
||||
check('création session managée claude → 201 (pid)', createManaged.status === 201 && managed?.pid > 0);
|
||||
|
||||
// Simule la capture du claudeSessionId : entrée registre pour le pid du PTY managé (pollée toutes les 400ms).
|
||||
writeFileSync(
|
||||
join(sessions, `${managed.pid}.json`),
|
||||
JSON.stringify({ pid: managed.pid, sessionId: 'sid-managed', cwd: workDir, status: 'idle' }),
|
||||
);
|
||||
const captured = await c.waitMsg(
|
||||
(m) => m.type === 'session_update' && m.session?.id === managed.id && m.session?.claudeSessionId === 'sid-managed',
|
||||
);
|
||||
check('claudeSessionId capturé depuis le registre (session managée)', !!captured);
|
||||
|
||||
// Fermeture (kill) puis reprise par UUID managé → 201 dans le cwd d'origine (avant le fix : 404).
|
||||
const killManaged = await fetch(`${ORIGIN}/api/v1/sessions/${managed.id}`, { method: 'DELETE', headers: { Origin: ORIGIN, Cookie: cookie } });
|
||||
check('kill session managée → 200', killManaged.status === 200);
|
||||
await sleep(400); // laisse handleExit persister ended_at
|
||||
const resumeManaged = await postJson(`/api/v1/sessions/${managed.id}/resume`, cookie);
|
||||
const resumedManaged = (await resumeManaged.json()).session;
|
||||
check(
|
||||
'resume d’une session MANAGÉE morte par UUID → 201',
|
||||
resumeManaged.status === 201 && resumedManaged?.command === 'claude' && resumedManaged?.source === 'managed' && resumedManaged?.cwd === workDir,
|
||||
);
|
||||
|
||||
// Broadcast : une nouvelle session découverte est poussée via session_update au rafraîchissement périodique.
|
||||
writeJsonl(workDir, 'sid-new');
|
||||
const pushed = await c.waitMsg((m) => m.type === 'session_update' && m.session?.id === 'sid-new', 13000);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Vrai daemon + vrai repo git tmp. Couvre : enregistrement repo, création worktree avec hook
|
||||
// post-create, broadcast WS worktree_update, corrélation worktree↔session (bash), suppression.
|
||||
import { spawn, execFileSync } from 'node:child_process';
|
||||
import { mkdtempSync, rmSync, existsSync } from 'node:fs';
|
||||
import { mkdtempSync, rmSync, existsSync, writeFileSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join, dirname, basename } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
@@ -119,6 +119,24 @@ try {
|
||||
const feat = wlist1.worktrees.find((w) => w.branch === 'feat');
|
||||
check('corrélation worktree ↔ session (cwd)', feat?.sessions?.some((s) => s.command === 'bash' && s.live));
|
||||
|
||||
// Session sur le checkout principal (« bosser sur la branche principale ») avec création de branche.
|
||||
const mainSess = await j(`/api/v1/repos/${repoSummary.id}/session`, 'POST', cookie, { command: 'bash', branch: 'mainfeat', newBranch: true });
|
||||
const mainBody = await mainSess.json();
|
||||
check('POST repo session → 201 (bash)', mainSess.status === 201 && mainBody.session?.command === 'bash');
|
||||
check('session de branche principale : cwd = checkout principal', mainBody.session?.cwd === repoSummary.path);
|
||||
const mainPush = await c.waitMsg((m) => m.type === 'worktree_update' && m.worktree?.isMain && m.worktree?.branch === 'mainfeat');
|
||||
check('broadcast worktree_update (branche principale basculée)', !!mainPush);
|
||||
await sleep(300);
|
||||
const wlistM = await (await j('/api/v1/worktrees', 'GET', cookie)).json();
|
||||
const mainWt = wlistM.worktrees.find((w) => w.isMain);
|
||||
check('session corrélée au checkout principal', mainWt?.branch === 'mainfeat' && mainWt.sessions.some((s) => s.id === mainBody.session.id));
|
||||
|
||||
// Refus 409 quand le checkout principal est sale.
|
||||
writeFileSync(join(repo, 'scratch.txt'), 'wip\n');
|
||||
const dirtyRefused = await j(`/api/v1/repos/${repoSummary.id}/session`, 'POST', cookie, { command: 'bash', branch: 'other', newBranch: true });
|
||||
check('repo session sur checkout sale → 409', dirtyRefused.status === 409);
|
||||
rmSync(join(repo, 'scratch.txt'), { force: true });
|
||||
|
||||
// Suppression forcée (une session vit dans le worktree).
|
||||
const refused = await j(`/api/v1/repos/${repoSummary.id}/worktrees?path=${encodeURIComponent(wtPath)}&force=false`, 'DELETE', cookie);
|
||||
check('delete sans force (session live) → 409', refused.status === 409);
|
||||
|
||||
@@ -24,15 +24,20 @@ const check = (name, ok, detail = '') => {
|
||||
};
|
||||
|
||||
const tmp = mkdtempSync(join(tmpdir(), 'arb-accept-p5-'));
|
||||
function initRepo(path) {
|
||||
execFileSync('mkdir', ['-p', path]);
|
||||
const git = (...args) => execFileSync('git', args, { cwd: path, stdio: 'pipe' });
|
||||
git('init', '-b', 'main');
|
||||
git('config', 'user.email', 'test@arboretum.dev');
|
||||
git('config', 'user.name', 'Test');
|
||||
execFileSync('bash', ['-lc', 'echo "# demo" > README.md'], { cwd: path });
|
||||
git('add', '-A');
|
||||
git('commit', '-m', 'init');
|
||||
}
|
||||
const repo = join(tmp, 'demo-repo');
|
||||
execFileSync('mkdir', ['-p', repo]);
|
||||
const git = (...args) => execFileSync('git', args, { cwd: repo, stdio: 'pipe' });
|
||||
git('init', '-b', 'main');
|
||||
git('config', 'user.email', 'test@arboretum.dev');
|
||||
git('config', 'user.name', 'Test');
|
||||
execFileSync('bash', ['-lc', 'echo "# demo" > README.md'], { cwd: repo });
|
||||
git('add', '-A');
|
||||
git('commit', '-m', 'init');
|
||||
const repo2 = join(tmp, 'demo-repo-2');
|
||||
initRepo(repo);
|
||||
initRepo(repo2);
|
||||
|
||||
const srv = spawn(
|
||||
'node',
|
||||
@@ -109,6 +114,43 @@ try {
|
||||
const pushedAdd = await c.waitMsg((m) => m.type === 'group_update' && m.group?.repoIds?.includes(repoSummary.id));
|
||||
check('broadcast WS group_update (ajout repo)', !!pushedAdd);
|
||||
|
||||
// ---- P6 : session de groupe multi-repo (UNE session couvrant tous les repos via --add-dir) ----
|
||||
// Enregistre un 2e repo, l'ajoute au groupe, puis lance UNE session de groupe (bash, sans quota).
|
||||
const addRepo2 = await j('/api/v1/repos', 'POST', cookie, { path: repo2 });
|
||||
const repo2Summary = (await addRepo2.json()).repo;
|
||||
check('POST /repos (2e repo) → 201', addRepo2.status === 201 && repo2Summary?.valid === true);
|
||||
await j(`/api/v1/groups/${group.id}/repos`, 'POST', cookie, { repoId: repo2Summary.id });
|
||||
|
||||
// Mode « checkouts principaux » (pas de branch) : couvre le worktree principal de chaque repo.
|
||||
const gsRes = await j(`/api/v1/groups/${group.id}/session`, 'POST', cookie, { command: 'bash' });
|
||||
const gsBody = await gsRes.json();
|
||||
const gsession = gsBody.session;
|
||||
check('POST /groups/:id/session → 201', gsRes.status === 201 && !!gsession);
|
||||
check('session de groupe : 2 répertoires couverts', Array.isArray(gsBody.dirs) && gsBody.dirs.length === 2);
|
||||
// cwd = parent commun des repos (P6), chaque repo relié en --add-dir → 2 addedDirs.
|
||||
check('session de groupe : cwd = parent commun des repos', gsession?.cwd === tmp);
|
||||
check('session de groupe : addedDirs = les 2 repos', (gsession?.addedDirs?.length ?? 0) === 2);
|
||||
check('session de groupe : groupId posé', gsession?.groupId === group.id);
|
||||
check('session de groupe : cwd parent + 2 repos addedDirs = 3 chemins distincts', new Set([gsession?.cwd, ...(gsession?.addedDirs ?? [])]).size === 3);
|
||||
|
||||
// La session apparaît dans la liste globale avec son groupId.
|
||||
const sessList = await (await j('/api/v1/sessions', 'GET', cookie)).json();
|
||||
const listed = sessList.sessions?.find((s) => s.id === gsession.id);
|
||||
check('GET /sessions : session de groupe présente avec groupId', listed?.groupId === group.id);
|
||||
|
||||
// broadcast WS session_update reçu pour la session de groupe.
|
||||
const pushedSession = await c.waitMsg((m) => m.type === 'session_update' && m.session?.id === gsession.id);
|
||||
check('broadcast WS session_update (session de groupe)', !!pushedSession);
|
||||
|
||||
// groupe sans worktree résolu (branche inexistante) → 400.
|
||||
const gsBad = await j(`/api/v1/groups/${group.id}/session`, 'POST', cookie, { command: 'bash', branch: 'no/such/branch' });
|
||||
check('POST /groups/:id/session branche absente → 400', gsBad.status === 400);
|
||||
|
||||
// Arrêt de la session de groupe + nettoyage du 2e repo (CASCADE retire repo2 de la membership).
|
||||
const killSession = await j(`/api/v1/sessions/${gsession.id}`, 'DELETE', cookie);
|
||||
check('DELETE session de groupe → 200', killSession.status === 200);
|
||||
await j(`/api/v1/repos/${repo2Summary.id}`, 'DELETE', cookie);
|
||||
|
||||
// Renommage via PATCH.
|
||||
const patched = await j(`/api/v1/groups/${group.id}`, 'PATCH', cookie, { label: 'Renamed' });
|
||||
check('PATCH /groups/:id → 200 (renommé)', patched.status === 200 && (await patched.json()).group?.label === 'Renamed');
|
||||
|
||||
@@ -84,6 +84,7 @@ export function buildApp(config: Config, db: Db, serverVersion: string): AppBund
|
||||
const push = new PushService(db, config.vapidContact, undefined, box);
|
||||
const manager = new PtyManager(db, config.claudeSessionsDir, push);
|
||||
const discovery = new DiscoveryService({
|
||||
db,
|
||||
ptyManager: manager,
|
||||
projectsDir: config.claudeProjectsDir,
|
||||
sessionsDir: config.claudeSessionsDir,
|
||||
@@ -168,9 +169,9 @@ export function buildApp(config: Config, db: Db, serverVersion: string): AppBund
|
||||
});
|
||||
|
||||
registerAuthRoutes(app, auth, limiter, serverVersion, db);
|
||||
registerSessionRoutes(app, manager, discovery);
|
||||
registerSessionRoutes(app, manager, discovery, db);
|
||||
registerRepoRoutes(app, worktrees, db);
|
||||
registerGroupRoutes(app, groups, db);
|
||||
registerGroupRoutes(app, groups, db, worktrees, manager);
|
||||
registerWorktreeRoutes(app, worktrees);
|
||||
registerPushRoutes(app, push, db);
|
||||
registerSettingsRoutes(app, db, config, serverVersion, push);
|
||||
|
||||
@@ -10,6 +10,8 @@ export interface SpawnOptions {
|
||||
command: 'claude' | 'bash';
|
||||
/** reprise d'une session existante (P2) : `--resume <id>`, `--fork-session` si fork. */
|
||||
resume?: { claudeSessionId: string; fork?: boolean };
|
||||
/** répertoires supplémentaires à relier dans une seule session (P6) : `--add-dir <path>` répété. */
|
||||
addDirs?: string[];
|
||||
}
|
||||
|
||||
let cachedClaudeBin: string | null = null;
|
||||
@@ -42,5 +44,7 @@ export function buildSpawnSpec(opts: SpawnOptions): SpawnSpec {
|
||||
args.push('--resume', opts.resume.claudeSessionId);
|
||||
if (opts.resume.fork) args.push('--fork-session');
|
||||
}
|
||||
// Session de groupe : relie plusieurs repos/worktrees dans une seule session (P6).
|
||||
for (const dir of opts.addDirs ?? []) args.push('--add-dir', dir);
|
||||
return { file: resolveClaudeBin(), args, env };
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { join } from 'node:path';
|
||||
import type { SessionSummary } from '@arboretum/shared';
|
||||
import { scanProjects, type DiscoveredJsonl } from './jsonl-discovery.js';
|
||||
import { readRegistry, type RegistryEntry } from './session-registry.js';
|
||||
import { listHiddenSessionIds, type Db } from '../db/index.js';
|
||||
import type { PtyManager } from './pty-manager.js';
|
||||
|
||||
const DEFAULT_REFRESH_MS = 10_000;
|
||||
@@ -17,6 +18,7 @@ export interface DiscoveryServiceEvents {
|
||||
}
|
||||
|
||||
export interface DiscoveryOptions {
|
||||
db: Db;
|
||||
ptyManager: PtyManager;
|
||||
projectsDir?: string;
|
||||
sessionsDir?: string;
|
||||
@@ -24,6 +26,7 @@ export interface DiscoveryOptions {
|
||||
}
|
||||
|
||||
export class DiscoveryService extends EventEmitter<DiscoveryServiceEvents> {
|
||||
private readonly db: Db;
|
||||
private readonly projectsDir: string;
|
||||
private readonly sessionsDir: string;
|
||||
private readonly ptyManager: PtyManager;
|
||||
@@ -35,6 +38,7 @@ export class DiscoveryService extends EventEmitter<DiscoveryServiceEvents> {
|
||||
|
||||
constructor(opts: DiscoveryOptions) {
|
||||
super();
|
||||
this.db = opts.db;
|
||||
this.ptyManager = opts.ptyManager;
|
||||
this.projectsDir = opts.projectsDir ?? join(homedir(), '.claude', 'projects');
|
||||
this.sessionsDir = opts.sessionsDir ?? join(homedir(), '.claude', 'sessions');
|
||||
@@ -81,6 +85,9 @@ export class DiscoveryService extends EventEmitter<DiscoveryServiceEvents> {
|
||||
if (r.claudeSessionId) regBySid.set(r.claudeSessionId, r);
|
||||
}
|
||||
const known = this.ptyManager.knownClaudeSessionIds();
|
||||
// Sessions masquées par l'utilisateur : on les garde dans le cache (resume/fork possibles) mais
|
||||
// marquées `hidden` → la route /sessions les exclut par défaut.
|
||||
const hiddenIds = listHiddenSessionIds(this.db);
|
||||
|
||||
// Dédoublonnage des JSONL par claudeSessionId (on retient le plus récent).
|
||||
const latest = new Map<string, DiscoveredJsonl>();
|
||||
@@ -113,6 +120,7 @@ export class DiscoveryService extends EventEmitter<DiscoveryServiceEvents> {
|
||||
resumable: !live, // morte → --resume direct ; vivante → fork/observe (jamais resume : corruption)
|
||||
attachable: false, // Arboretum ne tient pas le PTY d'une session externe
|
||||
registryStatus: r?.status ?? null,
|
||||
hidden: hiddenIds.has(d.claudeSessionId),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -190,6 +190,16 @@ export async function addWorktree(
|
||||
await git(repoPath, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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).
|
||||
*/
|
||||
export async function switchBranch(repoPath: string, opts: { branch: string; create: boolean }): Promise<void> {
|
||||
await git(repoPath, opts.create ? ['switch', '-c', opts.branch] : ['switch', opts.branch]);
|
||||
}
|
||||
|
||||
export async function removeWorktree(repoPath: string, worktreePath: string, force: boolean): Promise<void> {
|
||||
await git(repoPath, ['worktree', 'remove', ...(force ? ['--force'] : []), '--', worktreePath]);
|
||||
}
|
||||
|
||||
@@ -167,6 +167,8 @@ export class GroupManager extends EventEmitter<GroupManagerEvents> {
|
||||
// CASCADE (PRAGMA foreign_keys = ON) purge group_repos.
|
||||
const res = this.db.prepare('DELETE FROM groups WHERE id = ?').run(id);
|
||||
if (res.changes === 0) return false;
|
||||
// Les sessions de groupe (P6) ne sont pas en FK : on désorpheline leur group_id manuellement.
|
||||
this.db.prepare('UPDATE sessions SET group_id = NULL WHERE group_id = ?').run(id);
|
||||
this.emit('group_removed', id);
|
||||
return true;
|
||||
}
|
||||
|
||||
37
packages/server/src/core/group-session.ts
Normal file
37
packages/server/src/core/group-session.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
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.
|
||||
*/
|
||||
export function commonAncestorDir(paths: string[]): string {
|
||||
const first = paths[0];
|
||||
if (first === undefined) throw new Error('commonAncestorDir: empty input');
|
||||
const firstSegs = resolve(first).split(sep);
|
||||
let common = firstSegs.length;
|
||||
for (let i = 1; i < paths.length; i++) {
|
||||
const segs = resolve(paths[i]!).split(sep);
|
||||
let k = 0;
|
||||
while (k < common && k < segs.length && segs[k] === firstSegs[k]) k++;
|
||||
common = k;
|
||||
}
|
||||
const joined = firstSegs.slice(0, common).join(sep);
|
||||
// `['', 'a', 'b'].slice(0,1).join('/')` === '' → racine POSIX ; rétablir le séparateur racine.
|
||||
return joined === '' ? parse(resolve(first)).root : joined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Politique de répertoire de travail d'une session de groupe (P6) : le `cwd` est le PARENT COMMUN
|
||||
* des répertoires couverts (racine neutre, chemins relatifs cross-repo naturels), chaque répertoire
|
||||
* étant ensuite relié via `--add-dir` (le dédoublonnage + filtrage du cwd est fait par `PtyManager`).
|
||||
* Garde-fou : si le parent commun est la racine du FS (repos éparpillés sur des racines différentes),
|
||||
* on retombe sur le premier répertoire pour ne pas accorder à Claude la permission sur tout le disque.
|
||||
*/
|
||||
export function resolveGroupCwd(dirs: string[]): { cwd: string; addDirs: string[] } {
|
||||
const first = dirs[0];
|
||||
if (first === undefined) throw new Error('resolveGroupCwd: empty input');
|
||||
const ancestor = commonAncestorDir(dirs);
|
||||
const root = parse(resolve(first)).root;
|
||||
const cwd = ancestor === root ? first : ancestor;
|
||||
return { cwd, addDirs: dirs };
|
||||
}
|
||||
@@ -20,6 +20,17 @@ const NOTIFY_DEBOUNCE_MS = 1500;
|
||||
const CLAUDE_ID_POLL_MS = 400;
|
||||
const CLAUDE_ID_TIMEOUT_MS = 60_000;
|
||||
|
||||
/** Parse la colonne `added_dirs` (JSON array de chemins) de façon défensive ; [] si NULL/invalide. */
|
||||
function parseAddedDirs(raw: string | null): string[] {
|
||||
if (!raw) return [];
|
||||
try {
|
||||
const v = JSON.parse(raw);
|
||||
return Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string') : [];
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/** Lien entre un client WS attaché et une session. La gateway fournit les callbacks d'envoi. */
|
||||
export interface ClientBinding {
|
||||
channel: number;
|
||||
@@ -48,6 +59,10 @@ interface ManagedSession {
|
||||
killTimer: NodeJS.Timeout | null;
|
||||
/** ID interne du CLI claude, résolu via le registre après spawn (null pour bash / pas encore prêt). */
|
||||
claudeSessionId: string | null;
|
||||
/** répertoires supplémentaires reliés dans la session (--add-dir) ; [] pour une session mono-repo (P6). */
|
||||
addedDirs: string[];
|
||||
/** groupe propriétaire d'une session de groupe multi-repo ; null sinon (P6). */
|
||||
groupId: string | null;
|
||||
/** détection d'état fin (busy/waiting/idle + dialogue) ; null pour bash (P3-B). */
|
||||
tracker: SessionActivityTracker | null;
|
||||
/** dernière activité notifiée (détection du front montant vers `waiting` pour le push P4-B). */
|
||||
@@ -72,14 +87,33 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
super();
|
||||
}
|
||||
|
||||
spawn(opts: { cwd: string; command?: 'claude' | 'bash'; resume?: { claudeSessionId: string; fork?: boolean } }): SessionSummary {
|
||||
spawn(opts: {
|
||||
cwd: string;
|
||||
command?: 'claude' | 'bash';
|
||||
resume?: { claudeSessionId: string; fork?: boolean };
|
||||
/** répertoires supplémentaires à relier (session de groupe multi-repo, P6). */
|
||||
addDirs?: string[];
|
||||
/** groupe propriétaire (session de groupe, P6). */
|
||||
groupId?: string;
|
||||
}): SessionSummary {
|
||||
const cwd = opts.cwd;
|
||||
if (!existsSync(cwd) || !statSync(cwd).isDirectory()) {
|
||||
throw Object.assign(new Error(`Not a directory: ${cwd}`), { statusCode: 400 });
|
||||
}
|
||||
// Dédoublonne et écarte le cwd primaire ; valide chaque répertoire supplémentaire (comme le cwd).
|
||||
const addedDirs = [...new Set(opts.addDirs ?? [])].filter((d) => d !== cwd);
|
||||
for (const dir of addedDirs) {
|
||||
if (!existsSync(dir) || !statSync(dir).isDirectory()) {
|
||||
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).
|
||||
const command = opts.resume ? 'claude' : (opts.command ?? 'claude');
|
||||
const spec = buildSpawnSpec({ command, ...(opts.resume ? { resume: opts.resume } : {}) });
|
||||
const spec = buildSpawnSpec({
|
||||
command,
|
||||
...(opts.resume ? { resume: opts.resume } : {}),
|
||||
...(addedDirs.length ? { addDirs: addedDirs } : {}),
|
||||
});
|
||||
const id = randomUUID();
|
||||
const proc = pty.spawn(spec.file, spec.args, {
|
||||
name: 'xterm-256color',
|
||||
@@ -101,6 +135,8 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
exited: null,
|
||||
killTimer: null,
|
||||
claudeSessionId: null,
|
||||
addedDirs,
|
||||
groupId: opts.groupId ?? null,
|
||||
tracker: null,
|
||||
prevActivity: null,
|
||||
notifyTimer: null,
|
||||
@@ -116,8 +152,16 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
}
|
||||
this.live.set(id, session);
|
||||
this.db
|
||||
.prepare('INSERT INTO sessions (id, cwd, command, created_at, resumed_from) VALUES (?, ?, ?, ?, ?)')
|
||||
.run(id, cwd, command, session.createdAt, opts.resume?.claudeSessionId ?? null);
|
||||
.prepare('INSERT INTO sessions (id, cwd, command, created_at, resumed_from, added_dirs, group_id) VALUES (?, ?, ?, ?, ?, ?, ?)')
|
||||
.run(
|
||||
id,
|
||||
cwd,
|
||||
command,
|
||||
session.createdAt,
|
||||
opts.resume?.claudeSessionId ?? null,
|
||||
addedDirs.length ? JSON.stringify(addedDirs) : null,
|
||||
session.groupId,
|
||||
);
|
||||
|
||||
proc.onData((data) => this.handleOutput(session, Buffer.from(data, 'utf8')));
|
||||
proc.onExit(({ exitCode, signal }) => this.handleExit(session, exitCode, signal ?? null));
|
||||
@@ -145,6 +189,36 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
setTimeout(tick, CLAUDE_ID_POLL_MS).unref();
|
||||
}
|
||||
|
||||
/**
|
||||
* Contexte de session de groupe (P6) à réinjecter au resume : derniers `added_dirs`/`group_id`
|
||||
* persistés pour ce claudeSessionId. Permet à `--resume` de re-relier les mêmes répertoires.
|
||||
*/
|
||||
groupSessionContext(claudeSessionId: string): { addedDirs: string[]; groupId: string | null } | null {
|
||||
const row = this.db
|
||||
.prepare('SELECT added_dirs, group_id FROM sessions WHERE claude_session_id = ? AND added_dirs IS NOT NULL ORDER BY created_at DESC LIMIT 1')
|
||||
.get(claudeSessionId) as { added_dirs: string | null; group_id: string | null } | undefined;
|
||||
if (!row) return null;
|
||||
return { addedDirs: parseAddedDirs(row.added_dirs), groupId: row.group_id };
|
||||
}
|
||||
|
||||
/**
|
||||
* Cible de reprise d'une session managée MORTE (P2/P6), résolue par UUID Arboretum : son cwd
|
||||
* d'origine, son claudeSessionId et son contexte de groupe, lus en DB. null si l'id ne correspond
|
||||
* pas à une session managée morte, reprenable (claude + claudeSessionId connu).
|
||||
* Complète `DiscoveryService.getDiscovered`, qui ne couvre QUE les sessions claude EXTERNES
|
||||
* (une managée connue est justement exclue de la découverte).
|
||||
*/
|
||||
resumeTargetById(id: string): { cwd: string; claudeSessionId: string; addedDirs: string[]; groupId: string | null } | null {
|
||||
if (this.live.has(id)) return null; // vivante : pas de resume direct (fork via le même chemin)
|
||||
const row = this.db
|
||||
.prepare(
|
||||
"SELECT cwd, claude_session_id, added_dirs, group_id FROM sessions WHERE id = ? AND ended_at IS NOT NULL AND claude_session_id IS NOT NULL AND command = 'claude'",
|
||||
)
|
||||
.get(id) as { cwd: string; claude_session_id: string; added_dirs: string | null; group_id: string | null } | undefined;
|
||||
if (!row) return null;
|
||||
return { cwd: row.cwd, claudeSessionId: row.claude_session_id, addedDirs: parseAddedDirs(row.added_dirs), groupId: row.group_id };
|
||||
}
|
||||
|
||||
/** Session managée VIVANTE portant ce claudeSessionId (garde-fou anti-resume d'une session vivante). */
|
||||
findLiveByClaudeSessionId(claudeSessionId: string): SessionSummary | null {
|
||||
for (const s of this.live.values()) {
|
||||
@@ -170,29 +244,34 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
const liveSummaries = [...this.live.values()].map((s) => this.summarize(s));
|
||||
const liveIds = new Set(this.live.keys());
|
||||
const rows = this.db
|
||||
.prepare('SELECT id, cwd, command, title, created_at, ended_at, exit_code, claude_session_id FROM sessions ORDER BY created_at DESC LIMIT 100')
|
||||
.all() as Array<{ id: string; cwd: string; command: string; title: string | null; created_at: string; ended_at: string | null; exit_code: number | null; claude_session_id: string | null }>;
|
||||
.prepare('SELECT id, cwd, command, title, created_at, ended_at, exit_code, claude_session_id, added_dirs, group_id FROM sessions ORDER BY created_at DESC LIMIT 100')
|
||||
.all() as Array<{ id: string; cwd: string; command: string; title: string | null; created_at: string; ended_at: string | null; exit_code: number | null; claude_session_id: string | null; added_dirs: string | null; group_id: string | null }>;
|
||||
const historical: SessionSummary[] = rows
|
||||
.filter((r) => !liveIds.has(r.id))
|
||||
.map((r) => ({
|
||||
.map((r) => {
|
||||
const addedDirs = parseAddedDirs(r.added_dirs);
|
||||
return {
|
||||
id: r.id,
|
||||
cwd: r.cwd,
|
||||
command: r.command,
|
||||
title: r.title,
|
||||
status: 'exited',
|
||||
status: 'exited' as const,
|
||||
live: false,
|
||||
createdAt: r.created_at,
|
||||
endedAt: r.ended_at,
|
||||
exitCode: r.exit_code,
|
||||
clients: 0,
|
||||
source: 'managed',
|
||||
source: 'managed' as const,
|
||||
claudeSessionId: r.claude_session_id,
|
||||
pid: null,
|
||||
// une session claude morte avec un claudeSessionId connu est reprenable (--resume direct).
|
||||
resumable: r.command === 'claude' && r.claude_session_id != null,
|
||||
attachable: false,
|
||||
registryStatus: null,
|
||||
}));
|
||||
...(addedDirs.length ? { addedDirs } : {}),
|
||||
groupId: r.group_id,
|
||||
};
|
||||
});
|
||||
return [...liveSummaries, ...historical];
|
||||
}
|
||||
|
||||
@@ -427,6 +506,8 @@ export class PtyManager extends EventEmitter<PtyManagerEvents> {
|
||||
activity: act?.activity ?? null,
|
||||
waitingFor: act?.waitingFor ?? null,
|
||||
dialog: act?.dialog ?? null,
|
||||
...(s.addedDirs.length ? { addedDirs: s.addedDirs } : {}),
|
||||
groupId: s.groupId,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
listWorktrees,
|
||||
pruneWorktrees,
|
||||
removeWorktree,
|
||||
switchBranch,
|
||||
worktreeStatus,
|
||||
type ParsedWorktree,
|
||||
} from './git.js';
|
||||
@@ -355,6 +356,41 @@ export class WorktreeManager extends EventEmitter<WorktreeManagerEvents> {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* est le dépôt réel de l'utilisateur, déjà configuré/approuvé. Sérialisé par repo (withLock).
|
||||
*/
|
||||
async startMainSession(
|
||||
repoId: string,
|
||||
req: { command?: 'claude' | 'bash'; branch?: string; newBranch?: boolean },
|
||||
): Promise<{ session: SessionSummary; worktree: WorktreeSummary | null }> {
|
||||
const row = this.getRepoRow(repoId);
|
||||
if (!row) throw httpError(404, 'NOT_FOUND', 'No repo with this id');
|
||||
const branch = req.branch?.trim() || undefined;
|
||||
if (branch !== undefined && !isValidBranchName(branch)) throw httpError(400, 'BAD_BRANCH', `Invalid branch name: ${branch}`);
|
||||
|
||||
return this.withLock(repoId, async () => {
|
||||
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');
|
||||
}
|
||||
try {
|
||||
await switchBranch(row.path, { branch, create: req.newBranch ?? true });
|
||||
} catch (err) {
|
||||
throw httpError(400, 'SWITCH_FAILED', (err as Error).message);
|
||||
}
|
||||
this.factsCache.delete(repoId);
|
||||
}
|
||||
const session = this.ptyManager.spawn({ cwd: row.path, command: req.command ?? 'claude' });
|
||||
const worktree = await this.emitWorktree(row, row.path);
|
||||
return { session, worktree };
|
||||
});
|
||||
}
|
||||
|
||||
async adoptWorktree(repoId: string, req: { path: string; runHooks?: boolean; preTrust?: boolean }): Promise<{ worktree: WorktreeSummary; hookResults: HookRunResult[] }> {
|
||||
const row = this.getRepoRow(repoId);
|
||||
if (!row) throw httpError(404, 'NOT_FOUND', 'No repo with this id');
|
||||
|
||||
@@ -118,6 +118,30 @@ const MIGRATIONS: Array<{ id: number; sql: string }> = [
|
||||
CREATE INDEX idx_audit_ts ON audit_logs(ts);
|
||||
`,
|
||||
},
|
||||
{
|
||||
// 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,
|
||||
sql: `
|
||||
ALTER TABLE sessions ADD COLUMN added_dirs TEXT;
|
||||
ALTER TABLE sessions ADD COLUMN group_id TEXT;
|
||||
CREATE INDEX idx_sessions_group_id ON sessions(group_id);
|
||||
`,
|
||||
},
|
||||
{
|
||||
// Masquage des sessions Claude découvertes (lancées en CLI hors Arboretum) qui polluent la liste.
|
||||
// Calqué sur repos.hidden (#6) : la session masquée reste connue (resume/fork possibles) mais est
|
||||
// exclue de la liste par défaut, et un re-scan ne la ressuscite pas. Clé = claudeSessionId (stable,
|
||||
// partagé entre une découverte et sa reprise managée).
|
||||
id: 9,
|
||||
sql: `
|
||||
CREATE TABLE hidden_sessions (
|
||||
claude_session_id TEXT PRIMARY KEY,
|
||||
hidden_at TEXT NOT NULL
|
||||
);
|
||||
`,
|
||||
},
|
||||
];
|
||||
|
||||
export type Db = DatabaseSync;
|
||||
@@ -174,3 +198,23 @@ export function getSetting(db: Db, key: string): string | null {
|
||||
export function setSetting(db: Db, key: string, value: string): void {
|
||||
db.prepare('INSERT INTO settings (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value').run(key, value);
|
||||
}
|
||||
|
||||
// ---- Sessions masquées (par claudeSessionId) ----
|
||||
|
||||
/** Ensemble des claudeSessionId masqués par l'utilisateur. */
|
||||
export function listHiddenSessionIds(db: Db): Set<string> {
|
||||
const rows = db.prepare('SELECT claude_session_id FROM hidden_sessions').all() as Array<{ claude_session_id: string }>;
|
||||
return new Set(rows.map((r) => r.claude_session_id));
|
||||
}
|
||||
|
||||
/** Masque une session (idempotent). */
|
||||
export function hideSession(db: Db, claudeSessionId: string): void {
|
||||
db.prepare(
|
||||
'INSERT INTO hidden_sessions (claude_session_id, hidden_at) VALUES (?, ?) ON CONFLICT(claude_session_id) DO NOTHING',
|
||||
).run(claudeSessionId, new Date().toISOString());
|
||||
}
|
||||
|
||||
/** Ré-affiche une session masquée (idempotent). */
|
||||
export function unhideSession(db: Db, claudeSessionId: string): void {
|
||||
db.prepare('DELETE FROM hidden_sessions WHERE claude_session_id = ?').run(claudeSessionId);
|
||||
}
|
||||
|
||||
@@ -2,16 +2,27 @@ import type { FastifyInstance } from 'fastify';
|
||||
import type {
|
||||
AddRepoRequest,
|
||||
CreateGroupRequest,
|
||||
CreateGroupSessionRequest,
|
||||
GroupResponse,
|
||||
GroupSessionResponse,
|
||||
GroupsListResponse,
|
||||
UpdateGroupRequest,
|
||||
} from '@arboretum/shared';
|
||||
import type { GroupManager } from '../core/group-manager.js';
|
||||
import type { WorktreeManager } from '../core/worktree-manager.js';
|
||||
import type { PtyManager } from '../core/pty-manager.js';
|
||||
import type { Db } from '../db/index.js';
|
||||
import { recordAudit } from '../core/audit-log.js';
|
||||
import { resolveGroupCwd } from '../core/group-session.js';
|
||||
import { sendManagerError } from './repos.js';
|
||||
|
||||
export function registerGroupRoutes(app: FastifyInstance, gm: GroupManager, db: Db): void {
|
||||
export function registerGroupRoutes(
|
||||
app: FastifyInstance,
|
||||
gm: GroupManager,
|
||||
db: Db,
|
||||
wt: WorktreeManager,
|
||||
manager: PtyManager,
|
||||
): void {
|
||||
app.get('/api/v1/groups', async (): Promise<GroupsListResponse> => ({ groups: gm.listGroups() }));
|
||||
|
||||
app.get('/api/v1/groups/:id', async (req, reply) => {
|
||||
@@ -88,4 +99,63 @@ export function registerGroupRoutes(app: FastifyInstance, gm: GroupManager, db:
|
||||
return sendManagerError(reply, err);
|
||||
}
|
||||
});
|
||||
|
||||
// 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
|
||||
// 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) => {
|
||||
const { id } = req.params as { id: string };
|
||||
const body = (req.body as Partial<CreateGroupSessionRequest> | null) ?? {};
|
||||
const command = body.command ?? 'claude';
|
||||
if (command !== 'claude' && command !== 'bash') {
|
||||
return reply.status(400).send({ error: { code: 'BAD_REQUEST', message: 'command must be claude or bash' } });
|
||||
}
|
||||
const branch = typeof body.branch === 'string' && body.branch.trim() !== '' ? body.branch.trim() : null;
|
||||
|
||||
let group;
|
||||
try {
|
||||
group = gm.getGroup(id);
|
||||
} catch (err) {
|
||||
return sendManagerError(reply, err);
|
||||
}
|
||||
|
||||
const dirs: string[] = [];
|
||||
const skipped: Array<{ repoId: string; reason: string }> = [];
|
||||
for (const repoId of group.repoIds) {
|
||||
let worktrees;
|
||||
try {
|
||||
worktrees = await wt.listRepoWorktrees(repoId);
|
||||
} catch (err) {
|
||||
skipped.push({ repoId, reason: err instanceof Error ? err.message : String(err) });
|
||||
continue;
|
||||
}
|
||||
const match = branch ? worktrees.find((w) => w.branch === branch) : worktrees.find((w) => w.isMain);
|
||||
if (!match) {
|
||||
skipped.push({ repoId, reason: branch ? `no worktree on branch ${branch}` : 'no main worktree' });
|
||||
continue;
|
||||
}
|
||||
if (!dirs.includes(match.path)) dirs.push(match.path);
|
||||
}
|
||||
|
||||
if (dirs.length === 0) {
|
||||
return reply.status(400).send({ error: { code: 'BAD_REQUEST', message: 'no directory to span (group has no resolvable worktree)' } });
|
||||
}
|
||||
// cwd = parent commun des repos couverts, chacun relié en --add-dir (P6). Voir resolveGroupCwd.
|
||||
const { cwd, addDirs } = resolveGroupCwd(dirs);
|
||||
|
||||
try {
|
||||
const session = manager.spawn({ cwd, addDirs, command, groupId: id });
|
||||
recordAudit(db, {
|
||||
actor: req.authContext?.tokenId ?? 'unknown',
|
||||
action: 'group.session.create',
|
||||
resourceId: id,
|
||||
details: { command, dirs: dirs.length, ...(branch ? { branch } : {}) },
|
||||
});
|
||||
return reply.status(201).send({ session, dirs, skipped } satisfies GroupSessionResponse);
|
||||
} catch (err) {
|
||||
const statusCode = (err as { statusCode?: number }).statusCode ?? 500;
|
||||
return reply.status(statusCode).send({ error: { code: 'SPAWN_FAILED', message: (err as Error).message } });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
import type { FastifyInstance } from 'fastify';
|
||||
import type { CreateSessionRequest, SessionResponse, SessionsListResponse } from '@arboretum/shared';
|
||||
import type { CreateSessionRequest, HideDiscoveredResponse, SessionResponse, SessionsListResponse } from '@arboretum/shared';
|
||||
import type { PtyManager } from '../core/pty-manager.js';
|
||||
import { mergeSessions, type DiscoveryService } from '../core/discovery-service.js';
|
||||
import { hideSession, unhideSession, type Db } from '../db/index.js';
|
||||
import { recordAudit } from '../core/audit-log.js';
|
||||
|
||||
export function registerSessionRoutes(app: FastifyInstance, manager: PtyManager, discovery: DiscoveryService): void {
|
||||
app.get('/api/v1/sessions', async (): Promise<SessionsListResponse> => {
|
||||
return { sessions: mergeSessions(manager.list(), discovery.list()) };
|
||||
export function registerSessionRoutes(app: FastifyInstance, manager: PtyManager, discovery: DiscoveryService, db: Db): void {
|
||||
app.get('/api/v1/sessions', async (req): Promise<SessionsListResponse> => {
|
||||
const includeHidden = (req.query as { includeHidden?: string }).includeHidden === 'true';
|
||||
const all = mergeSessions(manager.list(), discovery.list());
|
||||
return { sessions: includeHidden ? all : all.filter((s) => !s.hidden) };
|
||||
});
|
||||
|
||||
// Résout le claudeSessionId d'un :id de session (managée par UUID, ou découverte dont l'id EST le sid).
|
||||
const resolveClaudeSid = (id: string): string | null => {
|
||||
const managed = manager.resumeTargetById(id);
|
||||
if (managed?.claudeSessionId) return managed.claudeSessionId;
|
||||
return discovery.getDiscovered(id) ? id : null;
|
||||
};
|
||||
|
||||
app.post('/api/v1/sessions', async (req, reply) => {
|
||||
const body = req.body as Partial<CreateSessionRequest> | null;
|
||||
if (!body || typeof body.cwd !== 'string' || !body.cwd.startsWith('/')) {
|
||||
@@ -26,20 +37,32 @@ export function registerSessionRoutes(app: FastifyInstance, manager: PtyManager,
|
||||
}
|
||||
});
|
||||
|
||||
// Reprise d'une session morte : nouveau PTY managé `--resume <id>` DANS SON CWD D'ORIGINE (spike S1).
|
||||
// Le cwd n'est jamais fourni par le client : il est lu sur disque via la découverte.
|
||||
// Reprise d'une session morte : nouveau PTY managé `--resume <claudeSessionId>` DANS SON CWD D'ORIGINE
|
||||
// (spike S1). Le cwd n'est JAMAIS fourni par le client. Deux origines d'id possibles :
|
||||
// - session managée morte (id = UUID Arboretum) → cwd + claudeSessionId + groupe lus en DB ;
|
||||
// - session claude EXTERNE découverte (id = claudeSessionId) → cwd lu sur disque.
|
||||
app.post('/api/v1/sessions/:id/resume', async (req, reply) => {
|
||||
const { id } = req.params as { id: string };
|
||||
const discovered = discovery.getDiscovered(id);
|
||||
if (!discovered) {
|
||||
const managed = manager.resumeTargetById(id);
|
||||
const discovered = managed ? null : discovery.getDiscovered(id);
|
||||
if (!managed && !discovered) {
|
||||
return reply.status(404).send({ error: { code: 'NOT_FOUND', message: 'No resumable session with this id' } });
|
||||
}
|
||||
const cwd = managed ? managed.cwd : discovered!.cwd;
|
||||
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(id) || manager.findLiveByClaudeSessionId(id)) {
|
||||
if (discovery.isClaudeSessionLive(claudeSessionId) || manager.findLiveByClaudeSessionId(claudeSessionId)) {
|
||||
return reply.status(409).send({ error: { code: 'SESSION_LIVE', message: 'Session is live — fork it instead' } });
|
||||
}
|
||||
try {
|
||||
const session = manager.spawn({ cwd: discovered.cwd, resume: { claudeSessionId: id } });
|
||||
// Session de groupe (P6) : re-relie les mêmes répertoires (--add-dir) et son groupe au resume.
|
||||
const ctx = managed ? { addedDirs: managed.addedDirs, groupId: managed.groupId } : manager.groupSessionContext(claudeSessionId);
|
||||
const session = manager.spawn({
|
||||
cwd,
|
||||
resume: { claudeSessionId },
|
||||
...(ctx?.addedDirs.length ? { addDirs: ctx.addedDirs } : {}),
|
||||
...(ctx?.groupId ? { groupId: ctx.groupId } : {}),
|
||||
});
|
||||
const res: SessionResponse = { session };
|
||||
return reply.status(201).send(res);
|
||||
} catch (err) {
|
||||
@@ -49,14 +72,18 @@ export function registerSessionRoutes(app: FastifyInstance, manager: PtyManager,
|
||||
});
|
||||
|
||||
// Fork : duplique une session (vivante ou morte) sans la corrompre (`--resume <id> --fork-session`).
|
||||
// Même résolution d'id que /resume (managée morte par UUID, sinon externe découverte par claudeSessionId).
|
||||
app.post('/api/v1/sessions/:id/fork', async (req, reply) => {
|
||||
const { id } = req.params as { id: string };
|
||||
const discovered = discovery.getDiscovered(id);
|
||||
if (!discovered) {
|
||||
const managed = manager.resumeTargetById(id);
|
||||
const discovered = managed ? null : discovery.getDiscovered(id);
|
||||
if (!managed && !discovered) {
|
||||
return reply.status(404).send({ error: { code: 'NOT_FOUND', message: 'No session with this id to fork' } });
|
||||
}
|
||||
const cwd = managed ? managed.cwd : discovered!.cwd;
|
||||
const claudeSessionId = managed ? managed.claudeSessionId : id;
|
||||
try {
|
||||
const session = manager.spawn({ cwd: discovered.cwd, resume: { claudeSessionId: id, fork: true } });
|
||||
const session = manager.spawn({ cwd, resume: { claudeSessionId, fork: true } });
|
||||
const res: SessionResponse = { session };
|
||||
return reply.status(201).send(res);
|
||||
} catch (err) {
|
||||
@@ -65,6 +92,49 @@ export function registerSessionRoutes(app: FastifyInstance, manager: PtyManager,
|
||||
}
|
||||
});
|
||||
|
||||
// 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.
|
||||
app.post('/api/v1/sessions/:id/hide', async (req, reply) => {
|
||||
const { id } = req.params as { id: string };
|
||||
const sid = resolveClaudeSid(id);
|
||||
if (!sid) {
|
||||
return reply.status(404).send({ error: { code: 'NOT_FOUND', message: 'No session with this id to hide' } });
|
||||
}
|
||||
hideSession(db, sid);
|
||||
await discovery.refresh(); // rediffuse l'état (hidden) aux clients
|
||||
recordAudit(db, { actor: req.authContext?.tokenId ?? 'unknown', action: 'session.hide', resourceId: sid });
|
||||
return reply.send({ ok: true });
|
||||
});
|
||||
|
||||
// Ré-affiche une session masquée.
|
||||
app.delete('/api/v1/sessions/:id/hide', async (req, reply) => {
|
||||
const { id } = req.params as { id: string };
|
||||
const sid = resolveClaudeSid(id);
|
||||
if (!sid) {
|
||||
return reply.status(404).send({ error: { code: 'NOT_FOUND', message: 'No session with this id to unhide' } });
|
||||
}
|
||||
unhideSession(db, sid);
|
||||
await discovery.refresh();
|
||||
recordAudit(db, { actor: req.authContext?.tokenId ?? 'unknown', action: 'session.unhide', resourceId: sid });
|
||||
return reply.send({ ok: true });
|
||||
});
|
||||
|
||||
// Masquage de masse : nettoie d'un coup tout l'historique externe actuellement visible. Les futures
|
||||
// sessions externes réapparaîtront (sinon --no-discover). Renvoie le nombre de sessions masquées.
|
||||
app.post('/api/v1/sessions/hide-discovered', async (req, reply) => {
|
||||
const sids = discovery
|
||||
.list()
|
||||
.filter((s) => !s.hidden && s.claudeSessionId)
|
||||
.map((s) => s.claudeSessionId as string);
|
||||
for (const sid of sids) hideSession(db, sid);
|
||||
await discovery.refresh();
|
||||
if (sids.length > 0) {
|
||||
recordAudit(db, { actor: req.authContext?.tokenId ?? 'unknown', action: 'session.hideDiscovered', resourceId: null, details: { count: sids.length } });
|
||||
}
|
||||
const res: HideDiscoveredResponse = { hidden: sids.length };
|
||||
return reply.send(res);
|
||||
});
|
||||
|
||||
app.delete('/api/v1/sessions/:id', async (req, reply) => {
|
||||
const { id } = req.params as { id: string };
|
||||
if (!manager.kill(id)) {
|
||||
|
||||
@@ -3,6 +3,8 @@ import type {
|
||||
AdoptWorktreeRequest,
|
||||
CreateWorktreeRequest,
|
||||
CreateWorktreeResponse,
|
||||
SessionResponse,
|
||||
StartRepoSessionRequest,
|
||||
WorktreeResponse,
|
||||
WorktreesListResponse,
|
||||
} from '@arboretum/shared';
|
||||
@@ -43,6 +45,33 @@ export function registerWorktreeRoutes(app: FastifyInstance, wt: WorktreeManager
|
||||
}
|
||||
});
|
||||
|
||||
// Session sur le checkout principal (« bosser sur la branche principale » sans worktree),
|
||||
// avec création/bascule de branche optionnelle côté serveur.
|
||||
app.post('/api/v1/repos/:id/session', async (req, reply) => {
|
||||
const { id } = req.params as { id: string };
|
||||
const body = (req.body as Partial<StartRepoSessionRequest> | null) ?? {};
|
||||
if (body.command != null && body.command !== 'claude' && body.command !== 'bash') {
|
||||
return reply.status(400).send({ error: { code: 'BAD_REQUEST', message: 'command must be claude or bash' } });
|
||||
}
|
||||
if (body.branch != null && typeof body.branch !== 'string') {
|
||||
return reply.status(400).send({ error: { code: 'BAD_REQUEST', message: 'branch must be a string' } });
|
||||
}
|
||||
if (body.newBranch != null && typeof body.newBranch !== 'boolean') {
|
||||
return reply.status(400).send({ error: { code: 'BAD_REQUEST', message: 'newBranch must be a boolean' } });
|
||||
}
|
||||
try {
|
||||
const out = await wt.startMainSession(id, {
|
||||
...(body.command !== undefined ? { command: body.command } : {}),
|
||||
...(body.branch !== undefined ? { branch: body.branch } : {}),
|
||||
...(body.newBranch !== undefined ? { newBranch: body.newBranch } : {}),
|
||||
});
|
||||
const res: SessionResponse = { session: out.session };
|
||||
return reply.status(201).send(res);
|
||||
} catch (err) {
|
||||
return sendManagerError(reply, err);
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/api/v1/repos/:id/worktrees/adopt', async (req, reply) => {
|
||||
const { id } = req.params as { id: string };
|
||||
const body = req.body as Partial<AdoptWorktreeRequest> | null;
|
||||
|
||||
@@ -148,6 +148,20 @@ describe('app e2e — auth, origin et sessions', () => {
|
||||
expect(res.json()).toEqual({ sessions: [] });
|
||||
});
|
||||
|
||||
it('masquage des sessions : hide-discovered (vide), includeHidden, hide d’un id inconnu → 404', async () => {
|
||||
const headers = { authorization: `Bearer ${t.token}` };
|
||||
const mass = await t.bundle.app.inject({ method: 'POST', url: '/api/v1/sessions/hide-discovered', headers });
|
||||
expect(mass.statusCode).toBe(200);
|
||||
expect(mass.json()).toEqual({ hidden: 0 });
|
||||
|
||||
const withHidden = await t.bundle.app.inject({ method: 'GET', url: '/api/v1/sessions?includeHidden=true', headers });
|
||||
expect(withHidden.statusCode).toBe(200);
|
||||
expect(withHidden.json()).toEqual({ sessions: [] });
|
||||
|
||||
const unknown = await t.bundle.app.inject({ method: 'POST', url: '/api/v1/sessions/nope/hide', headers });
|
||||
expect(unknown.statusCode).toBe(404);
|
||||
});
|
||||
|
||||
it('Origin interdite → 403 même avec un Bearer valide, et même sur la route publique de login', async () => {
|
||||
const res = await t.bundle.app.inject({
|
||||
method: 'GET',
|
||||
|
||||
29
packages/server/test/claude-launcher.test.ts
Normal file
29
packages/server/test/claude-launcher.test.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { buildSpawnSpec } from '../src/core/claude-launcher.js';
|
||||
|
||||
// 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)', () => {
|
||||
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');
|
||||
expect(spec.args).toEqual(['--add-dir', '/a', '--add-dir', '/b', '--add-dir', '/c']);
|
||||
});
|
||||
|
||||
it('combine --resume et --add-dir (reprise d’une session de groupe)', () => {
|
||||
const spec = buildSpawnSpec({ command: 'claude', resume: { claudeSessionId: 'sid' }, addDirs: ['/x'] });
|
||||
expect(spec.args).toEqual(['--resume', 'sid', '--add-dir', '/x']);
|
||||
});
|
||||
|
||||
it('aucun --add-dir quand addDirs est vide/absent', () => {
|
||||
expect(buildSpawnSpec({ command: 'claude' }).args).toEqual([]);
|
||||
expect(buildSpawnSpec({ command: 'claude', addDirs: [] }).args).toEqual([]);
|
||||
});
|
||||
|
||||
it('ignore addDirs pour bash (pas de --add-dir)', () => {
|
||||
const spec = buildSpawnSpec({ command: 'bash', addDirs: ['/a', '/b'] });
|
||||
expect(spec.file).toBe('bash');
|
||||
expect(spec.args).toEqual(['--norc']);
|
||||
});
|
||||
});
|
||||
@@ -7,7 +7,7 @@ import { DiscoveryService, mergeSessions } from '../src/core/discovery-service.j
|
||||
import { munge } from '../src/core/jsonl-discovery.js';
|
||||
import { readProcStart } from '../src/core/session-registry.js';
|
||||
import { PtyManager } from '../src/core/pty-manager.js';
|
||||
import { openDb, type Db } from '../src/db/index.js';
|
||||
import { openDb, hideSession, unhideSession, listHiddenSessionIds, type Db } from '../src/db/index.js';
|
||||
|
||||
function writeJsonl(projectsDir: string, cwd: string, sid: string): void {
|
||||
const dir = join(projectsDir, munge(cwd));
|
||||
@@ -30,7 +30,7 @@ describe('DiscoveryService', () => {
|
||||
sessionsDir = mkdtempSync(join(tmpdir(), 'arb-sess-'));
|
||||
db = openDb(':memory:');
|
||||
manager = new PtyManager(db, sessionsDir);
|
||||
svc = new DiscoveryService({ ptyManager: manager, projectsDir, sessionsDir });
|
||||
svc = new DiscoveryService({ db, ptyManager: manager, projectsDir, sessionsDir });
|
||||
});
|
||||
afterEach(() => {
|
||||
svc.stop();
|
||||
@@ -71,6 +71,29 @@ describe('DiscoveryService', () => {
|
||||
expect(svc.list().find((x) => x.id === 'managed-sid')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('marque hidden une session masquée mais la garde résoluble (resume/fork)', async () => {
|
||||
writeJsonl(projectsDir, '/home/u/old', 'old-sid');
|
||||
hideSession(db, 'old-sid');
|
||||
await svc.refresh();
|
||||
const s = svc.list().find((x) => x.id === 'old-sid');
|
||||
expect(s?.hidden).toBe(true);
|
||||
// toujours connue : la reprise/le fork doivent rester possibles
|
||||
expect(svc.getDiscovered('old-sid')?.cwd).toBe('/home/u/old');
|
||||
// ré-affichage
|
||||
unhideSession(db, 'old-sid');
|
||||
await svc.refresh();
|
||||
expect(svc.list().find((x) => x.id === 'old-sid')?.hidden).toBe(false);
|
||||
});
|
||||
|
||||
it('hideSession est idempotent et listHiddenSessionIds reflète l’état', () => {
|
||||
hideSession(db, 'a');
|
||||
hideSession(db, 'a');
|
||||
hideSession(db, 'b');
|
||||
expect(listHiddenSessionIds(db)).toEqual(new Set(['a', 'b']));
|
||||
unhideSession(db, 'a');
|
||||
expect(listHiddenSessionIds(db)).toEqual(new Set(['b']));
|
||||
});
|
||||
|
||||
it('émet discovery_update sur changement uniquement', async () => {
|
||||
writeJsonl(projectsDir, '/home/u/x', 'sid-x');
|
||||
const seen: SessionSummary[] = [];
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
addWorktree,
|
||||
removeWorktree,
|
||||
pruneWorktrees,
|
||||
switchBranch,
|
||||
isDirtyWorktreeError,
|
||||
} from '../src/core/git.js';
|
||||
|
||||
@@ -118,6 +119,20 @@ describe('opérations git (repo tmp réel)', () => {
|
||||
expect((await listWorktrees(repo)).some((w) => resolve(w.path) === resolve(wtPath))).toBe(false);
|
||||
});
|
||||
|
||||
it('switchBranch : create=true crée une branche, create=false bascule sur une existante', async () => {
|
||||
const repo = makeTmpRepo();
|
||||
const cur = (): string => execFileSync('git', ['branch', '--show-current'], { cwd: repo }).toString().trim();
|
||||
|
||||
await switchBranch(repo, { branch: 'feature/new', create: true });
|
||||
expect(cur()).toBe('feature/new');
|
||||
|
||||
await switchBranch(repo, { branch: 'main', create: false });
|
||||
expect(cur()).toBe('main');
|
||||
|
||||
// créer une branche déjà existante échoue (git refuse).
|
||||
await expect(switchBranch(repo, { branch: 'feature/new', create: true })).rejects.toBeDefined();
|
||||
});
|
||||
|
||||
it('prune retire un worktree dont le dossier a disparu', async () => {
|
||||
const repo = makeTmpRepo();
|
||||
const wtPath = join(dirname(repo), `${basename(repo)}-wt-gone`);
|
||||
|
||||
45
packages/server/test/group-cwd.test.ts
Normal file
45
packages/server/test/group-cwd.test.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { commonAncestorDir, resolveGroupCwd } from '../src/core/group-session.js';
|
||||
|
||||
describe('commonAncestorDir', () => {
|
||||
it('renvoie le chemin lui-même pour un seul répertoire', () => {
|
||||
expect(commonAncestorDir(['/home/johan/WebstormProjects/arboretum'])).toBe('/home/johan/WebstormProjects/arboretum');
|
||||
});
|
||||
|
||||
it('renvoie le parent commun de deux siblings', () => {
|
||||
expect(commonAncestorDir(['/p/a', '/p/b'])).toBe('/p');
|
||||
});
|
||||
|
||||
it('gère un répertoire ancêtre d’un autre', () => {
|
||||
expect(commonAncestorDir(['/p/a', '/p/a/b'])).toBe('/p/a');
|
||||
});
|
||||
|
||||
it('compare par segments, pas par préfixe de chaîne', () => {
|
||||
// /a/bc n'est PAS un ancêtre de /a/bcd : ancêtre commun = /a
|
||||
expect(commonAncestorDir(['/a/bc', '/a/bcd'])).toBe('/a');
|
||||
});
|
||||
|
||||
it('renvoie la racine quand aucun segment n’est commun', () => {
|
||||
expect(commonAncestorDir(['/x/a', '/y/b'])).toBe('/');
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveGroupCwd', () => {
|
||||
it('mono-repo : cwd = le repo, addDirs sera filtré à vide par PtyManager', () => {
|
||||
const { cwd, addDirs } = resolveGroupCwd(['/p/a']);
|
||||
expect(cwd).toBe('/p/a');
|
||||
expect(addDirs).toEqual(['/p/a']);
|
||||
});
|
||||
|
||||
it('multi-repos sous un parent commun : cwd = parent, addDirs = tous les repos', () => {
|
||||
const dirs = ['/home/johan/WebstormProjects/beehelp_lambdas', '/home/johan/WebstormProjects/beehelp_api'];
|
||||
const { cwd, addDirs } = resolveGroupCwd(dirs);
|
||||
expect(cwd).toBe('/home/johan/WebstormProjects');
|
||||
expect(addDirs).toEqual(dirs);
|
||||
});
|
||||
|
||||
it('garde-fou : repos sur des racines différentes → retombe sur le premier répertoire', () => {
|
||||
const { cwd } = resolveGroupCwd(['/x/a', '/y/b']);
|
||||
expect(cwd).toBe('/x/a');
|
||||
});
|
||||
});
|
||||
@@ -97,4 +97,15 @@ describe('GroupManager', () => {
|
||||
db.prepare('DELETE FROM repos WHERE id = ?').run('repo-a');
|
||||
expect(gm.getGroup(g.id).repoIds).toEqual(['repo-b']);
|
||||
});
|
||||
|
||||
it('deleteGroup : désorpheline le group_id des sessions de groupe (P6)', () => {
|
||||
const g = gm.createGroup({ label: 'A' });
|
||||
// session de groupe liée à g (insérée directement, comme le ferait PtyManager.spawn).
|
||||
db.prepare(
|
||||
'INSERT INTO sessions (id, cwd, command, created_at, group_id) VALUES (?, ?, ?, ?, ?)',
|
||||
).run('sess-1', '/tmp/a', 'claude', new Date().toISOString(), g.id);
|
||||
expect(gm.deleteGroup(g.id)).toBe(true);
|
||||
const row = db.prepare('SELECT group_id FROM sessions WHERE id = ?').get('sess-1') as { group_id: string | null };
|
||||
expect(row.group_id).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -187,6 +187,34 @@ describe('PtyManager (pty mocké)', () => {
|
||||
expect(listed).toMatchObject({ live: false, resumable: true, claudeSessionId: 'sid-known' });
|
||||
});
|
||||
|
||||
it('resumeTargetById : session claude morte → cwd + claudeSessionId + groupe ; null sinon', () => {
|
||||
const d1 = mkdtempSync(join(tmpdir(), 'arb-rt-'));
|
||||
try {
|
||||
const summary = manager.spawn({ cwd, command: 'claude', addDirs: [d1], groupId: 'grpR' });
|
||||
db.prepare('UPDATE sessions SET claude_session_id = ? WHERE id = ?').run('cs-resume', summary.id);
|
||||
// vivante → null (resume direct interdit ; fork passe par le même chemin)
|
||||
expect(manager.resumeTargetById(summary.id)).toBeNull();
|
||||
lastPty().emitExit(0);
|
||||
// morte avec claudeSessionId connu → cible complète
|
||||
expect(manager.resumeTargetById(summary.id)).toEqual({
|
||||
cwd,
|
||||
claudeSessionId: 'cs-resume',
|
||||
addedDirs: [d1],
|
||||
groupId: 'grpR',
|
||||
});
|
||||
// id inconnu → null
|
||||
expect(manager.resumeTargetById('nope')).toBeNull();
|
||||
} finally {
|
||||
rmSync(d1, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it('resumeTargetById : session bash morte (sans claudeSessionId) → null', () => {
|
||||
const { summary, pty } = spawnBash();
|
||||
pty.emitExit(0);
|
||||
expect(manager.resumeTargetById(summary.id)).toBeNull();
|
||||
});
|
||||
|
||||
it('capture le claudeSessionId via le registre (poll par pid) → findLiveByClaudeSessionId', () => {
|
||||
vi.useFakeTimers();
|
||||
const sessDir = mkdtempSync(join(tmpdir(), 'arb-sess-'));
|
||||
@@ -574,4 +602,53 @@ describe('PtyManager (pty mocké)', () => {
|
||||
expect(manager.attach(summary.id, makeBinding('interactive'), 80, 24)).toEqual({ ok: false, code: 'NOT_FOUND' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('session de groupe multi-repo (P6)', () => {
|
||||
it('spawn avec addDirs : --add-dir au pty, addedDirs + groupId résumés et persistés', () => {
|
||||
const d1 = mkdtempSync(join(tmpdir(), 'arb-g1-'));
|
||||
const d2 = mkdtempSync(join(tmpdir(), 'arb-g2-'));
|
||||
try {
|
||||
const summary = manager.spawn({ cwd, command: 'claude', addDirs: [d1, d2], groupId: 'grp1' });
|
||||
expect(lastPty().args).toEqual(['--add-dir', d1, '--add-dir', d2]);
|
||||
expect(summary.addedDirs).toEqual([d1, d2]);
|
||||
expect(summary.groupId).toBe('grp1');
|
||||
const row = db.prepare('SELECT added_dirs, group_id FROM sessions WHERE id = ?').get(summary.id) as {
|
||||
added_dirs: string | null;
|
||||
group_id: string | null;
|
||||
};
|
||||
expect(JSON.parse(row.added_dirs as string)).toEqual([d1, d2]);
|
||||
expect(row.group_id).toBe('grp1');
|
||||
} finally {
|
||||
rmSync(d1, { recursive: true, force: true });
|
||||
rmSync(d2, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it('dédoublonne et écarte le cwd primaire des addDirs', () => {
|
||||
const d1 = mkdtempSync(join(tmpdir(), 'arb-g4-'));
|
||||
try {
|
||||
const summary = manager.spawn({ cwd, command: 'claude', addDirs: [d1, d1, cwd] });
|
||||
expect(summary.addedDirs).toEqual([d1]);
|
||||
} finally {
|
||||
rmSync(d1, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it('rejette un addDir inexistant (400)', () => {
|
||||
expect(() => manager.spawn({ cwd, command: 'bash', addDirs: ['/no/such/dir/xyz-arb'] })).toThrow();
|
||||
});
|
||||
|
||||
it('groupSessionContext renvoie les addedDirs/groupId persistés (resume)', () => {
|
||||
const d1 = mkdtempSync(join(tmpdir(), 'arb-g5-'));
|
||||
try {
|
||||
const summary = manager.spawn({ cwd, command: 'claude', addDirs: [d1], groupId: 'grpX' });
|
||||
// simule la capture du claudeSessionId (normalement résolue via le registre)
|
||||
db.prepare('UPDATE sessions SET claude_session_id = ? WHERE id = ?').run('cs-1', summary.id);
|
||||
expect(manager.groupSessionContext('cs-1')).toEqual({ addedDirs: [d1], groupId: 'grpX' });
|
||||
expect(manager.groupSessionContext('unknown')).toBeNull();
|
||||
} finally {
|
||||
rmSync(d1, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -69,7 +69,7 @@ describe('WorktreeManager', () => {
|
||||
claudeHome = mkdtempSync(join(tmpdir(), 'arb-ch-'));
|
||||
dirs.push(claudeHome);
|
||||
pty = new PtyManager(db, join(claudeHome, 'sessions'));
|
||||
discovery = new DiscoveryService({ ptyManager: pty, projectsDir: join(claudeHome, 'projects'), sessionsDir: join(claudeHome, 'sessions') });
|
||||
discovery = new DiscoveryService({ db, ptyManager: pty, projectsDir: join(claudeHome, 'projects'), sessionsDir: join(claudeHome, 'sessions') });
|
||||
wt = new WorktreeManager(db, pty, discovery);
|
||||
});
|
||||
|
||||
@@ -116,6 +116,46 @@ describe('WorktreeManager', () => {
|
||||
await expect(wt.createWorktree(r.id, { branch: '../evil', newBranch: true })).rejects.toMatchObject({ statusCode: 400 });
|
||||
});
|
||||
|
||||
it('startMainSession : session dans le checkout principal (branche actuelle, sans mutation git)', async () => {
|
||||
const repo = makeTmpRepo();
|
||||
const r = await wt.addRepo({ path: repo });
|
||||
const out = await wt.startMainSession(r.id, { command: 'bash' });
|
||||
expect(resolve(out.session.cwd)).toBe(resolve(repo));
|
||||
expect(out.session).toMatchObject({ command: 'bash', live: true });
|
||||
// pas de bascule de branche → toujours sur main.
|
||||
expect(execFileSync('git', ['branch', '--show-current'], { cwd: repo }).toString().trim()).toBe('main');
|
||||
const main = (await wt.listRepoWorktrees(r.id, true)).find((w) => w.isMain);
|
||||
expect(main?.sessions.some((s) => s.id === out.session.id)).toBe(true);
|
||||
});
|
||||
|
||||
it('startMainSession : newBranch crée et bascule la branche dans le checkout principal + event', async () => {
|
||||
const repo = makeTmpRepo();
|
||||
const r = await wt.addRepo({ path: repo });
|
||||
const events: Array<{ worktree: WorktreeSummary }> = [];
|
||||
wt.on('worktree_update', (e) => events.push(e));
|
||||
const out = await wt.startMainSession(r.id, { command: 'bash', branch: 'feature/x', newBranch: true });
|
||||
expect(execFileSync('git', ['branch', '--show-current'], { cwd: repo }).toString().trim()).toBe('feature/x');
|
||||
expect(out.worktree?.branch).toBe('feature/x');
|
||||
expect(events.some((e) => e.worktree.isMain && e.worktree.branch === 'feature/x')).toBe(true);
|
||||
});
|
||||
|
||||
it('startMainSession : checkout principal sale → 409 DIRTY_TREE (pas de bascule)', async () => {
|
||||
const repo = makeTmpRepo();
|
||||
const r = await wt.addRepo({ path: repo });
|
||||
writeFileSync(join(repo, 'scratch.txt'), 'wip\n'); // arbre sale
|
||||
await expect(wt.startMainSession(r.id, { command: 'bash', branch: 'feature/y', newBranch: true })).rejects.toMatchObject({
|
||||
statusCode: 409,
|
||||
code: 'DIRTY_TREE',
|
||||
});
|
||||
expect(execFileSync('git', ['branch', '--show-current'], { cwd: repo }).toString().trim()).toBe('main');
|
||||
});
|
||||
|
||||
it('startMainSession : branche invalide → 400', async () => {
|
||||
const repo = makeTmpRepo();
|
||||
const r = await wt.addRepo({ path: repo });
|
||||
await expect(wt.startMainSession(r.id, { command: 'bash', branch: '../evil', newBranch: true })).rejects.toMatchObject({ statusCode: 400 });
|
||||
});
|
||||
|
||||
it('deleteWorktree : main refusé (400), dirty refusé (409) puis force OK', async () => {
|
||||
const repo = makeTmpRepo();
|
||||
const r = await wt.addRepo({ path: repo });
|
||||
|
||||
@@ -53,6 +53,11 @@ export interface SessionsListResponse {
|
||||
export interface SessionResponse {
|
||||
session: SessionSummary;
|
||||
}
|
||||
/** 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
|
||||
// sont TOUJOURS dérivés du :id (lu sur disque), jamais fournis par le client (cf. spike S1).
|
||||
@@ -128,6 +133,20 @@ export interface AdoptWorktreeRequest {
|
||||
preTrust?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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. */
|
||||
command?: 'claude' | 'bash';
|
||||
/** si fourni : crée/bascule cette branche dans le checkout principal avant la session. */
|
||||
branch?: string;
|
||||
/** true (défaut quand `branch` fourni) : `git switch -c` ; false : bascule sur une branche existante. */
|
||||
newBranch?: boolean;
|
||||
}
|
||||
|
||||
// ---- Groupes de travail (P5) ----
|
||||
export interface GroupsListResponse {
|
||||
groups: GroupSummary[];
|
||||
@@ -152,6 +171,22 @@ export interface AddRepoRequest {
|
||||
repoId: string;
|
||||
}
|
||||
|
||||
// ---- Session de groupe multi-repo (P6) ----
|
||||
/** Lance UNE session Claude couvrant tous les repos du groupe (via `--add-dir`). */
|
||||
export interface CreateGroupSessionRequest {
|
||||
/** défaut : claude. */
|
||||
command?: 'claude' | 'bash';
|
||||
/** présent → couvre le worktree de cette branche dans chaque repo ; absent → les checkouts principaux. */
|
||||
branch?: string;
|
||||
}
|
||||
export interface GroupSessionResponse {
|
||||
session: SessionSummary;
|
||||
/** répertoires effectivement couverts par la session (cwd primaire en tête). */
|
||||
dirs: string[];
|
||||
/** repos du groupe pour lesquels aucun worktree n'a pu être résolu. */
|
||||
skipped: Array<{ repoId: string; reason: string }>;
|
||||
}
|
||||
|
||||
// ---- Navigateur de répertoires (sélecteur de dossier côté web) ----
|
||||
export interface FsEntry {
|
||||
name: string;
|
||||
|
||||
@@ -113,6 +113,14 @@ export interface SessionSummary {
|
||||
waitingFor?: string | null;
|
||||
/** dialogue typé en cours (présent quand activity === 'waiting'). */
|
||||
dialog?: SessionDialog | null;
|
||||
// ---- P6 : session de groupe multi-repo (additif) ----
|
||||
/** répertoires supplémentaires couverts via `--add-dir` ; absent/[] pour une session mono-repo. */
|
||||
addedDirs?: string[];
|
||||
/** groupe propriétaire d'une session de groupe (couvre plusieurs repos) ; null/absent sinon. */
|
||||
groupId?: string | null;
|
||||
// ---- Masquage (additif) ----
|
||||
/** true = session découverte masquée par l'utilisateur (exclue de la liste sauf includeHidden). */
|
||||
hidden?: boolean;
|
||||
}
|
||||
|
||||
// ---- Worktrees & repos (P3) ----
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<noscript>
|
||||
<div style="padding: 24px; font-family: system-ui, sans-serif; color: #f4f4f5; text-align: center">
|
||||
Arboretum — mission control for your AI coding agents.
|
||||
<a href="https://git.lidge.fr/johanleroy/git-arboretum" style="color: #34d399">View on Gitea</a>.
|
||||
<a href="https://git.lidge.fr/johanleroy/arboretum" style="color: #34d399">View on Gitea</a>.
|
||||
</div>
|
||||
</noscript>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
|
||||
16
packages/site/public/.htaccess
Normal file
16
packages/site/public/.htaccess
Normal file
@@ -0,0 +1,16 @@
|
||||
# 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
|
||||
# passent. Les bundles Vite sont déjà minifiés, hashés et gzippés : PageSpeed
|
||||
# n'apporte rien ici et casse le rendu. On le désactive pour ce vhost.
|
||||
#
|
||||
# NB : si l'hébergement interdit ces directives en .htaccess (AllowOverride
|
||||
# restrictif), Apache renverra une 500 → dans ce cas, supprimer ce fichier et
|
||||
# désactiver PageSpeed depuis Plesk (Apache & nginx Settings).
|
||||
<IfModule pagespeed_module>
|
||||
ModPagespeed off
|
||||
</IfModule>
|
||||
<IfModule ngx_pagespeed_module>
|
||||
pagespeed off;
|
||||
</IfModule>
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { INSTALL_COMMAND } from '../composables/useCopy';
|
||||
import { REPO, LICENSE, COFFEE } from '../lib/links';
|
||||
import IconGitea from './icons/IconGitea.vue';
|
||||
import CopyButton from './CopyButton.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const REPO = 'https://git.lidge.fr/johanleroy/git-arboretum';
|
||||
const LICENSE = 'https://git.lidge.fr/johanleroy/git-arboretum/src/branch/main/LICENSE';
|
||||
const COFFEE = 'https://buymeacoffee.com/johanleroy';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -40,7 +40,10 @@ const COFFEE = 'https://buymeacoffee.com/johanleroy';
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 2v2" /><path d="M14 2v2" /><path d="M5 8h13a1 1 0 0 1 1 1v2a4 4 0 0 1-4 4H8a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1Z" /><path d="M6 15a4 4 0 0 0 4 4h2a4 4 0 0 0 4-4" /><path d="M19 9h1.5a2.5 2.5 0 0 1 0 5H18" /></svg>
|
||||
{{ t('coffee') }}
|
||||
</a>
|
||||
<span class="font-mono text-[12.5px] text-zinc-600">npx @johanleroy/git-arboretum</span>
|
||||
<div class="flex items-center gap-2">
|
||||
<code class="font-mono text-[12.5px] text-zinc-600">{{ INSTALL_COMMAND }}</code>
|
||||
<CopyButton variant="icon" :text="INSTALL_COMMAND" :label="t('copyCommand')" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { REPO } from '../lib/links';
|
||||
import LangToggle from './LangToggle.vue';
|
||||
import IconGitea from './icons/IconGitea.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const REPO = 'https://git.lidge.fr/johanleroy/git-arboretum';
|
||||
|
||||
const navLinks = [
|
||||
{ href: '#features', key: 'navFeatures' },
|
||||
|
||||
57
packages/site/src/components/CopyButton.vue
Normal file
57
packages/site/src/components/CopyButton.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useCopy } from '../composables/useCopy';
|
||||
import IconCopy from './icons/IconCopy.vue';
|
||||
import IconCheck from './icons/IconCheck.vue';
|
||||
|
||||
// Bouton « copier » réutilisable, avec retour visuel (icône ✓ + label) pendant 1800 ms.
|
||||
// Deux variantes :
|
||||
// - 'bar' : bouton étiqueté intégré aux barres de commande (hero, CTA final).
|
||||
// - 'icon' : bouton compact icône seule, pour les blocs de code (étapes, footer).
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
text: string;
|
||||
variant?: 'bar' | 'icon';
|
||||
label?: string; // aria-label décrivant ce qui est copié
|
||||
barClass?: string; // padding/ajustements de la variante 'bar'
|
||||
}>(),
|
||||
{ variant: 'bar', label: '', barClass: 'px-[15px]' },
|
||||
);
|
||||
|
||||
const { t } = useI18n();
|
||||
const { copied, copy } = useCopy();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button
|
||||
v-if="variant === 'bar'"
|
||||
type="button"
|
||||
:aria-label="label || t('copy')"
|
||||
:class="[
|
||||
'inline-flex flex-none items-center gap-[7px] border-l border-zinc-800 bg-zinc-900 font-mono text-[13px] font-semibold transition-colors hover:bg-zinc-800 hover:text-emerald-400 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-emerald-500/70',
|
||||
barClass,
|
||||
copied ? 'text-emerald-400' : 'text-zinc-300',
|
||||
]"
|
||||
@click="copy(text)"
|
||||
>
|
||||
<component :is="copied ? IconCheck : IconCopy" :size="15" />
|
||||
<span aria-live="polite">{{ copied ? t('copied') : t('copy') }}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
v-else
|
||||
type="button"
|
||||
:aria-label="label || t('copy')"
|
||||
:title="copied ? t('copied') : label || t('copy')"
|
||||
:class="[
|
||||
'inline-flex flex-none items-center justify-center rounded-md border p-1.5 transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-500/70',
|
||||
copied
|
||||
? 'border-emerald-500/40 bg-zinc-800 text-emerald-400'
|
||||
: 'border-zinc-800 bg-zinc-900/80 text-zinc-400 hover:border-emerald-500/40 hover:bg-zinc-800 hover:text-emerald-400',
|
||||
]"
|
||||
@click="copy(text)"
|
||||
>
|
||||
<component :is="copied ? IconCheck : IconCopy" :size="14" />
|
||||
<span aria-live="polite" class="sr-only">{{ copied ? t('copied') : t('copy') }}</span>
|
||||
</button>
|
||||
</template>
|
||||
@@ -1,12 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useCopy, INSTALL_COMMAND } from '../composables/useCopy';
|
||||
import { INSTALL_COMMAND } from '../composables/useCopy';
|
||||
import { REPO } from '../lib/links';
|
||||
import IconGitea from './icons/IconGitea.vue';
|
||||
import IconCopy from './icons/IconCopy.vue';
|
||||
import CopyButton from './CopyButton.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { copied, copy } = useCopy();
|
||||
const REPO = 'https://git.lidge.fr/johanleroy/git-arboretum';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -34,15 +33,7 @@ const REPO = 'https://git.lidge.fr/johanleroy/git-arboretum';
|
||||
<div class="flex min-w-0 flex-1 items-center gap-2.5 overflow-x-auto whitespace-nowrap px-4 font-mono text-sm">
|
||||
<span class="text-emerald-400">$</span><span class="text-zinc-200">{{ INSTALL_COMMAND }}</span>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Copy install command"
|
||||
class="inline-flex flex-none items-center gap-[7px] border-l border-zinc-800 bg-zinc-900 px-4 font-mono text-[13px] font-semibold text-zinc-300 transition-colors hover:bg-zinc-800 hover:text-emerald-400 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-emerald-500/70"
|
||||
@click="copy()"
|
||||
>
|
||||
<IconCopy :size="15" />
|
||||
<span aria-live="polite">{{ copied ? t('copied') : t('copy') }}</span>
|
||||
</button>
|
||||
<CopyButton variant="bar" :text="INSTALL_COMMAND" :label="t('copyCommand')" bar-class="px-4" />
|
||||
</div>
|
||||
|
||||
<div class="mt-[18px]">
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||
import { useHeroTimeline, type SessionState } from '../composables/useHeroTimeline';
|
||||
import { DLG_OPTS } from '../i18n/content';
|
||||
import type { AppLocale } from '../i18n';
|
||||
import IconGitea from './icons/IconGitea.vue';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const { anim } = useHeroTimeline('hero-stage');
|
||||
@@ -20,10 +21,11 @@ const LINE_COLORS: Record<string, string> = {
|
||||
run: '#7dd3fc',
|
||||
};
|
||||
|
||||
// Couleurs alignées sur SessionStateBadge de l'app (zinc/emerald/amber/sky de Tailwind).
|
||||
const PILL: Record<SessionState, { bg: string; fg: string; dot: string; pulse: string }> = {
|
||||
idle: { bg: 'rgba(2,44,34,.6)', fg: '#34d399', dot: '#34d399', pulse: '' },
|
||||
busy: { bg: 'rgba(8,47,73,.7)', fg: '#7dd3fc', dot: '#7dd3fc', pulse: 'pulseSky 2s ease-in-out infinite' },
|
||||
waiting: { bg: 'rgba(69,26,3,.7)', fg: '#fcd34d', dot: '#fcd34d', pulse: 'pulseAmber 2.2s ease-in-out infinite' },
|
||||
idle: { bg: '#022c22', fg: '#34d399', dot: '#34d399', pulse: '' },
|
||||
busy: { bg: '#082f49', fg: '#7dd3fc', dot: '#7dd3fc', pulse: 'pulseSky 2s ease-in-out infinite' },
|
||||
waiting: { bg: '#451a03', fg: '#fcd34d', dot: '#fcd34d', pulse: 'pulseAmber 2.2s ease-in-out infinite' },
|
||||
};
|
||||
|
||||
const pill = computed(() => PILL[anim.value.sess]);
|
||||
@@ -33,36 +35,14 @@ 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).
|
||||
const dlgOptions = computed(() =>
|
||||
DLG_OPTS[locale.value as AppLocale].map((txt, i) => {
|
||||
const highlighted = anim.value.hl === i;
|
||||
const answered = anim.value.ans === i;
|
||||
const row: Record<string, string> = {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '9px',
|
||||
padding: '7px 9px',
|
||||
borderRadius: '7px',
|
||||
border: '1px solid transparent',
|
||||
background: 'rgba(9,9,11,.4)',
|
||||
transition: 'background .2s, border-color .2s',
|
||||
};
|
||||
if (highlighted) {
|
||||
row.background = 'rgba(69,26,3,.5)';
|
||||
row.border = '1px solid rgba(217,119,6,.6)';
|
||||
}
|
||||
if (answered) {
|
||||
row.background = 'rgba(2,44,34,.45)';
|
||||
row.border = '1px solid rgba(5,150,105,.6)';
|
||||
}
|
||||
return {
|
||||
num: answered ? '✓' : String(i + 1),
|
||||
DLG_OPTS[locale.value as AppLocale].map((txt, i) => ({
|
||||
num: anim.value.ans === i ? '✓' : String(i + 1),
|
||||
text: txt,
|
||||
rowStyle: row,
|
||||
numColor: answered ? '#34d399' : '#fbbf24',
|
||||
textColor: answered ? '#a7f3d0' : highlighted ? '#fde68a' : '#d4d4d8',
|
||||
};
|
||||
}),
|
||||
highlighted: anim.value.hl === i,
|
||||
answered: anim.value.ans === i,
|
||||
})),
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -76,62 +56,82 @@ const dlgOptions = computed(() =>
|
||||
<span class="h-2.5 w-2.5 rounded-full bg-zinc-700"></span>
|
||||
<span class="h-2.5 w-2.5 rounded-full bg-zinc-700"></span>
|
||||
<span class="h-2.5 w-2.5 rounded-full bg-zinc-700"></span>
|
||||
<span class="ml-2 font-mono text-[11.5px] text-zinc-600">arboretum · localhost:7777</span>
|
||||
<span class="ml-2 font-mono text-[11.5px] text-zinc-600">arboretum · localhost:7317</span>
|
||||
</div>
|
||||
|
||||
<div class="flex min-h-[360px]">
|
||||
<!-- sidebar -->
|
||||
<div class="flex min-h-[440px]">
|
||||
<!-- sidebar (fidèle à AppSidebar : Worktrees / Sessions / Groups, puis Réglages / Aide / Gitea / Café) -->
|
||||
<div
|
||||
class="flex w-[168px] flex-none flex-col border-r border-[#1c1c1f] bg-zinc-900/40 px-2.5 py-3"
|
||||
class="flex w-[190px] flex-none flex-col border-r border-[#1c1c1f] bg-zinc-900/40 px-2 py-3"
|
||||
>
|
||||
<div class="flex items-center gap-2 px-1 pb-3">
|
||||
<div class="flex items-center gap-2 px-2 pb-3">
|
||||
<img
|
||||
src="/assets/arboretum-mark.png"
|
||||
alt=""
|
||||
width="20"
|
||||
height="20"
|
||||
class="h-5 w-5 object-contain"
|
||||
width="22"
|
||||
height="22"
|
||||
class="h-[22px] w-[22px] object-contain"
|
||||
/>
|
||||
<span class="font-mono text-[13px] font-semibold text-zinc-200">Arboretum</span>
|
||||
<span class="text-[14px] font-semibold text-zinc-100">Arboretum</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="mb-3 flex items-center gap-2 rounded-lg border border-zinc-800 bg-zinc-950/50 px-[9px] py-[7px]"
|
||||
class="mb-2 flex items-center gap-2 rounded-lg border border-zinc-800 bg-zinc-950/40 px-2.5 py-1.5"
|
||||
>
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="#52525b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8" /><path d="m21 21-4.3-4.3" /></svg>
|
||||
<span class="flex-1 text-[11.5px] text-zinc-600">{{ t('mSearch') }}</span>
|
||||
<span class="rounded border border-zinc-800 px-[5px] py-px font-mono text-[10px] text-zinc-500">⌘K</span>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#52525b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8" /><path d="m21 21-4.3-4.3" /></svg>
|
||||
<span class="flex-1 text-[12px] text-zinc-500">{{ t('mSearch') }}</span>
|
||||
<span class="rounded border border-zinc-700 px-[5px] py-px font-mono text-[10px] text-zinc-500">⌘K</span>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-0.5">
|
||||
<div class="flex items-center gap-[9px] rounded-lg bg-zinc-800 px-[9px] py-[7px] text-zinc-100">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="7" height="9" x="3" y="3" rx="1" /><rect width="7" height="5" x="14" y="3" rx="1" /><rect width="7" height="9" x="14" y="12" rx="1" /><rect width="7" height="5" x="3" y="16" rx="1" /></svg>
|
||||
<span class="text-[12.5px]">{{ t('mDash') }}</span>
|
||||
<!-- nav primaire -->
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="flex items-center gap-2.5 rounded-lg bg-zinc-800 px-2.5 py-1.5 text-zinc-100">
|
||||
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="6" x2="6" y1="3" y2="15" /><circle cx="18" cy="6" r="3" /><circle cx="6" cy="18" r="3" /><path d="M18 9a9 9 0 0 1-9 9" /></svg>
|
||||
<span class="flex-1 text-[12.5px] font-medium">{{ t('mWorktrees') }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-zinc-400">
|
||||
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m7 11 2-2-2-2" /><path d="M11 13h4" /><rect width="18" height="18" x="3" y="3" rx="2" ry="2" /></svg>
|
||||
<span class="flex-1 text-[12.5px] font-medium">{{ t('mSessions') }}</span>
|
||||
<span
|
||||
v-show="anim.att > 0"
|
||||
class="ml-auto inline-flex h-[17px] min-w-[17px] items-center justify-center rounded-full px-[5px] font-mono text-[10px] font-bold"
|
||||
style="background: #f59e0b; color: #1c1300"
|
||||
class="rounded-full bg-amber-500/20 px-1.5 text-[11px] font-semibold text-amber-300"
|
||||
>{{ anim.att }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="flex items-center gap-[9px] rounded-lg px-[9px] py-[7px] text-zinc-400">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z" /><path d="M7 16.5 12 13.5" /><path d="M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z" /><path d="m17 16.5 4.74-2.85" /><path d="M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0z" /></svg>
|
||||
<span class="text-[12.5px]">{{ t('mGroups') }}</span>
|
||||
<div class="flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-zinc-400">
|
||||
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z" /><path d="M7 16.5 12 13.5" /><path d="M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z" /><path d="m17 16.5 4.74-2.85" /><path d="M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0z" /></svg>
|
||||
<span class="flex-1 text-[12.5px] font-medium">{{ t('mGroups') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1"></div>
|
||||
|
||||
<div class="flex flex-col gap-0.5 border-t border-[#1c1c1f] pt-2.5">
|
||||
<div class="flex items-center gap-[9px] rounded-lg px-[9px] py-1.5 text-zinc-400">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" /><circle cx="12" cy="12" r="3" /></svg>
|
||||
<span class="text-[12.5px]">{{ t('mSettings') }}</span>
|
||||
<!-- nav secondaire -->
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-zinc-400">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" /><circle cx="12" cy="12" r="3" /></svg>
|
||||
<span class="flex-1 text-[12.5px] font-medium">{{ t('mSettings') }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-[9px] rounded-lg px-[9px] py-1.5 text-zinc-400">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10" /><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" /><path d="M12 17h.01" /></svg>
|
||||
<span class="text-[12.5px]">{{ t('mHelp') }}</span>
|
||||
<div class="flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-zinc-400">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10" /><path d="m4.93 4.93 4.24 4.24" /><path d="m14.83 9.17 4.24-4.24" /><path d="m14.83 14.83 4.24 4.24" /><path d="m9.17 14.83-4.24 4.24" /><circle cx="12" cy="12" r="4" /></svg>
|
||||
<span class="flex-1 text-[12.5px] font-medium">{{ t('mHelp') }}</span>
|
||||
</div>
|
||||
<div class="px-[9px] pt-1.5 font-mono text-[10px] text-zinc-700">v0.4.2</div>
|
||||
<div class="flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-zinc-400">
|
||||
<IconGitea :size="16" />
|
||||
<span class="flex-1 text-[12.5px] font-medium">{{ t('mGitea') }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-zinc-400">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 2v2" /><path d="M14 2v2" /><path d="M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1" /><path d="M6 2v2" /></svg>
|
||||
<span class="flex-1 text-[12.5px] font-medium">{{ t('coffee') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- pied : langue · notifications · déconnexion + version (fidèle à AppShellFooter) -->
|
||||
<div class="mt-2 flex items-center gap-2 border-t border-[#1c1c1f] px-1 pt-2.5">
|
||||
<span class="rounded border border-zinc-700 px-1.5 py-px font-mono text-[10px] text-zinc-400">{{ locale.toUpperCase() }}</span>
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#34d399" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10.268 21a2 2 0 0 0 3.464 0" /><path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" /></svg>
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#71717a" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" /><polyline points="16 17 21 12 16 7" /><line x1="21" x2="9" y1="12" y2="12" /></svg>
|
||||
<span class="ml-auto font-mono text-[10px] text-zinc-600">v1.6.0</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -142,9 +142,9 @@ const dlgOptions = computed(() =>
|
||||
class="flex min-h-0 flex-1 flex-col overflow-hidden rounded-[10px] border border-zinc-800 bg-zinc-950"
|
||||
>
|
||||
<div class="flex items-center justify-between border-b border-[#1c1c1f] px-[11px] py-2">
|
||||
<span class="font-mono text-[11.5px] text-zinc-400">api · feat/auth</span>
|
||||
<span class="font-mono text-[11.5px] text-zinc-300">api · feat/auth</span>
|
||||
<span
|
||||
class="inline-flex items-center gap-1.5 rounded-full px-[9px] py-[3px] font-mono text-[11px]"
|
||||
class="inline-flex items-center gap-1.5 rounded px-2 py-[3px] font-mono text-[11px]"
|
||||
:style="{ background: pill.bg, color: pill.fg }"
|
||||
>
|
||||
<span
|
||||
@@ -167,24 +167,30 @@ const dlgOptions = computed(() =>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- dialogue de permission -->
|
||||
<!-- dialogue de permission (fidèle à DialogPrompt : badge type + question + options + Deny) -->
|
||||
<div
|
||||
v-if="anim.dlg"
|
||||
class="animate-dlg-in rounded-[10px] border border-[rgba(120,53,15,0.6)] bg-[rgba(69,26,3,0.3)] p-[11px]"
|
||||
class="animate-dlg-in rounded-lg border border-amber-900/60 bg-amber-950/30 p-[11px]"
|
||||
>
|
||||
<div class="mb-[9px] flex items-center gap-2">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#fbbf24" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" /><path d="M12 9v4" /><path d="M12 17h.01" /></svg>
|
||||
<span class="text-[12.5px] text-zinc-200">{{ t('dlgQ') }}</span>
|
||||
<div class="mb-2 flex items-center gap-2">
|
||||
<span class="inline-flex items-center rounded bg-amber-900 px-1.5 py-0.5 text-[11px] font-medium text-amber-200">{{ t('mPermission') }}</span>
|
||||
<span class="text-[12.5px] text-amber-100">{{ t('dlgQ') }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col gap-[5px]">
|
||||
<div v-for="(op, i) in dlgOptions" :key="i" :style="op.rowStyle">
|
||||
<div class="flex flex-wrap gap-[6px]">
|
||||
<span
|
||||
class="w-[15px] flex-none text-center font-mono text-[11px] font-bold"
|
||||
:style="{ color: op.numColor }"
|
||||
>{{ op.num }}</span
|
||||
v-for="(op, i) in dlgOptions"
|
||||
:key="i"
|
||||
class="inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors"
|
||||
:class="op.answered
|
||||
? 'border-emerald-500/70 bg-emerald-950/50 text-emerald-300'
|
||||
: op.highlighted
|
||||
? 'border-amber-400 bg-amber-950/50 text-amber-200'
|
||||
: 'border-zinc-700 bg-zinc-800 text-zinc-200'"
|
||||
>
|
||||
<span class="text-xs" :style="{ color: op.textColor }">{{ op.text }}</span>
|
||||
</div>
|
||||
<span class="font-mono" :class="op.answered ? 'text-emerald-400' : 'text-amber-400'">{{ op.num }}</span>
|
||||
{{ op.text }}
|
||||
</span>
|
||||
<span class="inline-flex items-center rounded-lg border border-red-900 bg-red-950 px-2.5 py-1.5 text-xs font-medium text-red-300">{{ t('mDeny') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useCopy, INSTALL_COMMAND } from '../composables/useCopy';
|
||||
import { INSTALL_COMMAND } from '../composables/useCopy';
|
||||
import { REPO } from '../lib/links';
|
||||
import HeroMockup from './HeroMockup.vue';
|
||||
import IconGitea from './icons/IconGitea.vue';
|
||||
import IconCopy from './icons/IconCopy.vue';
|
||||
import CopyButton from './CopyButton.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { copied, copy } = useCopy();
|
||||
const REPO = 'https://git.lidge.fr/johanleroy/git-arboretum';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -44,15 +43,7 @@ const REPO = 'https://git.lidge.fr/johanleroy/git-arboretum';
|
||||
>
|
||||
<span class="text-emerald-400">$</span><span class="text-zinc-200">{{ INSTALL_COMMAND }}</span>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Copy install command"
|
||||
class="inline-flex flex-none items-center gap-[7px] border-l border-zinc-800 bg-zinc-900 px-[15px] font-mono text-[13px] font-semibold text-zinc-300 transition-colors hover:bg-zinc-800 hover:text-emerald-400 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-emerald-500/70"
|
||||
@click="copy()"
|
||||
>
|
||||
<IconCopy :size="15" />
|
||||
<span aria-live="polite">{{ copied ? t('copied') : t('copy') }}</span>
|
||||
</button>
|
||||
<CopyButton variant="bar" :text="INSTALL_COMMAND" :label="t('copyCommand')" />
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex flex-wrap gap-[13px]">
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { INSTALL_COMMAND } from '../composables/useCopy';
|
||||
import CopyButton from './CopyButton.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
// Port par défaut réel du daemon (cf. packages/server/src/config.ts).
|
||||
const LOCAL_URL = 'http://localhost:7317';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -15,16 +20,22 @@ const { t } = useI18n();
|
||||
<div class="mb-[18px] font-mono text-[13px] text-emerald-400">01</div>
|
||||
<h3 class="m-0 mb-2.5 text-lg font-semibold text-zinc-50">{{ t('step1Title') }}</h3>
|
||||
<p class="m-0 mb-4 text-[14.5px] leading-[1.55] text-zinc-400">{{ t('step1Desc') }}</p>
|
||||
<div class="overflow-x-auto whitespace-nowrap rounded-lg border border-zinc-800 bg-zinc-950 p-[11px] font-mono text-[12.5px] text-zinc-200">
|
||||
<span class="text-emerald-400">$ </span>npx @johanleroy/git-arboretum
|
||||
<div class="flex items-center gap-2 rounded-lg border border-zinc-800 bg-zinc-950 p-[11px]">
|
||||
<code class="min-w-0 flex-1 overflow-x-auto whitespace-nowrap font-mono text-[12.5px] text-zinc-200">
|
||||
<span class="text-emerald-400">$ </span>{{ INSTALL_COMMAND }}
|
||||
</code>
|
||||
<CopyButton variant="icon" :text="INSTALL_COMMAND" :label="t('copyCommand')" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="rounded-xl border border-zinc-800 bg-zinc-900/50 p-[26px]">
|
||||
<div class="mb-[18px] font-mono text-[13px] text-emerald-400">02</div>
|
||||
<h3 class="m-0 mb-2.5 text-lg font-semibold text-zinc-50">{{ t('step2Title') }}</h3>
|
||||
<p class="m-0 mb-4 text-[14.5px] leading-[1.55] text-zinc-400">{{ t('step2Desc') }}</p>
|
||||
<div class="overflow-x-auto whitespace-nowrap rounded-lg border border-zinc-800 bg-zinc-950 p-[11px] font-mono text-[12.5px] text-sky-300">
|
||||
→ http://localhost:7777
|
||||
<div class="flex items-center gap-2 rounded-lg border border-zinc-800 bg-zinc-950 p-[11px]">
|
||||
<code class="min-w-0 flex-1 overflow-x-auto whitespace-nowrap font-mono text-[12.5px] text-sky-300">
|
||||
→ {{ LOCAL_URL }}
|
||||
</code>
|
||||
<CopyButton variant="icon" :text="LOCAL_URL" :label="t('copyUrl')" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="rounded-xl border border-zinc-800 bg-zinc-900/50 p-[26px]">
|
||||
|
||||
@@ -1,67 +1,115 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
const { t } = useI18n();
|
||||
import { DLG_OPTS } from '../i18n/content';
|
||||
import type { AppLocale } from '../i18n';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
// Options du dialogue (réutilisées pour le rail « À traiter » et la vue mobile).
|
||||
const dlgOpts = computed(() => DLG_OPTS[locale.value as AppLocale]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section id="showcase" class="mx-auto flex max-w-[1200px] scroll-mt-[84px] flex-col gap-[92px] px-6">
|
||||
<!-- a) dashboard + needs attention -->
|
||||
<!-- a) dashboard worktree-first : rail « À traiter » + section de repo (fidèle à AttentionSection + RepoSection) -->
|
||||
<div v-reveal class="flex flex-wrap items-center gap-12">
|
||||
<div class="min-w-[280px] flex-[1_1_380px]">
|
||||
<div class="min-w-[280px] flex-[1_1_360px]">
|
||||
<div class="mb-3 font-mono text-xs uppercase tracking-[0.12em] text-emerald-400">{{ t('scAKicker') }}</div>
|
||||
<h2 class="m-0 mb-4 text-[clamp(26px,3vw,34px)] font-semibold leading-[1.15] tracking-[-0.025em] text-zinc-50">
|
||||
{{ t('scATitle') }}
|
||||
</h2>
|
||||
<p class="m-0 text-[16.5px] leading-[1.6] text-zinc-400">{{ t('scABody') }}</p>
|
||||
</div>
|
||||
<div class="min-w-[280px] flex-[1_1_420px]">
|
||||
<div class="overflow-hidden rounded-xl border border-zinc-800 bg-[#0c0c0e] shadow-card">
|
||||
<div class="flex items-center gap-[9px] border-b border-[#1c1c1f] bg-[rgba(69,26,3,0.18)] px-[15px] py-3">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fcd34d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" /><path d="M12 9v4" /><path d="M12 17h.01" /></svg>
|
||||
<span class="text-sm font-semibold text-zinc-50">{{ t('mAttn') }}</span>
|
||||
<span class="ml-auto rounded-full bg-amber-300/[0.12] px-[9px] py-0.5 font-mono text-[11px] text-amber-300">2</span>
|
||||
<div class="flex min-w-[280px] flex-[1_1_440px] flex-col gap-3">
|
||||
<!-- rail « À traiter » -->
|
||||
<div class="flex flex-col gap-2 rounded-xl border border-amber-900/50 bg-amber-950/20 p-3 shadow-card">
|
||||
<div class="flex items-center gap-2">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fbbf24" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" /><path d="M12 9v4" /><path d="M12 17h.01" /></svg>
|
||||
<h3 class="text-sm font-semibold text-amber-200">{{ t('mAttn') }}</h3>
|
||||
<span class="rounded-full bg-amber-500/20 px-1.5 text-[11px] font-semibold text-amber-300">1</span>
|
||||
</div>
|
||||
<div class="flex flex-col gap-2 p-2.5">
|
||||
<div class="flex items-center gap-3 rounded-[9px] border border-[rgba(120,53,15,0.55)] bg-[rgba(69,26,3,0.3)] px-[13px] py-[11px]">
|
||||
<span class="h-2 w-2 flex-none animate-pulse-amber rounded-full bg-amber-300"></span>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="font-mono text-[13px] text-zinc-200">api · feat/auth</div>
|
||||
<div class="text-xs text-[#d4a55a]">Approve change to login.ts?</div>
|
||||
<span class="truncate font-mono text-xs text-amber-300/80">~/code/arboretum/api</span>
|
||||
<!-- DialogPrompt -->
|
||||
<div class="rounded-lg border border-amber-900/60 bg-amber-950/30 p-2.5">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="inline-flex items-center rounded bg-amber-900 px-1.5 py-0.5 text-[11px] font-medium text-amber-200">{{ t('mPermission') }}</span>
|
||||
<span class="text-[12.5px] text-amber-100">{{ t('dlgQ') }}</span>
|
||||
</div>
|
||||
<button type="button" class="flex-none rounded-[7px] border border-amber-300/30 bg-amber-300/[0.12] px-3 py-[5px] text-xs font-semibold text-amber-300">Answer</button>
|
||||
<div class="mt-2 flex flex-wrap gap-1.5">
|
||||
<span
|
||||
v-for="(op, i) in dlgOpts"
|
||||
:key="i"
|
||||
class="inline-flex items-center gap-1.5 rounded-lg border border-zinc-700 bg-zinc-800 px-2.5 py-1.5 text-xs font-medium text-zinc-200"
|
||||
>
|
||||
<span class="font-mono text-amber-400">{{ i + 1 }}</span> {{ op }}
|
||||
</span>
|
||||
<span class="inline-flex items-center rounded-lg border border-red-900 bg-red-950 px-2.5 py-1.5 text-xs font-medium text-red-300">{{ t('mDeny') }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-3 rounded-[9px] border border-[rgba(120,53,15,0.55)] bg-[rgba(69,26,3,0.3)] px-[13px] py-[11px]">
|
||||
<span class="h-2 w-2 flex-none animate-pulse-amber rounded-full bg-amber-300"></span>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="font-mono text-[13px] text-zinc-200">web · checkout</div>
|
||||
<div class="text-xs text-[#d4a55a]">Run the failing test again?</div>
|
||||
</div>
|
||||
<button type="button" class="flex-none rounded-[7px] border border-amber-300/30 bg-amber-300/[0.12] px-3 py-[5px] text-xs font-semibold text-amber-300">Answer</button>
|
||||
</div>
|
||||
<div class="mx-0.5 my-[3px] h-px bg-[#1c1c1f]"></div>
|
||||
<div class="flex items-center gap-3 rounded-[9px] px-[13px] py-[9px]">
|
||||
<span class="h-2 w-2 flex-none animate-pulse-sky rounded-full bg-sky-300"></span>
|
||||
<div class="min-w-0 flex-1 font-mono text-[13px] text-zinc-400">db · refactor</div>
|
||||
<span class="flex-none font-mono text-[11px] text-sky-300">{{ t('busy') }}</span>
|
||||
|
||||
<!-- section de repo : worktrees + état de session -->
|
||||
<div class="flex flex-col gap-2 rounded-xl border border-zinc-800 bg-zinc-900/50 p-3 shadow-card">
|
||||
<header class="flex flex-wrap items-center gap-2">
|
||||
<h3 class="font-semibold text-zinc-100">arboretum</h3>
|
||||
<span class="truncate font-mono text-xs text-zinc-500">~/code/arboretum</span>
|
||||
<span class="ml-auto inline-flex items-center gap-1.5 rounded-lg border border-zinc-700 bg-zinc-800 px-2 py-1 text-xs font-medium text-zinc-200">
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14" /><path d="M12 5v14" /></svg>
|
||||
{{ t('mStart') }}
|
||||
</span>
|
||||
</header>
|
||||
|
||||
<!-- worktree : branche principale, session au repos -->
|
||||
<div class="rounded border border-zinc-800 bg-zinc-900/40 p-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="font-mono text-sm text-zinc-200">main</span>
|
||||
<span class="inline-flex items-center rounded bg-zinc-800 px-1.5 py-0.5 text-[11px] font-medium text-zinc-400">{{ t('mMain') }}</span>
|
||||
<span class="ml-auto text-xs text-zinc-600">{{ t('mClean') }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-3 rounded-[9px] px-[13px] py-[9px]">
|
||||
<span class="h-2 w-2 flex-none rounded-full bg-emerald-400"></span>
|
||||
<div class="min-w-0 flex-1 font-mono text-[13px] text-zinc-400">docs · main</div>
|
||||
<span class="flex-none font-mono text-[11px] text-emerald-400">{{ t('idle') }}</span>
|
||||
<p class="truncate font-mono text-xs text-zinc-500">~/code/arboretum</p>
|
||||
<div class="mt-1 flex items-center gap-2">
|
||||
<span class="inline-flex items-center gap-1 rounded bg-zinc-800/60 px-1.5 py-0.5">
|
||||
<span class="inline-flex items-center gap-1 rounded bg-emerald-950 px-1.5 py-0.5 text-[11px] font-medium text-emerald-400">
|
||||
<span class="h-1.5 w-1.5 rounded-full bg-emerald-400"></span>{{ t('idle') }}
|
||||
</span>
|
||||
<span class="font-mono text-[11px] text-zinc-400">claude</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- worktree : branche de feature, session occupée -->
|
||||
<div class="rounded border border-zinc-800 bg-zinc-900/40 p-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="font-mono text-sm text-zinc-200">feat/auth</span>
|
||||
<span class="ml-auto flex items-center gap-2 text-xs text-zinc-500">
|
||||
<span>↑2</span>
|
||||
<span class="text-amber-400">● {{ t('mDirty') }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<p class="truncate font-mono text-xs text-zinc-500">~/code/arboretum/.wt/feat-auth</p>
|
||||
<div class="mt-1 flex items-center gap-2">
|
||||
<span class="inline-flex items-center gap-1 rounded bg-zinc-800/60 px-1.5 py-0.5">
|
||||
<span class="inline-flex items-center gap-1 rounded bg-sky-950 px-1.5 py-0.5 text-[11px] font-medium text-sky-300">
|
||||
<span class="h-1.5 w-1.5 animate-pulse-sky rounded-full bg-sky-300"></span>{{ t('busy') }}
|
||||
</span>
|
||||
<span class="font-mono text-[11px] text-zinc-400">claude</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- b) multi-terminal grid -->
|
||||
<!-- b) grille multi-terminaux (fidèle à TerminalCell : badge d'état + titre repo · branche + commande) -->
|
||||
<div v-reveal class="flex flex-wrap-reverse items-center gap-12">
|
||||
<div class="min-w-[280px] flex-[1_1_420px]">
|
||||
<div class="min-w-[280px] flex-[1_1_440px]">
|
||||
<div class="grid grid-cols-2 gap-2.5 overflow-hidden rounded-xl border border-zinc-800 bg-[#0c0c0e] p-3 shadow-card">
|
||||
<div class="overflow-hidden rounded-[9px] border border-zinc-800 bg-zinc-950">
|
||||
<div class="flex items-center justify-between border-b border-[#1c1c1f] px-[11px] py-2">
|
||||
<span class="font-mono text-[11px] text-zinc-400">api · feat/auth</span>
|
||||
<span class="h-1.5 w-1.5 animate-pulse-sky rounded-full bg-sky-300"></span>
|
||||
<div class="overflow-hidden rounded-lg border border-zinc-800 bg-[#09090b]">
|
||||
<div class="flex items-center gap-2 border-b border-zinc-800 px-2 py-1.5">
|
||||
<span class="inline-flex items-center gap-1 rounded bg-sky-950 px-1.5 py-0.5 text-[10px] font-medium text-sky-300"><span class="h-1.5 w-1.5 animate-pulse-sky rounded-full bg-sky-300"></span>{{ t('busy') }}</span>
|
||||
<span class="truncate font-mono text-[11px] text-zinc-300">api · feat/auth</span>
|
||||
<span class="ml-auto shrink-0 font-mono text-[11px] text-zinc-500">claude</span>
|
||||
</div>
|
||||
<div class="p-[11px] font-mono text-[11px] leading-[1.75] text-zinc-300">
|
||||
<div class="text-emerald-400">● Edit session.ts</div>
|
||||
@@ -70,10 +118,11 @@ const { t } = useI18n();
|
||||
<div class="text-zinc-500">refactoring guards…</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-hidden rounded-[9px] border border-zinc-800 bg-zinc-950">
|
||||
<div class="flex items-center justify-between border-b border-[#1c1c1f] px-[11px] py-2">
|
||||
<span class="font-mono text-[11px] text-zinc-400">web · fix/cart</span>
|
||||
<span class="h-1.5 w-1.5 rounded-full bg-emerald-400"></span>
|
||||
<div class="overflow-hidden rounded-lg border border-zinc-800 bg-[#09090b]">
|
||||
<div class="flex items-center gap-2 border-b border-zinc-800 px-2 py-1.5">
|
||||
<span class="inline-flex items-center gap-1 rounded bg-emerald-950 px-1.5 py-0.5 text-[10px] font-medium text-emerald-400"><span class="h-1.5 w-1.5 rounded-full bg-emerald-400"></span>{{ t('idle') }}</span>
|
||||
<span class="truncate font-mono text-[11px] text-zinc-300">web · fix/cart</span>
|
||||
<span class="ml-auto shrink-0 font-mono text-[11px] text-zinc-500">claude</span>
|
||||
</div>
|
||||
<div class="p-[11px] font-mono text-[11px] leading-[1.75] text-zinc-300">
|
||||
<div class="text-emerald-400">✓ all tests passing</div>
|
||||
@@ -84,10 +133,11 @@ const { t } = useI18n();
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-hidden rounded-[9px] border border-zinc-800 bg-zinc-950">
|
||||
<div class="flex items-center justify-between border-b border-[#1c1c1f] px-[11px] py-2">
|
||||
<span class="font-mono text-[11px] text-zinc-400">db · refactor</span>
|
||||
<span class="h-1.5 w-1.5 animate-pulse-sky rounded-full bg-sky-300"></span>
|
||||
<div class="overflow-hidden rounded-lg border border-zinc-800 bg-[#09090b]">
|
||||
<div class="flex items-center gap-2 border-b border-zinc-800 px-2 py-1.5">
|
||||
<span class="inline-flex items-center gap-1 rounded bg-sky-950 px-1.5 py-0.5 text-[10px] font-medium text-sky-300"><span class="h-1.5 w-1.5 animate-pulse-sky rounded-full bg-sky-300"></span>{{ t('busy') }}</span>
|
||||
<span class="truncate font-mono text-[11px] text-zinc-300">db · refactor</span>
|
||||
<span class="ml-auto shrink-0 font-mono text-[11px] text-zinc-500">claude</span>
|
||||
</div>
|
||||
<div class="p-[11px] font-mono text-[11px] leading-[1.75] text-zinc-300">
|
||||
<div class="text-emerald-400">● Write migration</div>
|
||||
@@ -95,20 +145,21 @@ const { t } = useI18n();
|
||||
<div class="text-zinc-500">applying to schema…</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-hidden rounded-[9px] border border-zinc-800 bg-zinc-950">
|
||||
<div class="flex items-center justify-between border-b border-[#1c1c1f] px-[11px] py-2">
|
||||
<span class="font-mono text-[11px] text-zinc-400">docs · api</span>
|
||||
<span class="h-1.5 w-1.5 animate-pulse-sky rounded-full bg-sky-300"></span>
|
||||
<div class="overflow-hidden rounded-lg border border-zinc-800 bg-[#09090b]">
|
||||
<div class="flex items-center gap-2 border-b border-zinc-800 px-2 py-1.5">
|
||||
<span class="inline-flex items-center gap-1 rounded bg-amber-950 px-1.5 py-0.5 text-[10px] font-medium text-amber-300"><span class="h-1.5 w-1.5 animate-pulse-amber rounded-full bg-amber-300"></span>{{ t('waiting') }}</span>
|
||||
<span class="truncate font-mono text-[11px] text-zinc-300">docs · api</span>
|
||||
<span class="ml-auto shrink-0 font-mono text-[11px] text-zinc-500">claude</span>
|
||||
</div>
|
||||
<div class="p-[11px] font-mono text-[11px] leading-[1.75] text-zinc-300">
|
||||
<div class="text-emerald-400">● Read README.md</div>
|
||||
<div class="text-zinc-500">## Quick start</div>
|
||||
<div class="text-zinc-500">writing examples…</div>
|
||||
<div class="text-amber-300">Permission required</div>
|
||||
<div class="text-zinc-500">waiting for input…</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="min-w-[280px] flex-[1_1_380px]">
|
||||
<div class="min-w-[280px] flex-[1_1_360px]">
|
||||
<div class="mb-3 font-mono text-xs uppercase tracking-[0.12em] text-emerald-400">{{ t('scBKicker') }}</div>
|
||||
<h2 class="m-0 mb-4 text-[clamp(26px,3vw,34px)] font-semibold leading-[1.15] tracking-[-0.025em] text-zinc-50">
|
||||
{{ t('scBTitle') }}
|
||||
@@ -117,7 +168,7 @@ const { t } = useI18n();
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- c) mobile -->
|
||||
<!-- c) mobile : push + réponse au dialogue (fidèle à DialogPrompt) + barre d'onglets -->
|
||||
<div v-reveal class="flex flex-wrap items-center gap-12">
|
||||
<div class="min-w-[280px] flex-[1_1_380px]">
|
||||
<div class="mb-3 font-mono text-xs uppercase tracking-[0.12em] text-emerald-400">{{ t('scCKicker') }}</div>
|
||||
@@ -127,11 +178,12 @@ const { t } = useI18n();
|
||||
<p class="m-0 text-[16.5px] leading-[1.6] text-zinc-400">{{ t('scCBody') }}</p>
|
||||
</div>
|
||||
<div class="flex min-w-[280px] flex-[1_1_320px] justify-center">
|
||||
<div class="relative w-[288px] overflow-hidden rounded-[40px] border-[9px] border-zinc-900 bg-zinc-950 shadow-phone">
|
||||
<div class="relative w-[300px] overflow-hidden rounded-[40px] border-[9px] border-zinc-900 bg-zinc-950 shadow-phone">
|
||||
<div class="flex h-[30px] items-center justify-center">
|
||||
<div class="h-1.5 w-[90px] rounded-full bg-zinc-800"></div>
|
||||
</div>
|
||||
<div class="px-[13px] pb-[22px]">
|
||||
<div class="px-3 pb-[64px]">
|
||||
<!-- toast push -->
|
||||
<div class="flex items-start gap-[11px] rounded-[15px] border border-[rgba(120,53,15,0.5)] bg-[#0c0c0e] p-[13px] shadow-toast-sm">
|
||||
<span class="inline-flex h-[30px] w-[30px] flex-none items-center justify-center rounded-lg bg-emerald-500/[0.14]">
|
||||
<img src="/assets/arboretum-mark.png" alt="" width="18" height="18" class="h-[18px] w-[18px] object-contain" />
|
||||
@@ -145,24 +197,54 @@ const { t } = useI18n();
|
||||
<div class="text-xs leading-[1.45] text-zinc-400">{{ t('toastBody') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-[14px] overflow-hidden rounded-[15px] border border-zinc-800 bg-zinc-950">
|
||||
<div class="flex items-center gap-2 border-b border-[#1c1c1f] px-[13px] py-[11px]">
|
||||
<span class="h-[7px] w-[7px] animate-pulse-amber rounded-full bg-amber-300"></span>
|
||||
<span class="font-mono text-[11px] text-zinc-300">feat/auth</span>
|
||||
|
||||
<!-- carte « À traiter » + DialogPrompt -->
|
||||
<div class="mt-[14px] flex flex-col gap-2 rounded-[15px] border border-amber-900/50 bg-amber-950/20 p-2.5">
|
||||
<div class="flex items-center gap-2">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fbbf24" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" /><path d="M12 9v4" /><path d="M12 17h.01" /></svg>
|
||||
<span class="text-[13px] font-semibold text-amber-200">{{ t('mAttn') }}</span>
|
||||
<span class="rounded-full bg-amber-500/20 px-1.5 text-[11px] font-semibold text-amber-300">1</span>
|
||||
</div>
|
||||
<div class="p-[13px]">
|
||||
<div class="text-[13px] leading-[1.5] text-zinc-300">{{ t('dlgQ') }}</div>
|
||||
<div class="mt-2 rounded-lg border border-[#1c1c1f] bg-[#0c0c0e] p-[9px] font-mono text-[11px] leading-[1.6] text-zinc-500">
|
||||
<div class="text-emerald-400">+ verifyToken(req)</div>
|
||||
<div class="text-red-400">- skipAuth()</div>
|
||||
</div>
|
||||
<div class="mt-[13px] flex gap-2">
|
||||
<button type="button" class="flex-1 rounded-lg bg-emerald-600 py-2.5 text-[13px] font-semibold text-white">{{ t('approve') }}</button>
|
||||
<button type="button" class="flex-1 rounded-lg border border-zinc-800 bg-transparent py-2.5 text-[13px] font-medium text-zinc-300">{{ t('reject') }}</button>
|
||||
<span class="font-mono text-[11px] text-amber-300/80">api · feat/auth</span>
|
||||
<div class="rounded-lg border border-amber-900/60 bg-amber-950/30 p-2.5">
|
||||
<span class="inline-flex items-center rounded bg-amber-900 px-1.5 py-0.5 text-[11px] font-medium text-amber-200">{{ t('mPermission') }}</span>
|
||||
<div class="mt-1.5 text-[13px] leading-[1.4] text-amber-100">{{ t('dlgQ') }}</div>
|
||||
<div class="mt-2 flex flex-col gap-1.5">
|
||||
<span
|
||||
v-for="(op, i) in dlgOpts"
|
||||
:key="i"
|
||||
class="flex items-center gap-2 rounded-lg border border-zinc-700 bg-zinc-800 px-2.5 py-2 text-[13px] font-medium text-zinc-200"
|
||||
>
|
||||
<span class="font-mono text-amber-400">{{ i + 1 }}</span> {{ op }}
|
||||
</span>
|
||||
<span class="rounded-lg border border-red-900 bg-red-950 px-2.5 py-2 text-center text-[13px] font-medium text-red-300">{{ t('mDeny') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- barre d'onglets mobile (fidèle à MobileTabBar) -->
|
||||
<div class="absolute inset-x-0 bottom-0 flex border-t border-zinc-800 bg-zinc-950/95 backdrop-blur">
|
||||
<div class="flex flex-1 flex-col items-center gap-0.5 py-2 text-zinc-500">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="6" x2="6" y1="3" y2="15" /><circle cx="18" cy="6" r="3" /><circle cx="6" cy="18" r="3" /><path d="M18 9a9 9 0 0 1-9 9" /></svg>
|
||||
<span class="text-[10px]">{{ t('mWorktrees') }}</span>
|
||||
</div>
|
||||
<div class="relative flex flex-1 flex-col items-center gap-0.5 py-2 text-emerald-400">
|
||||
<span class="relative">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m7 11 2-2-2-2" /><path d="M11 13h4" /><rect width="18" height="18" x="3" y="3" rx="2" ry="2" /></svg>
|
||||
<span class="absolute -right-1.5 -top-1.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-amber-500 px-1 text-[9px] font-semibold text-amber-950">1</span>
|
||||
</span>
|
||||
<span class="text-[10px]">{{ t('mSessions') }}</span>
|
||||
</div>
|
||||
<div class="flex flex-1 flex-col items-center gap-0.5 py-2 text-zinc-500">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z" /><path d="M7 16.5 12 13.5" /><path d="M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z" /><path d="m17 16.5 4.74-2.85" /><path d="M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0z" /></svg>
|
||||
<span class="text-[10px]">{{ t('mGroups') }}</span>
|
||||
</div>
|
||||
<div class="flex flex-1 flex-col items-center gap-0.5 py-2 text-zinc-500">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="4" x2="20" y1="12" y2="12" /><line x1="4" x2="20" y1="6" y2="6" /><line x1="4" x2="20" y1="18" y2="18" /></svg>
|
||||
<span class="text-[10px]">{{ t('mMore') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,7 +25,7 @@ const { t } = useI18n();
|
||||
>
|
||||
<svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z" /><path d="M7 16.5 12 13.5" /><path d="M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z" /><path d="m17 16.5 4.74-2.85" /><path d="M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0z" /></svg>
|
||||
</div>
|
||||
<span class="font-mono text-[11px] text-zinc-300">payments</span>
|
||||
<span class="font-mono text-[11px] text-zinc-300">{{ t('grpHub') }}</span>
|
||||
</div>
|
||||
<div class="relative h-[96px] flex-1">
|
||||
<svg width="100%" height="100%" viewBox="0 0 100 96" preserveAspectRatio="none" class="absolute inset-0" aria-hidden="true">
|
||||
|
||||
19
packages/site/src/components/icons/IconCheck.vue
Normal file
19
packages/site/src/components/icons/IconCheck.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
withDefaults(defineProps<{ size?: number }>(), { size: 15 });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<svg
|
||||
:width="size"
|
||||
:height="size"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2.2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path d="M20 6 9 17l-5-5" />
|
||||
</svg>
|
||||
</template>
|
||||
@@ -10,8 +10,8 @@ export interface FaqItem {
|
||||
export const FAQS: Record<AppLocale, FaqItem[]> = {
|
||||
en: [
|
||||
{
|
||||
q: 'Is Arboretum an IDE?',
|
||||
a: "No — it's a command center. It doesn't replace your editor; it supervises the AI coding agents working across your repos: spawning sessions, surfacing their state, and letting you answer them.",
|
||||
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 / idle 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?',
|
||||
@@ -23,7 +23,7 @@ export const FAQS: Record<AppLocale, FaqItem[]> = {
|
||||
},
|
||||
{
|
||||
q: 'Does it work on mobile?',
|
||||
a: 'Yes. The dashboard is an installable PWA. Add it to your home screen, get Web Push the moment a session needs you, and approve or reject a prompt with a single tap.',
|
||||
a: 'Yes. The dashboard is an installable PWA. Add it to your home screen, get Web Push the moment a session needs you, and answer a prompt with a single tap.',
|
||||
},
|
||||
{
|
||||
q: 'Is my code safe?',
|
||||
@@ -32,8 +32,8 @@ export const FAQS: Record<AppLocale, FaqItem[]> = {
|
||||
],
|
||||
fr: [
|
||||
{
|
||||
q: 'Arboretum est-il un IDE ?',
|
||||
a: "Non — c'est un poste de commandement. Il ne remplace pas votre éditeur ; il supervise les agents de code IA qui travaillent sur vos repos : lancement des sessions, affichage de leur état, et réponse à leurs questions.",
|
||||
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 / inactive 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 ?',
|
||||
@@ -45,7 +45,7 @@ export const FAQS: Record<AppLocale, FaqItem[]> = {
|
||||
},
|
||||
{
|
||||
q: 'Fonctionne-t-il sur mobile ?',
|
||||
a: "Oui. Le dashboard est une PWA installable. Ajoutez-le à l'écran d'accueil, recevez un Web Push dès qu'une session a besoin de vous, et approuvez ou refusez une question d'un toucher.",
|
||||
a: "Oui. Le dashboard est une PWA installable. Ajoutez-le à l'écran d'accueil, recevez un Web Push dès qu'une session a besoin de vous, et répondez à une question d'un seul toucher.",
|
||||
},
|
||||
{
|
||||
q: 'Mon code est-il en sécurité ?',
|
||||
|
||||
@@ -15,9 +15,9 @@ export default {
|
||||
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 — not to be an IDE',
|
||||
featTitle: 'Built to supervise agents working in parallel',
|
||||
feat1Title: 'Worktree-first',
|
||||
feat1Desc: 'Every session is pinned to a git worktree. You see branches, not chaos.',
|
||||
feat1Desc: 'Work on your main branch or spin up an isolated worktree — every session stays pinned to a branch. 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',
|
||||
@@ -29,25 +29,26 @@ export default {
|
||||
feat6Title: 'Answer without a terminal',
|
||||
feat6Desc: 'Respond to agent prompts and dialogs right from the dashboard.',
|
||||
feat7Title: 'Work groups',
|
||||
feat7Desc: 'Group repos and launch the same feature across all of them at once.',
|
||||
feat7Desc: 'Group repos and run one Claude session across all of them at once.',
|
||||
feat8Title: 'Local-first & secure',
|
||||
feat8Desc: 'Binds to localhost, hashes tokens, remote access via Tailscale.',
|
||||
scAKicker: 'Worktree-first dashboard',
|
||||
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.',
|
||||
'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. 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, 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.',
|
||||
grpHub: '1 session',
|
||||
grpKicker: 'Work groups · cross-repo',
|
||||
grpTitle: 'Ship one feature across every repo at once',
|
||||
grpTitle: 'Drive every repo from one Claude session',
|
||||
grpBody:
|
||||
'Group the repos that move together — a service, its client, its docs. Launch the same task to all of them and Arboretum spins up a worktree and an agent in each, then tracks them as one unit.',
|
||||
'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',
|
||||
@@ -55,7 +56,7 @@ export default {
|
||||
step2Title: 'Open the dashboard',
|
||||
step2Desc: 'It serves a web dashboard on localhost. Install it as a PWA on any device.',
|
||||
step3Title: 'Spawn & supervise',
|
||||
step3Desc: 'Start Claude Code sessions on any worktree and watch them from anywhere.',
|
||||
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.',
|
||||
@@ -74,20 +75,29 @@ export default {
|
||||
footTag: 'a garden of branches, one pane of glass.',
|
||||
license: 'MIT License',
|
||||
coffee: 'Buy me a coffee',
|
||||
mDash: 'Dashboard',
|
||||
mWorktrees: 'Worktrees',
|
||||
mSessions: 'Sessions',
|
||||
mGroups: 'Groups',
|
||||
mSettings: 'Settings',
|
||||
mHelp: 'Help',
|
||||
mGitea: 'Gitea',
|
||||
mMore: 'More',
|
||||
mSearch: 'Search',
|
||||
mAttn: 'Needs attention',
|
||||
waiting: 'waiting',
|
||||
busy: 'busy',
|
||||
idle: 'idle',
|
||||
approve: 'Approve',
|
||||
reject: 'Reject',
|
||||
mPermission: 'Permission',
|
||||
mDeny: 'Deny (Esc)',
|
||||
mMain: 'main',
|
||||
mClean: 'clean',
|
||||
mDirty: '3 changed',
|
||||
mStart: 'Start work',
|
||||
toastTitle: 'Session waiting for you',
|
||||
toastBody: 'api · feat/auth needs a decision',
|
||||
dlgQ: 'Apply this change to login.ts?',
|
||||
copy: 'Copy',
|
||||
copied: 'Copied',
|
||||
copyCommand: 'Copy command',
|
||||
copyUrl: 'Copy URL',
|
||||
};
|
||||
|
||||
@@ -15,9 +15,9 @@ export default {
|
||||
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 les agents — pas pour être un IDE',
|
||||
featTitle: 'Conçu pour superviser des agents qui travaillent en parallèle',
|
||||
feat1Title: "Worktree d'abord",
|
||||
feat1Desc: 'Chaque session est rattachée à un worktree git. Vous voyez des branches, pas du chaos.',
|
||||
feat1Desc: 'Travaillez sur votre branche principale ou créez un worktree isolé — chaque session reste rattachée à une branche. 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',
|
||||
@@ -29,25 +29,26 @@ export default {
|
||||
feat6Title: 'Répondre sans terminal',
|
||||
feat6Desc: 'Répondez aux questions et dialogues des agents directement depuis le dashboard.',
|
||||
feat7Title: 'Work groups',
|
||||
feat7Desc: 'Regroupez des repos et lancez la même feature dans tous à la fois.',
|
||||
feat7Desc: 'Regroupez des repos et pilotez-les via une seule session Claude, tous à la fois.',
|
||||
feat8Title: 'Local-first & sécurisé',
|
||||
feat8Desc: 'Se lie à localhost, hashe les tokens, accès distant via Tailscale.',
|
||||
scAKicker: 'Dashboard worktree-first',
|
||||
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.",
|
||||
"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. 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, 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.",
|
||||
grpHub: '1 session',
|
||||
grpKicker: 'Work groups · cross-repo',
|
||||
grpTitle: "Livrez une feature dans tous les repos d'un coup",
|
||||
grpTitle: 'Pilotez tous vos repos depuis une seule session Claude',
|
||||
grpBody:
|
||||
'Regroupez les repos qui avancent ensemble — un service, son client, sa doc. Lancez la même tâche à tous ; Arboretum crée un worktree et un agent dans chacun, puis les suit comme un seul ensemble.',
|
||||
'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',
|
||||
@@ -55,7 +56,7 @@ export default {
|
||||
step2Title: 'Ouvrez le dashboard',
|
||||
step2Desc: "Il sert un dashboard web sur localhost. Installez-le en PWA sur n'importe quel appareil.",
|
||||
step3Title: 'Lancez & supervisez',
|
||||
step3Desc: "Démarrez des sessions Claude Code sur n'importe quel worktree et surveillez-les de partout.",
|
||||
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.",
|
||||
@@ -67,27 +68,36 @@ export default {
|
||||
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.',
|
||||
faqTitle: 'Vos questions, nos réponses',
|
||||
faqTitle: 'Vos questions, les réponses',
|
||||
ctaTitle: 'Prenez le commandement de vos agents',
|
||||
ctaBody: 'Une commande pour lancer. Tout superviser depuis un seul endroit.',
|
||||
ctaSource: 'Voir le code sur Gitea',
|
||||
footTag: 'un jardin de branches, une seule vitre.',
|
||||
license: 'Licence MIT',
|
||||
coffee: 'Paye-moi un café',
|
||||
mDash: 'Tableau de bord',
|
||||
mWorktrees: 'Worktrees',
|
||||
mSessions: 'Sessions',
|
||||
mGroups: 'Groupes',
|
||||
mSettings: 'Réglages',
|
||||
mHelp: 'Aide',
|
||||
mGitea: 'Gitea',
|
||||
mMore: 'Plus',
|
||||
mSearch: 'Rechercher',
|
||||
mAttn: 'À traiter',
|
||||
waiting: 'en attente',
|
||||
busy: 'occupé',
|
||||
idle: 'au repos',
|
||||
approve: 'Approuver',
|
||||
reject: 'Refuser',
|
||||
busy: 'occupée',
|
||||
idle: 'inactive',
|
||||
mPermission: 'Permission',
|
||||
mDeny: 'Refuser (Échap)',
|
||||
mMain: 'principal',
|
||||
mClean: 'propre',
|
||||
mDirty: '3 modifiés',
|
||||
mStart: 'Démarrer',
|
||||
toastTitle: 'Une session vous attend',
|
||||
toastBody: 'api · feat/auth attend une décision',
|
||||
dlgQ: 'Appliquer ce changement à login.ts ?',
|
||||
copy: 'Copier',
|
||||
copied: 'Copié',
|
||||
copyCommand: 'Copier la commande',
|
||||
copyUrl: "Copier l'URL",
|
||||
};
|
||||
|
||||
6
packages/site/src/lib/links.ts
Normal file
6
packages/site/src/lib/links.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// 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';
|
||||
export const LICENSE = `${REPO}/src/branch/main/LICENSE`;
|
||||
export const COFFEE = 'https://buymeacoffee.com/johanleroy';
|
||||
@@ -1,122 +0,0 @@
|
||||
<template>
|
||||
<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4" @click.self="emit('close')">
|
||||
<div class="flex max-h-[90vh] w-full max-w-lg flex-col gap-3 overflow-y-auto rounded-lg border border-zinc-800 bg-zinc-900 p-4">
|
||||
<header class="flex items-center gap-2">
|
||||
<h2 class="font-semibold text-zinc-100">{{ t('crossRepo.title') }}</h2>
|
||||
<button class="btn ml-auto text-xs" @click="emit('close')">{{ t('crossRepo.close') }}</button>
|
||||
</header>
|
||||
<p class="text-xs text-zinc-500">{{ t('crossRepo.intro') }}</p>
|
||||
|
||||
<form class="flex flex-col gap-3" @submit.prevent="onSubmit">
|
||||
<label class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('crossRepo.branchLabel') }}
|
||||
<input v-model="branch" class="input font-mono" :placeholder="t('crossRepo.branchPlaceholder')" required />
|
||||
</label>
|
||||
<div class="flex flex-wrap items-end gap-3">
|
||||
<label class="flex items-center gap-1.5 text-xs text-zinc-400">
|
||||
<input v-model="newBranch" type="checkbox" /> {{ t('crossRepo.newBranch') }}
|
||||
</label>
|
||||
<label class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('crossRepo.baseRefLabel') }}
|
||||
<input v-model="baseRef" class="input font-mono" placeholder="HEAD" />
|
||||
</label>
|
||||
<label class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('crossRepo.startLabel') }}
|
||||
<select v-model="startSession" class="input">
|
||||
<option :value="null">{{ t('crossRepo.startNone') }}</option>
|
||||
<option value="claude">claude</option>
|
||||
<option value="bash">bash</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('crossRepo.reposLabel') }}
|
||||
<div class="flex flex-col gap-1">
|
||||
<label
|
||||
v-for="repo in repos"
|
||||
:key="repo.id"
|
||||
class="flex items-center gap-2 rounded border border-zinc-800 bg-zinc-950/40 px-2 py-1"
|
||||
>
|
||||
<input v-model="selectedRepoIds" type="checkbox" :value="repo.id" :disabled="running" />
|
||||
<span class="flex-1 text-zinc-300">{{ repo.label }}</span>
|
||||
<span v-if="results[repo.id]" class="text-[11px]" :class="statusClass(repo.id)">
|
||||
{{ statusText(repo.id) }}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<button type="submit" class="btn-primary" :disabled="running || branch.trim() === '' || selectedRepoIds.length === 0">
|
||||
{{ running ? t('crossRepo.creating') : t('crossRepo.create', { n: selectedRepoIds.length }) }}
|
||||
</button>
|
||||
<button v-if="hasFailures && !running" type="button" class="btn text-xs" @click="retryFailed">
|
||||
{{ t('crossRepo.retryFailed') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type { RepoSummary } from '@arboretum/shared';
|
||||
import { useGroupsStore, type CrossRepoResult } from '../stores/groups';
|
||||
|
||||
const props = defineProps<{ repos: RepoSummary[] }>();
|
||||
const emit = defineEmits<{ close: [] }>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const groups = useGroupsStore();
|
||||
|
||||
const branch = ref('');
|
||||
const newBranch = ref(true);
|
||||
const baseRef = ref('');
|
||||
const startSession = ref<'claude' | 'bash' | null>(null);
|
||||
const selectedRepoIds = ref<string[]>(props.repos.map((r) => r.id));
|
||||
const results = ref<Record<string, CrossRepoResult>>({});
|
||||
const running = ref(false);
|
||||
|
||||
const hasFailures = computed(() => Object.values(results.value).some((r) => r.status === 'error'));
|
||||
|
||||
function statusClass(repoId: string): string {
|
||||
return results.value[repoId]?.status === 'ok' ? 'text-emerald-400' : 'text-red-400';
|
||||
}
|
||||
function statusText(repoId: string): string {
|
||||
const r = results.value[repoId];
|
||||
if (!r) return '';
|
||||
return r.status === 'ok' ? t('crossRepo.ok') : `${t('crossRepo.error')}: ${r.message ?? ''}`;
|
||||
}
|
||||
|
||||
async function run(repoIds: string[]): Promise<void> {
|
||||
if (repoIds.length === 0) return;
|
||||
running.value = true;
|
||||
for (const id of repoIds) delete results.value[id];
|
||||
try {
|
||||
await groups.createCrossRepoFeature(
|
||||
repoIds,
|
||||
{
|
||||
branch: branch.value.trim(),
|
||||
newBranch: newBranch.value,
|
||||
...(baseRef.value.trim() ? { baseRef: baseRef.value.trim() } : {}),
|
||||
startSession: startSession.value,
|
||||
},
|
||||
(result) => {
|
||||
results.value = { ...results.value, [result.repoId]: result };
|
||||
},
|
||||
);
|
||||
} finally {
|
||||
running.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onSubmit(): void {
|
||||
void run([...selectedRepoIds.value]);
|
||||
}
|
||||
function retryFailed(): void {
|
||||
void run(Object.values(results.value).filter((r) => r.status === 'error').map((r) => r.repoId));
|
||||
}
|
||||
</script>
|
||||
@@ -4,18 +4,21 @@
|
||||
<span class="badge bg-amber-900 text-amber-200">{{ t(`sessions.dialog.kind.${dialog.kind}`) }}</span>
|
||||
<span class="text-sm text-amber-100">{{ dialog.waitingFor ?? t('sessions.dialog.waiting') }}</span>
|
||||
</div>
|
||||
<div class="mt-2 flex flex-wrap gap-2">
|
||||
<!-- Options empilées verticalement et pleine largeur : un libellé long (ex. AskUserQuestion) wrappe
|
||||
proprement au lieu d'être tronqué/collé au suivant comme avec un flex-wrap horizontal. -->
|
||||
<div class="mt-2 flex flex-col gap-1.5">
|
||||
<button
|
||||
v-for="opt in dialog.options"
|
||||
:key="opt.n"
|
||||
class="btn text-xs"
|
||||
class="btn w-full items-start justify-start whitespace-normal break-words text-left text-xs"
|
||||
:class="opt.selected ? 'border-amber-400 text-amber-200' : ''"
|
||||
:disabled="busy"
|
||||
@click="respond('select', opt.n)"
|
||||
>
|
||||
<span class="font-mono text-amber-400">{{ opt.n }}</span> {{ opt.label }}
|
||||
<span class="font-mono text-amber-400">{{ opt.n }}</span>
|
||||
<span class="min-w-0 flex-1">{{ opt.label }}</span>
|
||||
</button>
|
||||
<button class="btn-danger text-xs" :disabled="busy" @click="respond('deny')">
|
||||
<button class="btn-danger w-full justify-start text-left text-xs" :disabled="busy" @click="respond('deny')">
|
||||
{{ t('sessions.dialog.deny') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
160
packages/web/src/components/GroupSessionModal.vue
Normal file
160
packages/web/src/components/GroupSessionModal.vue
Normal file
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4" @click.self="emit('close')">
|
||||
<div class="flex max-h-[90vh] w-full max-w-lg flex-col gap-3 overflow-y-auto rounded-lg border border-zinc-800 bg-zinc-900 p-4">
|
||||
<header class="flex items-center gap-2">
|
||||
<h2 class="font-semibold text-zinc-100">{{ t('crossRepo.title') }}</h2>
|
||||
<button class="btn ml-auto text-xs" @click="emit('close')">{{ t('crossRepo.close') }}</button>
|
||||
</header>
|
||||
<p class="text-xs text-zinc-500">{{ t('crossRepo.intro') }}</p>
|
||||
|
||||
<form class="flex flex-col gap-3" @submit.prevent="onSubmit">
|
||||
<!-- mode : couvrir une nouvelle branche par repo, ou les checkouts principaux -->
|
||||
<div class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('crossRepo.modeLabel') }}
|
||||
<div class="flex flex-wrap gap-3">
|
||||
<label class="flex items-center gap-1.5">
|
||||
<input v-model="mode" type="radio" value="feature" :disabled="running" /> {{ t('crossRepo.modeFeature') }}
|
||||
</label>
|
||||
<label class="flex items-center gap-1.5">
|
||||
<input v-model="mode" type="radio" value="main" :disabled="running" /> {{ t('crossRepo.modeMain') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- mode feature : branche commune créée dans chaque repo -->
|
||||
<template v-if="mode === 'feature'">
|
||||
<label class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('crossRepo.branchLabel') }}
|
||||
<input v-model="branch" class="input font-mono" :placeholder="t('crossRepo.branchPlaceholder')" :required="mode === 'feature'" />
|
||||
</label>
|
||||
<div class="flex flex-wrap items-end gap-3">
|
||||
<label class="flex items-center gap-1.5 text-xs text-zinc-400">
|
||||
<input v-model="newBranch" type="checkbox" /> {{ t('crossRepo.newBranch') }}
|
||||
</label>
|
||||
<label class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('crossRepo.baseRefLabel') }}
|
||||
<input v-model="baseRef" class="input font-mono" placeholder="HEAD" />
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<label class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('crossRepo.commandLabel') }}
|
||||
<select v-model="command" class="input">
|
||||
<option value="claude">claude</option>
|
||||
<option value="bash">bash</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<div class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('crossRepo.reposLabel') }}
|
||||
<div class="flex flex-col gap-1">
|
||||
<div
|
||||
v-for="repo in repos"
|
||||
:key="repo.id"
|
||||
class="flex items-center gap-2 rounded border border-zinc-800 bg-zinc-950/40 px-2 py-1"
|
||||
>
|
||||
<span class="flex-1 text-zinc-300">{{ repo.label }}</span>
|
||||
<span v-if="repoStatus(repo.id)" class="text-[11px]" :class="repoStatusClass(repo.id)">
|
||||
{{ repoStatus(repo.id) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p v-if="outcome" class="text-xs" :class="outcome.session ? 'text-emerald-400' : 'text-red-400'">
|
||||
{{ outcome.session ? t('crossRepo.done') : t('crossRepo.sessionFailed') }}
|
||||
</p>
|
||||
<p v-if="errorMsg" class="text-xs text-red-400">{{ errorMsg }}</p>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<button type="submit" class="btn-primary" :disabled="running || (mode === 'feature' && branch.trim() === '') || repos.length === 0">
|
||||
{{ running ? t('crossRepo.launching') : t('crossRepo.launch') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type { RepoSummary } from '@arboretum/shared';
|
||||
import { useGroupsStore, type CrossRepoResult, type GroupFeatureOutcome } from '../stores/groups';
|
||||
import { useToastsStore } from '../stores/toasts';
|
||||
|
||||
const props = defineProps<{ groupId: string; repos: RepoSummary[] }>();
|
||||
const emit = defineEmits<{ close: [] }>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const groups = useGroupsStore();
|
||||
const toasts = useToastsStore();
|
||||
|
||||
const mode = ref<'feature' | 'main'>('feature');
|
||||
const branch = ref('');
|
||||
const newBranch = ref(true);
|
||||
const baseRef = ref('');
|
||||
const command = ref<'claude' | 'bash'>('claude');
|
||||
const wtResults = ref<Record<string, CrossRepoResult>>({});
|
||||
const outcome = ref<GroupFeatureOutcome | null>(null);
|
||||
const errorMsg = ref<string | null>(null);
|
||||
const running = ref(false);
|
||||
|
||||
const skippedById = computed<Record<string, string>>(() => {
|
||||
const m: Record<string, string> = {};
|
||||
for (const s of outcome.value?.skipped ?? []) m[s.repoId] = s.reason;
|
||||
return m;
|
||||
});
|
||||
|
||||
function repoStatus(repoId: string): string {
|
||||
const wt = wtResults.value[repoId];
|
||||
if (wt) return wt.status === 'ok' ? t('crossRepo.ok') : `${t('crossRepo.error')}: ${wt.message ?? ''}`;
|
||||
const skip = skippedById.value[repoId];
|
||||
if (skip) return `${t('crossRepo.skippedLabel')}: ${skip}`;
|
||||
return '';
|
||||
}
|
||||
function repoStatusClass(repoId: string): string {
|
||||
const wt = wtResults.value[repoId];
|
||||
if (wt) return wt.status === 'ok' ? 'text-emerald-400' : 'text-red-400';
|
||||
return skippedById.value[repoId] ? 'text-amber-400' : '';
|
||||
}
|
||||
|
||||
async function onSubmit(): Promise<void> {
|
||||
if (running.value || props.repos.length === 0) return;
|
||||
if (mode.value === 'feature' && branch.value.trim() === '') return;
|
||||
running.value = true;
|
||||
wtResults.value = {};
|
||||
outcome.value = null;
|
||||
errorMsg.value = null;
|
||||
try {
|
||||
outcome.value = await groups.createGroupFeature(
|
||||
props.groupId,
|
||||
props.repos.map((r) => r.id),
|
||||
{
|
||||
command: command.value,
|
||||
...(mode.value === 'feature'
|
||||
? { branch: branch.value.trim(), newBranch: newBranch.value, ...(baseRef.value.trim() ? { baseRef: baseRef.value.trim() } : {}) }
|
||||
: {}),
|
||||
},
|
||||
(result) => {
|
||||
wtResults.value = { ...wtResults.value, [result.repoId]: result };
|
||||
},
|
||||
);
|
||||
// Session lancée → on redirige vers son terminal plein écran (comme une session individuelle).
|
||||
// En cas d'échec serveur (session null), on garde le modal ouvert avec le statut d'erreur.
|
||||
if (outcome.value.session) {
|
||||
const failed = outcome.value.skipped.length + outcome.value.worktreeResults.filter((r) => r.status !== 'ok').length;
|
||||
if (failed > 0) toasts.info(t('toast.groupSessionPartial', { n: failed }));
|
||||
else toasts.success(t('toast.groupSessionLaunched'));
|
||||
await router.push({ name: 'session', params: { id: outcome.value.session.id } });
|
||||
}
|
||||
} catch (err) {
|
||||
errorMsg.value = err instanceof Error ? err.message : String(err);
|
||||
} finally {
|
||||
running.value = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -5,7 +5,7 @@
|
||||
<BaseBadge v-if="!repo.valid" tone="red">{{ t('repos.invalid') }}</BaseBadge>
|
||||
<span class="truncate font-mono text-xs text-zinc-500" :title="repo.path">{{ repo.path }}</span>
|
||||
<div class="ml-auto flex items-center gap-2">
|
||||
<BaseButton size="sm" :icon="Plus" @click="creating = !creating">{{ t('worktrees.new') }}</BaseButton>
|
||||
<BaseButton size="sm" :icon="Plus" @click="creating = !creating">{{ t('worktrees.startWork') }}</BaseButton>
|
||||
<BaseButton size="sm" :icon="Scissors" :loading="busy" @click="onPrune">{{ t('worktrees.prune') }}</BaseButton>
|
||||
<BaseButton
|
||||
size="sm"
|
||||
@@ -18,7 +18,17 @@
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<form v-if="creating" class="card-inset flex flex-wrap items-end gap-2" @submit.prevent="onCreate">
|
||||
<form v-if="creating" class="card-inset flex flex-col gap-2" @submit.prevent="onCreate">
|
||||
<!-- mode : créer un worktree dédié, ou bosser directement sur le checkout principal -->
|
||||
<div class="flex flex-wrap items-center gap-3 text-xs text-zinc-400">
|
||||
{{ t('worktrees.modeLabel') }}
|
||||
<label class="flex items-center gap-1.5"><input v-model="mode" type="radio" value="worktree" /> {{ t('worktrees.modeWorktree') }}</label>
|
||||
<label class="flex items-center gap-1.5"><input v-model="mode" type="radio" value="main" /> {{ t('worktrees.modeMain') }}</label>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-end gap-2">
|
||||
<!-- mode worktree : branche + créer/existante -->
|
||||
<template v-if="mode === 'worktree'">
|
||||
<label class="flex flex-1 flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('worktrees.branch') }}
|
||||
<input v-model="branch" class="input font-mono" placeholder="feature/…" required />
|
||||
@@ -32,9 +42,34 @@
|
||||
</select>
|
||||
</label>
|
||||
<label class="flex items-center gap-1 text-xs text-zinc-400"><input v-model="newBranch" type="checkbox" /> {{ t('worktrees.newBranch') }}</label>
|
||||
<BaseButton type="submit" variant="primary" size="sm" :loading="busy" :disabled="branch.trim() === ''">
|
||||
{{ t('worktrees.create') }}
|
||||
</template>
|
||||
|
||||
<!-- mode branche principale : option git (branche actuelle ou nouvelle branche) + commande -->
|
||||
<template v-else>
|
||||
<label class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('worktrees.branchModeLabel') }}
|
||||
<select v-model="mainBranchMode" class="input">
|
||||
<option value="current">{{ t('worktrees.currentBranch') }}</option>
|
||||
<option value="new">{{ t('worktrees.newBranchOpt') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label v-if="mainBranchMode === 'new'" class="flex flex-1 flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('worktrees.branch') }}
|
||||
<input v-model="branch" class="input font-mono" placeholder="feature/…" />
|
||||
</label>
|
||||
<label class="flex flex-col gap-1 text-xs text-zinc-400">
|
||||
{{ t('worktrees.commandLabel') }}
|
||||
<select v-model="mainCommand" class="input">
|
||||
<option value="claude">claude</option>
|
||||
<option value="bash">bash</option>
|
||||
</select>
|
||||
</label>
|
||||
</template>
|
||||
|
||||
<BaseButton type="submit" variant="primary" size="sm" :loading="busy" :disabled="!canSubmit">
|
||||
{{ mode === 'worktree' ? t('worktrees.create') : t('worktrees.start') }}
|
||||
</BaseButton>
|
||||
</div>
|
||||
</form>
|
||||
<p v-if="error" class="text-sm text-red-400">{{ error }}</p>
|
||||
|
||||
@@ -66,20 +101,37 @@ const toasts = useToastsStore();
|
||||
// applique le tri/filtre/recherche partagé (toolbar du dashboard) aux worktrees de ce repo.
|
||||
const worktrees = computed(() => view.apply(store.worktreesForRepo(props.repo.id)));
|
||||
const creating = ref(false);
|
||||
const mode = ref<'worktree' | 'main'>('worktree');
|
||||
const branch = ref('');
|
||||
const newBranch = ref(true);
|
||||
const startSession = ref<'claude' | 'bash' | null>(null);
|
||||
const mainBranchMode = ref<'current' | 'new'>('current');
|
||||
const mainCommand = ref<'claude' | 'bash'>('claude');
|
||||
const busy = ref(false);
|
||||
const error = ref<string | null>(null);
|
||||
|
||||
// worktree : branche obligatoire ; branche principale + nouvelle branche : branche obligatoire ; sinon OK.
|
||||
const canSubmit = computed(() =>
|
||||
mode.value === 'worktree' ? branch.value.trim() !== '' : mainBranchMode.value === 'current' || branch.value.trim() !== '',
|
||||
);
|
||||
|
||||
async function onCreate(): Promise<void> {
|
||||
busy.value = true;
|
||||
error.value = null;
|
||||
try {
|
||||
if (mode.value === 'worktree') {
|
||||
await store.createWorktree(props.repo.id, { branch: branch.value.trim(), newBranch: newBranch.value, startSession: startSession.value });
|
||||
toasts.success(t('toast.worktreeCreated'));
|
||||
} else {
|
||||
// bosser sur la branche principale : session dans le checkout principal, avec création de branche optionnelle.
|
||||
await store.startMainSession(props.repo.id, {
|
||||
command: mainCommand.value,
|
||||
...(mainBranchMode.value === 'new' ? { branch: branch.value.trim(), newBranch: true } : {}),
|
||||
});
|
||||
toasts.success(t('toast.sessionCreated'));
|
||||
}
|
||||
branch.value = '';
|
||||
creating.value = false;
|
||||
toasts.success(t('toast.worktreeCreated'));
|
||||
} catch (err) {
|
||||
error.value = err instanceof Error ? err.message : String(err);
|
||||
} finally {
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
<header class="flex items-center gap-2 border-b border-zinc-800 px-2 py-1">
|
||||
<SessionStateBadge :session="session" />
|
||||
<span class="truncate font-mono text-xs text-zinc-300" :title="session.cwd">{{ title }}</span>
|
||||
<span
|
||||
v-if="spannedCount > 1"
|
||||
class="shrink-0 rounded-full border border-sky-800/60 bg-sky-950/40 px-1.5 py-0.5 text-[10px] text-sky-300"
|
||||
:title="spannedDirs.join('\n')"
|
||||
>
|
||||
{{ t('groups.spanBadge', spannedCount) }}
|
||||
</span>
|
||||
<span class="ml-auto shrink-0 font-mono text-[11px] text-zinc-500">{{ session.command }}</span>
|
||||
</header>
|
||||
<DialogPrompt v-if="isWaiting" :session="session" class="px-2 pt-2" />
|
||||
@@ -15,6 +22,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type { SessionSummary } from '@arboretum/shared';
|
||||
import { useWorktreesStore } from '../stores/worktrees';
|
||||
import SessionStateBadge from './SessionStateBadge.vue';
|
||||
@@ -23,6 +31,11 @@ import TerminalView from './TerminalView.vue';
|
||||
|
||||
const props = defineProps<{ session: SessionSummary }>();
|
||||
const worktrees = useWorktreesStore();
|
||||
const { t } = useI18n();
|
||||
|
||||
// session de groupe (P6) : couvre plusieurs répertoires via --add-dir → badge « groupe · N dépôts ».
|
||||
const spannedDirs = computed(() => [props.session.cwd, ...(props.session.addedDirs ?? [])]);
|
||||
const spannedCount = computed(() => spannedDirs.value.length);
|
||||
|
||||
// libellé : « repo · branche » si le worktree est connu, sinon le dernier segment du cwd.
|
||||
const title = computed(() => {
|
||||
|
||||
@@ -6,9 +6,16 @@
|
||||
{{ t('groups.gridCapped', { shown: MAX_CELLS, total: sessions.length }) }}
|
||||
</p>
|
||||
<!-- une seule socket WS multiplexe tous les terminaux ; cap dur pour préserver GPU/canaux.
|
||||
Sur mobile la grille retombe à une colonne (empilement). -->
|
||||
Sur mobile la grille retombe à une colonne (empilement). Hauteur relative au viewport
|
||||
(dvh) : terminaux grands sur PC, exploitables sur mobile ; xterm re-fit via ResizeObserver.
|
||||
Plancher min-h-80 pour les fenêtres courtes. -->
|
||||
<div class="grid grid-cols-1 gap-3 lg:grid-cols-2 2xl:grid-cols-3">
|
||||
<TerminalCell v-for="s in shown" :key="s.id" :session="s" class="h-80" />
|
||||
<TerminalCell
|
||||
v-for="s in shown"
|
||||
:key="s.id"
|
||||
:session="s"
|
||||
class="h-[68dvh] min-h-80 lg:h-[calc((100dvh-9rem)/2)]"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="relative min-h-0 bg-[#09090b]">
|
||||
<div class="relative h-full min-h-0 bg-[#09090b]">
|
||||
<div ref="container" class="h-full w-full" />
|
||||
<div
|
||||
v-if="!controlling && !ended"
|
||||
@@ -71,6 +71,19 @@ onMounted(async () => {
|
||||
fit.fit();
|
||||
const activeTerm = term;
|
||||
|
||||
// Re-mesure après stabilisation du layout flex : au `onMounted`, le conteneur peut ne pas avoir sa
|
||||
// taille finale (la hauteur flex se résout après le 1er paint) → un seul `fit()` donne trop peu de
|
||||
// lignes et déforme le TUI. On refait donc le calcul en `requestAnimationFrame`, puis on resynchronise
|
||||
// les dimensions PTY. Sert aussi après un resync (reconnexion) où l'écran est remis à plat.
|
||||
const refit = (): void => {
|
||||
try {
|
||||
fit.fit();
|
||||
} catch {
|
||||
/* conteneur sans dimension (démontage en cours) : ignoré */
|
||||
}
|
||||
attachment?.resize(activeTerm.cols, activeTerm.rows);
|
||||
};
|
||||
|
||||
try {
|
||||
attachment = await wsClient.attach({
|
||||
sessionId: props.sessionId,
|
||||
@@ -79,7 +92,10 @@ onMounted(async () => {
|
||||
rows: activeTerm.rows,
|
||||
sink: {
|
||||
write: (data, callback) => activeTerm.write(data, callback),
|
||||
reset: () => activeTerm.reset(),
|
||||
reset: () => {
|
||||
activeTerm.reset();
|
||||
requestAnimationFrame(refit);
|
||||
},
|
||||
onDetached: (reason) => {
|
||||
if (reason === 'session_exit' || reason === 'replaced') ended.value = true;
|
||||
},
|
||||
@@ -99,12 +115,10 @@ onMounted(async () => {
|
||||
return;
|
||||
}
|
||||
controlling.value = attachment.controlling;
|
||||
requestAnimationFrame(refit); // recale la taille une fois le layout fullbleed stabilisé
|
||||
|
||||
activeTerm.onData((data) => attachment?.sendStdin(data));
|
||||
resizeObserver = new ResizeObserver(() => {
|
||||
fit.fit();
|
||||
attachment?.resize(activeTerm.cols, activeTerm.rows);
|
||||
});
|
||||
resizeObserver = new ResizeObserver(refit);
|
||||
resizeObserver.observe(container.value);
|
||||
if (props.mode === 'interactive') activeTerm.focus();
|
||||
});
|
||||
|
||||
@@ -26,6 +26,30 @@
|
||||
</RouterLink>
|
||||
<span v-if="worktree.sessions.length === 0" class="text-xs text-zinc-600">{{ t('worktrees.noSession') }}</span>
|
||||
|
||||
<!-- lancement d'une session sur ce worktree ; carte principale = bosser sur la branche principale -->
|
||||
<button v-if="hasLiveSession && !showLauncher" class="btn text-xs" @click="showLauncher = true">+ {{ t('worktrees.start') }}</button>
|
||||
<form v-if="!hasLiveSession || showLauncher" class="flex flex-wrap items-center gap-1" @submit.prevent="onStart">
|
||||
<template v-if="worktree.isMain">
|
||||
<select v-model="branchMode" class="input text-xs" :aria-label="t('worktrees.branchModeLabel')">
|
||||
<option value="current">{{ t('worktrees.currentBranch') }}</option>
|
||||
<option value="new">{{ t('worktrees.newBranchOpt') }}</option>
|
||||
</select>
|
||||
<input v-if="branchMode === 'new'" v-model="newBranchName" class="input w-32 font-mono text-xs" placeholder="feature/…" />
|
||||
</template>
|
||||
<select v-model="startCommand" class="input text-xs" :aria-label="t('worktrees.commandLabel')">
|
||||
<option value="claude">claude</option>
|
||||
<option value="bash">bash</option>
|
||||
</select>
|
||||
<button
|
||||
type="submit"
|
||||
class="btn-primary text-xs"
|
||||
:disabled="starting || (worktree.isMain && branchMode === 'new' && newBranchName.trim() === '')"
|
||||
>
|
||||
{{ starting ? t('worktrees.starting') : t('worktrees.start') }}
|
||||
</button>
|
||||
</form>
|
||||
<span v-if="startError" class="text-xs text-amber-400">{{ startError }}</span>
|
||||
|
||||
<div v-if="!worktree.isMain" class="ml-auto flex items-center gap-2">
|
||||
<template v-if="confirming">
|
||||
<span v-if="error" class="text-xs text-amber-400">{{ error }}</span>
|
||||
@@ -74,6 +98,39 @@ const forceNeeded = ref(false);
|
||||
const error = ref<string | null>(null);
|
||||
const busy = ref(false);
|
||||
|
||||
// --- lancement de session sur ce worktree ---
|
||||
const hasLiveSession = computed(() => props.worktree.sessions.some((s) => liveSession(s).live));
|
||||
const showLauncher = ref(false);
|
||||
const startCommand = ref<'claude' | 'bash'>('claude');
|
||||
const branchMode = ref<'current' | 'new'>('current'); // carte principale uniquement
|
||||
const newBranchName = ref('');
|
||||
const starting = ref(false);
|
||||
const startError = ref<string | null>(null);
|
||||
|
||||
async function onStart(): Promise<void> {
|
||||
if (starting.value) return;
|
||||
starting.value = true;
|
||||
startError.value = null;
|
||||
try {
|
||||
if (props.worktree.isMain && branchMode.value === 'new') {
|
||||
// bosser sur la branche principale en créant d'abord une branche dans le checkout principal.
|
||||
await store.startMainSession(props.worktree.repoId, { command: startCommand.value, branch: newBranchName.value.trim(), newBranch: true });
|
||||
} else {
|
||||
// worktree existant (ou branche principale actuelle) : session directe dans son cwd.
|
||||
await sessions.createSession(props.worktree.path, startCommand.value);
|
||||
}
|
||||
// resynchronise les worktrees du repo pour que la nouvelle session apparaisse sur la carte.
|
||||
await store.refreshRepoWorktrees(props.worktree.repoId);
|
||||
showLauncher.value = false;
|
||||
newBranchName.value = '';
|
||||
branchMode.value = 'current';
|
||||
} catch (err) {
|
||||
startError.value = err instanceof Error ? err.message : String(err);
|
||||
} finally {
|
||||
starting.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const branchLabel = computed(() =>
|
||||
props.worktree.branch ?? (props.worktree.detached ? `${t('worktrees.detached')} ${props.worktree.head.slice(0, 7)}` : '—'),
|
||||
);
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
<div class="flex min-h-0 w-full flex-1 overflow-hidden">
|
||||
<AppSidebar />
|
||||
<div class="flex min-h-0 min-w-0 flex-1 flex-col">
|
||||
<main v-if="fullbleed" class="flex min-h-0 flex-1 flex-col pb-14 md:pb-0">
|
||||
<!-- fullbleed (terminal) : pas de tabbar mobile ni de padding bas → terminal réellement plein écran
|
||||
(la navigation reste accessible via le lien « ← retour » du header de la vue). -->
|
||||
<main v-if="fullbleed" class="flex min-h-0 flex-1 flex-col">
|
||||
<slot />
|
||||
</main>
|
||||
<main v-else class="flex-1 overflow-y-auto pb-14 md:pb-0">
|
||||
@@ -10,7 +12,7 @@
|
||||
<slot />
|
||||
</div>
|
||||
</main>
|
||||
<MobileTabBar />
|
||||
<MobileTabBar v-if="!fullbleed" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -41,6 +41,12 @@ export default {
|
||||
live: 'live',
|
||||
resumable: 'resumable',
|
||||
sourceDiscovered: 'discovered',
|
||||
hide: 'Hide',
|
||||
unhide: 'Unhide',
|
||||
hiddenBadge: 'hidden',
|
||||
hideDiscovered: 'Hide external history',
|
||||
showHidden: 'Show hidden',
|
||||
hideHidden: 'Hide hidden',
|
||||
clients: 'no client | 1 client | {n} clients',
|
||||
exitCode: 'exit code {code}',
|
||||
statusLabel: {
|
||||
@@ -96,25 +102,29 @@ export default {
|
||||
viewGrid: 'Terminals',
|
||||
gridEmpty: 'No active session in this group.',
|
||||
gridCapped: 'Showing {shown} of {total} sessions — close some terminals to see the rest.',
|
||||
newFeature: 'New cross-repo feature',
|
||||
newFeature: 'New group session',
|
||||
spanBadge: 'group · {n} repo | group · {n} repos',
|
||||
},
|
||||
crossRepo: {
|
||||
title: 'New cross-repo feature',
|
||||
intro: 'Create the same worktree across the selected repos, in one action.',
|
||||
title: 'New group session',
|
||||
intro: 'Launch one Claude session that spans every repo in this group — a single conversation across all of them.',
|
||||
modeLabel: 'Directories',
|
||||
modeFeature: 'New branch in each repo',
|
||||
modeMain: 'Main checkouts',
|
||||
branchLabel: 'Branch name',
|
||||
branchPlaceholder: 'feature/…',
|
||||
newBranch: 'create branch',
|
||||
baseRefLabel: 'Base ref (optional)',
|
||||
startLabel: 'Start session',
|
||||
startNone: 'no session',
|
||||
reposLabel: 'Apply to',
|
||||
create: 'Create across {n} repos',
|
||||
creating: 'Creating…',
|
||||
retryFailed: 'Retry failed',
|
||||
commandLabel: 'Session',
|
||||
reposLabel: 'Repos in this session',
|
||||
launch: 'Launch session',
|
||||
launching: 'Launching…',
|
||||
close: 'Close',
|
||||
pending: 'pending…',
|
||||
ok: 'created',
|
||||
ok: 'worktree created',
|
||||
error: 'failed',
|
||||
skippedLabel: 'skipped',
|
||||
done: 'Group session started.',
|
||||
sessionFailed: 'Could not start the session.',
|
||||
},
|
||||
repos: {
|
||||
add: 'Add repo',
|
||||
@@ -137,7 +147,16 @@ export default {
|
||||
branch: 'Branch',
|
||||
newBranch: 'create branch',
|
||||
start: 'Start',
|
||||
starting: 'Starting…',
|
||||
startNone: 'no session',
|
||||
startWork: 'Start work',
|
||||
modeLabel: 'Mode',
|
||||
modeWorktree: 'Worktree',
|
||||
modeMain: 'Main branch',
|
||||
branchModeLabel: 'Branch',
|
||||
currentBranch: 'current branch',
|
||||
newBranchOpt: 'new branch',
|
||||
commandLabel: 'Command',
|
||||
delete: 'Delete',
|
||||
confirmDelete: 'Confirm delete',
|
||||
forceDelete: 'Force delete',
|
||||
@@ -155,6 +174,8 @@ export default {
|
||||
sessionEnded: 'Session ended',
|
||||
back: 'Sessions',
|
||||
notAttachable: 'This session runs outside Arboretum — fork it to interact, or resume it once it has stopped.',
|
||||
fullscreen: 'Fullscreen',
|
||||
exitFullscreen: 'Exit fullscreen',
|
||||
},
|
||||
push: {
|
||||
enable: 'Enable notifications',
|
||||
@@ -285,6 +306,9 @@ export default {
|
||||
sessionKilled: 'Session killed',
|
||||
sessionResumed: 'Session resumed',
|
||||
sessionForked: 'Session forked',
|
||||
sessionHidden: 'Session hidden',
|
||||
sessionUnhidden: 'Session shown',
|
||||
sessionsHidden: 'no session hidden | 1 session hidden | {n} sessions hidden',
|
||||
repoAdded: 'Repository added',
|
||||
repoRemoved: 'Repository removed',
|
||||
worktreeCreated: 'Worktree created',
|
||||
@@ -293,6 +317,8 @@ export default {
|
||||
groupCreated: 'Group created',
|
||||
groupUpdated: 'Group updated',
|
||||
groupDeleted: 'Group deleted',
|
||||
groupSessionLaunched: 'Group session started',
|
||||
groupSessionPartial: 'Group session started ({n} repo(s) skipped)',
|
||||
genericError: 'Something went wrong',
|
||||
dismiss: 'Dismiss',
|
||||
},
|
||||
|
||||
@@ -43,6 +43,12 @@ const fr: typeof en = {
|
||||
live: 'en cours',
|
||||
resumable: 'reprenable',
|
||||
sourceDiscovered: 'découverte',
|
||||
hide: 'Masquer',
|
||||
unhide: 'Réafficher',
|
||||
hiddenBadge: 'masquée',
|
||||
hideDiscovered: 'Masquer l’historique externe',
|
||||
showHidden: 'Afficher les masquées',
|
||||
hideHidden: 'Masquer les masquées',
|
||||
clients: 'aucun client | 1 client | {n} clients',
|
||||
exitCode: 'code de sortie {code}',
|
||||
statusLabel: {
|
||||
@@ -98,25 +104,29 @@ const fr: typeof en = {
|
||||
viewGrid: 'Terminaux',
|
||||
gridEmpty: 'Aucune session active dans ce groupe.',
|
||||
gridCapped: '{shown} sessions affichées sur {total} — fermez des terminaux pour voir le reste.',
|
||||
newFeature: 'Nouvelle feature cross-repo',
|
||||
newFeature: 'Nouvelle session de groupe',
|
||||
spanBadge: 'groupe · {n} dépôt | groupe · {n} dépôts',
|
||||
},
|
||||
crossRepo: {
|
||||
title: 'Nouvelle feature cross-repo',
|
||||
intro: 'Crée le même worktree dans les dépôts sélectionnés, en une seule action.',
|
||||
title: 'Nouvelle session de groupe',
|
||||
intro: 'Lance UNE session Claude couvrant tous les dépôts du groupe — une seule conversation reliant l’ensemble.',
|
||||
modeLabel: 'Répertoires',
|
||||
modeFeature: 'Nouvelle branche dans chaque dépôt',
|
||||
modeMain: 'Checkouts principaux',
|
||||
branchLabel: 'Nom de branche',
|
||||
branchPlaceholder: 'feature/…',
|
||||
newBranch: 'créer la branche',
|
||||
baseRefLabel: 'Réf. de base (optionnel)',
|
||||
startLabel: 'Démarrer une session',
|
||||
startNone: 'aucune session',
|
||||
reposLabel: 'Appliquer à',
|
||||
create: 'Créer dans {n} dépôts',
|
||||
creating: 'Création…',
|
||||
retryFailed: 'Réessayer les échecs',
|
||||
commandLabel: 'Session',
|
||||
reposLabel: 'Dépôts de la session',
|
||||
launch: 'Lancer la session',
|
||||
launching: 'Lancement…',
|
||||
close: 'Fermer',
|
||||
pending: 'en cours…',
|
||||
ok: 'créé',
|
||||
ok: 'worktree créé',
|
||||
error: 'échec',
|
||||
skippedLabel: 'ignoré',
|
||||
done: 'Session de groupe démarrée.',
|
||||
sessionFailed: 'Impossible de démarrer la session.',
|
||||
},
|
||||
repos: {
|
||||
add: 'Ajouter un repo',
|
||||
@@ -139,7 +149,16 @@ const fr: typeof en = {
|
||||
branch: 'Branche',
|
||||
newBranch: 'créer la branche',
|
||||
start: 'Démarrer',
|
||||
starting: 'Démarrage…',
|
||||
startNone: 'aucune session',
|
||||
startWork: 'Démarrer le travail',
|
||||
modeLabel: 'Mode',
|
||||
modeWorktree: 'Worktree',
|
||||
modeMain: 'Branche principale',
|
||||
branchModeLabel: 'Branche',
|
||||
currentBranch: 'branche actuelle',
|
||||
newBranchOpt: 'nouvelle branche',
|
||||
commandLabel: 'Commande',
|
||||
delete: 'Supprimer',
|
||||
confirmDelete: 'Confirmer',
|
||||
forceDelete: 'Forcer la suppression',
|
||||
@@ -158,6 +177,8 @@ const fr: typeof en = {
|
||||
back: 'Sessions',
|
||||
notAttachable:
|
||||
'Cette session tourne hors d’Arboretum — dupliquez-la pour interagir, ou reprenez-la une fois arrêtée.',
|
||||
fullscreen: 'Plein écran',
|
||||
exitFullscreen: 'Quitter le plein écran',
|
||||
},
|
||||
push: {
|
||||
enable: 'Activer les notifications',
|
||||
@@ -288,6 +309,9 @@ const fr: typeof en = {
|
||||
sessionKilled: 'Session tuée',
|
||||
sessionResumed: 'Session reprise',
|
||||
sessionForked: 'Session dupliquée',
|
||||
sessionHidden: 'Session masquée',
|
||||
sessionUnhidden: 'Session réaffichée',
|
||||
sessionsHidden: 'aucune session masquée | 1 session masquée | {n} sessions masquées',
|
||||
repoAdded: 'Dépôt ajouté',
|
||||
repoRemoved: 'Dépôt retiré',
|
||||
worktreeCreated: 'Worktree créé',
|
||||
@@ -296,6 +320,8 @@ const fr: typeof en = {
|
||||
groupCreated: 'Groupe créé',
|
||||
groupUpdated: 'Groupe mis à jour',
|
||||
groupDeleted: 'Groupe supprimé',
|
||||
groupSessionLaunched: 'Session de groupe démarrée',
|
||||
groupSessionPartial: 'Session de groupe démarrée ({n} dépôt(s) ignoré(s))',
|
||||
genericError: 'Une erreur est survenue',
|
||||
dismiss: 'Fermer',
|
||||
},
|
||||
|
||||
@@ -2,8 +2,9 @@ import { defineStore } from 'pinia';
|
||||
import { ref } from 'vue';
|
||||
import type {
|
||||
CreateGroupRequest,
|
||||
CreateWorktreeRequest,
|
||||
CreateGroupSessionRequest,
|
||||
GroupResponse,
|
||||
GroupSessionResponse,
|
||||
GroupsListResponse,
|
||||
GroupSummary,
|
||||
RepoSummary,
|
||||
@@ -14,17 +15,32 @@ import type {
|
||||
import { api, ApiError } from '../lib/api';
|
||||
import { wsClient, type GroupEvent } from '../lib/ws-client';
|
||||
import { useWorktreesStore } from './worktrees';
|
||||
import { useSessionsStore } from './sessions';
|
||||
|
||||
/** Requête « feature cross-repo » : un worktree (et éventuellement une session) par repo. */
|
||||
export type CrossRepoRequest = Omit<CreateWorktreeRequest, 'path'>;
|
||||
|
||||
/** Résultat par repo d'une action cross-repo (tolérance aux échecs partiels). */
|
||||
/** Résultat par repo de la création de worktree (mode feature, tolérance aux échecs partiels). */
|
||||
export interface CrossRepoResult {
|
||||
repoId: string;
|
||||
status: 'ok' | 'error';
|
||||
message?: string;
|
||||
worktreePath?: string;
|
||||
sessionId?: string;
|
||||
}
|
||||
|
||||
/** Options de lancement d'une session de groupe (P6). */
|
||||
export interface GroupFeatureOptions {
|
||||
command: 'claude' | 'bash';
|
||||
/** présent → crée le worktree de cette branche dans chaque repo puis relie ; absent → checkouts principaux. */
|
||||
branch?: string;
|
||||
newBranch?: boolean;
|
||||
baseRef?: string;
|
||||
}
|
||||
|
||||
/** Bilan d'un lancement de session de groupe. */
|
||||
export interface GroupFeatureOutcome {
|
||||
/** résultats de création de worktree par repo ([] en mode checkouts principaux). */
|
||||
worktreeResults: CrossRepoResult[];
|
||||
session: SessionSummary | null;
|
||||
dirs: string[];
|
||||
skipped: Array<{ repoId: string; reason: string }>;
|
||||
}
|
||||
|
||||
export const useGroupsStore = defineStore('groups', () => {
|
||||
@@ -68,7 +84,12 @@ export const useGroupsStore = defineStore('groups', () => {
|
||||
return useWorktreesStore().worktrees.filter((w) => ids.has(w.repoId));
|
||||
}
|
||||
function sessionsInGroup(groupId: string): SessionSummary[] {
|
||||
return worktreesInGroup(groupId).flatMap((w) => w.sessions);
|
||||
// Union { sessions corrélées par cwd aux worktrees du groupe } ∪ { sessions de groupe (groupId) },
|
||||
// dé-dupliquée par id : une session de groupe multi-repo ne doit apparaître qu'une fois.
|
||||
const byId = new Map<string, SessionSummary>();
|
||||
for (const w of worktreesInGroup(groupId)) for (const s of w.sessions) byId.set(s.id, s);
|
||||
for (const s of useSessionsStore().sessions) if (s.groupId === groupId) byId.set(s.id, s);
|
||||
return [...byId.values()];
|
||||
}
|
||||
|
||||
async function fetchGroups(): Promise<void> {
|
||||
@@ -109,27 +130,38 @@ export const useGroupsStore = defineStore('groups', () => {
|
||||
return res.group;
|
||||
}
|
||||
|
||||
/** Lance UNE session Claude couvrant tous les repos du groupe (--add-dir côté serveur). */
|
||||
async function createGroupSession(groupId: string, req: CreateGroupSessionRequest): Promise<GroupSessionResponse> {
|
||||
// La session est upsertée dans le store sessions par le broadcast WS `session_update`.
|
||||
return api.post<GroupSessionResponse>(`/api/v1/groups/${groupId}/session`, req);
|
||||
}
|
||||
|
||||
/**
|
||||
* Crée le même worktree (et éventuellement une session) dans chaque repo, en une action.
|
||||
* Orchestration côté client : les worktrees sont indépendants entre repos, donc on tolère
|
||||
* les échecs partiels (un repo en échec n'empêche pas les autres). Feedback par repo.
|
||||
* Lance une session de groupe reliant tous les repos (P6). En mode « feature » (branch fournie),
|
||||
* crée d'abord le même worktree de branche dans chaque repo — orchestration côté client tolérante
|
||||
* aux échecs partiels, feedback par repo — PUIS une seule session couvrant ces worktrees. En mode
|
||||
* « checkouts principaux » (sans branch), la session couvre directement le worktree principal de chaque repo.
|
||||
*/
|
||||
async function createCrossRepoFeature(
|
||||
async function createGroupFeature(
|
||||
groupId: string,
|
||||
repoIds: string[],
|
||||
req: CrossRepoRequest,
|
||||
opts: GroupFeatureOptions,
|
||||
onProgress?: (result: CrossRepoResult) => void,
|
||||
): Promise<CrossRepoResult[]> {
|
||||
): Promise<GroupFeatureOutcome> {
|
||||
const wt = useWorktreesStore();
|
||||
return Promise.all(
|
||||
let worktreeResults: CrossRepoResult[] = [];
|
||||
if (opts.branch) {
|
||||
const branch = opts.branch;
|
||||
worktreeResults = await Promise.all(
|
||||
repoIds.map(async (repoId): Promise<CrossRepoResult> => {
|
||||
try {
|
||||
const res = await wt.createWorktree(repoId, req);
|
||||
const result: CrossRepoResult = {
|
||||
repoId,
|
||||
status: 'ok',
|
||||
worktreePath: res.worktree.path,
|
||||
...(res.session ? { sessionId: res.session.id } : {}),
|
||||
};
|
||||
const res = await wt.createWorktree(repoId, {
|
||||
branch,
|
||||
newBranch: opts.newBranch ?? true,
|
||||
...(opts.baseRef ? { baseRef: opts.baseRef } : {}),
|
||||
startSession: null,
|
||||
});
|
||||
const result: CrossRepoResult = { repoId, status: 'ok', worktreePath: res.worktree.path };
|
||||
onProgress?.(result);
|
||||
return result;
|
||||
} catch (err) {
|
||||
@@ -144,6 +176,12 @@ export const useGroupsStore = defineStore('groups', () => {
|
||||
}),
|
||||
);
|
||||
}
|
||||
const res = await createGroupSession(groupId, {
|
||||
command: opts.command,
|
||||
...(opts.branch ? { branch: opts.branch } : {}),
|
||||
});
|
||||
return { worktreeResults, session: res.session, dirs: res.dirs, skipped: res.skipped };
|
||||
}
|
||||
|
||||
function startRealtime(): void {
|
||||
unsubscribe ??= wsClient.subscribeGroups(onEvent);
|
||||
@@ -168,7 +206,8 @@ export const useGroupsStore = defineStore('groups', () => {
|
||||
deleteGroup,
|
||||
addRepoToGroup,
|
||||
removeRepoFromGroup,
|
||||
createCrossRepoFeature,
|
||||
createGroupSession,
|
||||
createGroupFeature,
|
||||
startRealtime,
|
||||
stopRealtime,
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { ref } from 'vue';
|
||||
import type { CreateSessionRequest, SessionResponse, SessionSummary, SessionsListResponse } from '@arboretum/shared';
|
||||
import type { CreateSessionRequest, HideDiscoveredResponse, SessionResponse, SessionSummary, SessionsListResponse } from '@arboretum/shared';
|
||||
import { api } from '../lib/api';
|
||||
import { wsClient, type SessionEvent } from '../lib/ws-client';
|
||||
|
||||
@@ -8,6 +8,8 @@ export const useSessionsStore = defineStore('sessions', () => {
|
||||
const sessions = ref<SessionSummary[]>([]);
|
||||
const loading = ref(false);
|
||||
const loadError = ref<string | null>(null);
|
||||
// false (défaut) : les sessions masquées sont exclues ; true : on les inclut (mode « afficher les masquées »).
|
||||
const showHidden = ref(false);
|
||||
let unsubscribe: (() => void) | null = null;
|
||||
|
||||
// vivantes d'abord, puis par date de création décroissante (même ordre que le serveur)
|
||||
@@ -15,7 +17,17 @@ export const useSessionsStore = defineStore('sessions', () => {
|
||||
return [...list].sort((a, b) => Number(b.live) - Number(a.live) || b.createdAt.localeCompare(a.createdAt));
|
||||
}
|
||||
|
||||
function remove(id: string): void {
|
||||
const idx = sessions.value.findIndex((s) => s.id === id);
|
||||
if (idx >= 0) sessions.value.splice(idx, 1);
|
||||
}
|
||||
|
||||
function upsert(session: SessionSummary): void {
|
||||
// session masquée et mode « afficher les masquées » inactif : on la retire de la liste.
|
||||
if (session.hidden && !showHidden.value) {
|
||||
remove(session.id);
|
||||
return;
|
||||
}
|
||||
const idx = sessions.value.findIndex((s) => s.id === session.id);
|
||||
if (idx >= 0) sessions.value.splice(idx, 1, session);
|
||||
else sessions.value.push(session);
|
||||
@@ -43,7 +55,8 @@ export const useSessionsStore = defineStore('sessions', () => {
|
||||
loading.value = true;
|
||||
loadError.value = null;
|
||||
try {
|
||||
const res = await api.get<SessionsListResponse>('/api/v1/sessions');
|
||||
const url = showHidden.value ? '/api/v1/sessions?includeHidden=true' : '/api/v1/sessions';
|
||||
const res = await api.get<SessionsListResponse>(url);
|
||||
sessions.value = sorted(res.sessions);
|
||||
} catch (err) {
|
||||
loadError.value = err instanceof Error ? err.message : String(err);
|
||||
@@ -52,6 +65,31 @@ export const useSessionsStore = defineStore('sessions', () => {
|
||||
}
|
||||
}
|
||||
|
||||
async function setShowHidden(value: boolean): Promise<void> {
|
||||
showHidden.value = value;
|
||||
await fetchSessions();
|
||||
}
|
||||
|
||||
// Masque une session découverte (retrait optimiste si on n'affiche pas les masquées).
|
||||
async function hideSession(id: string): Promise<void> {
|
||||
await api.post<{ ok: true }>(`/api/v1/sessions/${id}/hide`);
|
||||
if (!showHidden.value) remove(id);
|
||||
}
|
||||
|
||||
// Ré-affiche une session masquée.
|
||||
async function unhideSession(id: string): Promise<void> {
|
||||
await api.delete<{ ok: true }>(`/api/v1/sessions/${id}/hide`);
|
||||
}
|
||||
|
||||
// Masque tout l'historique de sessions externes visible. Renvoie le nombre masqué.
|
||||
async function hideDiscovered(): Promise<number> {
|
||||
const res = await api.post<HideDiscoveredResponse>('/api/v1/sessions/hide-discovered');
|
||||
if (!showHidden.value) {
|
||||
sessions.value = sessions.value.filter((s) => !(s.source === 'discovered' && !s.hidden));
|
||||
}
|
||||
return res.hidden;
|
||||
}
|
||||
|
||||
function startRealtime(): void {
|
||||
unsubscribe ??= wsClient.subscribeSessions(onEvent);
|
||||
}
|
||||
@@ -90,12 +128,17 @@ export const useSessionsStore = defineStore('sessions', () => {
|
||||
sessions,
|
||||
loading,
|
||||
loadError,
|
||||
showHidden,
|
||||
fetchSessions,
|
||||
setShowHidden,
|
||||
startRealtime,
|
||||
stopRealtime,
|
||||
createSession,
|
||||
killSession,
|
||||
resumeSession,
|
||||
forkSession,
|
||||
hideSession,
|
||||
unhideSession,
|
||||
hideDiscovered,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -7,6 +7,9 @@ import type {
|
||||
RepoResponse,
|
||||
ReposListResponse,
|
||||
RepoSummary,
|
||||
SessionResponse,
|
||||
SessionSummary,
|
||||
StartRepoSessionRequest,
|
||||
WorktreeSummary,
|
||||
WorktreesListResponse,
|
||||
} from '@arboretum/shared';
|
||||
@@ -104,6 +107,16 @@ export const useWorktreesStore = defineStore('worktrees', () => {
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lance une session sur le checkout principal du repo (« bosser sur la branche principale » sans
|
||||
* worktree). Avec `branch`, le serveur crée/bascule la branche d'abord. La session et le worktree
|
||||
* mis à jour arrivent aussi par WS ; on retourne la session pour permettre la navigation immédiate.
|
||||
*/
|
||||
async function startMainSession(repoId: string, req: StartRepoSessionRequest = {}): Promise<SessionSummary> {
|
||||
const res = await api.post<SessionResponse>(`/api/v1/repos/${repoId}/session`, req);
|
||||
return res.session;
|
||||
}
|
||||
|
||||
async function deleteWorktree(repoId: string, path: string, force: boolean): Promise<void> {
|
||||
await api.delete<{ ok: true }>(`/api/v1/repos/${repoId}/worktrees?path=${encodeURIComponent(path)}&force=${force}`);
|
||||
removeWorktreeLocal(path);
|
||||
@@ -135,6 +148,7 @@ export const useWorktreesStore = defineStore('worktrees', () => {
|
||||
discover,
|
||||
refreshRepoWorktrees,
|
||||
createWorktree,
|
||||
startMainSession,
|
||||
deleteWorktree,
|
||||
prune,
|
||||
startRealtime,
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<CrossRepoFeatureModal v-if="showFeatureModal && group" :repos="groupRepos" @close="showFeatureModal = false" />
|
||||
<GroupSessionModal v-if="showFeatureModal && group" :group-id="group.id" :repos="groupRepos" @close="showFeatureModal = false" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -91,7 +91,7 @@ import SegmentedControl from '../components/ui/SegmentedControl.vue';
|
||||
import ListToolbar from '../components/ListToolbar.vue';
|
||||
import RepoSection from '../components/RepoSection.vue';
|
||||
import TerminalGrid from '../components/TerminalGrid.vue';
|
||||
import CrossRepoFeatureModal from '../components/CrossRepoFeatureModal.vue';
|
||||
import GroupSessionModal from '../components/GroupSessionModal.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="flex min-h-0 flex-col">
|
||||
<div ref="root" class="flex min-h-0 flex-1 flex-col bg-[#09090b]">
|
||||
<header class="flex items-center gap-3 border-b border-zinc-800 bg-zinc-900/60 px-3 py-1.5">
|
||||
<RouterLink :to="{ name: 'sessions' }" class="text-sm text-zinc-400 transition-colors hover:text-zinc-200">
|
||||
← {{ t('terminal.back') }}
|
||||
@@ -8,6 +8,15 @@
|
||||
<span class="truncate font-mono text-xs text-zinc-500" :title="session?.cwd ?? sessionId">
|
||||
{{ session?.cwd ?? sessionId }}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
class="ml-auto shrink-0 rounded p-1 text-zinc-400 transition-colors hover:bg-zinc-800 hover:text-zinc-200"
|
||||
:title="t(isFullscreen ? 'terminal.exitFullscreen' : 'terminal.fullscreen')"
|
||||
:aria-label="t(isFullscreen ? 'terminal.exitFullscreen' : 'terminal.fullscreen')"
|
||||
@click="toggleFullscreen"
|
||||
>
|
||||
<component :is="isFullscreen ? Minimize : Maximize" class="h-4 w-4" />
|
||||
</button>
|
||||
</header>
|
||||
<DialogPrompt v-if="session && session.activity === 'waiting'" :session="session" class="m-2" />
|
||||
<TerminalView v-if="attachable" :key="`${sessionId}:${mode}`" :session-id="sessionId" :mode="mode" class="flex-1" />
|
||||
@@ -19,9 +28,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted } from 'vue';
|
||||
import { computed, onBeforeUnmount, onMounted, ref, useTemplateRef } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Maximize, Minimize } from '@lucide/vue';
|
||||
import { useSessionsStore } from '../stores/sessions';
|
||||
import TerminalView from '../components/TerminalView.vue';
|
||||
import DialogPrompt from '../components/DialogPrompt.vue';
|
||||
@@ -36,8 +46,25 @@ const session = computed(() => store.sessions.find((s) => s.id === sessionId.val
|
||||
// défaut true : une navigation directe (liste pas encore chargée) tente l'attache d'une session managée.
|
||||
const attachable = computed(() => session.value?.attachable ?? true);
|
||||
|
||||
// Vrai plein écran (API Fullscreen) — surtout utile sur mobile pour récupérer la barre d'URL.
|
||||
// On synchronise `isFullscreen` sur l'événement natif : l'utilisateur peut sortir via Échap.
|
||||
const root = useTemplateRef<HTMLDivElement>('root');
|
||||
const isFullscreen = ref(false);
|
||||
function syncFullscreen(): void {
|
||||
isFullscreen.value = document.fullscreenElement === root.value;
|
||||
}
|
||||
function toggleFullscreen(): void {
|
||||
if (document.fullscreenElement) void document.exitFullscreen().catch(() => {});
|
||||
else void root.value?.requestFullscreen().catch(() => {});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// navigation directe : garantit l'en-tête (cwd/commande) même si l'AppShell n'a pas encore chargé.
|
||||
if (store.sessions.length === 0) void store.fetchSessions();
|
||||
document.addEventListener('fullscreenchange', syncFullscreen);
|
||||
});
|
||||
onBeforeUnmount(() => {
|
||||
document.removeEventListener('fullscreenchange', syncFullscreen);
|
||||
if (document.fullscreenElement === root.value) void document.exitFullscreen().catch(() => {});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<PageHeader :title="t('nav.sessions')">
|
||||
<BaseButton v-if="hasDiscovered" variant="ghost" size="sm" :icon="EyeOff" :loading="hidingAll" @click="onHideDiscovered">
|
||||
{{ t('sessions.hideDiscovered') }}
|
||||
</BaseButton>
|
||||
<BaseButton variant="ghost" size="sm" :icon="store.showHidden ? EyeOff : Eye" @click="onToggleHidden">
|
||||
{{ t(store.showHidden ? 'sessions.hideHidden' : 'sessions.showHidden') }}
|
||||
</BaseButton>
|
||||
<BaseButton variant="ghost" size="sm" :icon="RefreshCw" :loading="store.loading" @click="store.fetchSessions()">
|
||||
{{ t('common.refresh') }}
|
||||
</BaseButton>
|
||||
@@ -43,6 +49,7 @@
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="badge bg-zinc-800 font-mono text-zinc-300">{{ s.command }}</span>
|
||||
<BaseBadge v-if="s.source === 'discovered'" tone="sky">{{ t('sessions.sourceDiscovered') }}</BaseBadge>
|
||||
<BaseBadge v-if="s.hidden" tone="zinc">{{ t('sessions.hiddenBadge') }}</BaseBadge>
|
||||
<SessionStateBadge :session="s" />
|
||||
<span class="ml-auto text-xs text-zinc-500">{{ formatDate(s.createdAt) }}</span>
|
||||
</div>
|
||||
@@ -73,6 +80,9 @@
|
||||
<BaseButton variant="primary" size="sm" :icon="Play" :loading="actingId === s.id" @click="onResume(s.id)">{{ t('sessions.resume') }}</BaseButton>
|
||||
<BaseButton size="sm" :icon="GitFork" :loading="actingId === s.id" @click="onFork(s.id)">{{ t('sessions.fork') }}</BaseButton>
|
||||
</template>
|
||||
<!-- masquage : réafficher une session masquée, ou masquer une session découverte qui pollue la liste -->
|
||||
<BaseButton v-if="s.hidden" variant="ghost" size="sm" :icon="Eye" :loading="hidingId === s.id" @click="onUnhide(s.id)">{{ t('sessions.unhide') }}</BaseButton>
|
||||
<BaseButton v-else-if="s.source === 'discovered'" variant="ghost" size="sm" :icon="EyeOff" :loading="hidingId === s.id" @click="onHide(s.id)">{{ t('sessions.hide') }}</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@@ -88,11 +98,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type { SessionSummary } from '@arboretum/shared';
|
||||
import { RefreshCw, FolderOpen, Plus, TerminalSquare, SquareTerminal, Eye, Trash2, GitFork, Play, Search } from '@lucide/vue';
|
||||
import { RefreshCw, FolderOpen, Plus, TerminalSquare, SquareTerminal, Eye, EyeOff, Trash2, GitFork, Play, Search } from '@lucide/vue';
|
||||
import { useSessionsStore } from '../stores/sessions';
|
||||
import { useWorktreesStore } from '../stores/worktrees';
|
||||
import { useToastsStore } from '../stores/toasts';
|
||||
@@ -130,6 +140,10 @@ const creating = ref(false);
|
||||
const killArmedId = ref<string | null>(null);
|
||||
const killing = ref(false);
|
||||
const actingId = ref<string | null>(null);
|
||||
const hidingId = ref<string | null>(null);
|
||||
const hidingAll = ref(false);
|
||||
// au moins une session externe visible → propose le masquage de masse
|
||||
const hasDiscovered = computed(() => store.sessions.some((s) => s.source === 'discovered' && !s.hidden));
|
||||
|
||||
onMounted(() => {
|
||||
// navigation directe : garantit la liste même si l'AppShell n'a pas encore chargé.
|
||||
@@ -197,4 +211,48 @@ async function onConfirmKill(id: string): Promise<void> {
|
||||
killArmedId.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function onHide(id: string): Promise<void> {
|
||||
hidingId.value = id;
|
||||
try {
|
||||
await store.hideSession(id);
|
||||
toasts.success(t('toast.sessionHidden'));
|
||||
} catch (err) {
|
||||
toasts.error(err);
|
||||
} finally {
|
||||
hidingId.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function onUnhide(id: string): Promise<void> {
|
||||
hidingId.value = id;
|
||||
try {
|
||||
await store.unhideSession(id);
|
||||
toasts.success(t('toast.sessionUnhidden'));
|
||||
} catch (err) {
|
||||
toasts.error(err);
|
||||
} finally {
|
||||
hidingId.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function onHideDiscovered(): Promise<void> {
|
||||
hidingAll.value = true;
|
||||
try {
|
||||
const n = await store.hideDiscovered();
|
||||
toasts.success(t('toast.sessionsHidden', n));
|
||||
} catch (err) {
|
||||
toasts.error(err);
|
||||
} finally {
|
||||
hidingAll.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function onToggleHidden(): Promise<void> {
|
||||
try {
|
||||
await store.setShowHidden(!store.showHidden);
|
||||
} catch (err) {
|
||||
toasts.error(err);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -70,6 +70,14 @@ const en: HelpSection[] = [
|
||||
title: 'Discovered sessions',
|
||||
body: 'Sessions you start in your own terminal are detected automatically and tagged as discovered. Observe them read-only, or resume/fork them once stopped.',
|
||||
},
|
||||
{
|
||||
title: 'Hide noisy history',
|
||||
body: 'Old sessions started outside Arboretum can pile up. Hide one from its row, or use “Hide external history” to clear them all in one click. Hidden sessions stay resumable and survive a re-scan — toggle “Show hidden” to bring them back.',
|
||||
},
|
||||
{
|
||||
title: 'Fullscreen terminal',
|
||||
body: 'The web terminal fills the whole screen, with the prompt pinned to the bottom and full scrollback above. Tap the fullscreen button in the header to go edge-to-edge — handy on phones.',
|
||||
},
|
||||
{
|
||||
title: 'Resume & fork',
|
||||
body: 'Resume restarts a stopped session in its original working directory, with full scrollback replayed. Fork creates a fresh independent copy with the same command and cwd.',
|
||||
@@ -122,7 +130,7 @@ const en: HelpSection[] = [
|
||||
},
|
||||
{
|
||||
title: 'Cross-repo feature',
|
||||
body: 'Create the same worktree (and an optional session) across every repo of the group in one action; partial failures can be retried per repo.',
|
||||
body: 'Create the same branch worktree across every repo of the group, then launch one Claude session that spans them all — one conversation, one shared context. Partial worktree failures can be retried per repo, and the new session opens straight into its terminal.',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -238,6 +246,14 @@ const fr: HelpSection[] = [
|
||||
title: 'Sessions découvertes',
|
||||
body: 'Les sessions lancées dans votre propre terminal sont détectées automatiquement et marquées « découvertes ». Observez-les en lecture seule, ou reprenez/forkez-les une fois arrêtées.',
|
||||
},
|
||||
{
|
||||
title: 'Masquer l’historique',
|
||||
body: 'Les anciennes sessions lancées hors d’Arboretum peuvent s’accumuler. Masquez-en une depuis sa ligne, ou utilisez « Masquer l’historique externe » pour toutes les retirer en un clic. Les sessions masquées restent reprenables et survivent à un nouveau scan — activez « Afficher les masquées » pour les retrouver.',
|
||||
},
|
||||
{
|
||||
title: 'Terminal plein écran',
|
||||
body: 'Le terminal web occupe tout l’écran, avec l’invite ancrée en bas et tout l’historique défilable au-dessus. Touchez le bouton plein écran dans l’en-tête pour passer bord à bord — pratique sur téléphone.',
|
||||
},
|
||||
{
|
||||
title: 'Reprendre & forker',
|
||||
body: 'Reprendre relance une session arrêtée dans son répertoire d’origine, avec tout l’historique rejoué. Forker crée une copie indépendante neuve avec la même commande et le même cwd.',
|
||||
@@ -290,7 +306,7 @@ const fr: HelpSection[] = [
|
||||
},
|
||||
{
|
||||
title: 'Feature cross-repo',
|
||||
body: 'Créez le même worktree (et une session optionnelle) dans chaque dépôt du groupe en une seule action ; les échecs partiels sont rejouables dépôt par dépôt.',
|
||||
body: 'Créez le même worktree de branche dans chaque dépôt du groupe, puis lancez une seule session Claude qui les couvre tous — une conversation, un contexte partagé. Les échecs partiels de worktree sont rejouables dépôt par dépôt, et la session s’ouvre directement sur son terminal.',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user