Commit Graph
339 Commits
Author SHA1 Message Date
J. F. ZhangandGitHub c0502d128c Dispose terminal addons before terminal teardown (#58) 2026-01-11 17:28:19 +08:00
weishu 045379874a Release version 0.7.2 2026-01-10 22:17:47 +08:00
weishu db8482d586 chore: rename PWA to App 2026-01-10 22:15:28 +08:00
ChenandGitHub aaaad33e61 feat: add i18n support and enhance session UI (#50) 2026-01-10 22:07:22 +08:00
weishu c659446fc1 fix: enable shell option for Windows process spawning in ACP transport
close #49
2026-01-10 21:53:53 +08:00
40b0055a33 修复socket更新中的seq值bug (#54)
Co-authored-by: qiao <jovines@qq.com>
2026-01-10 21:42:00 +08:00
JovinesandGitHub 2fb61940e4 fix: prevent click navigation after long press on session list (#52) 2026-01-10 19:58:20 +08:00
weishu 325e4b61ea chore: allow bots 2026-01-09 09:29:05 +08:00
weishu cd01477df8 improve: enhance cleanup-sessions script with better preview output and message filtering
- Improved preview output columns: Removed id and tag columns, added Title (from metadata.summary.text), First Message (first user message), and human-readable Updated date
- Reordered columns for clarity: Updated, Msgs (fixed width), Title, First Message, Path
- Added --message=PATTERN filter option for fuzzy matching on first user message (case-insensitive)
- Fixed deletion count to use actual session count instead of result.changes (which included CASCADE deleted messages)
- Added helper functions: formatDate(), truncate(), extractUserText()
2026-01-08 16:04:08 +08:00
weishu c13eb5356f Release version 0.7.1 2026-01-08 14:45:45 +08:00
weishu 702b268a09 chore: optimize issue auto-response prompt structure and guidelines
- Removed redundant project structure details (references AGENTS.md instead)
- Added explicit Skip Conditions section with clear criteria
- Simplified Response Guidelines to 4 core principles
- Added unified response template with markdown format
- Emphasized mandatory GitHub posting requirement
2026-01-08 14:39:07 +08:00
weishu a9f3f7ba6b chore: fix codex issue/pr respond 2026-01-08 13:53:38 +08:00
weishu 04edef502d chore: fix gh command in workflow 2026-01-08 13:25:23 +08:00
weishu b338d16b6b feat: add automated PR review workflow using Codex 2026-01-08 13:17:13 +08:00
weishu 8f7547187f feat: add automated issue response workflow using Codex
Adds GitHub Actions workflow to auto-respond to new issues using OpenAI's Codex action.

Features:
- Triggers on newly opened issues
- Skips issues with duplicate/spam/bot-skip labels or existing bot responses
- Includes comprehensive prompt for context-aware responses
- Enhanced security constraints and response format guidelines
- Checks for existing HAPI Bot responses before processing

Files:
- .github/workflows/issue-auto-response.yml - GitHub Actions workflow
- .github/prompts/issue-auto-response.md - Codex prompt with project context and guidelines
2026-01-08 12:24:33 +08:00
weishu 1665c63d95 fix: add retry logic to daemon machine registration for transient connection errors
Add exponential backoff retry mechanism to handle ECONNREFUSED errors when the
server isn't ready yet during daemon startup. This includes:

- New errorUtils module with error classification helpers
- withRetry function in time.ts supporting configurable exponential backoff
- Machine registration retry with sensible defaults (60 attempts, 1-30s delays)
- Error refactoring to consolidate extractErrorInfo utility

close #35
2026-01-08 11:37:29 +08:00
Ruihang XiaandGitHub c0446766a5 feat(ui): change session action menu UI style (#33) 2026-01-08 11:09:42 +08:00
Begonia, HEandGitHub 146cbf8db0 feat(terminal): add Nerd Font support for Powerline themes (#29) 2026-01-08 10:55:03 +08:00
zrq8andGitHub 2646df346e fix: start codex on Windows by using shell; keep mcp args parseable (#40)
Windows global installs expose codex as codex.cmd; spawning 'codex' without shell hits ENOENT.

Enable shell to align with Claude's Windows behavior and resolve PATH lookup.

Shell spawn makes cmd.exe strip TOML double quotes in -c arrays, so args become a string.

Switch mcp args to TOML literal (single-quoted) arrays to preserve types; update tests.
2026-01-08 10:44:01 +08:00
weishu 9dc69d1e80 feat: add serverUrl configuration support with settings.json fallback
Implement serverUrl initialization following the cliApiToken design pattern:
- Environment variable HAPI_SERVER_URL (highest priority, allows temporary override)
- settings.json serverUrl field (user persistent configuration)
- Default value 'http://localhost:3006' (fallback)

Changes:
- Add serverUrl field to Settings interface (persistence.ts)
- Convert serverUrl to private property with getter/setter (configuration.ts)
- Create initializeServerUrl module to load from settings (serverUrlInit.ts)
- Integrate serverUrl initialization in tokenInit flow (tokenInit.ts)
- Skip auto-start when serverUrl is configured in settings (autoStartServer.ts)
2026-01-08 10:37:37 +08:00
weishu cb69001385 fix: prevent continuous "Load More" triggering in message virtualization
The IntersectionObserver's useEffect had handleLoadMore in its dependency
array, but handleLoadMore depended on isLoadingMoreMessages. When loading
completed, isLoadingMoreMessages changed, causing handleLoadMore to be
recreated and the observer to rebuild, immediately firing again and
triggering continuous load requests.

Fixed by storing handleLoadMore in a ref and removing it from the
IntersectionObserver's dependency array, allowing it to rebuild only when
hasMoreMessages or isLoadingMessages change.
2026-01-08 09:09:53 +08:00
weishu 9dd83f4300 Release version 0.7.0 2026-01-07 19:01:01 +08:00
weishu 803c2f65a9 feat: add notification optimization with visibility tracking and toast messages
Implement a visibility-aware notification system that delivers toast messages via SSE to visible browser tabs instead of sending push notifications, reducing unnecessary push requests. Includes VisibilityTracker for monitoring connection visibility, toast UI components, and enhanced SSEManager with toast delivery capability.
2026-01-07 18:58:31 +08:00
weishu ddbfde57cb refactor: track visible pending messages separately from total count
Introduces visibility tracking for pending messages to distinguish between
total pending messages and those that are actually visible to the user. This
allows the overflow warning to trigger only when visible messages are dropped,
not just any messages. Includes caching of visibility checks for pending
messages to improve performance.
2026-01-07 18:10:23 +08:00
weishu dfc5359aed feat: add TELEGRAM_NOTIFICATION configuration switch
Add support for enabling/disabling Telegram notifications independently from
bot token presence. Configuration respects priority: environment variable >
settings.json > default (enabled for backward compatibility).
2026-01-07 17:04:10 +08:00
weishu 0f29ee182c refactor: replace React Query message cache with windowed message store
Introduces a new message-window-store module to manage message state with
automatic windowing of visible and pending messages. This replaces manual
React Query cache operations with a centralized, observable state system.
close #39

Key changes:
- New MessageWindowState tracks visible/pending messages with size limits
- Automatic trimming of message windows (400 visible, 200 pending messages)
- Pending message buffering when user scrolls away from bottom
- Centralized status updates for optimistic messages
- Thread component simplified with forwarded scroll and pending callbacks
- Removes message count tracking from components

This improves performance for chats with many messages and provides a
cleaner separation of concerns between UI and state management.
2026-01-07 16:59:12 +08:00
weishu 70242041d5 docs: fix documentation links to work on GitHub and VitePress
Use relative paths with .md extension for docs/guide/*.md files and
relative paths in README.md to support both GitHub rendering and
VitePress website (which has base: '/docs/'). Fixes #36
2026-01-07 15:18:15 +08:00
weishu a627b085c8 feat: add --host and --port CLI arguments to hapi server command. fix #37
Add configurable host binding for the Mini App HTTP server through:
- New `webappHost` configuration (defaults to 127.0.0.1 for security)
- CLI arguments `--host` and `--port` with flexible parsing (--host=value or --host value)
- Priority order: CLI args > env vars > settings.json > defaults
- Updated Bun.serve() to bind to the configured hostname

Modified:
- server/src/config/settings.ts
- server/src/config/serverSettings.ts
- server/src/configuration.ts
- server/src/web/server.ts
- server/src/index.ts
- cli/src/commands/server.ts
2026-01-07 14:39:54 +08:00
weishu 89236d1d2e docs: update Quick Start section to use npx and simplify steps 2026-01-07 14:34:28 +08:00
weishu 605d44f3ac chore(codex): log MCP wrapper event types 2026-01-06 18:38:22 +08:00
weishu 918f752b1c refactor: move Server button into help links section below login form
Reorganizes the LoginPrompt layout by moving the Server button from an
absolute-positioned top-right corner into the main content flow as a text
link in a new "Help links" section below the login form. Also adds a
"Needs help?" link pointing to the documentation. This reduces visual
clutter, improves hierarchy by grouping related actions, and provides
better guidance for new users.
2026-01-06 10:32:42 +08:00
weishu d612726162 docs: rewrite Features section from pain-point perspective 2026-01-06 10:32:42 +08:00
OmoyxandGitHub 8d6c256867 fix(website): use @twsxtd/hapi instead of deprecated hapi package (#34)
## What changed

The website currently suggests installing `hapi` directly from npm, which
resolves to the deprecated `hapi@18.1.0` package (with known security issues).

This PR updates the installation command to use the correct CLI package:
`@twsxtd/hapi`.

## Why

Running `npm install -g hapi` triggers a deprecation and security warning:

> This version contains severe security issues and defects and should not be used

This is confusing for users and may lead them to believe HAPI itself is insecure.

## Result

- Users install the correct package
- No npm security warning
- Instructions now match the actual CLI package name
2026-01-06 08:58:45 +08:00
weishu c1092bcfec refactor: improve LoginPrompt UI/UX with simplified layout and better navigation
- Update subtitle to official slogan "Vibe Coding Anytime, Anywhere"
- Simplify input placeholder to "Access token"
- Remove verbose help text below the input field
- Move server settings from top-right corner to footer below form
- Add "Needs help?" link to docs (https://hapi.run/docs)
- Add underline styling to both help and server links for better affordance
- Add footer with copyright and Vibe Coding message
2026-01-05 21:28:42 +08:00
weishu 43e55b3ecb refactor: decompose Store into domain-specific substore classes 2026-01-05 19:35:20 +08:00
weishu ff35c52160 Release version 0.6.0 2026-01-05 18:42:37 +08:00
weishu 9a28e6e0a1 refactor: unify MCP bridge setup and system prompt delivery
Extract duplicate MCP bridge initialization code from codexLocalLauncher and
codexRemoteLauncher into a new buildHapiMcpBridge utility. This ensures both
modes use identical server setup logic and provides a single source of truth
for MCP configuration.

Update codexStartConfig to deliver system prompt via developer_instructions
instead of appending to the user message. This ensures consistent behavior
between local and remote modes and properly separates system guidance from
user intent.
2026-01-05 18:38:58 +08:00
weishu c50621e85a feat: add MCP config and system prompt support for Codex local mode
Implements MCP server configuration and developer instructions support in
Codex local mode, bringing it to parity with remote mode.

Key additions:
- buildMcpServerConfigArgs() and buildDeveloperInstructionsArg() utilities
  to construct -c config arguments for passing MCP servers and instructions
  to the Codex CLI at runtime
- TITLE_INSTRUCTION for Codex to call hapi__change_title to update chat
  session titles dynamically
- Codex local mode now starts hapi MCP bridge server and passes both MCP
  configuration and developer instructions to Claude, enabling full feature
  parity with remote mode

Files changed:
- New: codexMcpConfig.ts (utilities), systemPrompt.ts (prompt definition),
  codexMcpConfig.test.ts (comprehensive tests)
- Updated: codexLocal.ts (accepts mcpServers, builds config args),
  codexLocalLauncher.ts (starts hapi server, passes config),
  codexStartConfig.ts (imports TITLE_INSTRUCTION)
2026-01-05 18:38:58 +08:00
weishu 45822afa49 refactor: split CLI handlers into modular handler files 2026-01-05 18:32:52 +08:00
weishu 908d2f694a refactor: extract permission handler base class for code reuse 2026-01-05 18:04:51 +08:00
weishu e8252c601f refactor: extract remote launcher base class for code reuse 2026-01-05 16:50:22 +08:00
weishu 0e360f0a48 refactor: extract session scanner base class for code reuse
Create BaseSessionScanner abstract class to consolidate common session
scanning logic shared between Claude and Codex session scanners. Both
scanners now inherit from this base, reducing duplication and providing
consistent patterns for file watching, event processing, and state
management.
2026-01-05 15:53:30 +08:00
weishu 6ce521c3f8 refactor: consolidate configuration files into dedicated config module 2026-01-05 13:53:00 +08:00
weishu 77eefcd8da refactor: move path utilities to utils directory 2026-01-05 13:00:48 +08:00
weishu d388c92114 refactor: remove CLI dead code
Remove unused daemon installation/uninstallation logic and unnecessary re-exports:
- Delete cli/src/daemon/mac/ directory (macOS LaunchDaemon install/uninstall not used)
- Delete cli/src/daemon/install.ts and uninstall.ts wrappers
- Remove daemon install/uninstall subcommands from cli/src/commands/daemon.ts
- Delete cli/src/api/encryption.ts (misleading name, just base64 encoding)
- Inline base64 encoding directly in cli/src/persistence.ts
- Delete cli/src/modules/common/gitHandlers.ts (unnecessary re-export)
- Update cli/src/modules/common/registerCommonHandlers.ts to import directly from handlers/git

Part of refactoring plan item #1 "删除 CLI 死代码".
2026-01-05 13:00:48 +08:00
weishu 23887ce040 refactor: remove unused/deprecated code and legacy socket events 2026-01-05 13:00:48 +08:00
weishu 21a64dfb49 refactor: extract session summary utilities to shared module 2026-01-05 13:00:48 +08:00
weishu f7d161e6cf feat: add api-error event support with folding for retry messages
Introduces support for displaying API error system messages in the web UI with
automatic folding of consecutive retry messages to show only the latest state.
2026-01-05 13:00:25 +08:00
weishu b665e34d3c refactor: modularize store implementation into domain-specific modules 2026-01-05 11:51:49 +08:00
weishu f82728e9b3 refactor: remove deprecated logout command and legacy sidechain logic 2026-01-05 10:49:23 +08:00