@laylzj777/my-apple-apple-eventkit 1.1.0
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/CHANGELOG.md +575 -0
- package/LICENSE +21 -0
- package/README.md +304 -0
- package/README.zh-CN.md +270 -0
- package/bin/event +0 -0
- package/bin/event-disclaim +0 -0
- package/dist/bin/apple-calendar.d.ts +6 -0
- package/dist/bin/apple-calendar.js +8 -0
- package/dist/bin/apple-calendar.js.map +1 -0
- package/dist/bin/apple-reminders.d.ts +7 -0
- package/dist/bin/apple-reminders.js +9 -0
- package/dist/bin/apple-reminders.js.map +1 -0
- package/dist/bootstrap.d.ts +11 -0
- package/dist/bootstrap.js +44 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/server/handlers.d.ts +12 -0
- package/dist/server/handlers.js +58 -0
- package/dist/server/handlers.js.map +1 -0
- package/dist/server/mode.d.ts +19 -0
- package/dist/server/mode.js +47 -0
- package/dist/server/mode.js.map +1 -0
- package/dist/server/promptAbstractions.d.ts +61 -0
- package/dist/server/promptAbstractions.js +140 -0
- package/dist/server/promptAbstractions.js.map +1 -0
- package/dist/server/prompts.d.ts +13 -0
- package/dist/server/prompts.js +461 -0
- package/dist/server/prompts.js.map +1 -0
- package/dist/server/server.d.ts +61 -0
- package/dist/server/server.js +112 -0
- package/dist/server/server.js.map +1 -0
- package/dist/tools/definitions.d.ts +9 -0
- package/dist/tools/definitions.js +272 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/handlers/calendarHandlers.d.ts +11 -0
- package/dist/tools/handlers/calendarHandlers.js +151 -0
- package/dist/tools/handlers/calendarHandlers.js.map +1 -0
- package/dist/tools/handlers/formatters.d.ts +24 -0
- package/dist/tools/handlers/formatters.js +105 -0
- package/dist/tools/handlers/formatters.js.map +1 -0
- package/dist/tools/handlers/index.d.ts +8 -0
- package/dist/tools/handlers/index.js +9 -0
- package/dist/tools/handlers/index.js.map +1 -0
- package/dist/tools/handlers/listHandlers.d.ts +10 -0
- package/dist/tools/handlers/listHandlers.js +47 -0
- package/dist/tools/handlers/listHandlers.js.map +1 -0
- package/dist/tools/handlers/reminderHandlers.d.ts +10 -0
- package/dist/tools/handlers/reminderHandlers.js +219 -0
- package/dist/tools/handlers/reminderHandlers.js.map +1 -0
- package/dist/tools/handlers/shared.d.ts +28 -0
- package/dist/tools/handlers/shared.js +57 -0
- package/dist/tools/handlers/shared.js.map +1 -0
- package/dist/tools/handlers/subtaskHandlers.d.ts +12 -0
- package/dist/tools/handlers/subtaskHandlers.js +113 -0
- package/dist/tools/handlers/subtaskHandlers.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.js +74 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types/index.d.ts +263 -0
- package/dist/types/index.js +42 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/prompts.d.ts +88 -0
- package/dist/types/prompts.js +6 -0
- package/dist/types/prompts.js.map +1 -0
- package/dist/types/repository.d.ts +197 -0
- package/dist/types/repository.js +14 -0
- package/dist/types/repository.js.map +1 -0
- package/dist/utils/binaryValidator.d.ts +52 -0
- package/dist/utils/binaryValidator.js +185 -0
- package/dist/utils/binaryValidator.js.map +1 -0
- package/dist/utils/calendarRepository.d.ts +49 -0
- package/dist/utils/calendarRepository.js +226 -0
- package/dist/utils/calendarRepository.js.map +1 -0
- package/dist/utils/constants.d.ts +79 -0
- package/dist/utils/constants.js +80 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/dateFiltering.d.ts +41 -0
- package/dist/utils/dateFiltering.js +129 -0
- package/dist/utils/dateFiltering.js.map +1 -0
- package/dist/utils/dateUtils.d.ts +27 -0
- package/dist/utils/dateUtils.js +71 -0
- package/dist/utils/dateUtils.js.map +1 -0
- package/dist/utils/errorHandling.d.ts +27 -0
- package/dist/utils/errorHandling.js +88 -0
- package/dist/utils/errorHandling.js.map +1 -0
- package/dist/utils/eventCli.d.ts +40 -0
- package/dist/utils/eventCli.js +294 -0
- package/dist/utils/eventCli.js.map +1 -0
- package/dist/utils/helpers.d.ts +35 -0
- package/dist/utils/helpers.js +61 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/looseDateParser.d.ts +19 -0
- package/dist/utils/looseDateParser.js +149 -0
- package/dist/utils/looseDateParser.js.map +1 -0
- package/dist/utils/projectUtils.d.ts +13 -0
- package/dist/utils/projectUtils.js +92 -0
- package/dist/utils/projectUtils.js.map +1 -0
- package/dist/utils/reminderDateParser.d.ts +8 -0
- package/dist/utils/reminderDateParser.js +89 -0
- package/dist/utils/reminderDateParser.js.map +1 -0
- package/dist/utils/reminderRepository.d.ts +33 -0
- package/dist/utils/reminderRepository.js +262 -0
- package/dist/utils/reminderRepository.js.map +1 -0
- package/dist/utils/subtaskUtils.d.ts +103 -0
- package/dist/utils/subtaskUtils.js +253 -0
- package/dist/utils/subtaskUtils.js.map +1 -0
- package/dist/utils/tagUtils.d.ts +58 -0
- package/dist/utils/tagUtils.js +177 -0
- package/dist/utils/tagUtils.js.map +1 -0
- package/dist/utils/timeHelpers.d.ts +40 -0
- package/dist/utils/timeHelpers.js +136 -0
- package/dist/utils/timeHelpers.js.map +1 -0
- package/dist/validation/schemas.d.ts +385 -0
- package/dist/validation/schemas.js +579 -0
- package/dist/validation/schemas.js.map +1 -0
- package/package.json +96 -0
- package/scripts/build-event.mjs +513 -0
- package/scripts/disclaim.c +69 -0
- package/scripts/event-Info.plist +29 -0
- package/scripts/event.entitlements +10 -0
- package/scripts/postinstall.mjs +91 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* types/index.ts
|
|
3
|
+
* Type definitions for the Apple Reminders MCP server
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Priority levels for reminders, matching `EKReminderPriority` raw values:
|
|
7
|
+
* 0 = none, 1 = high, 5 = medium, 9 = low. Other integers in 1–9 fall in
|
|
8
|
+
* between those buckets but are not produced by Apple's UI; the read path
|
|
9
|
+
* still tolerates them via `PRIORITY_LABELS[priority] ?? 'unknown'`.
|
|
10
|
+
*/
|
|
11
|
+
export type ReminderPriority = 0 | 1 | 5 | 9;
|
|
12
|
+
/**
|
|
13
|
+
* Priority label mapping for display
|
|
14
|
+
*/
|
|
15
|
+
export declare const PRIORITY_LABELS: Record<number, string>;
|
|
16
|
+
/**
|
|
17
|
+
* Recurrence frequency types
|
|
18
|
+
*/
|
|
19
|
+
export type RecurrenceFrequency = 'minutely' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
20
|
+
/**
|
|
21
|
+
* Recurrence rule interface for repeating reminders
|
|
22
|
+
*/
|
|
23
|
+
export interface RecurrenceRule {
|
|
24
|
+
frequency: RecurrenceFrequency;
|
|
25
|
+
interval: number;
|
|
26
|
+
endDate?: string;
|
|
27
|
+
occurrenceCount?: number;
|
|
28
|
+
daysOfWeek?: number[];
|
|
29
|
+
daysOfMonth?: number[];
|
|
30
|
+
monthsOfYear?: number[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Location trigger proximity types
|
|
34
|
+
*/
|
|
35
|
+
export type LocationProximity = 'enter' | 'leave';
|
|
36
|
+
/**
|
|
37
|
+
* Location trigger interface for geofence-based reminders
|
|
38
|
+
*/
|
|
39
|
+
export interface LocationTrigger {
|
|
40
|
+
title: string;
|
|
41
|
+
latitude: number;
|
|
42
|
+
longitude: number;
|
|
43
|
+
radius?: number;
|
|
44
|
+
proximity: LocationProximity;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Structured location interface (EventKit EKStructuredLocation)
|
|
48
|
+
*/
|
|
49
|
+
export interface StructuredLocation {
|
|
50
|
+
title: string;
|
|
51
|
+
latitude?: number;
|
|
52
|
+
longitude?: number;
|
|
53
|
+
radius?: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Alarm interface (EventKit EKAlarm)
|
|
57
|
+
* - Relative alarms use seconds offset from start/due dates (negative = before).
|
|
58
|
+
* - Absolute alarms fire at a specific date/time.
|
|
59
|
+
* - Location alarms use a structured location + proximity (geofence).
|
|
60
|
+
* - alarmType is READ-ONLY: determined automatically by EventKit based on alarm properties.
|
|
61
|
+
*/
|
|
62
|
+
export interface Alarm {
|
|
63
|
+
relativeOffset?: number;
|
|
64
|
+
absoluteDate?: string;
|
|
65
|
+
locationTrigger?: LocationTrigger;
|
|
66
|
+
alarmType?: 'display' | 'audio' | 'procedure' | 'email';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Subtask interface for checklist items within reminders
|
|
70
|
+
*/
|
|
71
|
+
export interface Subtask {
|
|
72
|
+
id: string;
|
|
73
|
+
title: string;
|
|
74
|
+
isCompleted: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Subtask progress info
|
|
78
|
+
*/
|
|
79
|
+
export interface SubtaskProgress {
|
|
80
|
+
completed: number;
|
|
81
|
+
total: number;
|
|
82
|
+
percentage: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Reminder item interface
|
|
86
|
+
*/
|
|
87
|
+
export interface Reminder {
|
|
88
|
+
id: string;
|
|
89
|
+
title: string;
|
|
90
|
+
startDate?: string;
|
|
91
|
+
dueDate?: string;
|
|
92
|
+
completionDate?: string;
|
|
93
|
+
notes?: string;
|
|
94
|
+
url?: string;
|
|
95
|
+
location?: string;
|
|
96
|
+
timeZone?: string;
|
|
97
|
+
creationDate?: string;
|
|
98
|
+
lastModifiedDate?: string;
|
|
99
|
+
externalId?: string;
|
|
100
|
+
list: string;
|
|
101
|
+
isCompleted: boolean;
|
|
102
|
+
priority: number;
|
|
103
|
+
alarms?: Alarm[];
|
|
104
|
+
recurrenceRules?: RecurrenceRule[];
|
|
105
|
+
locationTrigger?: LocationTrigger;
|
|
106
|
+
tags?: string[];
|
|
107
|
+
subtasks?: Subtask[];
|
|
108
|
+
subtaskProgress?: SubtaskProgress;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Reminder list interface
|
|
112
|
+
*/
|
|
113
|
+
export interface ReminderList {
|
|
114
|
+
id: string;
|
|
115
|
+
title: string;
|
|
116
|
+
color?: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Calendar event interface
|
|
120
|
+
*/
|
|
121
|
+
export interface CalendarEvent {
|
|
122
|
+
id: string;
|
|
123
|
+
title: string;
|
|
124
|
+
startDate: string;
|
|
125
|
+
endDate: string;
|
|
126
|
+
calendar: string;
|
|
127
|
+
notes?: string;
|
|
128
|
+
location?: string;
|
|
129
|
+
structuredLocation?: StructuredLocation;
|
|
130
|
+
url?: string;
|
|
131
|
+
isAllDay: boolean;
|
|
132
|
+
availability?: 'not-supported' | 'busy' | 'free' | 'tentative' | 'unavailable' | 'unknown';
|
|
133
|
+
alarms?: Alarm[];
|
|
134
|
+
recurrenceRules?: RecurrenceRule[];
|
|
135
|
+
organizer?: {
|
|
136
|
+
name?: string;
|
|
137
|
+
url: string;
|
|
138
|
+
};
|
|
139
|
+
attendees?: Array<{
|
|
140
|
+
name?: string;
|
|
141
|
+
url: string;
|
|
142
|
+
status: string;
|
|
143
|
+
role: string;
|
|
144
|
+
type: string;
|
|
145
|
+
isCurrentUser: boolean;
|
|
146
|
+
}>;
|
|
147
|
+
status?: string;
|
|
148
|
+
isDetached?: boolean;
|
|
149
|
+
occurrenceDate?: string;
|
|
150
|
+
creationDate?: string;
|
|
151
|
+
lastModifiedDate?: string;
|
|
152
|
+
externalId?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Calendar interface
|
|
156
|
+
*/
|
|
157
|
+
export interface Calendar {
|
|
158
|
+
id: string;
|
|
159
|
+
title: string;
|
|
160
|
+
eventCount?: number;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Server configuration
|
|
164
|
+
*/
|
|
165
|
+
export interface ServerConfig {
|
|
166
|
+
name: string;
|
|
167
|
+
version: string;
|
|
168
|
+
/** 子模块模式(fork 增量):按域暴露工具,缺省 'all'。见 server/mode.ts。 */
|
|
169
|
+
mode?: import('../server/mode.js').ServerMode;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Shared type constants for better type safety and consistency
|
|
173
|
+
*/
|
|
174
|
+
export type ReminderAction = 'read' | 'create' | 'update' | 'delete';
|
|
175
|
+
export type ListAction = 'read' | 'create' | 'update' | 'delete';
|
|
176
|
+
export type CalendarAction = 'read' | 'create' | 'update' | 'delete';
|
|
177
|
+
export type CalendarsAction = 'read';
|
|
178
|
+
export type DueWithinOption = 'today' | 'tomorrow' | 'this-week' | 'overdue' | 'no-date';
|
|
179
|
+
/**
|
|
180
|
+
* Action constant arrays for enum validation
|
|
181
|
+
*/
|
|
182
|
+
export declare const REMINDER_ACTIONS: readonly ReminderAction[];
|
|
183
|
+
export declare const LIST_ACTIONS: readonly ListAction[];
|
|
184
|
+
export declare const CALENDAR_ACTIONS: readonly CalendarAction[];
|
|
185
|
+
export declare const DUE_WITHIN_OPTIONS: readonly DueWithinOption[];
|
|
186
|
+
/**
|
|
187
|
+
* Base tool arguments interface
|
|
188
|
+
*/
|
|
189
|
+
interface BaseToolArgs {
|
|
190
|
+
action: string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Tool argument types - keeping flexible for handler routing while maintaining type safety
|
|
194
|
+
*/
|
|
195
|
+
export interface RemindersToolArgs extends BaseToolArgs {
|
|
196
|
+
action: ReminderAction;
|
|
197
|
+
id?: string;
|
|
198
|
+
filterList?: string;
|
|
199
|
+
showCompleted?: boolean;
|
|
200
|
+
search?: string;
|
|
201
|
+
dueWithin?: DueWithinOption;
|
|
202
|
+
filterPriority?: 'high' | 'medium' | 'low' | 'none';
|
|
203
|
+
filterRecurring?: boolean;
|
|
204
|
+
filterLocationBased?: boolean;
|
|
205
|
+
filterTags?: string[];
|
|
206
|
+
title?: string;
|
|
207
|
+
newTitle?: string;
|
|
208
|
+
startDate?: string;
|
|
209
|
+
dueDate?: string;
|
|
210
|
+
note?: string;
|
|
211
|
+
url?: string;
|
|
212
|
+
completed?: boolean;
|
|
213
|
+
priority?: number;
|
|
214
|
+
tags?: string[];
|
|
215
|
+
addTags?: string[];
|
|
216
|
+
removeTags?: string[];
|
|
217
|
+
subtasks?: string[];
|
|
218
|
+
targetList?: string;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Subtask action type
|
|
222
|
+
*/
|
|
223
|
+
export type SubtaskAction = 'read' | 'create' | 'update' | 'delete' | 'toggle' | 'reorder';
|
|
224
|
+
/**
|
|
225
|
+
* Tool arguments for subtask operations
|
|
226
|
+
*/
|
|
227
|
+
export interface SubtasksToolArgs extends BaseToolArgs {
|
|
228
|
+
action: SubtaskAction;
|
|
229
|
+
reminderId: string;
|
|
230
|
+
subtaskId?: string;
|
|
231
|
+
title?: string;
|
|
232
|
+
completed?: boolean;
|
|
233
|
+
order?: string[];
|
|
234
|
+
}
|
|
235
|
+
export interface ListsToolArgs extends BaseToolArgs {
|
|
236
|
+
action: ListAction;
|
|
237
|
+
name?: string;
|
|
238
|
+
newName?: string;
|
|
239
|
+
}
|
|
240
|
+
export interface CalendarToolArgs extends BaseToolArgs {
|
|
241
|
+
action: CalendarAction;
|
|
242
|
+
id?: string;
|
|
243
|
+
filterCalendar?: string;
|
|
244
|
+
search?: string;
|
|
245
|
+
availability?: 'not-supported' | 'busy' | 'free' | 'tentative' | 'unavailable';
|
|
246
|
+
startDate?: string;
|
|
247
|
+
endDate?: string;
|
|
248
|
+
title?: string;
|
|
249
|
+
note?: string;
|
|
250
|
+
location?: string;
|
|
251
|
+
span?: 'this-event' | 'future-events';
|
|
252
|
+
targetCalendar?: string;
|
|
253
|
+
}
|
|
254
|
+
export interface CalendarsToolArgs extends BaseToolArgs {
|
|
255
|
+
action: CalendarsAction;
|
|
256
|
+
startDate?: string;
|
|
257
|
+
endDate?: string;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Prompt-related type exports for consumers that need to interact with the
|
|
261
|
+
* structured MCP prompt registry.
|
|
262
|
+
*/
|
|
263
|
+
export type { DailyTaskOrganizerArgs, PromptArgsByName, PromptArgumentDefinition, PromptMessage, PromptMessageContent, PromptMetadata, PromptName, PromptResponse, PromptTemplate, ReminderReviewAssistantArgs, SmartReminderCreatorArgs, WeeklyPlanningWorkflowArgs, } from './prompts.js';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* types/index.ts
|
|
3
|
+
* Type definitions for the Apple Reminders MCP server
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Priority label mapping for display
|
|
7
|
+
*/
|
|
8
|
+
export const PRIORITY_LABELS = {
|
|
9
|
+
0: 'none',
|
|
10
|
+
1: 'high',
|
|
11
|
+
5: 'medium',
|
|
12
|
+
9: 'low',
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Action constant arrays for enum validation
|
|
16
|
+
*/
|
|
17
|
+
export const REMINDER_ACTIONS = [
|
|
18
|
+
'read',
|
|
19
|
+
'create',
|
|
20
|
+
'update',
|
|
21
|
+
'delete',
|
|
22
|
+
];
|
|
23
|
+
export const LIST_ACTIONS = [
|
|
24
|
+
'read',
|
|
25
|
+
'create',
|
|
26
|
+
'update',
|
|
27
|
+
'delete',
|
|
28
|
+
];
|
|
29
|
+
export const CALENDAR_ACTIONS = [
|
|
30
|
+
'read',
|
|
31
|
+
'create',
|
|
32
|
+
'update',
|
|
33
|
+
'delete',
|
|
34
|
+
];
|
|
35
|
+
export const DUE_WITHIN_OPTIONS = [
|
|
36
|
+
'today',
|
|
37
|
+
'tomorrow',
|
|
38
|
+
'this-week',
|
|
39
|
+
'overdue',
|
|
40
|
+
'no-date',
|
|
41
|
+
];
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA2B;IACrD,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,KAAK;CACT,CAAC;AAqMF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA8B;IACzD,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;CACA,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAA0B;IACjD,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;CACA,CAAC;AAEX,MAAM,CAAC,MAAM,gBAAgB,GAA8B;IACzD,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;CACA,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAA+B;IAC5D,OAAO;IACP,UAAU;IACV,WAAW;IACX,SAAS;IACT,SAAS;CACD,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* types/prompts.ts
|
|
3
|
+
* Type definitions for MCP prompt templates and arguments
|
|
4
|
+
*/
|
|
5
|
+
export type PromptName = 'daily-task-organizer' | 'smart-reminder-creator' | 'reminder-review-assistant' | 'weekly-planning-workflow';
|
|
6
|
+
/**
|
|
7
|
+
* Describes an individual prompt argument exposed to MCP clients.
|
|
8
|
+
*/
|
|
9
|
+
export interface PromptArgumentDefinition {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Prompt metadata that is surfaced through the `ListPrompts` endpoint.
|
|
16
|
+
* Fields mirror the MCP `Prompt` schema (`name`, optional `title`,
|
|
17
|
+
* `description`, `arguments`). A `version` field was previously included but
|
|
18
|
+
* the MCP `Prompt` type has no such concept, so clients silently dropped it.
|
|
19
|
+
*/
|
|
20
|
+
export interface PromptMetadata<Name extends PromptName = PromptName> {
|
|
21
|
+
name: Name;
|
|
22
|
+
title?: string;
|
|
23
|
+
description: string;
|
|
24
|
+
arguments: PromptArgumentDefinition[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Content definition for a single prompt message.
|
|
28
|
+
*/
|
|
29
|
+
export interface PromptMessageContent {
|
|
30
|
+
type: 'text';
|
|
31
|
+
text: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* User-facing prompt message structure used when constructing prompt templates.
|
|
35
|
+
*/
|
|
36
|
+
export interface PromptMessage {
|
|
37
|
+
role: 'user';
|
|
38
|
+
content: PromptMessageContent;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Response payload returned from `GetPrompt` requests.
|
|
42
|
+
*/
|
|
43
|
+
export interface PromptResponse {
|
|
44
|
+
description: string;
|
|
45
|
+
messages: PromptMessage[];
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Arguments accepted by the `daily-task-organizer` prompt.
|
|
50
|
+
*/
|
|
51
|
+
export interface DailyTaskOrganizerArgs {
|
|
52
|
+
"Today's focus"?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Arguments accepted by the `smart-reminder-creator` prompt.
|
|
56
|
+
*/
|
|
57
|
+
export interface SmartReminderCreatorArgs {
|
|
58
|
+
'Task idea'?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Arguments accepted by the `reminder-review-assistant` prompt.
|
|
62
|
+
*/
|
|
63
|
+
export interface ReminderReviewAssistantArgs {
|
|
64
|
+
'Review focus'?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Arguments accepted by the `weekly-planning-workflow` prompt.
|
|
68
|
+
*/
|
|
69
|
+
export interface WeeklyPlanningWorkflowArgs {
|
|
70
|
+
'User ideas'?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Mapped helper type that links prompt names with their argument signatures.
|
|
74
|
+
*/
|
|
75
|
+
export interface PromptArgsByName {
|
|
76
|
+
'daily-task-organizer': DailyTaskOrganizerArgs;
|
|
77
|
+
'smart-reminder-creator': SmartReminderCreatorArgs;
|
|
78
|
+
'reminder-review-assistant': ReminderReviewAssistantArgs;
|
|
79
|
+
'weekly-planning-workflow': WeeklyPlanningWorkflowArgs;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Describes an individual prompt template with parsing and builder helpers.
|
|
83
|
+
*/
|
|
84
|
+
export interface PromptTemplate<Name extends PromptName> {
|
|
85
|
+
metadata: PromptMetadata<Name>;
|
|
86
|
+
parseArgs(rawArgs: Record<string, unknown> | null | undefined): PromptArgsByName[Name];
|
|
87
|
+
buildPrompt(args: PromptArgsByName[Name]): PromptResponse;
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/types/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* repository.ts
|
|
3
|
+
* Shared type definitions for repository layer JSON interfaces and the
|
|
4
|
+
* abstract contracts the application layer is allowed to depend on.
|
|
5
|
+
*
|
|
6
|
+
* Domain layer rule (CLAUDE.md): interfaces are defined in the *consuming*
|
|
7
|
+
* layer, not the implementation layer. The handlers / orchestration code in
|
|
8
|
+
* `src/tools/handlers/` are the consumers — these interfaces live here in
|
|
9
|
+
* `src/types/` so the concrete repositories in `src/utils/` formally
|
|
10
|
+
* implement them rather than the handlers being coupled to the
|
|
11
|
+
* implementation.
|
|
12
|
+
*/
|
|
13
|
+
import type { Calendar, CalendarEvent, Reminder, ReminderList } from './index.js';
|
|
14
|
+
/**
|
|
15
|
+
* Recurrence rule JSON interface as emitted by the `event` CLI
|
|
16
|
+
*/
|
|
17
|
+
export interface RecurrenceRuleJSON {
|
|
18
|
+
frequency: 'minutely' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
19
|
+
interval?: number;
|
|
20
|
+
endDate?: string | null;
|
|
21
|
+
occurrenceCount?: number | null;
|
|
22
|
+
daysOfWeek?: number[] | null;
|
|
23
|
+
daysOfMonth?: number[] | null;
|
|
24
|
+
monthsOfYear?: number[] | null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Location trigger JSON interface as emitted by the `event` CLI
|
|
28
|
+
*/
|
|
29
|
+
export interface LocationTriggerJSON {
|
|
30
|
+
title: string;
|
|
31
|
+
latitude: number;
|
|
32
|
+
longitude: number;
|
|
33
|
+
radius?: number;
|
|
34
|
+
proximity: 'enter' | 'leave' | 'none';
|
|
35
|
+
}
|
|
36
|
+
export interface StructuredLocationJSON {
|
|
37
|
+
title: string;
|
|
38
|
+
latitude?: number | null;
|
|
39
|
+
longitude?: number | null;
|
|
40
|
+
radius?: number | null;
|
|
41
|
+
}
|
|
42
|
+
export interface AlarmJSON {
|
|
43
|
+
relativeOffset?: number | null;
|
|
44
|
+
absoluteDate?: string | null;
|
|
45
|
+
locationTrigger?: LocationTriggerJSON | null;
|
|
46
|
+
alarmType?: string | null;
|
|
47
|
+
}
|
|
48
|
+
export interface ParticipantJSON {
|
|
49
|
+
name?: string | null;
|
|
50
|
+
url: string;
|
|
51
|
+
status?: string | null;
|
|
52
|
+
role?: string | null;
|
|
53
|
+
type?: string | null;
|
|
54
|
+
isCurrentUser?: boolean | null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* JSON interfaces emitted by the `event` CLI
|
|
58
|
+
*/
|
|
59
|
+
export interface ReminderJSON {
|
|
60
|
+
id: string;
|
|
61
|
+
title: string;
|
|
62
|
+
isCompleted: boolean;
|
|
63
|
+
list: string;
|
|
64
|
+
notes: string | null;
|
|
65
|
+
url: string | null;
|
|
66
|
+
location?: string | null;
|
|
67
|
+
timeZone?: string | null;
|
|
68
|
+
dueDate: string | null;
|
|
69
|
+
startDate?: string | null;
|
|
70
|
+
completionDate?: string | null;
|
|
71
|
+
creationDate?: string | null;
|
|
72
|
+
lastModifiedDate?: string | null;
|
|
73
|
+
externalId?: string | null;
|
|
74
|
+
priority: number;
|
|
75
|
+
alarms?: AlarmJSON[] | null;
|
|
76
|
+
recurrenceRules?: RecurrenceRuleJSON[] | null;
|
|
77
|
+
locationTrigger: LocationTriggerJSON | null;
|
|
78
|
+
}
|
|
79
|
+
export interface ListJSON {
|
|
80
|
+
id: string;
|
|
81
|
+
title: string;
|
|
82
|
+
color?: string | null;
|
|
83
|
+
}
|
|
84
|
+
export interface EventJSON {
|
|
85
|
+
id: string;
|
|
86
|
+
title: string;
|
|
87
|
+
calendar: string;
|
|
88
|
+
startDate: string;
|
|
89
|
+
endDate: string;
|
|
90
|
+
notes: string | null;
|
|
91
|
+
location: string | null;
|
|
92
|
+
structuredLocation?: StructuredLocationJSON | null;
|
|
93
|
+
url: string | null;
|
|
94
|
+
isAllDay: boolean;
|
|
95
|
+
availability?: string | null;
|
|
96
|
+
alarms?: AlarmJSON[] | null;
|
|
97
|
+
recurrenceRules?: RecurrenceRuleJSON[] | null;
|
|
98
|
+
organizer?: ParticipantJSON | null;
|
|
99
|
+
attendees?: ParticipantJSON[] | null;
|
|
100
|
+
status?: string | null;
|
|
101
|
+
isDetached?: boolean | null;
|
|
102
|
+
occurrenceDate?: string | null;
|
|
103
|
+
creationDate?: string | null;
|
|
104
|
+
lastModifiedDate?: string | null;
|
|
105
|
+
externalId?: string | null;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Data interfaces for repository methods
|
|
109
|
+
*/
|
|
110
|
+
/** Fields accepted by `event reminders create`. */
|
|
111
|
+
export interface CreateReminderData {
|
|
112
|
+
title: string;
|
|
113
|
+
list?: string;
|
|
114
|
+
notes?: string;
|
|
115
|
+
url?: string;
|
|
116
|
+
dueDate?: string;
|
|
117
|
+
priority?: number;
|
|
118
|
+
}
|
|
119
|
+
/** Fields accepted by `event reminders update`. */
|
|
120
|
+
export interface UpdateReminderData {
|
|
121
|
+
id: string;
|
|
122
|
+
newTitle?: string;
|
|
123
|
+
notes?: string;
|
|
124
|
+
url?: string;
|
|
125
|
+
isCompleted?: boolean;
|
|
126
|
+
startDate?: string;
|
|
127
|
+
dueDate?: string;
|
|
128
|
+
priority?: number;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Fields accepted by `event calendar create`. All-day events are inferred
|
|
132
|
+
* from the date format (bare `YYYY-MM-DD` without a time component).
|
|
133
|
+
*/
|
|
134
|
+
export interface CreateEventData {
|
|
135
|
+
title: string;
|
|
136
|
+
startDate: string;
|
|
137
|
+
endDate: string;
|
|
138
|
+
calendar?: string;
|
|
139
|
+
notes?: string;
|
|
140
|
+
location?: string;
|
|
141
|
+
}
|
|
142
|
+
/** Fields accepted by `event calendar update`. */
|
|
143
|
+
export interface UpdateEventData {
|
|
144
|
+
id: string;
|
|
145
|
+
title?: string;
|
|
146
|
+
startDate?: string;
|
|
147
|
+
endDate?: string;
|
|
148
|
+
notes?: string;
|
|
149
|
+
location?: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Reminder repository contract. Implementations are responsible for talking
|
|
153
|
+
* to the underlying EventKit data store (today: via the Swift CLI). The
|
|
154
|
+
* application layer depends only on this interface.
|
|
155
|
+
*/
|
|
156
|
+
export interface IReminderRepository {
|
|
157
|
+
findReminderById(id: string): Promise<Reminder>;
|
|
158
|
+
findReminders(filters?: {
|
|
159
|
+
list?: string;
|
|
160
|
+
showCompleted?: boolean;
|
|
161
|
+
search?: string;
|
|
162
|
+
dueWithin?: string;
|
|
163
|
+
priority?: 'high' | 'medium' | 'low' | 'none';
|
|
164
|
+
recurring?: boolean;
|
|
165
|
+
locationBased?: boolean;
|
|
166
|
+
tags?: string[];
|
|
167
|
+
}): Promise<Reminder[]>;
|
|
168
|
+
findAllLists(): Promise<ReminderList[]>;
|
|
169
|
+
createReminder(data: CreateReminderData): Promise<ReminderJSON>;
|
|
170
|
+
updateReminder(data: UpdateReminderData): Promise<ReminderJSON>;
|
|
171
|
+
deleteReminder(id: string): Promise<void>;
|
|
172
|
+
createReminderList(name: string): Promise<ReminderList>;
|
|
173
|
+
updateReminderList(currentName: string, newName: string): Promise<ReminderList>;
|
|
174
|
+
deleteReminderList(name: string): Promise<void>;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Calendar repository contract. Mirrors `IReminderRepository` for EventKit
|
|
178
|
+
* calendar/event operations.
|
|
179
|
+
*/
|
|
180
|
+
export interface ICalendarRepository {
|
|
181
|
+
findEventById(id: string): Promise<CalendarEvent>;
|
|
182
|
+
findEvents(filters?: {
|
|
183
|
+
startDate?: string;
|
|
184
|
+
endDate?: string;
|
|
185
|
+
calendarName?: string;
|
|
186
|
+
search?: string;
|
|
187
|
+
availability?: string;
|
|
188
|
+
}): Promise<CalendarEvent[]>;
|
|
189
|
+
findAllCalendars(): Promise<Calendar[]>;
|
|
190
|
+
findCalendars(filters?: {
|
|
191
|
+
startDate?: string;
|
|
192
|
+
endDate?: string;
|
|
193
|
+
}): Promise<Calendar[]>;
|
|
194
|
+
createEvent(data: CreateEventData): Promise<EventJSON>;
|
|
195
|
+
updateEvent(data: UpdateEventData): Promise<EventJSON>;
|
|
196
|
+
deleteEvent(id: string, span?: 'this-event' | 'future-events'): Promise<void>;
|
|
197
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* repository.ts
|
|
3
|
+
* Shared type definitions for repository layer JSON interfaces and the
|
|
4
|
+
* abstract contracts the application layer is allowed to depend on.
|
|
5
|
+
*
|
|
6
|
+
* Domain layer rule (CLAUDE.md): interfaces are defined in the *consuming*
|
|
7
|
+
* layer, not the implementation layer. The handlers / orchestration code in
|
|
8
|
+
* `src/tools/handlers/` are the consumers — these interfaces live here in
|
|
9
|
+
* `src/types/` so the concrete repositories in `src/utils/` formally
|
|
10
|
+
* implement them rather than the handlers being coupled to the
|
|
11
|
+
* implementation.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/types/repository.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* utils/binaryValidator.ts
|
|
3
|
+
* Secure binary path validation and integrity checking
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Security configuration for binary validation
|
|
7
|
+
*/
|
|
8
|
+
interface BinarySecurityConfig {
|
|
9
|
+
expectedHash?: string;
|
|
10
|
+
maxFileSize: number;
|
|
11
|
+
allowedPaths: string[];
|
|
12
|
+
requireAbsolutePath: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Binary validation error
|
|
16
|
+
*/
|
|
17
|
+
export declare class BinaryValidationError extends Error {
|
|
18
|
+
code: string;
|
|
19
|
+
constructor(message: string, code: string);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validates binary path for security
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateBinaryPath(binaryPath: string, config?: Partial<BinarySecurityConfig>): void;
|
|
25
|
+
/**
|
|
26
|
+
* Calculates SHA256 hash of binary file
|
|
27
|
+
*/
|
|
28
|
+
export declare function calculateBinaryHash(binaryPath: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Validates binary integrity using hash
|
|
31
|
+
*/
|
|
32
|
+
export declare function validateBinaryIntegrity(binaryPath: string, expectedHash: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Comprehensive binary security validation
|
|
35
|
+
*/
|
|
36
|
+
export declare function validateBinarySecurity(binaryPath: string, config?: Partial<BinarySecurityConfig>): {
|
|
37
|
+
isValid: boolean;
|
|
38
|
+
hash?: string;
|
|
39
|
+
errors: string[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Secure binary path finder with validation
|
|
43
|
+
*/
|
|
44
|
+
export declare function findSecureBinaryPath(possiblePaths: string[], config?: Partial<BinarySecurityConfig>): {
|
|
45
|
+
path: string | null;
|
|
46
|
+
validationResult?: ReturnType<typeof validateBinarySecurity>;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Environment-specific binary validation
|
|
50
|
+
*/
|
|
51
|
+
export declare function getEnvironmentBinaryConfig(): Partial<BinarySecurityConfig>;
|
|
52
|
+
export {};
|