Commit Graph
362 Commits
Author SHA1 Message Date
weishu 4a2e30ee28 Normalize CORS origins before server wiring 2026-01-14 09:23:45 +08:00
weishu 5d1899616c fix: typecheck 2026-01-14 08:59:55 +08:00
weishu 2449d783f6 refactor: use useNavigate for URL parameter cleanup in AppInner 2026-01-14 08:39:36 +08:00
weishu 716a42e5e0 fix: enable GitHub Pages SPA routing by copying index.html to 404.html
GitHub Pages will serve 404.html when a route is not found, allowing
the React app to load and handle client-side routing for SPA navigation.
2026-01-13 21:52:57 +08:00
weishu e8137cbeb2 feat: add TLS certificate validation for tunnel access
Add tlsGate module to validate tunnel TLS certificates before announcing public access. This ensures the tunnel has a valid, trusted certificate before displaying the public URL to users. The validation checks certificate validity period, hostname matching (including wildcard support), and handles both DNS names and IP addresses.

Refactor tunnel access announcement to wait for TLS readiness asynchronously, preventing premature display of access links.
2026-01-13 21:25:56 +08:00
weishu e0c36b71e6 Remove env-based tunnel toggle 2026-01-13 20:32:47 +08:00
weishu 5defb6dbfc feat: add wireguard relay integration for public server access with End-to-End Encryption
Integrates tunwg (WireGuard tunnel) to enable optional public access
to the hapi server. Tunnel is disabled by default and enabled via
--relay flag or HAPI_TUNNEL=true environment variable.

Users can now run 'hapi server --relay' and get a direct link like:
https://app.hapi.run/?server=https://xxx.relay.hapi.run&token=xxx
2026-01-13 20:18:11 +08:00
weishu ecae91fa1c chore: use self mention 2026-01-13 13:47:02 +08:00
weishu 02b47ca757 feat: add GitHub Actions workflow for @hapi mention auto-response
Add Codex-powered workflow that automatically responds to @hapi mentions in issue and PR review comments, with permission checks and skip conditions.
2026-01-13 13:32:06 +08:00
weishu efd91b05b9 chore: improve issue auto-response workflow triggers and concurrency handling 2026-01-13 13:17:40 +08:00
weishu ce23c1c8d8 chore: allow all users for Codex workflow actions 2026-01-13 13:12:10 +08:00
weishu 942f98f60a Release version 0.7.3 2026-01-13 12:31:38 +08:00
weishu 75de3cd1cb feat: add session resume capability via 'codex resume' command
close #51
2026-01-13 12:29:30 +08:00
weishu b5e90f1f50 fix: prevent auto-resume of old Codex sessions from before startup
CODEX_SESSION_SCANNER was incorrectly auto-resuming old sessions because
session files persist after Codex exits. Fixed by:

1. Only matching sessions created AFTER hapi startup (reject if
   sessionTimestamp < referenceTimestampMs)
2. Snapshot resumeSessionId at startup so scanner callbacks don't
   affect codexLocal's launch parameters
3. Updated session timestamp test to verify boundary conditions
2026-01-13 11:59:34 +08:00
weishu 251b04ec2d fix: use message field for Codex permission card subtitle
Codex elicitation requests from MCP use the 'message' field (from
ElicitRequest schema), not 'command' or 'cwd'. Update the permission
handler to extract and pass this field, and display it as the card
subtitle with fallback to command.
2026-01-13 11:06:50 +08:00
weishu 41d8844c00 fix: implement permission handler callbacks and add CodexPermission UI support
Adds onRequest and onComplete callbacks to CodexPermissionHandler to track
permission request/response lifecycle. Includes helper functions to normalize
command and cwd inputs, and displays permission requests in the web UI.
2026-01-13 11:06:50 +08:00
weishu a6e35eaf65 fix: add shell_command tool to knownTools registry
Codex API sends 'shell_command' as the tool name for bash commands, but
the web app didn't recognize it, falling back to a generic wrench icon.
This adds proper presentation with a terminal icon, matching Claude's
Bash tool display.
2026-01-13 11:06:50 +08:00
weishu d260ea86f0 fix: parse codex bash output format in web app display
Parse the "Exit code: X\nWall time: Y\nOutput:\n..." format from bash tool
results and display metadata (exit code and wall time) separately from the
output content as a code block.
2026-01-13 11:06:50 +08:00
f6cf2ee49c feat(web): add fuzzy matching for slash commands (#63)
Co-authored-by: Liheng <liheng@example.com>
2026-01-13 11:06:28 +08:00
weishu 8ed94193d8 fix: position session action menu at touch/click point
- Updated useLongPress.ts to pass click coordinates to onLongPress callback
- Modified SessionList.tsx to use menuAnchorPoint state instead of menuAnchorRef
- Updated SessionActionMenu.tsx to position menu based on anchorPoint coordinates
- Enhanced SessionHeader.tsx to calculate anchorPoint from button position and added stopPropagation to fix toggle issue

The menu now appears at the exact touch/click position instead of being centered or aligned to the button edge.
2026-01-12 19:08:01 +08:00
weishu 83664a7fc9 fix: use worktree grouping for homepage project count 2026-01-12 18:35:44 +08:00
weishu 9f2da5f8ae fix: suppress git stderr when running in non-git directory 2026-01-12 17:59:52 +08:00
weishu b6763a3913 chore: update agents.md 2026-01-12 17:59:52 +08:00
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