Commit Graph
126 Commits
Author SHA1 Message Date
weishu 37c6bc83d7 chore: migrate to AGPL-3.0-only 2026-01-04 20:45:15 +08:00
weishu 34cfe49f87 refactor: extract chat normalization and reducer logic, cleanup legacy credentials
- Split normalize.ts into focused modules: normalizeAgent, normalizeUser, normalizeUtils
- Extract reducer.ts into specialized modules: reducerCliOutput, reducerEvents, reducerTimeline, reducerTools
- Remove legacy credentials support (zod schema, readCredentials, writeCredentialsLegacy)
- Refactor NewSession component from monolithic file into modular subcomponents
- Improves code organization and maintainability across chat and authentication layers
2026-01-03 23:39:10 +08:00
weishu 63f3bcac3d fix: correct npm repository URL format in cli package
Use git+https://...git format to prevent npm publish warning about
auto-correction of repository URL field.
2026-01-03 23:15:23 +08:00
weishu 47e9d316c9 Release version 0.5.0 2026-01-03 22:54:52 +08:00
weishu f2f46e9383 refactor(api): extract versioned update handling to shared utility
Extract duplicate version acknowledgment logic from apiMachine and
apiSession into a reusable applyVersionedAck utility. This handles
success, version-mismatch, and error responses consistently with
customizable parsing and error handling via options object.
2026-01-03 22:23:29 +08:00
weishu 83bf40fa53 Fix npm release wrapper package 2026-01-03 22:22:45 +08:00
weishu aa0c3f2f0d refactor(cli): split command routing and modularize RPC handlers
Restructure CLI entry point and RPC handler registration to improve maintainability:

- Introduce command registry pattern with CommandDefinition interface for consistent command structure
- Extract individual command modules (claude, codex, daemon, doctor, gemini, auth, connect, etc.)
- Move RPC handlers into separate feature modules (bash, files, git, directories, ripgrep, difftastic, slashCommands)
- Create shared RPC types and response helpers (rpcTypes.ts, rpcResponses.ts)
- Move SpawnSessionOptions and SpawnSessionResult to rpcTypes for proper type organization
- Simplify index.ts to minimal entrypoint using command registry
- Update imports in apiMachine.ts and daemon/run.ts to use rpcTypes module

This enables:
- Better code organization by feature/command
- Easier testing of individual commands
- Safer RPC handler registration without side effects
- Clearer separation of concerns between routing and business logic
2026-01-03 17:29:05 +08:00
weishu 7fe61d1564 Release version 0.4.2 2026-01-03 16:13:01 +08:00
weishu 89b6fc34f7 refactor(cli): unify session bootstrap 2026-01-03 15:34:49 +08:00
weishu e2028b6914 Unify protocol types and modes 2026-01-03 14:43:59 +08:00
weishu bfca058967 Release version 0.4.1 2026-01-03 13:07:38 +08:00
weishu bc602ff5ea fix: archive session 2026-01-03 10:31:54 +08:00
weishu 690fbb3fba Release version 0.4.0 2026-01-02 21:47:45 +08:00
weishu 2de3a3d635 fix: expand codex custom prompt 2026-01-02 21:45:29 +08:00
weishu 94823b7a8b feat: add auto-start server feature for CLI
- Added /health endpoint to server for readiness checks (no auth required)
- Created autoStartServer module that auto-starts server when:
  - HAPI_SERVER_URL not set (using default localhost:3006)
  - cliApiToken exists in settings (server previously used)
  - Port 3006 is not currently listening
- Server runs as child process (not daemon) and exits when CLI exits
- Integrated maybeAutoStartServer() into hapi, codex, and gemini commands
2026-01-02 16:21:14 +08:00
weishu 5c059b6023 Release version 0.3.3 2025-12-31 23:44:12 +08:00
weishu 7ae7158127 fix: improve namespace-based multi-user 2025-12-31 23:28:29 +08:00
weishu e821458af8 feat: add namespace-based multi-user isolation
Implement namespace support across sessions, machines, and users for multi-user server deployments. Add access control with specific error reasons (namespace-missing, access-denied, not-found) and database schema updates with namespace columns and indexes.
2025-12-31 21:56:01 +08:00
weishu a0b1bb1524 refactor: remove unused onboardingCompleted field from Settings 2025-12-31 17:24:13 +08:00
weishu 4efc263d9b chore: add LGPL-3.0-or-later license and update package.json licenses
- Add LICENSE file to root and cli/ directories with LGPL-3.0-or-later text
- Create cli/NOTICE file with MIT attribution for happy-cli derived code
- Update license field in cli/, server/, and web/ package.json to "LGPL-3.0-or-later"
- Add NOTICE to cli/package.json files array for npm publishing
2025-12-31 13:08:02 +08:00
weishu d61cfc90c2 refactor: replace specific character regex with comprehensive non-alphanumeric pattern
Update the regex in getProjectPath to replace all non-alphanumeric characters
with dashes instead of only specific ones. This provides more robust handling
of edge cases in working directory paths.
2025-12-31 12:18:34 +08:00
weishu 705ce24e17 refactor: remove unnecessary getCleanEnv() function
Simplify environment handling by removing the getCleanEnv() function that was
filtering out local node_modules/.bin paths. Running from home directory is
sufficient to avoid local cwd side effects.
2025-12-31 11:16:45 +08:00
weishu 6afee1f7ff Release version 0.3.1 2025-12-30 17:58:53 +08:00
weishu b7dce6bf3f refactor: use undefined instead of null for optional return type 2025-12-30 17:39:24 +08:00
weishu 754d9dc0e8 feat: auto-detect git worktree context from git commands
When HAPI_WORKTREE_* environment variables are not set, fall back to
probing git to detect if running inside a worktree. This enables
worktree features to work automatically without explicit env vars.
2025-12-30 16:44:18 +08:00
weishu ce6234da3f fix: prevent race condition in MessageQueue2 wait logic 2025-12-30 13:26:33 +08:00
weishu b160888101 feat: implement message backfill to prevent message loss on reconnection 2025-12-30 13:22:27 +08:00
weishu 90e6879552 feat: add local session soft resume support for remote codex sessions 2025-12-30 11:59:34 +08:00
weishu 7845708123 fix git commit prompt 2025-12-29 14:36:24 +08:00
weishu afdec27b13 Release version 0.3.0 2025-12-28 20:57:16 +08:00
weishu 334cebc2da feat: add real-time permission and model mode synchronization close #21
Implements bidirectional sync of permission/model modes between CLI sessions and web app. Adds Codex-specific permission modes (read-only, safe-yolo, yolo) alongside Claude's modes. Web can now control CLI session state via RPC set-session-config handler, while CLI broadcasts state changes through keep-alive payloads. UI controls are flavor-aware, showing appropriate modes for Claude vs Codex vs Gemini. Type centralization in api/types eliminates circular dependencies.
2025-12-28 20:51:18 +08:00
weishu 2dc09a80db fix: pass through all permission modes in claudeRemote 2025-12-28 20:51:18 +08:00
weishu 05deb6fff8 feat: add directory autocomplete with validation for new session form 2025-12-28 16:31:53 +08:00
weishu ce40de900f fix: update slash command descriptions for claude, codex, and gemini.
close #20
2025-12-28 15:19:08 +08:00
weishu fbc0d601f8 feat: add slash command autocomplete to HappyComposer
Implements full-stack slash command autocomplete with agent-specific built-in commands and user-defined command discovery. Includes React Strict Mode fix for suggestion handling.
2025-12-28 15:19:08 +08:00
weishu 2004d22afe fix: capture process PID in local variable for TypeScript control flow 2025-12-28 14:01:12 +08:00
weishu c35a5ce827 feat: add git worktree session support with improved UI
Implement comprehensive worktree session support allowing users to spawn sessions in temporary git worktrees. Includes backend worktree management, full-stack integration, and refined UI for session type selection.

Backend:
- Add worktree creation/removal utilities with branch management
- Track worktree metadata (basePath, branch, name, path) in session metadata
- Automatic cleanup of worktrees when sessions fail or exit
- Enhanced error handling with stderr tail logging

UI improvements:
- Redesign session type toggle with improved alignment and spacing
- Move worktree description inline with label for cleaner layout
- Add branch name input field that appears when worktree mode selected
- Auto-focus on worktree input when switching modes
- Reduce gap between radio options from gap-3 to gap-1.5
- Update descriptive text and placeholders for clarity

Integration:
- Thread worktree parameters through API client, RPC handlers, and daemon
- Add worktreeEnv utility to read worktree info from environment
- Update session spawning to support both simple and worktree modes
2025-12-28 13:17:58 +08:00
weishu 50d5c4fd35 fix: resolve TypeScript type inference issue in claudeLocal.ts
Remove unnecessary Promise wrapper and move args building outside try block
so cleanupMcpConfig becomes const with proper type inference instead of never
2025-12-28 13:12:15 +08:00
Evan7198andweishu 62f0cf4c41 fix: improve cross-platform compatibility for path and file operations
Use basename() instead of split('/').pop() and 'wx' flag instead of
fs constants for better Windows compatibility.
2025-12-28 12:16:51 +08:00
weishu 2ef7e0ec5f refactor: extract MCP config handling to use temp files on Windows 2025-12-28 11:36:56 +08:00
weishu 7922356669 feat: add timeout and retry logic to bun install in release script 2025-12-28 00:03:37 +08:00
weishu 1d50f3c2f3 0.2.2 2025-12-27 23:45:24 +08:00
weishu 007721bdc8 fix: codex session selection 2025-12-27 22:24:18 +08:00
weishu 3bdcc14ed0 refactor: simplify yolo mode implementation by removing env vars
Remove HAPPY_GEMINI_ARGS and HAPPY_GEMINI_COMMAND environment variables.
Refactor gemini.ts to export registerGeminiAgent(yolo) function that
directly configures args instead of reading from environment.
2025-12-27 21:24:16 +08:00
58e61b3db9 feat: create new session with yolo mode (#13)
* feat: create new session with yolo mode

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix: harden sequence typecheck

* feat: add unified --yolo flag across all agents

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: weishu <twsxtd@gmail.com>
2025-12-27 21:03:34 +08:00
weishu 5342512ff1 Release version 0.2.1
fix: compile error for ink

see https://github.com/vadimdemedes/ink/issues/571
2025-12-26 21:45:46 +08:00
weishu f03c7f2cc8 feat: add intelligent session matching based on cwd and timestamp 2025-12-26 21:11:43 +08:00
weishu 19c2e054a9 fix: extend ink Key type with runtime properties 2025-12-26 20:45:50 +08:00
weishu b497abda98 refactor: extract CLI argument parsing into shared utility 2025-12-26 20:45:37 +08:00
weishu 5d79a3f1ef refactor: extract spawn abort handling into shared utility 2025-12-26 18:18:12 +08:00