Commit Graph
486 Commits
Author SHA1 Message Date
weishu fff474ccd7 Add project skills for codex, close #241 2026-03-06 11:01:29 +08:00
JlovecandGitHub ef3328f48f fix(cli): support project slash command completion (#245)
Add project-level slash command discovery with recursive nested command scanning, pass workingDirectory through slash-command handlers, and align hub/web source unions to include project commands.
2026-03-05 12:50:59 +08:00
JlovecandGitHub 55f08bd562 fix(cli): hide windows console windows for runner/claude subprocesses (#242) 2026-03-04 20:47:16 +08:00
weishu 5ceab49630 Release version 0.16.0 2026-03-03 10:36:22 +08:00
Mao MrandGitHub c9be2894ac feat(cursor): add support for Cursor Agent CLI integration (#236)
* feat(cursor): add support for Cursor Agent CLI integration

- Introduced new command `hapi cursor` to start Cursor Agent sessions.
- Added functionality for resuming sessions and managing permission modes.
- Updated documentation to include Cursor Agent usage and installation instructions.
- Enhanced existing codebase to accommodate Cursor as a recognized agent flavor.
- Implemented local and remote session handling for Cursor Agent.

This update expands HAPI's capabilities by integrating support for the Cursor Agent, allowing users to leverage its features alongside existing agents.

* Remove TODO.md file as it is no longer needed following the integration of Cursor Agent CLI support. This cleanup helps streamline project documentation and reflects the completion of the associated tasks.

* feat(cursor): implement remote mode and fix --hapi-starting-mode

- Consume --hapi-starting-mode in cursor command (do not forward to agent)
- Implement cursorRemoteLauncher: spawn agent -p with stream-json, --trust
- Add cursorEventConverter for NDJSON parsing (system/assistant/tool_call/result)
- Multi-turn via --resume session_id
- Update docs: cursor supports both local and remote modes

Made-with: Cursor

* fix: type error

* fix(cursor): address PR review - model UI, sessionId metadata, duplicate flags

- HappyComposer: use isClaudeFlavor for model mode (cursor has no model modes)
- cursorLocalLauncher: call onSessionFound for resume so cursorSessionId in metadata
- cursorCommand: do not forward parsed flags to cursorArgs (avoid duplicates)

Made-with: Cursor
2026-03-03 10:02:47 +08:00
weishu 72a23fc761 build baseline variant for linux x64. 2026-03-02 13:11:06 +08:00
weishu 91d03e481f docs: add npm registry recommendation for installation
Update installation guides to specify the official npm registry
and add a recommendation to use it for global installs, as some
mirrors may not sync platform packages in time.
2026-03-02 12:00:19 +08:00
weishu 673e0c8aec refactor(cli): extract platform validation and error reporting from binary launcher
Refactor platform detection and error reporting logic into dedicated,
testable functions. This improves code organization and enables better
error handling for unsupported platforms and missing platform packages.

- Add SUPPORTED_PLATFORMS constant with platform labels
- Extract getPlatformKey() utility function
- Extract isSupportedPlatform() validation function
- Extract reportUnsupportedPlatform() error reporting function
- Extract reportMissingPlatformPackage() error reporting function
- Update main() to use new functions for clearer error handling
2026-03-02 11:58:08 +08:00
weishu 9c2bdfb1ae refactor(cli): extract platform validation and error reporting functions
Extract platform detection and error reporting logic into reusable functions
to improve testability and reduce code duplication in the binary launcher.
Adds comprehensive test coverage for platform validation and error messages.
2026-03-02 11:57:41 +08:00
weishu 76f6196e2b Add Telegram group 2026-03-01 11:10:14 +08:00
weishu 2bdae8fe2d Release version 0.15.4 2026-03-01 11:05:36 +08:00
LihengwannaflyandGitHub 1942f088ff fix(sync): add SSE heartbeat and alive status (#223) 2026-02-28 01:46:21 +08:00
ElderDogeandGitHub 4ace791aa4 feat(cli): support subdirectory slash commands with colon-separated names (#227) 2026-02-28 01:44:50 +08:00
ElderDogeandGitHub da71d235f3 fix(web): show agent messages immediately regardless of scroll position (#228) 2026-02-28 01:44:12 +08:00
Mark LandGitHub 1f958f44fa fix(cli): report binary startup failures with actionable diagnostics (#220) 2026-02-27 09:01:24 +08:00
METOandGitHub acfc777d08 fix(cli): use getDefaultClaudeCodePath() in claudeRemote (#218)
Replace hardcoded 'claude' string with getDefaultClaudeCodePath() to
ensure the correct Claude Code executable path is resolved, consistent
with claudeLocal.ts. This respects HAPI_CLAUDE_PATH env var and finds
the global claude installation path properly.
2026-02-26 16:58:58 +08:00
weishu a74dcc9477 Release version 0.15.3 2026-02-25 17:38:32 +08:00
467fb54231 fix(web): add Shift+Enter keyboard shortcut to send messages (#209)
On iPadOS with a hardware keyboard, `isTouch` is true (via pointer:coarse)
so submitOnEnter is disabled and there's no keyboard-based way to send.

Add Shift+Enter as a send shortcut that works on all platforms without
changing existing behavior — desktop Enter-to-send is preserved.

Closes #175

via [HAPI](https://hapi.run)

Co-authored-by: HAPI <noreply@hapi.run>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:57:40 +08:00
10f7e1404e fix(cli): harden ACP/Codex event handling (#211)
Co-authored-by: Lihengwannafly <Lihengwannafly@users.noreply.github.com>
2026-02-25 16:57:28 +08:00
gaius-codiusandGitHub 77cfa715f9 fix(web): harden clipboard copy and terminal paste flows (#187) 2026-02-19 08:08:52 +08:00
weishu c8682047bf fix(cli): gemini hook settings schema (#173) 2026-02-14 15:46:34 +08:00
weishu eb8e749946 Release version 0.15.2 2026-02-11 10:25:00 +08:00
Him188andGitHub b11e6ed7eb feat(web): persist new session agent and yolo preferences (#171) 2026-02-10 15:40:45 +08:00
Fdcode6andGitHub 2080ee8c7f feat(cli): support slash commands from installed plugins (#155)
* feat(cli): support slash commands from installed plugins

Allows HAPI to automatically scan and load slash commands from installed Claude plugins (e.g. superpowers). Commands are indexed with their plugin namespace prefix.

* fix(web): add 'plugin' to SlashCommand source type

This fixes the typecheck error identified by the PR review bot.

* fix(web): update Suggestion type to include 'plugin' source

* fix(slashCommands): 修复 scoped 插件名称解析及多版本安装选择逻辑

- 使用 lastIndexOf('@') 替代 split('@')[0] 以正确解析带 scope 的插件名
- 按 lastUpdated 降序排序选择最新的安装实例
- 增加 installations 空数组边界检查
2026-02-08 10:37:04 +08:00
Mark LandGitHub 4a59d4896f fix: prevent /sessions/new from matching as dynamic sessionId route (#164) 2026-02-07 22:33:08 +08:00
weishu 857f625ce3 docs: Self-signed certificates 2026-02-07 11:41:43 +08:00
weishu 93d4028d83 fix(web): improve git status unavailable handling in files view 2026-02-06 21:04:27 +08:00
weishu fb9abc18d4 feat: Add directory tree tab to session files 2026-02-06 20:18:46 +08:00
weishu dc7472f1d0 ci(web): enable VITE_REQUIRE_HUB_URL for pages build 2026-02-06 17:04:00 +08:00
weishu cc9b9279bd fix(web): require hub URL without clearing input 2026-02-06 17:03:46 +08:00
weishu 4242c508c1 docs: update Cloudflare Tunnel section and add relay TCP configuration tip
- Remove Quick Tunnel (TryCloudflare) documentation as it doesn't support SSE which HAPI uses for real-time updates
- Add warning note explaining the limitation with link to Cloudflare docs
- Keep only Named Tunnel as the recommended approach
- Add tip about HAPI_RELAY_FORCE_TCP environment variable for users experiencing connectivity issues
2026-02-04 10:28:08 +08:00
weishu cb693c6c56 docs: add CONTRIBUTING.md with contributor guidelines
Add comprehensive contributor guidelines including code of conduct,
AI-generated code policy (GPT-5.2-codex only), PR best practices
(no mega PRs), bug report/feature request procedures, and getting
started instructions.
2026-02-03 19:57:14 +08:00
weishu 674133d8c7 Release version 0.15.1 2026-02-03 13:37:13 +08:00
798317cd05 fix(windows): use absolute path with shell:false for Claude spawn (#143)
On Windows, spawning Claude with shell: true causes the process to
exit immediately with code 1. This happens because shell: true invokes
cmd.exe /c claude <args>, and cmd.exe's PATH resolution differs from
direct process creation, leading to environment inconsistencies.

This fix:
- Adds findWindowsClaudePath() to locate claude.exe absolute path
- Changes spawn to use absolute path with shell: false on Windows
- Maintains Unix behavior (command name works fine with shell: false)
- Adds HAPI_CLAUDE_PATH env var for user override

Tested on Windows 11 with Claude Code v2.1.29 and hapi v0.15.0.

via [HAPI](https://hapi.run)

Co-authored-by: HAPI <noreply@hapi.run>
2026-02-03 13:28:14 +08:00
2f6bbcd400 fix(web): 修复切换会话时消息乱序问题 (#150)
* feat(web): add built-in Nerd Font for terminal icon support

Add MesloLGLDZ Nerd Font as a built-in web font to ensure Powerlevel10k
and other Nerd Font-dependent prompts render correctly in the web terminal,
even on devices without local Nerd Fonts installed (e.g., mobile phones).

Changes:
- Add MesloLGLDZNerdFontMono-Regular.woff2 to web/public/fonts/
- Load font via FontFace API with BASE_URL support for subpath deployments
- Merge font loading and terminal creation in same useEffect to ensure
  font is ready before terminal renders

Fixes #121

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: use CDN for Nerd Font instead of bundled file

Load MesloLGLDZ Nerd Font from jsDelivr CDN instead of bundling the 1.2MB
font file. This reduces the bundle size significantly while still ensuring
Nerd Font icons display correctly on all devices.

CDN URL: https://cdn.jsdelivr.net/gh/mshaugh/nerdfont-webfonts@v3.3.0/build/fonts/MesloLGLDZNerdFontMono-Regular.woff2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(web): prevent message ordering issues when switching sessions

When switching between sessions or loading paginated messages, old tool
blocks from agentState.requests were being mixed with current messages,
causing display order issues.

Root cause: reduceChatBlocks creates tool blocks for all permissions in
agentState, including those older than the current message page. These
old blocks (with earlier createdAt) would appear mixed with newer messages.

Fix:
1. In reducer.ts: Skip creating permission-only tool blocks if their
   createdAt is older than the oldest message in the current view
2. In SessionChat.tsx: Clear caches synchronously in useMemo when session
   changes, since useEffect runs after render

Closes #148

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>

---------

Co-authored-by: tfq <tfq@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: HAPI <noreply@hapi.run>
2026-02-03 12:51:27 +08:00
weishu 2735421e3f remove unsupported builtin commands for codex 2026-02-02 12:25:15 +08:00
weishu 91529c7592 fix duplicate pr review 2026-02-02 11:23:08 +08:00
61dd69d5df feat(web): add built-in Nerd Font for terminal icon support (#122)
* feat(web): add built-in Nerd Font for terminal icon support

Co-authored-by: tfq <tfq@gmail.com>
Co-authored-by: weishu <twsxtd@gmail.com>
2026-02-02 11:17:48 +08:00
weishu 5b27f6b41e feat(web): Add reconnecting feedback when SSE connection is lost (#125)
- Add ReconnectingBanner component to show "Reconnecting..." status
- Track SSE connection state in App.tsx with onDisconnect handler
- Add onBlocked callback to useSendMessage for handling blocked send attempts
- Provide haptic feedback when send is blocked due to no API or session
- Show toast notification when message cannot be sent due to server disconnection
- Add translation keys for reconnecting message and send blocked feedback in en/zh-CN

close #125
2026-02-01 19:40:43 +08:00
weishu 8dfc8749eb fix schema url 2026-01-31 11:06:39 +08:00
weishu effe033c4f docs: unify ENV and settings.json configuration documentation (#113)
- Add settings.json column to environment variables table with key name mappings
- Document missing ENV variables: TELEGRAM_BOT_TOKEN, TELEGRAM_NOTIFICATION,
  HAPI_RELAY_FORCE_TCP, VAPID_SUBJECT
- Add settings.json example with configuration priority explanation
- Create JSON Schema file for settings.json validation and editor autocompletion
  with all fields, descriptions, and ENV variable references

clsoe #113
2026-01-31 11:01:59 +08:00
therainismeandGitHub e9cc98b7ee feat(web): Add session sidebar for desktop, keep mobile single-page layout (#112)
* feat(web): Responsive session sidebar + split chat layout

* Update sidebar width

* Fixed dialog

* Move the sidebar scrollbar to the left without flipping content
2026-01-31 10:06:43 +08:00
Trustin LeeandGitHub 7cad11ca27 Add About section to settings page with version info and tests (#119)
* feat(web): add About section to settings page

- Add website link to hapi.run
- Display app version from CLI package
- Display protocol version from shared module
- Add Vitest testing setup with settings page tests

🤖 Generated with Claude Code

* test(web): add tests for website link and i18n key usage

Address residual risks mentioned in PR review:
- Test website link URL and security attributes (target, rel)
- Verify correct i18n keys are used for About section via spy

Simplify test setup by using real I18nProvider and en locale.

🤖 Generated with Claude Code
2026-01-30 09:48:49 +08:00
weishu c5190b4079 refactor: extract local launcher logic into shared BaseLocalLauncher class 2026-01-29 16:45:44 +08:00
weishu 308249abdb fix(web): improve font scale compatibility and defaults 2026-01-29 16:33:30 +08:00
therainismeandweishu efbe4f8d90 feat(web): add font size setting
- Add Settings > Display > Font Size selector (80/90/100/110/120%)
- Persist preference (hapi-font-scale) and apply globally via --app-font-scale
- Normalize main UI typography to match Settings
2026-01-29 16:25:47 +08:00
weishu 0ceda16160 refactor: extract access type definitions into shared module 2026-01-29 15:54:59 +08:00
weishu b7c06db327 refactor: extract agent flavor utility functions into shared module 2026-01-29 15:41:19 +08:00
weishu cdf8226a9d refactor: extract tool input utility functions into shared module
Move getInputString, getInputStringAny, and truncate functions from
individual ToolCard components into a dedicated toolInputUtils module
to eliminate duplication across PermissionFooter, ToolCard, and
knownTools components.
2026-01-29 14:37:06 +08:00
weishu 19ba69c6e4 Release version 0.15.0 2026-01-29 10:57:02 +08:00