Skip to content

feat: add hooks support#68

Merged
sirily11 merged 3 commits into
mainfrom
hooks
May 29, 2026
Merged

feat: add hooks support#68
sirily11 merged 3 commits into
mainfrom
hooks

Conversation

@sirily11
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 29, 2026 13:56
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rxcode Ready Ready Preview, Comment May 29, 2026 3:27pm

Request Review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds project-scoped lifecycle hooks that run at session start/stop, plus a new .packageScript run-profile type that surfaces package.json/deno.json tasks via the detected package manager (npm/yarn/pnpm/bun/deno). Hook output is rendered inline as tool-style cards, and start-hook stdout is injected into the agent's context. Also includes a Briefing "Show more/less" thread list, a new User Manual section, and a CI tweak.

Changes:

  • New HookProfile / HookTrigger model, HookService runner, AppState+Hooks, and persistence; wired into AppState+CrossProject (start) and AppState+Stream / .result (stop). New desktop UI: HooksSettingsSection, HookConfigurationsView, HookProfileDetailForm, shared BashEnvironmentEditor.
  • New PackageRunConfig / PackageManager and .packageScript RunProfileType; detector now infers the package manager from lockfiles, reads deno tasks, and probes installed managers. Run-profile UIs (desktop and mobile) gain a "Package" section.
  • Briefing thread list collapsed to 5 with a Show more/less toggle; user manual gets a Hooks page (EN+zh-CN); CI workflow trigger broadened.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Packages/Sources/RxCodeCore/Models/HookProfile.swift New hook model + trigger enum.
Packages/Sources/RxCodeCore/Models/PackageRunConfig.swift New package-manager model and config.
Packages/Sources/RxCodeCore/Models/RunProfile.swift Adds .packageScript case and package field.
Packages/Sources/RxCodeCore/RunProfile/RunTaskExecutor.swift Emits package-script wrapper lines.
Packages/Sources/RxCodeCore/RunProfile/DetectedRunnable.swift Carries optional PackageRunConfig for detected scripts.
Packages/Sources/RxCodeChatKit/ToolResultView.swift Renders Hook: tool calls as cards.
Packages/Tests/RxCodeCoreTests/RunTaskExecutorTests.swift Tests for package wrapper output.
RxCode/Services/Hooks/HookService.swift Headless Process runner for hooks with output cap.
RxCode/Services/PersistenceService.swift Hook profile load/save under hooks/.
RxCode/Services/RunProfile/RunProfileDetector.swift Multi-manager script detection + install probe.
RxCode/App/AppState.swift Caches hooks per project; tracks handled stop streamIds.
RxCode/App/AppState+Hooks.swift Hook cache, run loop, tool-card insertion.
RxCode/App/AppState+CrossProject.swift Start hooks + system-prompt injection; stop-hook firing.
RxCode/App/AppState+Stream.swift Cancel-path stop-hook firing.
RxCode/Views/Hooks/HookConfigurationsView.swift Modal split-pane hook editor.
RxCode/Views/Hooks/HookProfileDetailForm.swift Per-hook detail form.
RxCode/Views/Hooks/BashEnvironmentEditor.swift Shared env-preset editor.
RxCode/Views/Settings/HooksSettingsSection.swift Settings entry-point + project picker.
RxCode/Views/SettingsView.swift Inserts hooks section.
RxCode/Views/RunProfile/RunConfigurationsView.swift Adds Package section + add-action.
RxCode/Views/RunProfile/RunProfileDetailForm.swift Package command/script editor.
RxCode/Views/Sidebar/BriefingView.swift Threads list show-more/less toggle.
RxCode/Views/UserManualView.swift New "hooks" manual entry.
RxCodeMobile/Views/MobileRunProfileEditorView.swift Mobile package section + script picker.
RxCodeMobile/Views/SessionsList.swift Mobile add/edit support for package profiles.
RxCode/Resources/user_manual_hooks*.md EN + zh-CN hooks docs.
RxCode/Resources/Localizable.xcstrings New string keys.
.github/workflows/build.yaml Removes branches: [main] push filter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 7 to 11
on:
push:
branches:
- main
release:
types:
- created
Comment thread RxCode/App/AppState.swift
Comment on lines +941 to +943
/// Streams whose session-stop hooks have already fired, so the `.result`
/// path and the cancel path don't double-run them for the same stream.
var stopHooksHandledStreamIds: Set<UUID> = []
The hooks work added saveHookProfiles/loadHookProfiles to
AppStatePersistenceService but the test mock was not updated,
breaking the RxCodeTests build target in CI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sirily11 sirily11 merged commit 2bc9df4 into main May 29, 2026
13 checks passed
@sirily11 sirily11 deleted the hooks branch May 29, 2026 15:43
@sirily11
Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 1.13.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants