@agenticmail/enterprise 0.5.316 → 0.5.317
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/dist/agent-tools-263HM5QU.js +13949 -0
- package/dist/chunk-6G5SXLXC.js +4921 -0
- package/dist/chunk-6PWDS7KY.js +5087 -0
- package/dist/chunk-OW4GLBHP.js +1519 -0
- package/dist/cli-agent-FNMDJN7T.js +2357 -0
- package/dist/cli-serve-DTQLN5UI.js +140 -0
- package/dist/cli.js +3 -3
- package/dist/index.js +17 -17
- package/dist/integrations-TF4EBCJ7.js +43830 -0
- package/dist/microsoft-UFLZBEAC.js +1619 -0
- package/dist/runtime-QQ6LAY4U.js +45 -0
- package/dist/server-DFR7FI3Q.js +28 -0
- package/dist/setup-LW4MLU2N.js +20 -0
- package/package.json +1 -1
- package/src/agent-tools/index.ts +7 -2
- package/src/agent-tools/tools/microsoft/contacts.ts +176 -0
- package/src/agent-tools/tools/microsoft/graph-api.ts +50 -0
- package/src/agent-tools/tools/microsoft/index.ts +55 -0
- package/src/agent-tools/tools/microsoft/onedrive.ts +228 -0
- package/src/agent-tools/tools/microsoft/outlook-calendar.ts +286 -0
- package/src/agent-tools/tools/microsoft/outlook-mail.ts +431 -0
- package/src/agent-tools/tools/microsoft/teams.ts +244 -0
- package/src/agent-tools/tools/microsoft/todo.ts +181 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Microsoft To Do Tools
|
|
3
|
+
*
|
|
4
|
+
* Task management via Microsoft Graph API — lists, tasks, CRUD.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { AnyAgentTool, ToolCreationOptions } from '../../types.js';
|
|
8
|
+
import { jsonResult, errorResult } from '../../common.js';
|
|
9
|
+
import type { MicrosoftToolsConfig } from './index.js';
|
|
10
|
+
import { graph } from './graph-api.js';
|
|
11
|
+
|
|
12
|
+
export function createTodoTools(config: MicrosoftToolsConfig, _options?: ToolCreationOptions): AnyAgentTool[] {
|
|
13
|
+
const tp = config.tokenProvider;
|
|
14
|
+
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
name: 'todo_list_lists',
|
|
18
|
+
description: 'List all To Do task lists.',
|
|
19
|
+
category: 'utility' as const,
|
|
20
|
+
parameters: { type: 'object' as const, properties: {}, required: [] },
|
|
21
|
+
async execute(_id: string) {
|
|
22
|
+
try {
|
|
23
|
+
const token = await tp.getAccessToken();
|
|
24
|
+
const data = await graph(token, '/me/todo/lists');
|
|
25
|
+
const lists = (data.value || []).map((l: any) => ({
|
|
26
|
+
id: l.id, name: l.displayName, isOwner: l.isOwner,
|
|
27
|
+
wellknownName: l.wellknownListName,
|
|
28
|
+
}));
|
|
29
|
+
return jsonResult({ lists, count: lists.length });
|
|
30
|
+
} catch (e: any) { return errorResult(e.message); }
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
{
|
|
35
|
+
name: 'todo_list_tasks',
|
|
36
|
+
description: 'List tasks in a To Do list.',
|
|
37
|
+
category: 'utility' as const,
|
|
38
|
+
parameters: {
|
|
39
|
+
type: 'object' as const,
|
|
40
|
+
properties: {
|
|
41
|
+
listId: { type: 'string', description: 'Task list ID' },
|
|
42
|
+
includeCompleted: { type: 'boolean', description: 'Include completed tasks (default: false)' },
|
|
43
|
+
maxResults: { type: 'number', description: 'Max tasks (default: 50)' },
|
|
44
|
+
},
|
|
45
|
+
required: ['listId'],
|
|
46
|
+
},
|
|
47
|
+
async execute(_id: string, params: any) {
|
|
48
|
+
try {
|
|
49
|
+
const token = await tp.getAccessToken();
|
|
50
|
+
const query: Record<string, string> = {
|
|
51
|
+
'$top': String(params.maxResults || 50),
|
|
52
|
+
'$orderby': 'importance desc,createdDateTime desc',
|
|
53
|
+
'$select': 'id,title,body,status,importance,createdDateTime,lastModifiedDateTime,dueDateTime,completedDateTime,isReminderOn,reminderDateTime',
|
|
54
|
+
};
|
|
55
|
+
if (!params.includeCompleted) query['$filter'] = "status ne 'completed'";
|
|
56
|
+
const data = await graph(token, `/me/todo/lists/${params.listId}/tasks`, { query });
|
|
57
|
+
const tasks = (data.value || []).map((t: any) => ({
|
|
58
|
+
id: t.id, title: t.title,
|
|
59
|
+
body: t.body?.content, bodyType: t.body?.contentType,
|
|
60
|
+
status: t.status, importance: t.importance,
|
|
61
|
+
created: t.createdDateTime, modified: t.lastModifiedDateTime,
|
|
62
|
+
dueDate: t.dueDateTime?.dateTime, dueTimeZone: t.dueDateTime?.timeZone,
|
|
63
|
+
completedDate: t.completedDateTime?.dateTime,
|
|
64
|
+
hasReminder: t.isReminderOn,
|
|
65
|
+
}));
|
|
66
|
+
return jsonResult({ tasks, count: tasks.length });
|
|
67
|
+
} catch (e: any) { return errorResult(e.message); }
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
{
|
|
72
|
+
name: 'todo_create_task',
|
|
73
|
+
description: 'Create a new task in a To Do list.',
|
|
74
|
+
category: 'utility' as const,
|
|
75
|
+
parameters: {
|
|
76
|
+
type: 'object' as const,
|
|
77
|
+
properties: {
|
|
78
|
+
listId: { type: 'string', description: 'Task list ID' },
|
|
79
|
+
title: { type: 'string', description: 'Task title' },
|
|
80
|
+
body: { type: 'string', description: 'Task notes/description' },
|
|
81
|
+
dueDate: { type: 'string', description: 'Due date (ISO 8601 date, e.g., "2026-03-15")' },
|
|
82
|
+
importance: { type: 'string', description: 'low, normal, or high (default: normal)' },
|
|
83
|
+
reminderDateTime: { type: 'string', description: 'Reminder date/time (ISO 8601)' },
|
|
84
|
+
},
|
|
85
|
+
required: ['listId', 'title'],
|
|
86
|
+
},
|
|
87
|
+
async execute(_id: string, params: any) {
|
|
88
|
+
try {
|
|
89
|
+
const token = await tp.getAccessToken();
|
|
90
|
+
const task: any = { title: params.title };
|
|
91
|
+
if (params.body) task.body = { contentType: 'text', content: params.body };
|
|
92
|
+
if (params.dueDate) task.dueDateTime = { dateTime: params.dueDate + 'T00:00:00', timeZone: 'UTC' };
|
|
93
|
+
if (params.importance) task.importance = params.importance;
|
|
94
|
+
if (params.reminderDateTime) {
|
|
95
|
+
task.isReminderOn = true;
|
|
96
|
+
task.reminderDateTime = { dateTime: params.reminderDateTime, timeZone: 'UTC' };
|
|
97
|
+
}
|
|
98
|
+
const created = await graph(token, `/me/todo/lists/${params.listId}/tasks`, { method: 'POST', body: task });
|
|
99
|
+
return jsonResult({ id: created.id, title: created.title, status: created.status });
|
|
100
|
+
} catch (e: any) { return errorResult(e.message); }
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
{
|
|
105
|
+
name: 'todo_update_task',
|
|
106
|
+
description: 'Update an existing To Do task (title, status, due date, importance).',
|
|
107
|
+
category: 'utility' as const,
|
|
108
|
+
parameters: {
|
|
109
|
+
type: 'object' as const,
|
|
110
|
+
properties: {
|
|
111
|
+
listId: { type: 'string', description: 'Task list ID' },
|
|
112
|
+
taskId: { type: 'string', description: 'Task ID' },
|
|
113
|
+
title: { type: 'string', description: 'New title' },
|
|
114
|
+
status: { type: 'string', description: 'notStarted, inProgress, completed, waitingOnOthers, deferred' },
|
|
115
|
+
importance: { type: 'string', description: 'low, normal, or high' },
|
|
116
|
+
dueDate: { type: 'string', description: 'New due date (ISO 8601 date)' },
|
|
117
|
+
body: { type: 'string', description: 'New task notes' },
|
|
118
|
+
},
|
|
119
|
+
required: ['listId', 'taskId'],
|
|
120
|
+
},
|
|
121
|
+
async execute(_id: string, params: any) {
|
|
122
|
+
try {
|
|
123
|
+
const token = await tp.getAccessToken();
|
|
124
|
+
const update: any = {};
|
|
125
|
+
if (params.title) update.title = params.title;
|
|
126
|
+
if (params.status) update.status = params.status;
|
|
127
|
+
if (params.importance) update.importance = params.importance;
|
|
128
|
+
if (params.dueDate) update.dueDateTime = { dateTime: params.dueDate + 'T00:00:00', timeZone: 'UTC' };
|
|
129
|
+
if (params.body) update.body = { contentType: 'text', content: params.body };
|
|
130
|
+
const updated = await graph(token, `/me/todo/lists/${params.listId}/tasks/${params.taskId}`, {
|
|
131
|
+
method: 'PATCH', body: update
|
|
132
|
+
});
|
|
133
|
+
return jsonResult({ id: updated.id, title: updated.title, status: updated.status, updated: true });
|
|
134
|
+
} catch (e: any) { return errorResult(e.message); }
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
{
|
|
139
|
+
name: 'todo_delete_task',
|
|
140
|
+
description: 'Delete a To Do task.',
|
|
141
|
+
category: 'utility' as const,
|
|
142
|
+
parameters: {
|
|
143
|
+
type: 'object' as const,
|
|
144
|
+
properties: {
|
|
145
|
+
listId: { type: 'string', description: 'Task list ID' },
|
|
146
|
+
taskId: { type: 'string', description: 'Task ID to delete' },
|
|
147
|
+
},
|
|
148
|
+
required: ['listId', 'taskId'],
|
|
149
|
+
},
|
|
150
|
+
async execute(_id: string, params: any) {
|
|
151
|
+
try {
|
|
152
|
+
const token = await tp.getAccessToken();
|
|
153
|
+
await graph(token, `/me/todo/lists/${params.listId}/tasks/${params.taskId}`, { method: 'DELETE' });
|
|
154
|
+
return jsonResult({ deleted: true, taskId: params.taskId });
|
|
155
|
+
} catch (e: any) { return errorResult(e.message); }
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
{
|
|
160
|
+
name: 'todo_create_list',
|
|
161
|
+
description: 'Create a new To Do task list.',
|
|
162
|
+
category: 'utility' as const,
|
|
163
|
+
parameters: {
|
|
164
|
+
type: 'object' as const,
|
|
165
|
+
properties: {
|
|
166
|
+
name: { type: 'string', description: 'List name' },
|
|
167
|
+
},
|
|
168
|
+
required: ['name'],
|
|
169
|
+
},
|
|
170
|
+
async execute(_id: string, params: any) {
|
|
171
|
+
try {
|
|
172
|
+
const token = await tp.getAccessToken();
|
|
173
|
+
const list = await graph(token, '/me/todo/lists', {
|
|
174
|
+
method: 'POST', body: { displayName: params.name },
|
|
175
|
+
});
|
|
176
|
+
return jsonResult({ id: list.id, name: list.displayName });
|
|
177
|
+
} catch (e: any) { return errorResult(e.message); }
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
];
|
|
181
|
+
}
|