@jean2/client 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,178 @@
1
1
  # Jean2 Client
2
2
 
3
- A Tauri-based desktop application for macOS. React + Vite frontend with a modern chat interface for AI interactions.
3
+ Cross-platform frontend for the Jean2 AI Agent. Connects to a Jean2 server over WebSocket and REST API for real-time AI chat sessions with tool execution, multi-workspace support, and multi-server management.
4
4
 
5
- ## Installation
5
+ Three deployment targets:
6
6
 
7
- Download the latest release from GitHub releases for macOS.
7
+ - **Tauri Desktop** Native macOS application with multi-window support
8
+ - **Tauri iOS** — Native iPhone application
9
+ - **Web CLI** — Run locally via `npx @jean2/client`
8
10
 
9
- ## Usage
11
+ ## Features
10
12
 
11
- Launch the application from your Applications folder. Connect to a Jean2 server instance to start using the AI agent.
13
+ - Streaming chat with real-time message updates and token usage display
14
+ - Multi-model and multi-provider selection (budget/standard/premium tiers)
15
+ - Session management — create, close, reopen, rename, fork, compact, and revert
16
+ - Multi-server and multi-workspace support with quick switching
17
+ - Tool permission approval flow with allow-once and always-allow options
18
+ - File tree browser and file path autocomplete
19
+ - MCP (Model Context Protocol) server management
20
+ - Queued messages when a session is busy streaming
21
+ - Offline detection with exponential backoff auto-reconnect
22
+ - Dark and light themes (persists per platform)
23
+ - Responsive layout — works on desktop and mobile viewports
24
+
25
+ ## Prerequisites
26
+
27
+ - [Bun](https://bun.sh/)
28
+ - For Tauri desktop builds: [Rust](https://www.rust-lang.org/tools/install) and Xcode Command Line Tools (`xcode-select --install`)
29
+ - For iOS builds: Xcode, Apple Developer account — see [README-ios.md](README-ios.md)
30
+
31
+ ## Development
32
+
33
+ ```bash
34
+ # Install dependencies (from repo root)
35
+ bun install
36
+
37
+ # Start Vite dev server (port 5173, proxies to server on port 3000)
38
+ bun run dev
39
+ ```
40
+
41
+ The Vite dev server proxies `/api` and `/ws` to `http://localhost:3000`.
42
+
43
+ ### Tauri Desktop (Live Reload)
44
+
45
+ ```bash
46
+ # Opens native window with hot module replacement
47
+ bun run tauri:dev
48
+ ```
49
+
50
+ ### Tauri iOS (Live Reload)
51
+
52
+ ```bash
53
+ bun run tauri:ios:dev
54
+ ```
55
+
56
+ ## Building
57
+
58
+ ### Web
59
+
60
+ ```bash
61
+ bun run build
62
+ # Output: dist/
63
+ ```
64
+
65
+ ### Tauri Desktop
66
+
67
+ ```bash
68
+ # macOS (Apple Silicon)
69
+ bun run tauri:build:macos
70
+
71
+ # Generic (all targets)
72
+ bun run tauri:build
73
+ ```
74
+
75
+ ### macOS Gatekeeper (Unsigned Builds)
76
+
77
+ Apps downloaded from GitHub releases are not code-signed. macOS will block opening them by default. Remove the quarantine attribute:
78
+
79
+ ```bash
80
+ xattr -cr /Applications/Jean2.app
81
+ ```
82
+
83
+ ### Tauri iOS
84
+
85
+ See [README-ios.md](README-ios.md) for full build and deployment instructions.
86
+
87
+ ### CLI / npx
88
+
89
+ ```bash
90
+ bun run build:npx
91
+ # Output: dist/cli.mjs (bundled Node.js server)
92
+ ```
93
+
94
+ ## Running via npx
95
+
96
+ ```bash
97
+ npx @jean2/client
98
+ # Opens browser to http://localhost:3774
99
+
100
+ # Custom port
101
+ npx @jean2/client --port 8080
102
+ ```
103
+
104
+ The CLI bundles the built web assets and serves them with a static Node.js HTTP server.
105
+
106
+ ## Project Structure
107
+
108
+ ```
109
+ packages/client/
110
+ src/
111
+ App.tsx Root component, WebSocket + REST state management
112
+ main.tsx Entry point, ThemeProvider wrapper
113
+ cli.ts npx CLI — static file server
114
+ index.css Tailwind v4, theme tokens, responsive utilities
115
+ components/
116
+ chat/ ChatView, MessageBubble, MessageInput, ToolCall, etc.
117
+ layout/ AppSidebar, QuickSwitcher, WorkspaceSwitcher, FilesPanel
118
+ modals/ SettingsDialog, MCPManagementDialog, AddServerDialog
119
+ visualizations/ CodeBlock, DiffViewer, TerminalOutput, TodoList, etc.
120
+ shared/ MarkdownRenderer, ThemeToggle, EmptyState, OfflineState
121
+ files/ FileTree, FileTreeNode, FileAutocomplete
122
+ providers/ ThemeProvider
123
+ ui/ shadcn/ui primitives (button, dialog, sidebar, etc.)
124
+ contexts/
125
+ ServerContext.tsx Multi-server state, quick connections
126
+ hooks/
127
+ useApi.ts Authenticated fetch helper
128
+ useFileSearch.ts File search utility
129
+ useLocalStorage.ts LocalStorage hook
130
+ use-mobile.ts Mobile viewport detection
131
+ config/
132
+ auth.ts Token validation, URL normalization
133
+ servers.ts Server CRUD in localStorage
134
+ lib/
135
+ utils.ts cn() and Tailwind merge
136
+ storage.ts Platform-agnostic storage (Tauri Store / localStorage)
137
+ path.ts Path utilities
138
+ utils/
139
+ diff.ts Diff parsing utilities
140
+ src-tauri/
141
+ tauri.conf.json Tauri configuration
142
+ src/
143
+ lib.rs Platform gate (desktop vs mobile)
144
+ desktop.rs Desktop entry — multi-window, plugins
145
+ mobile.rs iOS entry — plugins only
146
+ components.json shadcn/ui configuration (radix-nova style)
147
+ vite.config.ts Vite — React, Tailwind, path aliases, dev proxy
148
+ package.npm.json Minimal manifest for npm publish (CLI mode)
149
+ VERSION Client version (0.2.1)
150
+ ```
151
+
152
+ ## Technology Stack
153
+
154
+ | Layer | Technology |
155
+ | ------------ | ------------------------------------------- |
156
+ | Framework | React 19 |
157
+ | Build | Vite 6, TypeScript |
158
+ | Styling | Tailwind CSS v4, shadcn/ui, Radix UI |
159
+ | Fonts | Geist Variable |
160
+ | Icons | Lucide React |
161
+ | Desktop | Tauri 2 (Rust) |
162
+ | Mobile | Tauri 2 iOS |
163
+ | Markdown | react-markdown + remark-gfm |
164
+ | Code blocks | prism-react-renderer |
165
+ | Storage | @tauri-apps/plugin-store / localStorage |
166
+ | CLI | esbuild bundle, Node.js http module |
167
+
168
+ ## Architecture
169
+
170
+ The client connects to a Jean2 server via WebSocket (`ws://host:port/ws?token=...`) for real-time events and REST (`http://host:port/api`) for initial data loading. All communication is authenticated with a bearer token.
171
+
172
+ **WebSocket protocol** handles session CRUD, message streaming (including delta-based text append), part creation/updates, permission requests, queue management, usage tracking, and compaction events. The `App.tsx` handler dispatches all `ServerMessage` types into React state.
173
+
174
+ **Multi-server support** allows connecting to multiple Jean2 server instances. Servers are persisted in localStorage. Switching servers clears all session state and reconnects.
175
+
176
+ **Multi-workspace support** isolates sessions by workspace. The active workspace is persisted and restored on reload.
177
+
178
+ **Platform abstraction** — the `storage` module (`lib/storage.ts`) transparently uses Tauri Store on native platforms and falls back to localStorage on web. The Tauri Rust layer adds native-only features like multi-window (`Cmd+N`).