@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.
Files changed (123) hide show
  1. package/CHANGELOG.md +575 -0
  2. package/LICENSE +21 -0
  3. package/README.md +304 -0
  4. package/README.zh-CN.md +270 -0
  5. package/bin/event +0 -0
  6. package/bin/event-disclaim +0 -0
  7. package/dist/bin/apple-calendar.d.ts +6 -0
  8. package/dist/bin/apple-calendar.js +8 -0
  9. package/dist/bin/apple-calendar.js.map +1 -0
  10. package/dist/bin/apple-reminders.d.ts +7 -0
  11. package/dist/bin/apple-reminders.js +9 -0
  12. package/dist/bin/apple-reminders.js.map +1 -0
  13. package/dist/bootstrap.d.ts +11 -0
  14. package/dist/bootstrap.js +44 -0
  15. package/dist/bootstrap.js.map +1 -0
  16. package/dist/index.d.ts +10 -0
  17. package/dist/index.js +12 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/server/handlers.d.ts +12 -0
  20. package/dist/server/handlers.js +58 -0
  21. package/dist/server/handlers.js.map +1 -0
  22. package/dist/server/mode.d.ts +19 -0
  23. package/dist/server/mode.js +47 -0
  24. package/dist/server/mode.js.map +1 -0
  25. package/dist/server/promptAbstractions.d.ts +61 -0
  26. package/dist/server/promptAbstractions.js +140 -0
  27. package/dist/server/promptAbstractions.js.map +1 -0
  28. package/dist/server/prompts.d.ts +13 -0
  29. package/dist/server/prompts.js +461 -0
  30. package/dist/server/prompts.js.map +1 -0
  31. package/dist/server/server.d.ts +61 -0
  32. package/dist/server/server.js +112 -0
  33. package/dist/server/server.js.map +1 -0
  34. package/dist/tools/definitions.d.ts +9 -0
  35. package/dist/tools/definitions.js +272 -0
  36. package/dist/tools/definitions.js.map +1 -0
  37. package/dist/tools/handlers/calendarHandlers.d.ts +11 -0
  38. package/dist/tools/handlers/calendarHandlers.js +151 -0
  39. package/dist/tools/handlers/calendarHandlers.js.map +1 -0
  40. package/dist/tools/handlers/formatters.d.ts +24 -0
  41. package/dist/tools/handlers/formatters.js +105 -0
  42. package/dist/tools/handlers/formatters.js.map +1 -0
  43. package/dist/tools/handlers/index.d.ts +8 -0
  44. package/dist/tools/handlers/index.js +9 -0
  45. package/dist/tools/handlers/index.js.map +1 -0
  46. package/dist/tools/handlers/listHandlers.d.ts +10 -0
  47. package/dist/tools/handlers/listHandlers.js +47 -0
  48. package/dist/tools/handlers/listHandlers.js.map +1 -0
  49. package/dist/tools/handlers/reminderHandlers.d.ts +10 -0
  50. package/dist/tools/handlers/reminderHandlers.js +219 -0
  51. package/dist/tools/handlers/reminderHandlers.js.map +1 -0
  52. package/dist/tools/handlers/shared.d.ts +28 -0
  53. package/dist/tools/handlers/shared.js +57 -0
  54. package/dist/tools/handlers/shared.js.map +1 -0
  55. package/dist/tools/handlers/subtaskHandlers.d.ts +12 -0
  56. package/dist/tools/handlers/subtaskHandlers.js +113 -0
  57. package/dist/tools/handlers/subtaskHandlers.js.map +1 -0
  58. package/dist/tools/index.d.ts +10 -0
  59. package/dist/tools/index.js +74 -0
  60. package/dist/tools/index.js.map +1 -0
  61. package/dist/types/index.d.ts +263 -0
  62. package/dist/types/index.js +42 -0
  63. package/dist/types/index.js.map +1 -0
  64. package/dist/types/prompts.d.ts +88 -0
  65. package/dist/types/prompts.js +6 -0
  66. package/dist/types/prompts.js.map +1 -0
  67. package/dist/types/repository.d.ts +197 -0
  68. package/dist/types/repository.js +14 -0
  69. package/dist/types/repository.js.map +1 -0
  70. package/dist/utils/binaryValidator.d.ts +52 -0
  71. package/dist/utils/binaryValidator.js +185 -0
  72. package/dist/utils/binaryValidator.js.map +1 -0
  73. package/dist/utils/calendarRepository.d.ts +49 -0
  74. package/dist/utils/calendarRepository.js +226 -0
  75. package/dist/utils/calendarRepository.js.map +1 -0
  76. package/dist/utils/constants.d.ts +79 -0
  77. package/dist/utils/constants.js +80 -0
  78. package/dist/utils/constants.js.map +1 -0
  79. package/dist/utils/dateFiltering.d.ts +41 -0
  80. package/dist/utils/dateFiltering.js +129 -0
  81. package/dist/utils/dateFiltering.js.map +1 -0
  82. package/dist/utils/dateUtils.d.ts +27 -0
  83. package/dist/utils/dateUtils.js +71 -0
  84. package/dist/utils/dateUtils.js.map +1 -0
  85. package/dist/utils/errorHandling.d.ts +27 -0
  86. package/dist/utils/errorHandling.js +88 -0
  87. package/dist/utils/errorHandling.js.map +1 -0
  88. package/dist/utils/eventCli.d.ts +40 -0
  89. package/dist/utils/eventCli.js +294 -0
  90. package/dist/utils/eventCli.js.map +1 -0
  91. package/dist/utils/helpers.d.ts +35 -0
  92. package/dist/utils/helpers.js +61 -0
  93. package/dist/utils/helpers.js.map +1 -0
  94. package/dist/utils/looseDateParser.d.ts +19 -0
  95. package/dist/utils/looseDateParser.js +149 -0
  96. package/dist/utils/looseDateParser.js.map +1 -0
  97. package/dist/utils/projectUtils.d.ts +13 -0
  98. package/dist/utils/projectUtils.js +92 -0
  99. package/dist/utils/projectUtils.js.map +1 -0
  100. package/dist/utils/reminderDateParser.d.ts +8 -0
  101. package/dist/utils/reminderDateParser.js +89 -0
  102. package/dist/utils/reminderDateParser.js.map +1 -0
  103. package/dist/utils/reminderRepository.d.ts +33 -0
  104. package/dist/utils/reminderRepository.js +262 -0
  105. package/dist/utils/reminderRepository.js.map +1 -0
  106. package/dist/utils/subtaskUtils.d.ts +103 -0
  107. package/dist/utils/subtaskUtils.js +253 -0
  108. package/dist/utils/subtaskUtils.js.map +1 -0
  109. package/dist/utils/tagUtils.d.ts +58 -0
  110. package/dist/utils/tagUtils.js +177 -0
  111. package/dist/utils/tagUtils.js.map +1 -0
  112. package/dist/utils/timeHelpers.d.ts +40 -0
  113. package/dist/utils/timeHelpers.js +136 -0
  114. package/dist/utils/timeHelpers.js.map +1 -0
  115. package/dist/validation/schemas.d.ts +385 -0
  116. package/dist/validation/schemas.js +579 -0
  117. package/dist/validation/schemas.js.map +1 -0
  118. package/package.json +96 -0
  119. package/scripts/build-event.mjs +513 -0
  120. package/scripts/disclaim.c +69 -0
  121. package/scripts/event-Info.plist +29 -0
  122. package/scripts/event.entitlements +10 -0
  123. package/scripts/postinstall.mjs +91 -0
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleIdentifier</key>
6
+ <string>io.github.lay777.calendar-event-cli</string>
7
+ <!-- TCC prompt display name ("... would like to access Calendar"). Overridable at build time via APP_EVENT_DISPLAY_NAME, see build-event.mjs. -->
8
+ <key>CFBundleName</key>
9
+ <string>Apple EventKit MCP</string>
10
+ <key>CFBundleDisplayName</key>
11
+ <string>Apple EventKit MCP</string>
12
+ <key>CFBundleInfoDictionaryVersion</key>
13
+ <string>6.0</string>
14
+ <key>CFBundleVersion</key>
15
+ <string>1</string>
16
+ <key>NSRemindersUsageDescription</key>
17
+ <string>This tool needs access to Reminders so it can query and manage your reminders.</string>
18
+ <key>NSRemindersFullAccessUsageDescription</key>
19
+ <string>This tool needs access to Reminders so it can query and manage your reminders.</string>
20
+ <key>NSRemindersWriteOnlyAccessUsageDescription</key>
21
+ <string>This tool needs access to Reminders so it can create reminders for you.</string>
22
+ <key>NSCalendarsUsageDescription</key>
23
+ <string>This tool needs access to Calendar so it can query and manage your events.</string>
24
+ <key>NSCalendarsFullAccessUsageDescription</key>
25
+ <string>This tool needs access to Calendar so it can query and manage your events.</string>
26
+ <key>NSCalendarsWriteOnlyAccessUsageDescription</key>
27
+ <string>This tool needs access to Calendar so it can create events for you.</string>
28
+ </dict>
29
+ </plist>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>com.apple.security.personal-information.calendars</key>
6
+ <true/>
7
+ <key>com.apple.security.personal-information.reminders</key>
8
+ <true/>
9
+ </dict>
10
+ </plist>
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Postinstall script for mcp-server-apple-events
5
+ *
6
+ * When the package is installed via npm, the pre-built `event` binary is
7
+ * included in the package and this script exits immediately. No Xcode required.
8
+ *
9
+ * When the repository is cloned locally (no pre-built binary), this script
10
+ * attempts to build the vendored `event` CLI from source. It gracefully skips
11
+ * on non-macOS platforms or if Swift is not available.
12
+ */
13
+
14
+ import { execFile } from 'node:child_process';
15
+ import { promises as fs } from 'node:fs';
16
+ import path from 'node:path';
17
+ import { fileURLToPath } from 'node:url';
18
+ import { promisify } from 'node:util';
19
+
20
+ const execFileAsync = promisify(execFile);
21
+
22
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
23
+ const projectRoot = path.resolve(__dirname, '..');
24
+
25
+ async function main() {
26
+ if (process.platform !== 'darwin') {
27
+ console.log('Skipping `event` CLI build on non-macOS platform');
28
+ process.exit(0);
29
+ }
30
+
31
+ // If the pre-built binaries are already present (npm install from published
32
+ // package), skip the source build entirely — the npm tarball does not
33
+ // include the vendor/event submodule sources, so there is nothing to
34
+ // build against anyway. Both `event` and the `event-disclaim` TCC shim
35
+ // must exist; a clone with a stale pre-shim build rebuilds to pick up the
36
+ // shim (issue #93).
37
+ const binPath = path.join(projectRoot, 'bin', 'event');
38
+ const disclaimPath = path.join(projectRoot, 'bin', 'event-disclaim');
39
+ try {
40
+ await fs.access(binPath, fs.constants.X_OK);
41
+ await fs.access(disclaimPath, fs.constants.X_OK);
42
+ console.log('Pre-built `event` binaries found, skipping source build.');
43
+ process.exit(0);
44
+ } catch {
45
+ // Binaries not present or not executable — proceed to build from source
46
+ }
47
+
48
+ await buildEvent();
49
+ }
50
+
51
+ // `execFile` (not `exec`) so the install path is passed as a discrete argv
52
+ // entry instead of being interpolated into a shell command. This keeps the
53
+ // build deterministic even when the project lives under a directory that
54
+ // contains spaces, `$`, backticks, or other shell-significant characters.
55
+ async function buildEvent() {
56
+ const buildScript = path.join(projectRoot, 'scripts', 'build-event.mjs');
57
+ const { stdout } = await execFileAsync(process.execPath, [buildScript], {
58
+ cwd: projectRoot,
59
+ });
60
+ if (stdout) {
61
+ console.log(stdout);
62
+ }
63
+ }
64
+
65
+ main()
66
+ .then(() => {
67
+ console.log('`event` CLI built successfully');
68
+ process.exit(0);
69
+ })
70
+ .catch((error) => {
71
+ console.error(`\n${'='.repeat(70)}`);
72
+ console.error('WARNING: `event` CLI build failed');
73
+ console.error('='.repeat(70));
74
+ console.error('\nError details:', error.message);
75
+ console.error(
76
+ '\nThe MCP server requires the bundled `event` binary to function.',
77
+ );
78
+ console.error('\nTo build manually:');
79
+ console.error(' 1. Navigate to the package directory');
80
+ console.error(
81
+ ' 2. Initialize the submodule: git submodule update --init --recursive',
82
+ );
83
+ console.error(' 3. Run: pnpm install && pnpm run build');
84
+ console.error('\nOr use a local clone instead of npx:');
85
+ console.error(
86
+ ' git clone --recurse-submodules https://github.com/fradser/mcp-server-apple-events.git',
87
+ );
88
+ console.error(' cd mcp-server-apple-events && pnpm install && pnpm build');
89
+ console.error(`${'='.repeat(70)}\n`);
90
+ process.exit(0); // Exit gracefully to not block installation
91
+ });