Commit Graph
379 Commits
Author SHA1 Message Date
weishu 3f465cd47d fix: escape newlines in shell arguments on Windows
close #70
2026-01-17 19:59:59 +08:00
weishu c44eae0b17 fix: use --add-dir flag for granting Claude read access to uploads 2026-01-17 19:38:12 +08:00
weishu 53e4de6684 feat: add file upload support 2026-01-17 19:38:12 +08:00
weishu 940d7b8233 feat(web): add turn-duration event display 2026-01-17 15:00:04 +08:00
weishu f33d142446 fix: send session-alive signal immediately on socket connect to prevent initial offline flicker 2026-01-15 22:21:03 +08:00
weishuandGitHub 9d2cbd949e Add demo section to README
Added demo section with a link to the demo.
2026-01-14 14:54:20 +08:00
weishu f11db23d9e Release version 0.8.2 2026-01-14 12:34:28 +08:00
weishu 0163eb372d fix: set default TUNWG_PATH and support ~ in HAPI_HOME
Extract getHapiHome() helper to properly expand ~ prefix in HAPI_HOME
env var. Set TUNWG_PATH default to $HAPI_HOME/tunwg when not specified.
2026-01-14 12:26:00 +08:00
weishu 860124a772 fix: require runtime assets for server command 2026-01-14 12:22:15 +08:00
weishu 659ccc7023 Release version 0.8.1 2026-01-14 11:58:23 +08:00
4f25fa2da4 feat(web): terminal quick keys + modifiers + long-press (#67)
* feat: expand terminal quick keys

Add navigation keys plus ctrl/alt modifiers for the web terminal.

* feat: make terminal modifiers sticky

Keep Ctrl/Alt active until toggled off, Termux-style.

* style: improve terminal quick key buttons

Boost active contrast and adjust sizing for mobile.

* feat: add terminal key popups

Use long-press popups for / and - keys.

* fix: make terminal modifiers mutually exclusive

* fix(web): keep soft keyboard open on terminal buttons

* fix(web): allow mouse clicks on terminal quick keys

* refactor(web): simplify terminal quick input modifier handling

Remove the applyModifiers callback and inline modifier state application.
Add automatic modifier reset after quick input when appropriate.

* refactor(web): extract dispatchSequence helper for terminal input handling

Create a reusable dispatchSequence callback to handle modifier application
and reset logic for both terminal data input and quick input handlers.

---------

Co-authored-by: weishu <twsxtd@gmail.com>
2026-01-14 11:55:58 +08:00
weishu 9131429a05 refactor: extract and reuse CORS options for Socket.IO and Engine 2026-01-14 11:40:27 +08:00
weishu 7003bda706 fix: use baseUrl for Socket.IO connection to support separate frontend hosting
Previously, useTerminalSocket used a relative path `/terminal` for Socket.IO,
which would connect to the frontend host instead of the actual HAPI server.
Now it uses the baseUrl from context to connect to the correct server, enabling
scenarios like hosting the frontend on GitHub Pages while the server runs elsewhere.
2026-01-14 11:27:35 +08:00
weishu 584a912311 docs: README 2026-01-14 11:12:42 +08:00
weishu f138bbf469 Release version 0.8.0 2026-01-14 10:53:58 +08:00
weishu ce88171d8e feat: disable static file serving in relay mode
When relay mode is enabled, skip serving frontend assets through the relay tunnel to reduce bandwidth pressure. Instead, show a helpful page on root directing users to the official frontend at app.hapi.run.

Changes:
- server/src/web/server.ts: Add relayMode and officialWebUrl options, skip static serving in relay mode, show helpful page on root
- server/src/index.ts: Pass relayMode and officialWebUrl to startWebServer
2026-01-14 10:49:37 +08:00
weishu c3c89a2773 docs: default to --relay for simplified remote access with E2EE
Update documentation across README, installation, and quick-start guides
to highlight the new relay-based access method with WireGuard + TLS
end-to-end encryption. Changes include:
- Recommend `hapi server --relay` as the default startup command
- Explain URL and QR code generation in terminal for instant access
- Note end-to-end encryption for security assurance
- Reorganize self-hosted tunnel options (Cloudflare, Tailscale, IP)
- Update website installation steps and add E2EE badge
2026-01-14 10:36:46 +08:00
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