@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.
- package/.env.example +22 -0
- package/LICENSE +21 -0
- package/README.md +422 -0
- package/advanced/index.js +652 -0
- package/auth/index.js +32 -0
- package/auth/oauth-server.js +233 -0
- package/auth/token-manager.js +105 -0
- package/auth/token-storage.js +359 -0
- package/auth/tools.js +159 -0
- package/calendar/accept.js +72 -0
- package/calendar/cancel.js +72 -0
- package/calendar/create.js +115 -0
- package/calendar/decline.js +72 -0
- package/calendar/delete.js +67 -0
- package/calendar/index.js +130 -0
- package/calendar/list.js +108 -0
- package/categories/index.js +955 -0
- package/config.js +95 -0
- package/contacts/index.js +754 -0
- package/email/attachments.js +365 -0
- package/email/conversations.js +666 -0
- package/email/delta.js +210 -0
- package/email/export.js +572 -0
- package/email/folder-utils.js +192 -0
- package/email/headers.js +344 -0
- package/email/index.js +537 -0
- package/email/list.js +136 -0
- package/email/mark-as-read.js +114 -0
- package/email/mime.js +286 -0
- package/email/read.js +161 -0
- package/email/search.js +628 -0
- package/email/send.js +169 -0
- package/folder/create.js +137 -0
- package/folder/delete.js +108 -0
- package/folder/index.js +112 -0
- package/folder/list.js +289 -0
- package/folder/move.js +186 -0
- package/folder/stats.js +322 -0
- package/index.js +162 -0
- package/llms.txt +76 -0
- package/outlook-auth-server.js +384 -0
- package/package.json +97 -0
- package/rules/create.js +273 -0
- package/rules/index.js +276 -0
- package/rules/list.js +216 -0
- package/settings/index.js +678 -0
- package/utils/field-presets.js +311 -0
- package/utils/graph-api.js +268 -0
- package/utils/mock-data.js +154 -0
- package/utils/odata-helpers.js +33 -0
- package/utils/response-formatter.js +457 -0
- 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
|
+
};
|