b91ef04ab0
- Server: chat ntfy messages carry a sequence id derived from their app id; clearing a chat app notification also clears it in ntfy (PUT /<topic>/<seq>/clear, verified on ntfy v2.38.1). - Server: a turn that sent an agent notify does not also send chat_reply. - notify tool and MCP instructions: Pipelines already notifies at reply end and for questions/approvals; notify is for mid-turn or background news. - Shown notify items carry channels (apps/phone); the transcript row says where it went. - App: NotificationBridge.close(tag); web closes tracked Notifications and tells other tabs over a BroadcastChannel; native bridge cancels by tag and now supports macOS. AgentNotices closes on notifications_cleared and on resubscribe cleared ids, and a tap sends clear_notifications. - Docs: skill, chat reference, ntfy/notifications docs, app note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
943 B
Dart
31 lines
943 B
Dart
import 'notification_bridge.dart';
|
|
import 'notification_models.dart';
|
|
|
|
/// The non-web bridge: there is no browser Notification API to reach.
|
|
///
|
|
/// It reports `unsupported` honestly rather than pretending a notification was
|
|
/// shown, so the surface falls back to the in-app `Needs you` channel. A native
|
|
/// platform notifier would replace this through the same seam.
|
|
class UnsupportedNotificationBridge implements NotificationBridge {
|
|
const UnsupportedNotificationBridge();
|
|
|
|
@override
|
|
NotificationEnvironment environment() => const NotificationEnvironment(
|
|
supported: false,
|
|
secureContext: false,
|
|
permission: 'default',
|
|
);
|
|
|
|
@override
|
|
Future<String> requestPermission() async => 'default';
|
|
|
|
@override
|
|
bool show(NotificationMessage message, {void Function()? onTap}) => false;
|
|
|
|
@override
|
|
void close(String tag) {}
|
|
}
|
|
|
|
NotificationBridge createNotificationBridge() =>
|
|
const UnsupportedNotificationBridge();
|