chore: rename tahuantinsuyu → cosmobiologia

Rename clean del proyecto astrológico antes de empezar el módulo
web (fase 2 = server axum, fase 3 = cliente WASM). Hacerlo ahora
ahorra refactor de URLs, package.json, paths de assets HTML y
deploy configs que aparecerían con el nombre en cuanto exista el
server.

Mecánica:
- `git mv` de los 10 crates de módulo + 2 apps:
  * `crates/modules/tahuantinsuyu/` → `cosmobiologia/`
  * `crates/modules/tahuantinsuyu/tahuantinsuyu-*` →
    `cosmobiologia/cosmobiologia-*`
  * `crates/apps/tahuantinsuyu` y `tahuantinsuyu-cli` análogos.
- Sed sobre todos los `.rs` y `.toml`: `tahuantinsuyu` →
  `cosmobiologia` (cubre crate names, deps paths, use
  statements, ProjectDirs literals, binary names).
- Workspace `Cargo.toml`: members con paths nuevos.
- Memoria del proyecto (`~/.claude/.../memory/project_*.md`)
  actualizada.

Cero leftovers: `grep -rn tahuantinsuyu --include="*.rs"
--include="*.toml" crates/` devuelve vacío.

DB & XDG: clean slate. La nueva app arranca con DB vacía en
`$XDG_DATA_HOME/cosmobiologia/charts.db`. Si tenías cartas
guardadas, viven todavía en `~/.local/share/tahuantinsuyu/` —
las podés migrar manualmente con un `cp`.

IDs UI inalterados: el prefijo `tts-` de gpui ElementIds queda
igual (cosmético, no afecta funcionalidad). Cambiarlo a `cb-`
ahora sería 3-4 líneas más de sed pero ningún beneficio
operativo.

Tests: 20 verdes (10 shell + 10 render math). Compila full:
`cargo check -p cosmobiologia` OK.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
sergio
2026-05-19 00:45:48 +00:00
parent 9084cf4b79
commit 06a1ca11ce
34 changed files with 325 additions and 315 deletions
+35
View File
@@ -0,0 +1,35 @@
[package]
name = "cosmobiologia"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
description = "Tahuantinsuyu — estudio profesional de astrología. Tree + canvas + panel sobre yahweh + eternal-astrology."
[dependencies]
cosmobiologia-card = { path = "../../modules/cosmobiologia/cosmobiologia-card" }
cosmobiologia-canvas = { path = "../../modules/cosmobiologia/cosmobiologia-canvas" }
cosmobiologia-engine = { path = "../../modules/cosmobiologia/cosmobiologia-engine" }
cosmobiologia-model = { path = "../../modules/cosmobiologia/cosmobiologia-model" }
cosmobiologia-modules = { path = "../../modules/cosmobiologia/cosmobiologia-modules" }
cosmobiologia-panel = { path = "../../modules/cosmobiologia/cosmobiologia-panel" }
cosmobiologia-store = { path = "../../modules/cosmobiologia/cosmobiologia-store" }
cosmobiologia-theme = { path = "../../modules/cosmobiologia/cosmobiologia-theme" }
cosmobiologia-tree = { path = "../../modules/cosmobiologia/cosmobiologia-tree" }
brahman-sidecar = { path = "../../shared/brahman-sidecar" }
yahweh-core = { workspace = true }
yahweh-theme = { workspace = true }
yahweh-widget-theme-switcher = { path = "../../modules/ui_engine/widgets/theme-switcher" }
yahweh-widget-splitter = { workspace = true }
yahweh-widget-container-core = { workspace = true }
gpui = { workspace = true }
directories = { workspace = true }
serde_json = { workspace = true }
[dev-dependencies]
# TestAppContext + #[gpui::test] para tests de integración del shell.
gpui = { workspace = true, features = ["test-support"] }
[[bin]]
name = "cosmobiologia"
path = "src/main.rs"
+95
View File
@@ -0,0 +1,95 @@
//! Tahuantinsuyu — binario standalone.
//!
//! Boot:
//! 1. `cosmobiologia_card::spawn_sidecar()` se presenta al Init brahman
//! (fire-and-forget; si no hay Init, la app sigue standalone).
//! 2. Abre la DB SQLite en `$XDG_DATA_HOME/cosmobiologia/charts.db`
//! (fallback a `~/.local/share/cosmobiologia/charts.db`).
//! 3. Levanta GPUI con [`yahweh_theme::Theme::install_default`].
//! 4. Compone el shell: [`Shell`] dueño del tree (izq), canvas (centro)
//! y panel (abajo). Cablea las suscripciones cross-widget.
//!
//! ## Layout
//!
//! ```text
//! ┌───────────┬────────────────────────────────────────┐
//! │ │ │
//! │ tree │ canvas │
//! │ (groups, │ (rueda / thumbnails) │
//! │ contacts,│ │
//! │ charts) │ │
//! │ │ │
//! ├───────────┴────────────────────────────────────────┤
//! │ control panel (módulos) │
//! └─────────────────────────────────────────────────────┘
//! ```
mod shell;
use std::path::PathBuf;
use gpui::{
App, AppContext, Application, Bounds, SharedString, TitlebarOptions, WindowBounds,
WindowOptions, px, size,
};
use cosmobiologia_store::Store;
use yahweh_theme::Theme;
use crate::shell::Shell;
const DB_FILENAME: &str = "charts.db";
const APP_TITLE: &str = "Tahuantinsuyu";
fn main() {
// Sidecar brahman primero — si el Init está corriendo, nos presentamos.
cosmobiologia_card::spawn_sidecar();
// Service socket: thread separado escuchando ComputeRequest. Otros
// módulos brahman pueden conectar y pedir cómputos de cartas
// natales sin GUI. Si el bind falla (socket ya tomado, sin
// permisos), loggea warn y la app sigue corriendo standalone.
let service_socket = cosmobiologia_card::service::default_service_socket();
eprintln!("[cosmobiologia] service socket → {}", service_socket.display());
cosmobiologia_card::service::spawn_service_thread(service_socket);
// DB en directorio de datos del usuario.
let db_path = resolve_db_path();
let store = match Store::open(&db_path) {
Ok(s) => s,
Err(e) => {
eprintln!(
"[cosmobiologia] no se pudo abrir la DB en {:?}: {} — usando memoria",
db_path, e
);
Store::in_memory().expect("in-memory store")
}
};
Application::new().run(move |cx: &mut App| {
Theme::install_default(cx);
let bounds = Bounds::centered(None, size(px(1400.0), px(900.0)), cx);
cx.open_window(
WindowOptions {
window_bounds: Some(WindowBounds::Windowed(bounds)),
titlebar: Some(TitlebarOptions {
title: Some(SharedString::from(APP_TITLE)),
..Default::default()
}),
..Default::default()
},
move |_w, cx| cx.new(|cx| Shell::new(store.clone(), cx)),
)
.expect("open window");
cx.activate(true);
});
}
fn resolve_db_path() -> PathBuf {
if let Some(dirs) = directories::ProjectDirs::from("net", "gioser", "cosmobiologia") {
let dir = dirs.data_dir().to_path_buf();
let _ = std::fs::create_dir_all(&dir);
return dir.join(DB_FILENAME);
}
PathBuf::from(DB_FILENAME)
}
File diff suppressed because it is too large Load Diff