Files
fn_registry/functions/infra/claude_fleet.go
T
egutierrez 927437a8d8 feat(infra): grupo claude-fleet — FleetView TUI + orquestacion de Claudes
Sistema FleetView para centralizar la flota de procesos Claude Code vivos en una
sola ventana kitty + tmux (socket aislado -L fleet) con un panel TUI:

- list_claude_fleet (+ tipo claude_fleet): escanea ~/.claude/sessions + goals +
  runtime, valida procesos vivos (anti-PID-reciclado), join por sessionId.
- list_resumable_claudes (+ tipo resumable_claude): sesiones cerradas reanudables.
- wrappers tmux: tmux_new_claude_window (con --resume), tmux_swap_window_into_console
  (preserva ancho del sidebar), tmux_map_claude_panes.
- launch_kittyclaude: comando entrypoint; instala atajos alt+flechas/enter/n/0/k/r,
  mouse on, remain-on-exit off; fija el ancho del sidebar con hooks.
- docs/capabilities/claude-fleet.md + entrada en el INDEX.

Incluye ademas funciones datascience en progreso (excel/duckdb/postgres) y ajustes
varios de docs e infra de otra sesion, agrupados aqui para no perderlos.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 00:04:41 +02:00

29 lines
1.8 KiB
Go

//go:build !windows
package infra
// ClaudeFleet describes a single Claude Code session process on the local
// machine, cross-joining the live process state (/proc) with the session and
// goal metadata that Claude Code persists under ~/.claude.
//
// It is the data record consumed by the fleetview TUI. Every field is derived
// from a single ~/.claude/sessions/<PID>.json entry plus its optional
// ~/.claude/goals/<sessionId>.json sidecar and the process' own /proc entry.
type ClaudeFleet struct {
PID int `json:"pid"`
KittyPID int `json:"kitty_pid"` // KITTY_PID from the process environ; 0 if not applicable (e.g. remote tmux)
SessionID string `json:"session_id"` // Claude Code sessionId (UUID)
Rename string `json:"rename"` // display name: short goal if present, else basename(cwd)
Target string `json:"target"` // sessionId[:8] + "@" + basename(cwd)
Goal string `json:"goal"` // from goals/<sessionId>.json .goal ("" if absent)
Phase string `json:"phase"` // from goals/<sessionId>.json .phase ("" if absent)
Emojis string `json:"emojis"` // 3 emojis representing the task (from goals .emojis; "" if absent)
Name string `json:"name"` // manual rename of the terminal (from goals .rename; "" if none)
Status string `json:"status"` // idle|busy|waiting (from sessions/<pid>.json)
Cwd string `json:"cwd"` // working directory of the session
TmuxWindow string `json:"tmux_window"` // "" for now (populated in a later phase)
Alive bool `json:"alive"` // process alive AND procStart matches (guards against PID recycling)
UpdatedAt int64 `json:"updated_at"` // from sessions/<pid>.json .updatedAt (epoch millis)
CtxPct int `json:"ctx_pct"` // context window used %, from runtime/<sessionId>.json; -1 if unknown
}