@littlebearapps/outlook-assistant 3.3.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 (52) hide show
  1. package/.env.example +22 -0
  2. package/LICENSE +21 -0
  3. package/README.md +422 -0
  4. package/advanced/index.js +652 -0
  5. package/auth/index.js +32 -0
  6. package/auth/oauth-server.js +233 -0
  7. package/auth/token-manager.js +105 -0
  8. package/auth/token-storage.js +359 -0
  9. package/auth/tools.js +159 -0
  10. package/calendar/accept.js +72 -0
  11. package/calendar/cancel.js +72 -0
  12. package/calendar/create.js +115 -0
  13. package/calendar/decline.js +72 -0
  14. package/calendar/delete.js +67 -0
  15. package/calendar/index.js +130 -0
  16. package/calendar/list.js +108 -0
  17. package/categories/index.js +955 -0
  18. package/config.js +95 -0
  19. package/contacts/index.js +754 -0
  20. package/email/attachments.js +365 -0
  21. package/email/conversations.js +666 -0
  22. package/email/delta.js +210 -0
  23. package/email/export.js +572 -0
  24. package/email/folder-utils.js +192 -0
  25. package/email/headers.js +344 -0
  26. package/email/index.js +537 -0
  27. package/email/list.js +136 -0
  28. package/email/mark-as-read.js +114 -0
  29. package/email/mime.js +286 -0
  30. package/email/read.js +161 -0
  31. package/email/search.js +628 -0
  32. package/email/send.js +169 -0
  33. package/folder/create.js +137 -0
  34. package/folder/delete.js +108 -0
  35. package/folder/index.js +112 -0
  36. package/folder/list.js +289 -0
  37. package/folder/move.js +186 -0
  38. package/folder/stats.js +322 -0
  39. package/index.js +162 -0
  40. package/llms.txt +76 -0
  41. package/outlook-auth-server.js +384 -0
  42. package/package.json +97 -0
  43. package/rules/create.js +273 -0
  44. package/rules/index.js +276 -0
  45. package/rules/list.js +216 -0
  46. package/settings/index.js +678 -0
  47. package/utils/field-presets.js +311 -0
  48. package/utils/graph-api.js +268 -0
  49. package/utils/mock-data.js +154 -0
  50. package/utils/odata-helpers.js +33 -0
  51. package/utils/response-formatter.js +457 -0
  52. package/utils/safety.js +123 -0
package/config.js ADDED
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Configuration for Outlook Assistant Server
3
+ *
4
+ * Token-efficient configuration with field presets and response limits.
5
+ */
6
+ const path = require('path');
7
+ const os = require('os');
8
+
9
+ // Import new utility modules
10
+ const {
11
+ FIELD_PRESETS,
12
+ FOLDER_FIELDS,
13
+ getEmailFields,
14
+ getFolderFields,
15
+ } = require('./utils/field-presets');
16
+ const { VERBOSITY, DEFAULT_LIMITS } = require('./utils/response-formatter');
17
+
18
+ // Ensure we have a home directory path — never fall back to /tmp (world-readable)
19
+ const homeDir = process.env.HOME || process.env.USERPROFILE || os.homedir();
20
+ if (!homeDir) {
21
+ throw new Error(
22
+ 'Cannot determine home directory. Set HOME or USERPROFILE environment variable.'
23
+ );
24
+ }
25
+
26
+ module.exports = {
27
+ // Server information
28
+ SERVER_NAME: 'outlook-assistant',
29
+ SERVER_VERSION: '3.3.0',
30
+
31
+ // Test mode setting
32
+ USE_TEST_MODE: process.env.USE_TEST_MODE === 'true',
33
+
34
+ // Authentication configuration
35
+ AUTH_CONFIG: {
36
+ clientId: process.env.OUTLOOK_CLIENT_ID || '',
37
+ clientSecret: process.env.OUTLOOK_CLIENT_SECRET || '',
38
+ redirectUri: 'http://localhost:3333/auth/callback',
39
+ scopes: [
40
+ 'offline_access',
41
+ 'User.Read',
42
+ 'Mail.Read',
43
+ 'Mail.ReadWrite',
44
+ 'Mail.Send',
45
+ 'Calendars.Read',
46
+ 'Calendars.ReadWrite',
47
+ 'Contacts.Read',
48
+ 'Contacts.ReadWrite',
49
+ 'People.Read',
50
+ 'MailboxSettings.ReadWrite',
51
+ // Org-dependent scopes (work/school accounts only):
52
+ // 'Mail.Read.Shared', // access-shared-mailbox tool
53
+ // 'Place.Read.All', // find-meeting-rooms tool
54
+ ],
55
+ tokenStorePath: path.join(homeDir, '.outlook-assistant-tokens.json'),
56
+ authServerUrl: 'http://localhost:3333',
57
+ },
58
+
59
+ // Microsoft Graph API
60
+ GRAPH_API_ENDPOINT: 'https://graph.microsoft.com/v1.0/',
61
+
62
+ // Calendar constants
63
+ CALENDAR_SELECT_FIELDS:
64
+ 'id,subject,bodyPreview,start,end,location,organizer,attendees,isAllDay,isCancelled',
65
+
66
+ // Email field presets (use getEmailFields() for dynamic selection)
67
+ FIELD_PRESETS,
68
+ getEmailFields,
69
+
70
+ // Legacy email fields (kept for backward compatibility)
71
+ EMAIL_SELECT_FIELDS: getEmailFields('list'),
72
+ EMAIL_DETAIL_FIELDS: getEmailFields('read'),
73
+ EMAIL_FORENSIC_FIELDS: getEmailFields('forensic'),
74
+ EMAIL_EXPORT_FIELDS: getEmailFields('export'),
75
+
76
+ // Folder field presets
77
+ FOLDER_FIELDS,
78
+ getFolderFields,
79
+
80
+ // Verbosity levels for response formatting
81
+ VERBOSITY,
82
+
83
+ // Default limits for token efficiency
84
+ DEFAULT_LIMITS,
85
+
86
+ // Pagination (updated to use DEFAULT_LIMITS)
87
+ DEFAULT_PAGE_SIZE: DEFAULT_LIMITS.listEmails,
88
+ MAX_RESULT_COUNT: 100, // Increased for batch operations
89
+
90
+ // Search defaults (reduced for token efficiency)
91
+ DEFAULT_SEARCH_RESULTS: DEFAULT_LIMITS.searchEmails,
92
+
93
+ // Timezone
94
+ DEFAULT_TIMEZONE: 'Australia/Melbourne', // Updated for Nathan's timezone
95
+ };