carmoji 0.3.13 → 0.3.15
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/carmoji.js +13 -2
- package/package.json +1 -1
package/carmoji.js
CHANGED
|
@@ -532,8 +532,19 @@ function eventFromHook(payload) {
|
|
|
532
532
|
case 'PostToolUse': return { event: 'tool_end', tool };
|
|
533
533
|
case 'PostToolUseFailure':
|
|
534
534
|
case 'Error': return { event: 'error' };
|
|
535
|
-
case 'PermissionRequest':
|
|
536
|
-
case 'Notification':
|
|
535
|
+
case 'PermissionRequest': return { event: 'permission', tool };
|
|
536
|
+
case 'Notification': {
|
|
537
|
+
// Claude Code routes several nudges through this one hook. Only a
|
|
538
|
+
// real permission prompt deserves the phone's pleading face; the
|
|
539
|
+
// "waiting for your input" idle reminder lands a minute after a
|
|
540
|
+
// *finished* reply, and mapping it to permission flipped "done"
|
|
541
|
+
// into "blocked". Anything not clearly a permission stays a bare
|
|
542
|
+
// heartbeat.
|
|
543
|
+
const note = firstString(payload.message, payload.detail) ?? '';
|
|
544
|
+
return /permission|approv/i.test(note)
|
|
545
|
+
? { event: 'permission', tool }
|
|
546
|
+
: { event: 'tool_end' };
|
|
547
|
+
}
|
|
537
548
|
case 'Stop': return { event: 'turn_done' };
|
|
538
549
|
case 'SessionEnd': return { event: 'session_end' };
|
|
539
550
|
// Liveness only: keep the session fresh without a face reaction.
|
package/package.json
CHANGED