name: native-notification-builder description: 构建跨平台的原生操作系统通知,支持操作按钮、图像和进度指示器 allowed-tools: Read, Write, Edit, Bash, Glob, Grep tags: [通知, 跨平台, 原生, 桌面, 用户界面]
原生通知构建器
在 Windows、macOS 和 Linux 平台上构建带有操作按钮、图像和进度指示器的原生操作系统通知。
功能
- 创建基本通知
- 添加操作按钮
- 包含图像和应用图标
- 显示进度指示器
- 配置通知声音
- 处理通知点击事件
- 设置通知优先级
- 配置通知分组
输入模式
{
"type": "object",
"properties": {
"projectPath": { "type": "string" },
"framework": { "enum": ["electron", "native", "tauri"] },
"features": { "type": "array", "items": { "enum": ["actions", "images", "progress", "sounds"] } }
},
"required": ["projectPath"]
}
Electron 示例
const { Notification } = require('electron');
const notification = new Notification({
title: '下载完成',
body: '您的文件已下载完毕。',
icon: '/path/to/icon.png',
actions: [
{ type: 'button', text: '打开' },
{ type: 'button', text: '在文件夹中显示' }
]
});
notification.on('action', (event, index) => {
if (index === 0) openFile();
else showInFolder();
});
notification.show();
相关技能
electron-tray-menu-buildersystem-services-integration进程