@delorenj/claude-notifications 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DO.md +5 -0
- package/FIXES-APPLIED.md +195 -0
- package/INTEGRATION.md +445 -0
- package/LAYOUT-INTEGRATION.md +191 -0
- package/QUICK-REFERENCE.md +195 -0
- package/README.md +145 -14
- package/TASK.md +15 -0
- package/ZELLIJ-NOTIFY.md +523 -0
- package/_bmad-output/implementation-artifacts/spec-install-multi-cli-hooks.md +241 -0
- package/bin/claude-notifications.js +417 -312
- package/bin/claude-notify.js +47 -1
- package/bin/zellij-notify.js +346 -0
- package/bun.lock +35 -0
- package/diagnose-zellij.sh +105 -0
- package/examples/settings-with-zellij.json +18 -0
- package/examples/settings-zellij-only.json +18 -0
- package/examples/zellij-notify-examples.sh +143 -0
- package/lib/adapters/_stub.js +35 -0
- package/lib/adapters/auggie.js +10 -0
- package/lib/adapters/claude-code.js +181 -0
- package/lib/adapters/codex.js +10 -0
- package/lib/adapters/copilot.js +10 -0
- package/lib/adapters/gemini.js +10 -0
- package/lib/adapters/index.js +240 -0
- package/lib/adapters/kimi.js +10 -0
- package/lib/adapters/opencode.js +14 -0
- package/lib/adapters/vibe.js +10 -0
- package/lib/config.js +44 -8
- package/lib/tui.js +115 -0
- package/lib/zellij.js +248 -0
- package/package.json +6 -4
- package/postinstall.js +28 -25
- package/preuninstall.js +18 -9
- package/test/adapters/claude-code.test.js +144 -0
- package/test/adapters/patches.test.js +81 -0
- package/test/adapters/registry.test.js +89 -0
- package/test/adapters/stubs.test.js +46 -0
- package/test/cli-json.test.js +79 -0
- package/test/helpers/fake-fs.js +59 -0
- package/test-integration.sh +113 -0
- package/test-notification-plugin.kdl +34 -0
- package/test-updated-layout.sh +75 -0
- package/test-zellij-cli.sh +72 -0
- package/zellij-plugin/.cargo/config.toml +5 -0
- package/zellij-plugin/.github/workflows/ci.yml +97 -0
- package/zellij-plugin/Cargo.lock +3558 -0
- package/zellij-plugin/Cargo.toml +40 -0
- package/zellij-plugin/README.md +290 -0
- package/zellij-plugin/build.sh +179 -0
- package/zellij-plugin/configs/examples/accessibility.kdl +31 -0
- package/zellij-plugin/configs/examples/catppuccin.kdl +32 -0
- package/zellij-plugin/configs/examples/default.kdl +34 -0
- package/zellij-plugin/configs/examples/minimal.kdl +22 -0
- package/zellij-plugin/docs/CONFIGURATION.md +191 -0
- package/zellij-plugin/docs/INTEGRATION.md +333 -0
- package/zellij-plugin/src/animation.rs +451 -0
- package/zellij-plugin/src/colors.rs +407 -0
- package/zellij-plugin/src/config.rs +664 -0
- package/zellij-plugin/src/event_bridge.rs +339 -0
- package/zellij-plugin/src/main.rs +420 -0
- package/zellij-plugin/src/notification.rs +466 -0
- package/zellij-plugin/src/queue.rs +399 -0
- package/zellij-plugin/src/renderer.rs +477 -0
- package/zellij-plugin/src/state.rs +338 -0
- package/zellij-plugin/src/tests.rs +413 -0
- package/.claude/checkpoints/1756392335.json +0 -1
- package/.claude/checkpoints/1756392341.json +0 -1
- package/.claude/checkpoints/1756392347.json +0 -1
- package/.claude/checkpoints/1756392376.json +0 -1
- package/.claude/checkpoints/1756392377.json +0 -1
- package/.claude/checkpoints/1756392386.json +0 -1
- package/.claude/checkpoints/1756392387.json +0 -1
- package/.claude/checkpoints/1756392398.json +0 -1
- package/.claude/checkpoints/1756392400.json +0 -1
- package/.claude/checkpoints/1756392427.json +0 -1
- package/.claude/checkpoints/1756392428.json +0 -1
- package/.claude/checkpoints/1756392486.json +0 -1
- package/.claude/checkpoints/1756392488.json +0 -1
- package/.claude/checkpoints/1756392558.json +0 -1
- package/.claude/checkpoints/1756392559.json +0 -1
- package/.claude/checkpoints/summary-session-20250828-105040.md +0 -57
- package/.claude/checkpoints/task-1756392207.json +0 -1
- package/.claude/checkpoints/task-1756392742.json +0 -1
- package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +0 -54
- package/.claude/commands/analysis/README.md +0 -9
- package/.claude/commands/analysis/bottleneck-detect.md +0 -162
- package/.claude/commands/analysis/performance-bottlenecks.md +0 -59
- package/.claude/commands/analysis/performance-report.md +0 -25
- package/.claude/commands/analysis/token-efficiency.md +0 -45
- package/.claude/commands/analysis/token-usage.md +0 -25
- package/.claude/commands/automation/README.md +0 -9
- package/.claude/commands/automation/auto-agent.md +0 -122
- package/.claude/commands/automation/self-healing.md +0 -106
- package/.claude/commands/automation/session-memory.md +0 -90
- package/.claude/commands/automation/smart-agents.md +0 -73
- package/.claude/commands/automation/smart-spawn.md +0 -25
- package/.claude/commands/automation/workflow-select.md +0 -25
- package/.claude/commands/coordination/README.md +0 -9
- package/.claude/commands/coordination/agent-spawn.md +0 -25
- package/.claude/commands/coordination/init.md +0 -44
- package/.claude/commands/coordination/orchestrate.md +0 -43
- package/.claude/commands/coordination/spawn.md +0 -45
- package/.claude/commands/coordination/swarm-init.md +0 -85
- package/.claude/commands/coordination/task-orchestrate.md +0 -25
- package/.claude/commands/github/README.md +0 -11
- package/.claude/commands/github/code-review-swarm.md +0 -514
- package/.claude/commands/github/code-review.md +0 -25
- package/.claude/commands/github/github-modes.md +0 -147
- package/.claude/commands/github/github-swarm.md +0 -121
- package/.claude/commands/github/issue-tracker.md +0 -292
- package/.claude/commands/github/issue-triage.md +0 -25
- package/.claude/commands/github/multi-repo-swarm.md +0 -519
- package/.claude/commands/github/pr-enhance.md +0 -26
- package/.claude/commands/github/pr-manager.md +0 -170
- package/.claude/commands/github/project-board-sync.md +0 -471
- package/.claude/commands/github/release-manager.md +0 -338
- package/.claude/commands/github/release-swarm.md +0 -544
- package/.claude/commands/github/repo-analyze.md +0 -25
- package/.claude/commands/github/repo-architect.md +0 -367
- package/.claude/commands/github/swarm-issue.md +0 -482
- package/.claude/commands/github/swarm-pr.md +0 -285
- package/.claude/commands/github/sync-coordinator.md +0 -301
- package/.claude/commands/github/workflow-automation.md +0 -442
- package/.claude/commands/hooks/README.md +0 -11
- package/.claude/commands/hooks/overview.md +0 -58
- package/.claude/commands/hooks/post-edit.md +0 -117
- package/.claude/commands/hooks/post-task.md +0 -112
- package/.claude/commands/hooks/pre-edit.md +0 -113
- package/.claude/commands/hooks/pre-task.md +0 -111
- package/.claude/commands/hooks/session-end.md +0 -118
- package/.claude/commands/hooks/setup.md +0 -103
- package/.claude/commands/memory/README.md +0 -9
- package/.claude/commands/memory/memory-persist.md +0 -25
- package/.claude/commands/memory/memory-search.md +0 -25
- package/.claude/commands/memory/memory-usage.md +0 -25
- package/.claude/commands/memory/neural.md +0 -47
- package/.claude/commands/memory/usage.md +0 -46
- package/.claude/commands/monitoring/README.md +0 -9
- package/.claude/commands/monitoring/agent-metrics.md +0 -25
- package/.claude/commands/monitoring/agents.md +0 -44
- package/.claude/commands/monitoring/real-time-view.md +0 -25
- package/.claude/commands/monitoring/status.md +0 -46
- package/.claude/commands/monitoring/swarm-monitor.md +0 -25
- package/.claude/commands/optimization/README.md +0 -9
- package/.claude/commands/optimization/auto-topology.md +0 -62
- package/.claude/commands/optimization/cache-manage.md +0 -25
- package/.claude/commands/optimization/parallel-execute.md +0 -25
- package/.claude/commands/optimization/parallel-execution.md +0 -50
- package/.claude/commands/optimization/topology-optimize.md +0 -25
- package/.claude/commands/pair/README.md +0 -261
- package/.claude/commands/pair/commands.md +0 -546
- package/.claude/commands/pair/config.md +0 -510
- package/.claude/commands/pair/examples.md +0 -512
- package/.claude/commands/pair/modes.md +0 -348
- package/.claude/commands/pair/session.md +0 -407
- package/.claude/commands/pair/start.md +0 -209
- package/.claude/commands/sparc/analyzer.md +0 -52
- package/.claude/commands/sparc/architect.md +0 -53
- package/.claude/commands/sparc/batch-executor.md +0 -54
- package/.claude/commands/sparc/coder.md +0 -54
- package/.claude/commands/sparc/debugger.md +0 -54
- package/.claude/commands/sparc/designer.md +0 -53
- package/.claude/commands/sparc/documenter.md +0 -54
- package/.claude/commands/sparc/innovator.md +0 -54
- package/.claude/commands/sparc/memory-manager.md +0 -54
- package/.claude/commands/sparc/optimizer.md +0 -54
- package/.claude/commands/sparc/orchestrator.md +0 -132
- package/.claude/commands/sparc/researcher.md +0 -54
- package/.claude/commands/sparc/reviewer.md +0 -54
- package/.claude/commands/sparc/sparc-modes.md +0 -174
- package/.claude/commands/sparc/swarm-coordinator.md +0 -54
- package/.claude/commands/sparc/tdd.md +0 -54
- package/.claude/commands/sparc/tester.md +0 -54
- package/.claude/commands/sparc/workflow-manager.md +0 -54
- package/.claude/commands/stream-chain/pipeline.md +0 -121
- package/.claude/commands/stream-chain/run.md +0 -70
- package/.claude/commands/swarm/analysis.md +0 -95
- package/.claude/commands/swarm/development.md +0 -96
- package/.claude/commands/swarm/examples.md +0 -168
- package/.claude/commands/swarm/maintenance.md +0 -102
- package/.claude/commands/swarm/optimization.md +0 -117
- package/.claude/commands/swarm/research.md +0 -136
- package/.claude/commands/swarm/testing.md +0 -131
- package/.claude/commands/training/README.md +0 -9
- package/.claude/commands/training/model-update.md +0 -25
- package/.claude/commands/training/neural-patterns.md +0 -74
- package/.claude/commands/training/neural-train.md +0 -25
- package/.claude/commands/training/pattern-learn.md +0 -25
- package/.claude/commands/training/specialization.md +0 -63
- package/.claude/commands/truth/start.md +0 -143
- package/.claude/commands/verify/check.md +0 -50
- package/.claude/commands/verify/start.md +0 -128
- package/.claude/commands/workflows/README.md +0 -9
- package/.claude/commands/workflows/development.md +0 -78
- package/.claude/commands/workflows/research.md +0 -63
- package/.claude/commands/workflows/workflow-create.md +0 -25
- package/.claude/commands/workflows/workflow-execute.md +0 -25
- package/.claude/commands/workflows/workflow-export.md +0 -25
- package/.claude/config.json +0 -36
- package/.claude/settings.json +0 -162
- package/.claude-flow/metrics/agent-metrics.json +0 -1
- package/.claude-flow/metrics/performance.json +0 -9
- package/.claude-flow/metrics/system-metrics.json +0 -230
- package/.claude-flow/metrics/task-metrics.json +0 -10
- package/FIXES.md +0 -75
- package/test-results.md +0 -163
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Configuration Reference
|
|
2
|
+
|
|
3
|
+
Complete reference for all configuration options in Zellij Visual Notifications.
|
|
4
|
+
|
|
5
|
+
## Configuration Location
|
|
6
|
+
|
|
7
|
+
The plugin is configured within your Zellij configuration file:
|
|
8
|
+
|
|
9
|
+
- `~/.config/zellij/config.kdl`
|
|
10
|
+
|
|
11
|
+
## Options Reference
|
|
12
|
+
|
|
13
|
+
### General Options
|
|
14
|
+
|
|
15
|
+
| Option | Type | Default | Description |
|
|
16
|
+
|--------|------|---------|-------------|
|
|
17
|
+
| `enabled` | boolean | `true` | Enable/disable the plugin |
|
|
18
|
+
| `debug` | boolean | `false` | Enable debug logging |
|
|
19
|
+
|
|
20
|
+
### Theme Options
|
|
21
|
+
|
|
22
|
+
| Option | Type | Default | Description |
|
|
23
|
+
|--------|------|---------|-------------|
|
|
24
|
+
| `theme` | string | `"default"` | Theme preset name |
|
|
25
|
+
| `success_color` | string | Theme-dependent | Color for success notifications (hex) |
|
|
26
|
+
| `error_color` | string | Theme-dependent | Color for error notifications (hex) |
|
|
27
|
+
| `warning_color` | string | Theme-dependent | Color for warning notifications (hex) |
|
|
28
|
+
| `info_color` | string | Theme-dependent | Color for info notifications (hex) |
|
|
29
|
+
|
|
30
|
+
#### Available Themes
|
|
31
|
+
|
|
32
|
+
- `default` - Default color scheme
|
|
33
|
+
- `dracula` - Dracula theme colors
|
|
34
|
+
- `nord` - Nord theme colors
|
|
35
|
+
- `catppuccin` or `catppuccin-mocha` - Catppuccin Mocha (dark)
|
|
36
|
+
- `catppuccin-latte` - Catppuccin Latte (light)
|
|
37
|
+
- `gruvbox` or `gruvbox-dark` - Gruvbox Dark
|
|
38
|
+
- `gruvbox-light` - Gruvbox Light
|
|
39
|
+
- `tokyo-night` - Tokyo Night colors
|
|
40
|
+
- `one-dark` - One Dark colors
|
|
41
|
+
- `solarized` or `solarized-dark` - Solarized Dark
|
|
42
|
+
- `solarized-light` - Solarized Light
|
|
43
|
+
|
|
44
|
+
### Animation Options
|
|
45
|
+
|
|
46
|
+
| Option | Type | Default | Description |
|
|
47
|
+
|--------|------|---------|-------------|
|
|
48
|
+
| `animation_enabled` | boolean | `true` | Enable/disable animations |
|
|
49
|
+
| `animation_style` | string | `"pulse"` | Animation style |
|
|
50
|
+
| `animation_speed` | integer | `50` | Animation speed (1-100) |
|
|
51
|
+
| `animation_cycles` | integer | `3` | Number of animation cycles |
|
|
52
|
+
|
|
53
|
+
#### Animation Styles
|
|
54
|
+
|
|
55
|
+
- `pulse` - Smooth fade in/out using sine wave
|
|
56
|
+
- `flash` - Quick on/off blink
|
|
57
|
+
- `fade` - Gradual fade out over animation duration
|
|
58
|
+
- `breathe` - Smooth breathing effect
|
|
59
|
+
- `none` - No animation (static color)
|
|
60
|
+
|
|
61
|
+
### Display Options
|
|
62
|
+
|
|
63
|
+
| Option | Type | Default | Description |
|
|
64
|
+
|--------|------|---------|-------------|
|
|
65
|
+
| `show_status_bar` | boolean | `true` | Show status bar widget |
|
|
66
|
+
| `show_border_colors` | boolean | `true` | Show border colors on panes |
|
|
67
|
+
| `show_tab_badges` | boolean | `true` | Show badges on pane tabs |
|
|
68
|
+
|
|
69
|
+
### Notification Options
|
|
70
|
+
|
|
71
|
+
| Option | Type | Default | Description |
|
|
72
|
+
|--------|------|---------|-------------|
|
|
73
|
+
| `notification_timeout_ms` | integer | `300000` | Notification TTL in milliseconds (5 min) |
|
|
74
|
+
| `queue_max_size` | integer | `100` | Maximum notifications in queue |
|
|
75
|
+
|
|
76
|
+
### Accessibility Options
|
|
77
|
+
|
|
78
|
+
| Option | Type | Default | Description |
|
|
79
|
+
|--------|------|---------|-------------|
|
|
80
|
+
| `high_contrast` | boolean | `false` | Enable high contrast mode |
|
|
81
|
+
| `reduced_motion` | boolean | `false` | Disable all animations |
|
|
82
|
+
|
|
83
|
+
## Examples
|
|
84
|
+
|
|
85
|
+
### Basic Configuration
|
|
86
|
+
|
|
87
|
+
```kdl
|
|
88
|
+
plugins {
|
|
89
|
+
visual-notifications location="file:~/.config/zellij/plugins/zellij-visual-notifications.wasm" {
|
|
90
|
+
enabled true
|
|
91
|
+
theme "dracula"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Custom Colors
|
|
97
|
+
|
|
98
|
+
```kdl
|
|
99
|
+
plugins {
|
|
100
|
+
visual-notifications location="file:~/.config/zellij/plugins/zellij-visual-notifications.wasm" {
|
|
101
|
+
enabled true
|
|
102
|
+
theme "default"
|
|
103
|
+
|
|
104
|
+
// Override specific colors
|
|
105
|
+
success_color "#50fa7b"
|
|
106
|
+
error_color "#ff5555"
|
|
107
|
+
warning_color "#f1fa8c"
|
|
108
|
+
info_color "#8be9fd"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Animation Configuration
|
|
114
|
+
|
|
115
|
+
```kdl
|
|
116
|
+
plugins {
|
|
117
|
+
visual-notifications location="file:~/.config/zellij/plugins/zellij-visual-notifications.wasm" {
|
|
118
|
+
enabled true
|
|
119
|
+
|
|
120
|
+
// Fast, attention-grabbing animation
|
|
121
|
+
animation_enabled true
|
|
122
|
+
animation_style "flash"
|
|
123
|
+
animation_speed 80
|
|
124
|
+
animation_cycles 5
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Minimal Distraction
|
|
130
|
+
|
|
131
|
+
```kdl
|
|
132
|
+
plugins {
|
|
133
|
+
visual-notifications location="file:~/.config/zellij/plugins/zellij-visual-notifications.wasm" {
|
|
134
|
+
enabled true
|
|
135
|
+
|
|
136
|
+
// Only border colors, no animation
|
|
137
|
+
animation_enabled false
|
|
138
|
+
show_status_bar false
|
|
139
|
+
show_tab_badges false
|
|
140
|
+
show_border_colors true
|
|
141
|
+
|
|
142
|
+
// Quick timeout
|
|
143
|
+
notification_timeout_ms 30000
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Accessibility Configuration
|
|
149
|
+
|
|
150
|
+
```kdl
|
|
151
|
+
plugins {
|
|
152
|
+
visual-notifications location="file:~/.config/zellij/plugins/zellij-visual-notifications.wasm" {
|
|
153
|
+
enabled true
|
|
154
|
+
|
|
155
|
+
// Accessibility features
|
|
156
|
+
high_contrast true
|
|
157
|
+
reduced_motion true
|
|
158
|
+
|
|
159
|
+
// Longer timeout
|
|
160
|
+
notification_timeout_ms 600000
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Environment Variables
|
|
166
|
+
|
|
167
|
+
The plugin respects these environment variables (when detectable):
|
|
168
|
+
|
|
169
|
+
| Variable | Effect |
|
|
170
|
+
|----------|--------|
|
|
171
|
+
| `COLORTERM` | Detects true color support |
|
|
172
|
+
| `TERM` | Detects terminal color capabilities |
|
|
173
|
+
|
|
174
|
+
## Hot Reload
|
|
175
|
+
|
|
176
|
+
Configuration changes require reloading the plugin:
|
|
177
|
+
|
|
178
|
+
1. Save your config file
|
|
179
|
+
2. Restart Zellij, or
|
|
180
|
+
3. Reload the plugin via keybinding
|
|
181
|
+
|
|
182
|
+
## Validation
|
|
183
|
+
|
|
184
|
+
The plugin validates configuration on load:
|
|
185
|
+
|
|
186
|
+
- Invalid color values fall back to theme defaults
|
|
187
|
+
- Invalid animation speeds are clamped to 1-100
|
|
188
|
+
- Invalid animation cycles are clamped to 1-10
|
|
189
|
+
- Unknown themes fall back to default
|
|
190
|
+
|
|
191
|
+
Validation errors are logged to Zellij's log file.
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# Integration Guide
|
|
2
|
+
|
|
3
|
+
How to integrate Zellij Visual Notifications with claude-notifications and other systems.
|
|
4
|
+
|
|
5
|
+
## Integration with claude-notifications
|
|
6
|
+
|
|
7
|
+
The primary use case for this plugin is integration with the claude-notifications npm package.
|
|
8
|
+
|
|
9
|
+
### Setup
|
|
10
|
+
|
|
11
|
+
1. Install claude-notifications globally:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g @delorenj/claude-notifications
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. Install the Zellij plugin (see README)
|
|
18
|
+
|
|
19
|
+
3. Configure claude-notifications to send messages to the plugin
|
|
20
|
+
|
|
21
|
+
### Modifying claude-notify.js
|
|
22
|
+
|
|
23
|
+
Add Zellij integration to the notification trigger (`bin/claude-notify.js`):
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
const { execSync } = require('child_process');
|
|
27
|
+
|
|
28
|
+
function notifyZellij(type, message) {
|
|
29
|
+
// Check if we're in a Zellij session
|
|
30
|
+
if (!process.env.ZELLIJ) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const payload = JSON.stringify({
|
|
35
|
+
type: type,
|
|
36
|
+
message: message,
|
|
37
|
+
source: 'claude-notifications',
|
|
38
|
+
timestamp: Date.now()
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
// Send via Zellij pipe
|
|
43
|
+
execSync(`echo '${payload}' | zellij pipe -p visual-notifications`, {
|
|
44
|
+
stdio: 'ignore'
|
|
45
|
+
});
|
|
46
|
+
} catch (e) {
|
|
47
|
+
// Zellij notification failed, continue silently
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// In the main notification function:
|
|
52
|
+
function main() {
|
|
53
|
+
// ... existing notification logic ...
|
|
54
|
+
|
|
55
|
+
// Add Zellij visual notification
|
|
56
|
+
notifyZellij('attention', 'Claude is waiting for you...');
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Message Protocol
|
|
61
|
+
|
|
62
|
+
### Request Format
|
|
63
|
+
|
|
64
|
+
Send JSON messages to the plugin via Zellij pipe:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
echo '{"type":"success","message":"Build completed"}' | zellij pipe -p visual-notifications
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Full Message Schema
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
interface NotificationMessage {
|
|
74
|
+
// Required
|
|
75
|
+
message: string;
|
|
76
|
+
|
|
77
|
+
// Optional
|
|
78
|
+
version?: string; // Protocol version (default: "1.0")
|
|
79
|
+
type?: string; // success|error|warning|info|attention|progress
|
|
80
|
+
title?: string; // Notification title
|
|
81
|
+
source?: string; // Source identifier
|
|
82
|
+
pane_id?: number; // Target pane ID
|
|
83
|
+
tab_index?: number; // Target tab index
|
|
84
|
+
priority?: string; // low|normal|high|critical
|
|
85
|
+
timestamp?: number; // Unix timestamp (ms)
|
|
86
|
+
ttl_ms?: number; // Time-to-live (ms)
|
|
87
|
+
command?: string; // Command that triggered notification
|
|
88
|
+
exit_code?: number; // Command exit code
|
|
89
|
+
duration_ms?: number; // Command duration (ms)
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Response
|
|
94
|
+
|
|
95
|
+
The plugin does not send responses. It processes messages asynchronously.
|
|
96
|
+
|
|
97
|
+
## Command Line Integration
|
|
98
|
+
|
|
99
|
+
### Manual Notifications
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Success
|
|
103
|
+
zellij-notify success "Build completed successfully"
|
|
104
|
+
|
|
105
|
+
# Error
|
|
106
|
+
zellij-notify error "Tests failed: 3 failures"
|
|
107
|
+
|
|
108
|
+
# Warning
|
|
109
|
+
zellij-notify warning "Memory usage high"
|
|
110
|
+
|
|
111
|
+
# Attention (Claude waiting)
|
|
112
|
+
zellij-notify attention "Claude is waiting for input"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Shell Function
|
|
116
|
+
|
|
117
|
+
Add to your `.bashrc` or `.zshrc`:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
zellij-notify() {
|
|
121
|
+
local type="$1"
|
|
122
|
+
local message="$2"
|
|
123
|
+
|
|
124
|
+
if [ -z "$ZELLIJ" ]; then
|
|
125
|
+
echo "Not in Zellij session"
|
|
126
|
+
return 1
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
echo "{\"type\":\"$type\",\"message\":\"$message\"}" | zellij pipe -p visual-notifications
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Git Hooks
|
|
134
|
+
|
|
135
|
+
Add visual notifications to Git operations:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# .git/hooks/post-commit
|
|
139
|
+
#!/bin/bash
|
|
140
|
+
if [ -n "$ZELLIJ" ]; then
|
|
141
|
+
echo '{"type":"success","message":"Commit created"}' | zellij pipe -p visual-notifications
|
|
142
|
+
fi
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# .git/hooks/post-merge
|
|
147
|
+
#!/bin/bash
|
|
148
|
+
if [ -n "$ZELLIJ" ]; then
|
|
149
|
+
echo '{"type":"info","message":"Merge completed"}' | zellij pipe -p visual-notifications
|
|
150
|
+
fi
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Build System Integration
|
|
154
|
+
|
|
155
|
+
#### npm scripts
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"scripts": {
|
|
160
|
+
"build": "tsc && npm run notify:success",
|
|
161
|
+
"notify:success": "[ -n \"$ZELLIJ\" ] && echo '{\"type\":\"success\",\"message\":\"Build completed\"}' | zellij pipe -p visual-notifications || true",
|
|
162
|
+
"notify:error": "[ -n \"$ZELLIJ\" ] && echo '{\"type\":\"error\",\"message\":\"Build failed\"}' | zellij pipe -p visual-notifications || true"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### Makefile
|
|
168
|
+
|
|
169
|
+
```makefile
|
|
170
|
+
.PHONY: build notify-success notify-error
|
|
171
|
+
|
|
172
|
+
build:
|
|
173
|
+
cargo build --release
|
|
174
|
+
@$(MAKE) notify-success
|
|
175
|
+
|
|
176
|
+
notify-success:
|
|
177
|
+
@if [ -n "$$ZELLIJ" ]; then \
|
|
178
|
+
echo '{"type":"success","message":"Build completed"}' | zellij pipe -p visual-notifications; \
|
|
179
|
+
fi
|
|
180
|
+
|
|
181
|
+
notify-error:
|
|
182
|
+
@if [ -n "$$ZELLIJ" ]; then \
|
|
183
|
+
echo '{"type":"error","message":"Build failed"}' | zellij pipe -p visual-notifications; \
|
|
184
|
+
fi
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Programmatic Integration
|
|
188
|
+
|
|
189
|
+
### Node.js
|
|
190
|
+
|
|
191
|
+
```javascript
|
|
192
|
+
const { execSync } = require('child_process');
|
|
193
|
+
|
|
194
|
+
class ZellijNotifier {
|
|
195
|
+
static isAvailable() {
|
|
196
|
+
return !!process.env.ZELLIJ;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
static notify(type, message, options = {}) {
|
|
200
|
+
if (!this.isAvailable()) return;
|
|
201
|
+
|
|
202
|
+
const payload = {
|
|
203
|
+
type,
|
|
204
|
+
message,
|
|
205
|
+
timestamp: Date.now(),
|
|
206
|
+
...options
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
try {
|
|
210
|
+
execSync(`echo '${JSON.stringify(payload)}' | zellij pipe -p visual-notifications`, {
|
|
211
|
+
stdio: 'ignore'
|
|
212
|
+
});
|
|
213
|
+
} catch (e) {
|
|
214
|
+
// Silently fail
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
static success(message) { this.notify('success', message); }
|
|
219
|
+
static error(message) { this.notify('error', message); }
|
|
220
|
+
static warning(message) { this.notify('warning', message); }
|
|
221
|
+
static info(message) { this.notify('info', message); }
|
|
222
|
+
static attention(message) { this.notify('attention', message); }
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
module.exports = ZellijNotifier;
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Python
|
|
229
|
+
|
|
230
|
+
```python
|
|
231
|
+
import os
|
|
232
|
+
import json
|
|
233
|
+
import subprocess
|
|
234
|
+
|
|
235
|
+
class ZellijNotifier:
|
|
236
|
+
@staticmethod
|
|
237
|
+
def is_available():
|
|
238
|
+
return 'ZELLIJ' in os.environ
|
|
239
|
+
|
|
240
|
+
@staticmethod
|
|
241
|
+
def notify(type: str, message: str, **kwargs):
|
|
242
|
+
if not ZellijNotifier.is_available():
|
|
243
|
+
return
|
|
244
|
+
|
|
245
|
+
payload = {
|
|
246
|
+
'type': type,
|
|
247
|
+
'message': message,
|
|
248
|
+
**kwargs
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
try:
|
|
252
|
+
subprocess.run(
|
|
253
|
+
f"echo '{json.dumps(payload)}' | zellij pipe -p visual-notifications",
|
|
254
|
+
shell=True,
|
|
255
|
+
capture_output=True
|
|
256
|
+
)
|
|
257
|
+
except Exception:
|
|
258
|
+
pass
|
|
259
|
+
|
|
260
|
+
@staticmethod
|
|
261
|
+
def success(message): ZellijNotifier.notify('success', message)
|
|
262
|
+
|
|
263
|
+
@staticmethod
|
|
264
|
+
def error(message): ZellijNotifier.notify('error', message)
|
|
265
|
+
|
|
266
|
+
@staticmethod
|
|
267
|
+
def warning(message): ZellijNotifier.notify('warning', message)
|
|
268
|
+
|
|
269
|
+
@staticmethod
|
|
270
|
+
def info(message): ZellijNotifier.notify('info', message)
|
|
271
|
+
|
|
272
|
+
@staticmethod
|
|
273
|
+
def attention(message): ZellijNotifier.notify('attention', message)
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Rust
|
|
277
|
+
|
|
278
|
+
```rust
|
|
279
|
+
use std::process::Command;
|
|
280
|
+
|
|
281
|
+
pub struct ZellijNotifier;
|
|
282
|
+
|
|
283
|
+
impl ZellijNotifier {
|
|
284
|
+
pub fn is_available() -> bool {
|
|
285
|
+
std::env::var("ZELLIJ").is_ok()
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
pub fn notify(notification_type: &str, message: &str) {
|
|
289
|
+
if !Self::is_available() {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
let payload = format!(
|
|
294
|
+
r#"{{"type":"{}","message":"{}"}}"#,
|
|
295
|
+
notification_type, message
|
|
296
|
+
);
|
|
297
|
+
|
|
298
|
+
let _ = Command::new("sh")
|
|
299
|
+
.arg("-c")
|
|
300
|
+
.arg(format!(
|
|
301
|
+
"echo '{}' | zellij pipe -p visual-notifications",
|
|
302
|
+
payload
|
|
303
|
+
))
|
|
304
|
+
.output();
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
pub fn success(message: &str) { Self::notify("success", message); }
|
|
308
|
+
pub fn error(message: &str) { Self::notify("error", message); }
|
|
309
|
+
pub fn warning(message: &str) { Self::notify("warning", message); }
|
|
310
|
+
pub fn info(message: &str) { Self::notify("info", message); }
|
|
311
|
+
pub fn attention(message: &str) { Self::notify("attention", message); }
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Troubleshooting Integration
|
|
316
|
+
|
|
317
|
+
### Plugin not receiving messages
|
|
318
|
+
|
|
319
|
+
1. Verify you're in a Zellij session: `echo $ZELLIJ`
|
|
320
|
+
2. Check plugin is loaded: Look for the status bar widget
|
|
321
|
+
3. Test with direct pipe: `echo '{"type":"info","message":"test"}' | zellij pipe -p visual-notifications`
|
|
322
|
+
|
|
323
|
+
### Messages not displaying
|
|
324
|
+
|
|
325
|
+
1. Check pane ID is valid (if specified)
|
|
326
|
+
2. Verify JSON is valid: `echo '{"type":"info","message":"test"}' | jq .`
|
|
327
|
+
3. Check notification timeout hasn't expired
|
|
328
|
+
|
|
329
|
+
### Performance issues
|
|
330
|
+
|
|
331
|
+
1. Reduce `queue_max_size` if memory is a concern
|
|
332
|
+
2. Disable animations with `animation_enabled false`
|
|
333
|
+
3. Use shorter TTL values
|