Repository navigation
feat(events): feed events from scripts beside agent events - #235
Open
adefreitas wants to merge 2 commits into
Open
adefreitas wants to merge 2 commits into
adefreitas wants to merge 2 commits into
Conversation
…o the socket
NudgeEvent gains source (agent, github, calendar, script), tag, severity
(info, action, alert), url, repo, pr and key, all defaulted, so agent hooks
and every existing caller are unchanged. A feed event stays NudgeKind.other,
which keeps it out of the handoff ledger, the Slack stop path and every
permission gate.
- EventStore: a keyed feed event replaces its earlier self; a feed never
takes the selection from what is being triaged; each source has its own
cap of 20 instead of sharing the per-session one.
- Banners: a feed banner no longer clears delivered banners (which took a
permission banner's Allow/Deny with it), reuses its key so a newer one
replaces the older, and opens its link when clicked.
- Events tab: a tag icon coloured by severity and a source chip
("GitHub · api#9"); ⏎ and O open the link, labelled Open.
- Socket: scripts may send the new fields. Only http(s) links are kept, an
unknown source falls back to agent, and a feed is forced to kind other and
loses fifo_path, hook_pid and has_action_button, so it can never be a
prompt.
- History records and searches source and tag; older lines still parse.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Events today are agent hooks only. This adds the model for events from somewhere else (a script now, GitHub and the calendar later): a source, tag, severity, link, repo, PR number and key, plus how the Events tab shows them. Agent events behave as before. No feed ships in this PR; a script posting to the socket is the only producer.
Changes
NudgeEventgainssource(agent,github,calendar,script),tag,severity(info,action,alert),url,repo,prandkey, all defaulted. A feed event is alwaysNudgeKind.other, so it stays out of the handoff ledger, the Slack stop path and the permission gates.EventStore: a keyed feed event replaces its earlier self; a feed never takes the selection from the prompt being triaged; each source keeps its own 20 events, apart from the per-session cap.httpandhttpslinks are kept, an unknown source oragentbecomes a plain agent event, and a feed is forced to kindotherand losesfifo_path,hook_pidandhas_action_button, so it can't be answered as a prompt.FeedStyle): icon by tag, falling back to the source's icon; colour by severity; a chip such asGitHub · api#9.⏎andOopen the link (primary action reads Open, or Done with no link).FeedEventTestscovers the model, store (keyed replacement, selection, caps), decoding and validation of the socket fields, an unchanged agent hook event, and history round trip.notify.sh eventcommand, which is a later PR.Testing
Automated:
./build.sh(no new warnings),make test-without-xcode(1485 tests, 0 failures),make typecheck-tests.Manual, after
make reload:printf '%s\n' '{"agent":"deploy-bot","event":"other","title":"Deployed","message":"api to production","source":"script","tag":"deploy","severity":"action","url":"https://example.com/deploys/9","repo":"acme/api","pr":9,"key":"deploy:9"}' | nc -U ~/.stack-nudge/panel.sockA row appears with an orange box icon and the chip
Script · api#9. The footer's primary action reads Open.⏎. The link opens in the browser and the row goes."message":"api to staging"twice. There is one row, not two.⏎still approves the prompt."source":"script","event":"permission","has_action_button":true. It shows as a plain row with no Approve."url":"file:///etc/hosts". The row shows, the footer reads Done, and⏎only dismisses it.H, filter bydeploy. The feed records show up with the box icon.Related issues
None.
🤖 Generated with Claude Code