feat: unified hook notifier, agent auto-detection, terminal transition UI

- Add hooks/notify.ps1 as single hook handler for all events
- Refactor settings.local.json to use notify.ps1 instead of inline PS
- Add Notification hook, auto-detect agent from session_id/transcript
- Rename agent 'main' to 'claude' across server routes and terminal
- Add loading overlay and error state for terminal switching transitions
- Add transitionError ref to useTranscriptDebug composable
This commit is contained in:
2026-02-21 04:33:42 -06:00
parent b9eec1013b
commit a56796a1be
8 changed files with 172 additions and 45 deletions

View File

@@ -96,12 +96,23 @@
"agent-ui"
],
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -File hooks/notify.ps1",
"timeout": 5000
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -Command \"try{$b=[Console]::In.ReadToEnd();Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-hook?agent=claude' -Method POST -Body $b -ContentType 'application/json' -TimeoutSec 3|Out-Null}catch{}\"",
"command": "powershell -NoProfile -File hooks/notify.ps1",
"timeout": 5000
}
]
@@ -113,7 +124,7 @@
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -Command \"try{$b=[Console]::In.ReadToEnd();Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-hook?agent=claude' -Method POST -Body $b -ContentType 'application/json' -TimeoutSec 3|Out-Null}catch{}\"",
"command": "powershell -NoProfile -File hooks/notify.ps1",
"timeout": 5000
}
]
@@ -125,7 +136,7 @@
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -Command \"try{$b=[Console]::In.ReadToEnd();Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-hook?agent=claude' -Method POST -Body $b -ContentType 'application/json' -TimeoutSec 3|Out-Null}catch{}\"",
"command": "powershell -NoProfile -File hooks/notify.ps1",
"timeout": 5000
}
]
@@ -137,7 +148,19 @@
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -Command \"try{$b=[Console]::In.ReadToEnd();Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-hook?agent=claude' -Method POST -Body $b -ContentType 'application/json' -TimeoutSec 3|Out-Null}catch{}\"",
"command": "powershell -NoProfile -File hooks/notify.ps1",
"timeout": 5000
}
]
}
],
"Notification": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -File hooks/notify.ps1",
"timeout": 5000
}
]
@@ -148,18 +171,7 @@
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -Command \"try{$b=[Console]::In.ReadToEnd();Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-hook?agent=claude' -Method POST -Body $b -ContentType 'application/json' -TimeoutSec 3|Out-Null}catch{}\"",
"timeout": 5000
}
]
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -Command \"try{$b=[Console]::In.ReadToEnd();Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-hook?agent=claude' -Method POST -Body $b -ContentType 'application/json' -TimeoutSec 3|Out-Null}catch{}\"",
"command": "powershell -NoProfile -File hooks/notify.ps1",
"timeout": 5000
}
]
@@ -171,7 +183,7 @@
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -Command \"try{$b=[Console]::In.ReadToEnd();Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-hook?agent=claude' -Method POST -Body $b -ContentType 'application/json' -TimeoutSec 3|Out-Null}catch{}\"",
"command": "powershell -NoProfile -File hooks/notify.ps1",
"timeout": 5000
}
]
@@ -187,24 +199,12 @@
]
}
],
"Notification": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -Command \"try{$b=[Console]::In.ReadToEnd();Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-hook?agent=claude' -Method POST -Body $b -ContentType 'application/json' -TimeoutSec 3|Out-Null}catch{}\"",
"timeout": 5000
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -Command \"try{$b=[Console]::In.ReadToEnd();Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-hook?agent=claude' -Method POST -Body $b -ContentType 'application/json' -TimeoutSec 3|Out-Null}catch{}\"",
"command": "powershell -NoProfile -File hooks/notify.ps1",
"timeout": 10000
}
]