@mcpcn/mcp-notification 1.1.13 → 1.1.16

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.
Files changed (2) hide show
  1. package/dist/index.js +53 -19
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -95,46 +95,80 @@ class ReminderServer {
95
95
  tools: [
96
96
  {
97
97
  name: 'set_reminder',
98
- description: '设置通知提醒,接收事件类型(提醒消息,执行任务)。支持一次性、按间隔循环、每日循环。规则:当用户表述为具体某天/今天/明天/后天/某日期某时间等,请选择repeat=none;优选将具体日期时间直接计算为RFC3339并填入triggerAt,或仅提供timeOfDay让服务端自动推算到最近一次的该时间(若当天已过则推算到明天)。只有当用户明确说"每天/每日/每晚/每早/每隔X时间"时,才使用repeat=daily或repeat=interval。一次性提醒可提供triggerAt或delaySec,或提供timeOfDay用于推算,优先使用delaySec。',
98
+ description: '设置通知提醒或创建自动任务。核心逻辑:1. 优先判断eventType。2. 时间处理:优先将用户口语时间转换为绝对时间(triggerAt)或相对秒数(delaySec)。只有当用户明确指定"每天/每隔X"时才使用循环设置。',
99
99
  inputSchema: {
100
100
  type: 'object',
101
101
  properties: {
102
- eventType: { type: 'string', enum: ['reminder', 'task'], description: '事件类型:reminder 提醒消息(用于通知用户)、task 执行任务(用于触发定时操作)。' },
103
- content: { type: 'string', minLength: 1, description: '提醒内容,例如 “开会”。' },
104
- repeat: { type: 'string', enum: ['none', 'interval', 'daily'], default: 'none', description: '提醒类型:none 一次性(包含“今天/明天/某天”的语义)、interval 按间隔、daily 每日(仅当用户明确要求“每天”时使用)。' },
105
- delaySec: { type: 'number', minimum: 1, description: '一次性提醒相对延迟秒数,例如 300 表示5分钟后触发。与triggerAt二选一。' },
106
- triggerAt: { type: 'string', description: '一次性提醒绝对时间,RFC3339 格式,例如 2025-11-21T08:00:00+08:00。' },
107
- intervalSec: { type: 'number', minimum: 1, description: '按间隔循环的间隔秒数,例如 3600 表示每小时提醒一次。仅repeat=interval时必需。' },
108
- timeOfDay: { type: 'string', pattern: '^\\d{1,2}:\\d{2}(:\\d{2})?$', description: '一天中的时间,格式 HH:mm 或 HH:mm:ss,例如 08:00 或 08:00:00。repeat=daily时必需;repeat=none且未提供triggerAt/delaySec时用于推算。典型用法:用户说“明天早上8点”,请选择repeat=none并设置timeOfDay="08:00",服务端会自动推算到最近的08:00。' },
109
- tzOffsetMin: { type: 'number', description: '时区偏移分钟,例如北京为 480;不提供时默认使用本机时区。' },
102
+ eventType: {
103
+ type: 'string',
104
+ enum: ['reminder', 'task'],
105
+ description: '决定由谁执行。task: 仅限系统能自动完成的数字化动作(发送邮件/消息、API打卡)。若用户要求物理动作(如"买咖啡"、"取快递")或不支持的操作,必须降级选 reminder。reminder: 提醒用户自己去做的任何事项。'
106
+ },
107
+ content: {
108
+ type: 'string',
109
+ minLength: 1,
110
+ description: '事项核心内容。关键清洗规则:请剔除用于"设定提醒时间"的词语(如"明天早上8点提醒我"->剔除"明天早上8点"),但务必保留属于事项内容的时间描述(如"提交10月份报告"、"准备周五的会议"中的时间词需保留)。'
111
+ },
112
+ repeat: {
113
+ type: 'string',
114
+ enum: ['none', 'interval', 'daily'],
115
+ default: 'none',
116
+ description: 'none: 单次(含今天/明天/特定日期)。daily: 仅当明确说"每天/每日"时。interval: 仅当明确说"每隔X分钟/小时"时。注意:若用户说"每周五"或"工作日",当前不支持复杂循环,请计算下一次发生的具体日期设为 none。'
117
+ },
118
+ delaySec: {
119
+ type: 'number',
120
+ minimum: 1,
121
+ description: '(优先级最高)相对现在的延迟秒数。如"5分钟后"->300。'
122
+ },
123
+ triggerAt: {
124
+ type: 'string',
125
+ description: '(优先级次高)RFC3339 格式绝对时间 (YYYY-MM-DDTHH:mm:ss+HH:mm)。优先计算具体日期时间填入此项。'
126
+ },
127
+ intervalSec: {
128
+ type: 'number',
129
+ minimum: 1,
130
+ description: '循环间隔秒数。仅 repeat=interval 时有效。'
131
+ },
132
+ timeOfDay: {
133
+ type: 'string',
134
+ pattern: '^([0-1]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$',
135
+ description: 'HH:mm 格式。场景:1) repeat=daily 时指定每天几点;2) repeat=none 且无法确定具体日期时,辅助服务端推算。'
136
+ },
137
+ tzOffsetMin: {
138
+ type: 'number',
139
+ description: '用户所在时区偏移(如北京为480)。'
140
+ }
110
141
  },
111
142
  required: ['eventType', 'content', 'repeat'],
112
143
  additionalProperties: false,
113
144
  oneOf: [
114
145
  {
146
+ description: '单次提醒:必须提供 triggerAt 或 delaySec 或 timeOfDay 其中之一',
115
147
  properties: { repeat: { const: 'none' } },
116
148
  anyOf: [
117
149
  { required: ['triggerAt'] },
118
150
  { required: ['delaySec'] },
119
- { required: ['timeOfDay'] },
120
- ],
151
+ { required: ['timeOfDay'] }
152
+ ]
121
153
  },
122
154
  {
155
+ description: '间隔循环:必须提供 intervalSec',
123
156
  properties: { repeat: { const: 'interval' } },
124
- required: ['intervalSec'],
157
+ required: ['intervalSec']
125
158
  },
126
159
  {
160
+ description: '每日循环:必须提供 timeOfDay',
127
161
  properties: { repeat: { const: 'daily' } },
128
- required: ['timeOfDay'],
129
- },
162
+ required: ['timeOfDay']
163
+ }
130
164
  ],
131
165
  examples: [
132
- { eventType: 'reminder', content: '开会', repeat: 'none', triggerAt: '2025-11-21T08:00:00+08:00' },
133
- { eventType: 'reminder', content: '喝水', repeat: 'none', delaySec: 300 },
134
- { eventType: 'task', content: '下午3点发邮件到 examples@gmail.com,内容是:王总,项目有新的进展吗', repeat: 'none', timeOfDay: '15:00', tzOffsetMin: 480 },
166
+ { eventType: 'reminder', content: '准备下周五的PPT', repeat: 'none', triggerAt: '2025-11-21T08:00:00+08:00' },
167
+ { eventType: 'reminder', content: '去楼下拿快递', repeat: 'none', delaySec: 600 },
168
+ { eventType: 'task', content: '发送邮件到 examples@gmail.com,内容是:王总,项目有新的进展吗', repeat: 'none', timeOfDay: '15:00', tzOffsetMin: 480 },
135
169
  { eventType: 'reminder', content: '站立休息', repeat: 'interval', intervalSec: 1800 },
136
- { eventType: 'task', content: '打卡', repeat: 'daily', timeOfDay: '09:00', tzOffsetMin: 480 },
137
- ],
170
+ { eventType: 'task', content: '打卡', repeat: 'daily', timeOfDay: '09:00', tzOffsetMin: 480 }
171
+ ]
138
172
  },
139
173
  },
140
174
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpcn/mcp-notification",
3
- "version": "1.1.13",
3
+ "version": "1.1.16",
4
4
  "description": "系统通知MCP服务器",
5
5
  "packageManager": "yarn@1.22.22",
6
6
  "main": "dist/index.js",