Skip to content

Commit 4a5ae66

Browse files
committed
refactor and ui/ux updates. Still much refactoring and clean-up to go.
1 parent 998414b commit 4a5ae66

183 files changed

Lines changed: 13953 additions & 3955 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
File renamed without changes.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ springtale-connector (depends on: crypto, store)
3434
springtale-scheduler (depends on: core, store)
3535
springtale-ai (depends on: core)
3636
springtale-mcp (depends on: core, connector)
37-
springtale-bot (depends on: core, crypto, connector, store, transport, ai)
37+
springtale-runtime (depends on: core, crypto, store, connector, ai, sentinel)
38+
springtale-bot (depends on: core, crypto, connector, store, transport, ai, runtime)
3839
springtale-sentinel (depends on: core, store)
3940
```
4041

File renamed without changes.
File renamed without changes.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
paths:
3+
- "tauri/**/*.{ts,tsx,css}"
4+
- "tauri/**/*.html"
5+
---
6+
7+
# SolidJS + Tauri Frontend Conventions
8+
9+
## Framework
10+
- SolidJS 1.9+ (fine-grained reactivity, signals, stores)
11+
- Tailwind 4 (utility-first, `@theme` for custom properties)
12+
- Vite 6 (build tool, HMR)
13+
- Tauri 2 (desktop shell, IPC via `invoke()`)
14+
15+
## Architecture
16+
- `packages/ui/` — shared component library (no app-specific logic)
17+
- `packages/types/` — shared TypeScript types
18+
- `apps/desktop/` — Tauri desktop app
19+
- `apps/dashboard/` — web SPA served by springtaled
20+
21+
## Colony visual system
22+
- All UI uses the colony pixel-art theme from `colony.css` and `sprites.css`
23+
- Colors from soil palette (not Tailwind defaults)
24+
- Silkscreen pixel font
25+
- CSS classes over inline styles. Only dynamic `width`/`left`/`top` as inline.
26+
- Sprite classes defined in `@layer components` in CSS, not inline box-shadow.
27+
28+
## Data flow
29+
- `DataProvider` interface (platform-agnostic) — defined in `dashboard/types.ts`
30+
- Desktop provider wraps Tauri IPC (`invoke()`)
31+
- Web provider wraps HTTP fetch + SSE
32+
- `createDashboardState(provider)` factory → `useDashboard()` hook
33+
- NO raw `invoke()` calls in components. Always go through provider.
34+
35+
## Component rules
36+
- One component per file, named exports only
37+
- No `innerHTML` or `dangerouslySetInnerHTML` — SolidJS auto-escapes
38+
- No `@apply` except in colony CSS files
39+
- Tailwind utility classes in `class=` attribute
40+
- `@source` directive in index.css to scan shared UI package
41+
42+
## No fake data
43+
- Every visual signal maps to real backend state
44+
- No `Math.random()` for data values
45+
- Seeded positions (deterministic from hash) are acceptable for layout
46+
- Decorative elements (litter dots, mushrooms, ground texture) are acceptable
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Springtale Product Model
2+
3+
## What this is
4+
5+
Springtale is a local-first, privacy-preserving bot automation platform.
6+
It replaces OpenClaw (250K+ stars, riddled with CVEs) with something safe,
7+
free, and open source. Built for people whose safety depends on privacy.
8+
9+
## The bot-first model
10+
11+
**Bots are the primary unit of interaction.** Not connectors, not rules, not AI.
12+
13+
A bot is:
14+
- A command router (deterministic, classical — `/search`, `/remind`, `/status`)
15+
- A set of connectors it can use (Telegram, GitHub, Kick, etc.)
16+
- Rules that fire automatically (cron, webhook, filesystem watch)
17+
- An AI adapter (optional, per-bot — defaults to NoopAdapter)
18+
- Session memory (per-user, per-channel, SQLite-backed)
19+
- A persona (name, identity, behavior config)
20+
21+
**AI is a socket, not the foundation.** The entire platform works without AI.
22+
Users plug in Ollama, OpenAI, or Anthropic per-bot. When AI hype dies,
23+
unplug the adapter. Nothing breaks. Every command, rule, and automation
24+
continues to work.
25+
26+
## How settings are scoped
27+
28+
Settings are NOT global. They're layered:
29+
30+
```
31+
App settings (vault, safety, language, data export)
32+
└── Formation settings (intent, members, momentum)
33+
└── Bot/Agent settings (connectors, rules, AI adapter, autonomy level)
34+
```
35+
36+
- **App settings** = things about THIS instance of Springtale
37+
- Vault lock/unlock, passphrase
38+
- Safety config (auto-lock, window title, content protection)
39+
- Language/locale
40+
- Data export/import
41+
- Panic wipe
42+
43+
- **Formation settings** = things about a GROUP of agents working together
44+
- Intent (reconnoiter, execute, stabilize, surge)
45+
- Member roster (which agents belong)
46+
- Momentum tier (cold/warm/hot/fever — determines capabilities)
47+
48+
- **Bot/Agent settings** = things about a SINGLE automation
49+
- Which connector it lives on (its "tree")
50+
- What rule triggers it
51+
- AI adapter (none, ollama, openai, anthropic)
52+
- Autonomy level (observe → suggest → approve → autonomous)
53+
54+
## The colony UI
55+
56+
The desktop app and web dashboard render a **pixel-art ecosystem visualization**
57+
inspired by RTS games (StarCraft, RimWorld) and colony sims (ONI, Factorio).
58+
59+
```
60+
Connectors → Trees (pixel sprites positioned on canvas)
61+
Rules/Bots → Springtail agents (pixel sprites near their tree)
62+
Pipelines → Mycelium lines (SVG paths between trees)
63+
Swarms → Formation zones (dashed ellipses with momentum labels)
64+
```
65+
66+
Reference design: `docs/intended-arch/springtale-colony-v8.html`
67+
Cooperation framework: `docs/intended-arch/COOPERATION.pdf`
68+
69+
### Visual communication
70+
71+
Agents communicate their state through:
72+
- **Simlish bubbles** — short words that map to real activity (not random)
73+
- **Activity CSS classes** — firing, error, waiting, active, idle
74+
- **Fuel/HP bars** — only visible when degraded
75+
- **Status symbols**`*` active, `!` firing, `!!` error, `~` waiting, `-` idle
76+
77+
### Game-inspired interaction
78+
79+
- Click to select trees/agents/formations
80+
- Drag trees to reposition on canvas
81+
- Command grid (3x3, StarCraft-style) changes per selection context
82+
- Keyboard shortcuts (1-9 select agents, Escape deselects)
83+
- Confirm dialogs for destructive actions (detach, dissolve, remove)
84+
85+
## What not to do
86+
87+
- Don't design global AI toggles. AI is per-bot.
88+
- Don't put connector config in app settings. Config is per-connector.
89+
- Don't treat rules as the primary UI element. Bots/agents are.
90+
- Don't add decorative fake data. Every visual signal maps to real state.
91+
- Don't make settings that tell users to "edit a TOML file." If it needs
92+
configuring, build the UI for it.
93+
- Don't leave empty command buttons. Every button does something real.

CLAUDE.md

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,86 @@
11
# Springtale
22

3-
Local-first, privacy-preserving automation platform built for people whose
4-
safety depends on privacy. Rust workspace. Connector infrastructure first,
5-
AI consumer second.
3+
Local-first, privacy-preserving automation platform for people whose
4+
safety depends on privacy. Bots are the primary unit — connector
5+
infrastructure first, AI consumer second. Everything works without AI.
66

77
**Target users:** Trans people, POC, activists, IPV survivors, immigrants —
88
people facing real surveillance, doxxing, deplatforming, and harassment.
9-
Every decision evaluated from the perspective of the most vulnerable user.
109

1110
## Build & Test
1211

1312
```bash
1413
cargo build --workspace # build all
1514
cargo test --workspace # test all
16-
cargo clippy --workspace --all-targets -- -D warnings # lint (warnings = errors)
15+
cargo clippy --workspace --all-targets -- -D warnings # lint
1716
cargo fmt --check # format check
1817
cargo nextest run --workspace # fast test runner (preferred)
18+
cd tauri && pnpm build # frontend build
19+
cd tauri/apps/desktop && pnpm tauri dev # desktop dev
20+
cd tauri/apps/dashboard && pnpm dev # web dashboard dev
1921
```
2022

21-
## Architecture (read before writing code)
23+
## Product Model — read first
24+
25+
**@.claude/rules/shared/product-model.md** — the bot-first model, how settings
26+
are scoped (app → formation → bot), the colony UI vision, what not to do.
27+
28+
## Architecture
2229

2330
**Use `current-arch` — it supersedes `intended-arch` where they differ.**
2431

2532
- Full architecture: `docs/current-arch/ARCHITECTURE.md`
2633
- Security model: `docs/current-arch/SECURITY.md`
27-
- Rekindle P2P spec: `docs/current-arch/rekindle-architecture.md`
28-
- Audit findings: `docs/current-arch/AUDIT-NOTES.md`
29-
- Change log: `docs/current-arch/CHANGELOG.md`
30-
31-
Original (pre-audit) docs preserved in `docs/intended-arch/` for reference.
32-
33-
## Phase Roadmap — know what phase you're building
34-
35-
- **Phase 1a**: Framework + Connectors (springtaled, CLI, SQLite, LocalTransport, NoopAdapter, 7 connectors)
36-
- **Phase 1b**: Bot Foundations (springtale-bot, classical command routing, connector-telegram)
37-
- **Phase 2a**: OpenClaw Parity (HttpTransport, AI adapters, sentinel, chat connectors, recursive pipelines)
38-
- **Phase 2b**: Desktop + Mobile + Safety (Tauri 2, duress/panic, travel mode, app disguise, accessibility)
39-
- **Phase 3**: Veilid Mesh (VeilidTransport via rekindle-protocol, distributed registry)
40-
41-
**Do not build Phase N+1 features while implementing Phase N.**
42-
Stubs and trait definitions for future phases are fine. Implementations are not.
34+
- Colony v8 visual reference: `docs/intended-arch/springtale-colony-v8.html`
35+
- Cooperation framework: `docs/intended-arch/COOPERATION.pdf`
4336

4437
## Core Constraints (non-negotiable)
4538

46-
1. **Security and privacy are constraints, not features.** Every decision evaluated against threat model (§2.1-2.9).
47-
2. **Built for the most vulnerable user.** Default-safe. Metadata-leaking features off by default. Zero telemetry.
48-
3. **`NoopAdapter` must work.** The entire platform operates correctly without any AI plugged in.
49-
4. **Secrets are types.** All sensitive values wrapped in `Secret<T>` from `secrecy`. Memory zeroed on drop via `zeroize`.
50-
5. **No native-tls.** `rustls-tls` exclusively. `native-tls` banned via Cargo.toml patch.
51-
6. **Modules over inline.** All functions, types, error variants in named modules. No free-floating impl blocks at crate root.
39+
1. **Security and privacy are constraints, not features.** Every decision evaluated against threat model.
40+
2. **Built for the most vulnerable user.** Default-safe. Zero telemetry.
41+
3. **`NoopAdapter` must work.** The entire platform operates without any AI plugged in.
42+
4. **Secrets are types.** All sensitive values wrapped in `Secret<T>` from `secrecy`.
43+
5. **No native-tls.** `rustls-tls` exclusively.
44+
6. **Modules over inline.** All functions, types, error variants in named modules.
5245
7. **Connectors are untrusted.** WASM sandbox, manifest signing, capability allow-list.
53-
8. **Transport is swappable.** All inter-node comms through `Transport` trait. No concrete transport escapes the module.
46+
8. **Transport is swappable.** All inter-node comms through `Transport` trait.
5447

5548
## Workspace Structure
5649

57-
- `crates/` — Pure Rust library crates (no Tauri dependency)
58-
- `connectors/` — First-party connector crates
59-
- `apps/` — springtaled (daemon) + springtale-cli
60-
- `tauri/` — Desktop shell (Phase 2b)
61-
- `sdk/` — TypeScript connector SDK (jco componentize → wasm32-wasip2)
50+
```
51+
crates/ — Pure Rust library crates (no Tauri dependency)
52+
connectors/ — First-party connector crates
53+
apps/ — springtaled (daemon) + springtale-cli
54+
tauri/ — Desktop shell + web dashboard (SolidJS + Tailwind)
55+
sdk/ — TypeScript connector SDK
56+
docs/ — Architecture, security, design references
57+
```
6258

6359
## Dependency Rules
6460

65-
- All version pins at workspace root `Cargo.toml`. No crate specifies its own version for shared deps.
66-
- Bounded version ranges only (e.g., `"42"` not `">=42.0.0"`). No unbounded `>=` pins.
67-
- `thiserror` for library error types. `anyhow` only in app binaries. Transport trait uses `TransportError`.
68-
- `#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)]` in all library crates.
69-
- `#![forbid(unsafe_code)]` on all crates except `springtale-crypto` and `springtale-connector` (audited unsafe only).
61+
- All version pins at workspace root `Cargo.toml`.
62+
- `thiserror` for library errors. `anyhow` only in app binaries.
63+
- `#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)]` in library crates.
64+
- `#![forbid(unsafe_code)]` except `springtale-crypto` and `springtale-connector`.
7065

7166
## Competitive Context
7267

73-
- **Phase 1a obsoletes NosytLabs' approach** — framework makes ad-hoc unsandboxed MCP servers obsolete.
74-
- **Phase 2a obsoletes OpenClaw** — 250K+ stars but 800+ malicious skills in ClawHub, CVE-2026-25253 RCE, no sandboxing.
75-
- **Phase 3 adds what no centralized platform can match** — E2E encrypted P2P AI chat via Veilid, no server, no phone number.
68+
- **Obsoletes OpenClaw** — 250K+ stars but 800+ malicious skills, CVE-2026-25253 RCE, no sandboxing.
69+
- **Obsoletes NosytLabs** — framework makes ad-hoc unsandboxed MCP servers obsolete.
70+
- **Phase 3 adds P2P** — E2E encrypted AI chat via Veilid, no server, no phone number.
71+
72+
## Rules
73+
74+
Rules are organized by domain and path-scoped:
75+
76+
- `.claude/rules/backend/` — Rust conventions, security, crate structure, connectors, testing
77+
- `.claude/rules/frontend/` — SolidJS conventions, Tauri integration
78+
- `.claude/rules/shared/` — Product model, git workflow
7679

77-
@.claude/rules/rust-conventions.md
78-
@.claude/rules/security.md
79-
@.claude/rules/crate-structure.md
80-
@.claude/rules/connector-guidelines.md
81-
@.claude/rules/testing.md
80+
@.claude/rules/shared/product-model.md
81+
@.claude/rules/backend/rust-conventions.md
82+
@.claude/rules/backend/security.md
83+
@.claude/rules/backend/crate-structure.md
84+
@.claude/rules/backend/connector-guidelines.md
85+
@.claude/rules/backend/testing.md
86+
@.claude/rules/frontend/solidjs-conventions.md

0 commit comments

Comments
 (0)