feat: add WatchContextInput for monitoring custom commands#353
Open
iberianpig wants to merge 3 commits intomainfrom
Open
feat: add WatchContextInput for monitoring custom commands#353iberianpig wants to merge 3 commits intomainfrom
iberianpig wants to merge 3 commits intomainfrom
Conversation
Add TailContextInput, TailContextDetector, and TailContextBuffer plugins to monitor user-defined commands and output their results as context events. This enables context-aware gesture configurations based on external command output. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…nput - Add warning log when tail_context command fails with exit status - Change empty config behavior from break to sleep+continue for hot-reload support - Update RBS type definitions for detector and tail_context_input - Add tests for error logging and empty config loop behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8360a28 to
1283f8e
Compare
- Rename tail_context -> watch_context (classes, config key, files)
- Add streaming mode support: when no interval specified, use IO.popen
for continuous command output monitoring
- Polling mode (with interval) executes command periodically
- Streaming mode (without interval) reads continuously from command
Config example:
```yaml
watch_context:
battery:
command: "cat /sys/class/power_supply/BAT0/capacity"
interval: 30 # polling mode
events:
command: "some-streaming-cmd" # streaming mode (no interval)
```
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3718be9 to
6e5142d
Compare
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
WatchContextInputplugin to monitor user-defined commands and output their results as context eventsOpen3.capture3for safer command execution with stderr loggingplugin: inputs: watch_context_input:config key (consistent with other plugins)Configuration Example
Test plan
bundle exec rspecto verify all tests pass (293 examples, 0 failures)bundle exec steep check🤖 Generated with Claude Code