@fbdo/smart-agentic-calendar 0.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 (154) hide show
  1. package/README.md +195 -0
  2. package/dist/analytics/allocation.d.ts +9 -0
  3. package/dist/analytics/allocation.d.ts.map +1 -0
  4. package/dist/analytics/allocation.js +27 -0
  5. package/dist/analytics/allocation.js.map +1 -0
  6. package/dist/analytics/analytics-engine.d.ts +17 -0
  7. package/dist/analytics/analytics-engine.d.ts.map +1 -0
  8. package/dist/analytics/analytics-engine.js +33 -0
  9. package/dist/analytics/analytics-engine.js.map +1 -0
  10. package/dist/analytics/estimation.d.ts +9 -0
  11. package/dist/analytics/estimation.d.ts.map +1 -0
  12. package/dist/analytics/estimation.js +74 -0
  13. package/dist/analytics/estimation.js.map +1 -0
  14. package/dist/analytics/health.d.ts +14 -0
  15. package/dist/analytics/health.d.ts.map +1 -0
  16. package/dist/analytics/health.js +146 -0
  17. package/dist/analytics/health.js.map +1 -0
  18. package/dist/analytics/period.d.ts +9 -0
  19. package/dist/analytics/period.d.ts.map +1 -0
  20. package/dist/analytics/period.js +41 -0
  21. package/dist/analytics/period.js.map +1 -0
  22. package/dist/analytics/productivity.d.ts +9 -0
  23. package/dist/analytics/productivity.d.ts.map +1 -0
  24. package/dist/analytics/productivity.js +34 -0
  25. package/dist/analytics/productivity.js.map +1 -0
  26. package/dist/common/constants.d.ts +13 -0
  27. package/dist/common/constants.d.ts.map +1 -0
  28. package/dist/common/constants.js +19 -0
  29. package/dist/common/constants.js.map +1 -0
  30. package/dist/common/id.d.ts +2 -0
  31. package/dist/common/id.d.ts.map +1 -0
  32. package/dist/common/id.js +5 -0
  33. package/dist/common/id.js.map +1 -0
  34. package/dist/common/time.d.ts +11 -0
  35. package/dist/common/time.d.ts.map +1 -0
  36. package/dist/common/time.js +67 -0
  37. package/dist/common/time.js.map +1 -0
  38. package/dist/engine/conflict-detector.d.ts +22 -0
  39. package/dist/engine/conflict-detector.d.ts.map +1 -0
  40. package/dist/engine/conflict-detector.js +194 -0
  41. package/dist/engine/conflict-detector.js.map +1 -0
  42. package/dist/engine/dependency-resolver.d.ts +8 -0
  43. package/dist/engine/dependency-resolver.d.ts.map +1 -0
  44. package/dist/engine/dependency-resolver.js +160 -0
  45. package/dist/engine/dependency-resolver.js.map +1 -0
  46. package/dist/engine/recurrence-manager.d.ts +24 -0
  47. package/dist/engine/recurrence-manager.d.ts.map +1 -0
  48. package/dist/engine/recurrence-manager.js +140 -0
  49. package/dist/engine/recurrence-manager.js.map +1 -0
  50. package/dist/engine/replan-coordinator.d.ts +24 -0
  51. package/dist/engine/replan-coordinator.d.ts.map +1 -0
  52. package/dist/engine/replan-coordinator.js +107 -0
  53. package/dist/engine/replan-coordinator.js.map +1 -0
  54. package/dist/engine/scheduler.d.ts +65 -0
  55. package/dist/engine/scheduler.d.ts.map +1 -0
  56. package/dist/engine/scheduler.js +368 -0
  57. package/dist/engine/scheduler.js.map +1 -0
  58. package/dist/index.d.ts +19 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +69 -0
  61. package/dist/index.js.map +1 -0
  62. package/dist/mcp/server.d.ts +25 -0
  63. package/dist/mcp/server.d.ts.map +1 -0
  64. package/dist/mcp/server.js +421 -0
  65. package/dist/mcp/server.js.map +1 -0
  66. package/dist/mcp/tools/analytics-tools.d.ts +45 -0
  67. package/dist/mcp/tools/analytics-tools.d.ts.map +1 -0
  68. package/dist/mcp/tools/analytics-tools.js +27 -0
  69. package/dist/mcp/tools/analytics-tools.js.map +1 -0
  70. package/dist/mcp/tools/config-tools.d.ts +55 -0
  71. package/dist/mcp/tools/config-tools.d.ts.map +1 -0
  72. package/dist/mcp/tools/config-tools.js +47 -0
  73. package/dist/mcp/tools/config-tools.js.map +1 -0
  74. package/dist/mcp/tools/event-tools.d.ts +50 -0
  75. package/dist/mcp/tools/event-tools.d.ts.map +1 -0
  76. package/dist/mcp/tools/event-tools.js +48 -0
  77. package/dist/mcp/tools/event-tools.js.map +1 -0
  78. package/dist/mcp/tools/schedule-tools.d.ts +80 -0
  79. package/dist/mcp/tools/schedule-tools.d.ts.map +1 -0
  80. package/dist/mcp/tools/schedule-tools.js +103 -0
  81. package/dist/mcp/tools/schedule-tools.js.map +1 -0
  82. package/dist/mcp/tools/task-tools.d.ts +106 -0
  83. package/dist/mcp/tools/task-tools.d.ts.map +1 -0
  84. package/dist/mcp/tools/task-tools.js +161 -0
  85. package/dist/mcp/tools/task-tools.js.map +1 -0
  86. package/dist/mcp/validators.d.ts +231 -0
  87. package/dist/mcp/validators.d.ts.map +1 -0
  88. package/dist/mcp/validators.js +405 -0
  89. package/dist/mcp/validators.js.map +1 -0
  90. package/dist/models/analytics.d.ts +55 -0
  91. package/dist/models/analytics.d.ts.map +1 -0
  92. package/dist/models/analytics.js +2 -0
  93. package/dist/models/analytics.js.map +1 -0
  94. package/dist/models/config.d.ts +32 -0
  95. package/dist/models/config.d.ts.map +1 -0
  96. package/dist/models/config.js +2 -0
  97. package/dist/models/config.js.map +1 -0
  98. package/dist/models/conflict.d.ts +21 -0
  99. package/dist/models/conflict.d.ts.map +1 -0
  100. package/dist/models/conflict.js +2 -0
  101. package/dist/models/conflict.js.map +1 -0
  102. package/dist/models/dependency.d.ts +5 -0
  103. package/dist/models/dependency.d.ts.map +1 -0
  104. package/dist/models/dependency.js +2 -0
  105. package/dist/models/dependency.js.map +1 -0
  106. package/dist/models/errors.d.ts +19 -0
  107. package/dist/models/errors.d.ts.map +1 -0
  108. package/dist/models/errors.js +29 -0
  109. package/dist/models/errors.js.map +1 -0
  110. package/dist/models/event.d.ts +11 -0
  111. package/dist/models/event.d.ts.map +1 -0
  112. package/dist/models/event.js +2 -0
  113. package/dist/models/event.js.map +1 -0
  114. package/dist/models/recurrence.d.ts +22 -0
  115. package/dist/models/recurrence.d.ts.map +1 -0
  116. package/dist/models/recurrence.js +2 -0
  117. package/dist/models/recurrence.js.map +1 -0
  118. package/dist/models/schedule.d.ts +16 -0
  119. package/dist/models/schedule.d.ts.map +1 -0
  120. package/dist/models/schedule.js +2 -0
  121. package/dist/models/schedule.js.map +1 -0
  122. package/dist/models/task.d.ts +21 -0
  123. package/dist/models/task.d.ts.map +1 -0
  124. package/dist/models/task.js +9 -0
  125. package/dist/models/task.js.map +1 -0
  126. package/dist/storage/analytics-repository.d.ts +17 -0
  127. package/dist/storage/analytics-repository.d.ts.map +1 -0
  128. package/dist/storage/analytics-repository.js +99 -0
  129. package/dist/storage/analytics-repository.js.map +1 -0
  130. package/dist/storage/config-repository.d.ts +20 -0
  131. package/dist/storage/config-repository.d.ts.map +1 -0
  132. package/dist/storage/config-repository.js +145 -0
  133. package/dist/storage/config-repository.js.map +1 -0
  134. package/dist/storage/database.d.ts +6 -0
  135. package/dist/storage/database.d.ts.map +1 -0
  136. package/dist/storage/database.js +160 -0
  137. package/dist/storage/database.js.map +1 -0
  138. package/dist/storage/event-repository.d.ts +16 -0
  139. package/dist/storage/event-repository.d.ts.map +1 -0
  140. package/dist/storage/event-repository.js +120 -0
  141. package/dist/storage/event-repository.js.map +1 -0
  142. package/dist/storage/recurrence-repository.d.ts +18 -0
  143. package/dist/storage/recurrence-repository.d.ts.map +1 -0
  144. package/dist/storage/recurrence-repository.js +99 -0
  145. package/dist/storage/recurrence-repository.js.map +1 -0
  146. package/dist/storage/schedule-repository.d.ts +13 -0
  147. package/dist/storage/schedule-repository.d.ts.map +1 -0
  148. package/dist/storage/schedule-repository.js +53 -0
  149. package/dist/storage/schedule-repository.js.map +1 -0
  150. package/dist/storage/task-repository.d.ts +29 -0
  151. package/dist/storage/task-repository.d.ts.map +1 -0
  152. package/dist/storage/task-repository.js +235 -0
  153. package/dist/storage/task-repository.js.map +1 -0
  154. package/package.json +77 -0
@@ -0,0 +1,421 @@
1
+ // eslint-disable-next-line sonarjs/deprecation -- Low-level Server is needed for setRequestHandler; McpServer has a different API
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
5
+ import { AppError } from "../models/errors.js";
6
+ const TASK_ID_DESCRIPTION = "Task ID (required)";
7
+ const PERIOD_ENUM = ["day", "week", "month"];
8
+ const ANALYSIS_PERIOD_DESCRIPTION = "Analysis period (required)";
9
+ export function wrapToolHandler(handler) {
10
+ return async (input) => {
11
+ try {
12
+ let result = handler(input);
13
+ if (result instanceof Promise) {
14
+ result = await result;
15
+ }
16
+ return {
17
+ content: [{ type: "text", text: JSON.stringify(result) }],
18
+ };
19
+ }
20
+ catch (error) {
21
+ if (error instanceof AppError) {
22
+ return {
23
+ content: [
24
+ {
25
+ type: "text",
26
+ text: JSON.stringify({ code: error.code, message: error.message }),
27
+ },
28
+ ],
29
+ isError: true,
30
+ };
31
+ }
32
+ return {
33
+ content: [
34
+ {
35
+ type: "text",
36
+ text: JSON.stringify({
37
+ code: "INTERNAL_ERROR",
38
+ message: "an unexpected error occurred",
39
+ }),
40
+ },
41
+ ],
42
+ isError: true,
43
+ };
44
+ }
45
+ };
46
+ }
47
+ export class McpServer {
48
+ tools = new Map();
49
+ constructor(taskTools, eventTools, scheduleTools, analyticsTools, configTools) {
50
+ this.registerTaskTools(taskTools);
51
+ this.registerEventTools(eventTools);
52
+ this.registerScheduleTools(scheduleTools);
53
+ this.registerAnalyticsTools(analyticsTools);
54
+ this.registerConfigTools(configTools);
55
+ }
56
+ getToolNames() {
57
+ return [...this.tools.keys()];
58
+ }
59
+ async start() {
60
+ // eslint-disable-next-line sonarjs/deprecation -- Low-level Server is needed for setRequestHandler
61
+ const server = new Server({ name: "smart-agentic-calendar", version: "1.0.0" }, { capabilities: { tools: {} } });
62
+ const toolsArray = [...this.tools.values()];
63
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
64
+ tools: toolsArray.map((t) => ({
65
+ name: t.name,
66
+ description: t.description,
67
+ inputSchema: t.inputSchema,
68
+ })),
69
+ }));
70
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
71
+ const toolName = request.params.name;
72
+ const tool = this.tools.get(toolName);
73
+ if (!tool) {
74
+ return {
75
+ content: [
76
+ {
77
+ type: "text",
78
+ text: JSON.stringify({
79
+ code: "NOT_FOUND",
80
+ message: `Unknown tool: ${toolName}`,
81
+ }),
82
+ },
83
+ ],
84
+ isError: true,
85
+ };
86
+ }
87
+ const wrapped = wrapToolHandler(tool.handler);
88
+ return wrapped((request.params.arguments ?? {}));
89
+ });
90
+ const transport = new StdioServerTransport();
91
+ await server.connect(transport);
92
+ process.stderr.write("Smart Agentic Calendar MCP server started\n");
93
+ }
94
+ register(def) {
95
+ this.tools.set(def.name, def);
96
+ }
97
+ registerTaskTools(t) {
98
+ this.register({
99
+ name: "create_task",
100
+ description: "Create a new task. Triggers background schedule replan. Required: title, estimated_duration. Optional: description, deadline, priority (P1-P4, default P3), category, tags, recurrence_rule, blocked_by.",
101
+ inputSchema: {
102
+ type: "object",
103
+ properties: {
104
+ title: { type: "string", description: "Task title (required)" },
105
+ description: { type: "string", description: "Task description (optional)" },
106
+ estimated_duration: {
107
+ type: "number",
108
+ description: "Duration in minutes (required, positive integer)",
109
+ },
110
+ deadline: {
111
+ type: "string",
112
+ description: "ISO 8601 UTC datetime (optional)",
113
+ },
114
+ priority: {
115
+ type: "string",
116
+ enum: ["P1", "P2", "P3", "P4"],
117
+ description: "Priority level (optional, default P3)",
118
+ },
119
+ category: { type: "string", description: "Task category (optional)" },
120
+ tags: {
121
+ type: "array",
122
+ items: { type: "string" },
123
+ description: "Tags (optional, default [])",
124
+ },
125
+ recurrence_rule: {
126
+ type: "string",
127
+ description: "RRULE string for recurring tasks (optional)",
128
+ },
129
+ blocked_by: {
130
+ type: "array",
131
+ items: { type: "string" },
132
+ description: "Task IDs this task depends on (optional)",
133
+ },
134
+ },
135
+ required: ["title", "estimated_duration"],
136
+ },
137
+ handler: (input) => t.createTask(input),
138
+ });
139
+ this.register({
140
+ name: "update_task",
141
+ description: "Update an existing task. Triggers background schedule replan. Required: task_id. At least one other field must be provided.",
142
+ inputSchema: {
143
+ type: "object",
144
+ properties: {
145
+ task_id: { type: "string", description: TASK_ID_DESCRIPTION },
146
+ title: { type: "string" },
147
+ description: { type: "string" },
148
+ estimated_duration: { type: "number" },
149
+ deadline: { type: "string" },
150
+ priority: { type: "string", enum: ["P1", "P2", "P3", "P4"] },
151
+ category: { type: "string" },
152
+ tags: { type: "array", items: { type: "string" } },
153
+ blocked_by: { type: "array", items: { type: "string" } },
154
+ },
155
+ required: ["task_id"],
156
+ },
157
+ handler: (input) => t.updateTask(input),
158
+ });
159
+ this.register({
160
+ name: "complete_task",
161
+ description: "Mark a task as completed. Records actual duration. Idempotent. Triggers background replan.",
162
+ inputSchema: {
163
+ type: "object",
164
+ properties: {
165
+ task_id: { type: "string", description: TASK_ID_DESCRIPTION },
166
+ actual_duration_minutes: {
167
+ type: "number",
168
+ description: "Actual time spent in minutes (optional, defaults to estimated)",
169
+ },
170
+ },
171
+ required: ["task_id"],
172
+ },
173
+ handler: (input) => t.completeTask(input),
174
+ });
175
+ this.register({
176
+ name: "delete_task",
177
+ description: "Cancel a task (soft delete). Returns affected dependent tasks. Triggers background replan.",
178
+ inputSchema: {
179
+ type: "object",
180
+ properties: {
181
+ task_id: { type: "string", description: TASK_ID_DESCRIPTION },
182
+ },
183
+ required: ["task_id"],
184
+ },
185
+ handler: (input) => t.deleteTask(input),
186
+ });
187
+ this.register({
188
+ name: "list_tasks",
189
+ description: "List tasks with optional filters. By default excludes cancelled tasks. No replan triggered.",
190
+ inputSchema: {
191
+ type: "object",
192
+ properties: {
193
+ status: {
194
+ type: "string",
195
+ enum: ["pending", "scheduled", "completed", "cancelled", "at_risk"],
196
+ },
197
+ priority: { type: "string", enum: ["P1", "P2", "P3", "P4"] },
198
+ deadline_before: { type: "string", description: "ISO 8601 datetime" },
199
+ deadline_after: { type: "string", description: "ISO 8601 datetime" },
200
+ category: { type: "string" },
201
+ },
202
+ },
203
+ handler: (input) => t.listTasks(input),
204
+ });
205
+ }
206
+ registerEventTools(e) {
207
+ this.register({
208
+ name: "create_event",
209
+ description: "Create a calendar event (timed or all-day). Triggers background replan. Required: title + (start_time & end_time) or (is_all_day & date).",
210
+ inputSchema: {
211
+ type: "object",
212
+ properties: {
213
+ title: { type: "string", description: "Event title (required)" },
214
+ start_time: { type: "string", description: "ISO 8601 start (required for timed)" },
215
+ end_time: { type: "string", description: "ISO 8601 end (required for timed)" },
216
+ is_all_day: { type: "boolean", description: "All-day event flag (optional)" },
217
+ date: { type: "string", description: "YYYY-MM-DD date (required for all-day)" },
218
+ },
219
+ required: ["title"],
220
+ },
221
+ handler: (input) => e.createEvent(input),
222
+ });
223
+ this.register({
224
+ name: "update_event",
225
+ description: "Update an existing event. Triggers background replan.",
226
+ inputSchema: {
227
+ type: "object",
228
+ properties: {
229
+ event_id: { type: "string", description: "Event ID (required)" },
230
+ title: { type: "string" },
231
+ start_time: { type: "string" },
232
+ end_time: { type: "string" },
233
+ is_all_day: { type: "boolean" },
234
+ date: { type: "string" },
235
+ },
236
+ required: ["event_id"],
237
+ },
238
+ handler: (input) => e.updateEvent(input),
239
+ });
240
+ this.register({
241
+ name: "delete_event",
242
+ description: "Delete an event. Triggers background replan.",
243
+ inputSchema: {
244
+ type: "object",
245
+ properties: {
246
+ event_id: { type: "string", description: "Event ID (required)" },
247
+ },
248
+ required: ["event_id"],
249
+ },
250
+ handler: (input) => e.deleteEvent(input),
251
+ });
252
+ this.register({
253
+ name: "list_events",
254
+ description: "List events in a date range. No replan triggered.",
255
+ inputSchema: {
256
+ type: "object",
257
+ properties: {
258
+ start_date: { type: "string", description: "Start date (required)" },
259
+ end_date: { type: "string", description: "End date (required)" },
260
+ },
261
+ required: ["start_date", "end_date"],
262
+ },
263
+ handler: (input) => e.listEvents(input),
264
+ });
265
+ }
266
+ registerScheduleTools(s) {
267
+ this.register({
268
+ name: "get_schedule",
269
+ description: "Get the current schedule with enriched time blocks. Returns schedule_status indicating if a replan is in progress. No replan triggered.",
270
+ inputSchema: {
271
+ type: "object",
272
+ properties: {
273
+ start_date: { type: "string", description: "Start date (required)" },
274
+ end_date: { type: "string", description: "End date (required)" },
275
+ },
276
+ required: ["start_date", "end_date"],
277
+ },
278
+ handler: (input) => s.getSchedule(input),
279
+ });
280
+ this.register({
281
+ name: "replan",
282
+ description: "Trigger a synchronous replan. Waits for completion. Returns updated schedule and conflicts with schedule_status 'up_to_date'.",
283
+ inputSchema: { type: "object", properties: {} },
284
+ handler: () => s.replan(),
285
+ });
286
+ this.register({
287
+ name: "get_conflicts",
288
+ description: "Get current scheduling conflicts. Returns conflict details with deprioritization suggestions. No replan triggered.",
289
+ inputSchema: { type: "object", properties: {} },
290
+ handler: () => s.getConflicts(),
291
+ });
292
+ }
293
+ registerAnalyticsTools(a) {
294
+ this.register({
295
+ name: "get_productivity_stats",
296
+ description: "Get task completion and on-time rates for a period. No replan triggered.",
297
+ inputSchema: {
298
+ type: "object",
299
+ properties: {
300
+ period: {
301
+ type: "string",
302
+ enum: PERIOD_ENUM,
303
+ description: ANALYSIS_PERIOD_DESCRIPTION,
304
+ },
305
+ },
306
+ required: ["period"],
307
+ },
308
+ handler: (input) => a.getProductivityStats(input),
309
+ });
310
+ this.register({
311
+ name: "get_schedule_health",
312
+ description: "Get schedule health score, utilization, and risk indicators. No replan triggered.",
313
+ inputSchema: { type: "object", properties: {} },
314
+ handler: () => a.getScheduleHealth(),
315
+ });
316
+ this.register({
317
+ name: "get_estimation_accuracy",
318
+ description: "Get estimation accuracy metrics comparing estimated vs actual durations. No replan triggered.",
319
+ inputSchema: {
320
+ type: "object",
321
+ properties: {
322
+ period: {
323
+ type: "string",
324
+ enum: PERIOD_ENUM,
325
+ description: ANALYSIS_PERIOD_DESCRIPTION,
326
+ },
327
+ },
328
+ required: ["period"],
329
+ },
330
+ handler: (input) => a.getEstimationAccuracy(input),
331
+ });
332
+ this.register({
333
+ name: "get_time_allocation",
334
+ description: "Get time allocation by category for a period. No replan triggered.",
335
+ inputSchema: {
336
+ type: "object",
337
+ properties: {
338
+ period: {
339
+ type: "string",
340
+ enum: PERIOD_ENUM,
341
+ description: ANALYSIS_PERIOD_DESCRIPTION,
342
+ },
343
+ },
344
+ required: ["period"],
345
+ },
346
+ handler: (input) => a.getTimeAllocation(input),
347
+ });
348
+ }
349
+ registerConfigTools(c) {
350
+ this.register({
351
+ name: "set_availability",
352
+ description: "Set weekly availability windows. Triggers background replan. Required: windows (non-empty array with day 0-6, start_time, end_time).",
353
+ inputSchema: {
354
+ type: "object",
355
+ properties: {
356
+ windows: {
357
+ type: "array",
358
+ items: {
359
+ type: "object",
360
+ properties: {
361
+ day: { type: "number", description: "Day of week (0=Sun, 6=Sat)" },
362
+ start_time: { type: "string", description: "HH:MM format" },
363
+ end_time: { type: "string", description: "HH:MM format" },
364
+ },
365
+ required: ["day", "start_time", "end_time"],
366
+ },
367
+ description: "Availability windows (required, non-empty)",
368
+ },
369
+ },
370
+ required: ["windows"],
371
+ },
372
+ handler: (input) => c.setAvailability(input),
373
+ });
374
+ this.register({
375
+ name: "set_focus_time",
376
+ description: "Set focus time blocks. Triggers background replan. Required: blocks (non-empty array). Optional: minimum_block_minutes (15-120, default 60).",
377
+ inputSchema: {
378
+ type: "object",
379
+ properties: {
380
+ blocks: {
381
+ type: "array",
382
+ items: {
383
+ type: "object",
384
+ properties: {
385
+ day: { type: "number" },
386
+ start_time: { type: "string" },
387
+ end_time: { type: "string" },
388
+ },
389
+ required: ["day", "start_time", "end_time"],
390
+ },
391
+ },
392
+ minimum_block_minutes: { type: "number", description: "Minimum block size (15-120)" },
393
+ },
394
+ required: ["blocks"],
395
+ },
396
+ handler: (input) => c.setFocusTime(input),
397
+ });
398
+ this.register({
399
+ name: "set_preferences",
400
+ description: "Update scheduling preferences (partial merge). Triggers background replan. At least one field required.",
401
+ inputSchema: {
402
+ type: "object",
403
+ properties: {
404
+ buffer_time_minutes: { type: "number", description: "Buffer between tasks (>= 0)" },
405
+ default_priority: { type: "string", enum: ["P1", "P2", "P3", "P4"] },
406
+ default_duration: { type: "number", description: "Default task duration in minutes" },
407
+ scheduling_horizon_weeks: { type: "number", description: "Scheduling horizon (1-12)" },
408
+ minimum_block_minutes: { type: "number", description: "Min task block (15-120)" },
409
+ },
410
+ },
411
+ handler: (input) => c.setPreferences(input),
412
+ });
413
+ this.register({
414
+ name: "get_preferences",
415
+ description: "Get full configuration including availability, focus time, and scheduling preferences. No replan triggered.",
416
+ inputSchema: { type: "object", properties: {} },
417
+ handler: () => c.getPreferences(),
418
+ });
419
+ }
420
+ }
421
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,kIAAkI;AAClI,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAO/C,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACjD,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC7C,MAAM,2BAA2B,GAAG,4BAA4B,CAAC;AASjE,MAAM,UAAU,eAAe,CAAC,OAAoD;IAMlF,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE;QACrB,IAAI,CAAC;YACH,IAAI,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;YAC5B,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;gBAC9B,MAAM,GAAG,MAAM,MAAM,CAAC;YACxB,CAAC;YACD,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,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+1,45 @@
1
+ import type { AnalyticsEngine } from "../../analytics/analytics-engine.js";
2
+ export declare class AnalyticsTools {
3
+ private readonly analyticsEngine;
4
+ constructor(analyticsEngine: AnalyticsEngine);
5
+ getProductivityStats(input: {
6
+ period: string;
7
+ }): {
8
+ period: "month" | "day" | "week";
9
+ tasks_completed: number;
10
+ tasks_overdue: number;
11
+ tasks_cancelled: number;
12
+ completion_rate: number;
13
+ on_time_rate: number;
14
+ };
15
+ getScheduleHealth(): {
16
+ health_score: number;
17
+ utilization_percentage: number;
18
+ overdue_count: number;
19
+ at_risk_count: number;
20
+ free_hours_this_week: number;
21
+ busiest_day: string | null;
22
+ lightest_day: string | null;
23
+ };
24
+ getEstimationAccuracy(input: {
25
+ period: string;
26
+ }): {
27
+ average_accuracy_percentage: number | null;
28
+ overestimate_count: number;
29
+ underestimate_count: number;
30
+ average_overestimate_minutes: number | null;
31
+ average_underestimate_minutes: number | null;
32
+ accuracy_by_category: Record<string, number> | null;
33
+ };
34
+ getTimeAllocation(input: {
35
+ period: string;
36
+ }): {
37
+ period: "month" | "day" | "week";
38
+ categories: {
39
+ category: string;
40
+ hours: number;
41
+ percentage: number;
42
+ }[];
43
+ };
44
+ }
45
+ //# sourceMappingURL=analytics-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/analytics-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAS3E,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;gBAEtC,eAAe,EAAE,eAAe;IAI5C,oBAAoB,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;;;;;;;;IAM9C,iBAAiB;;;;;;;;;IAKjB,qBAAqB,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;;;;;;;;IAM/C,iBAAiB,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;;;;;;;;CAK5C"}
@@ -0,0 +1,27 @@
1
+ import { validatePeriodInput, mapProductivityOutput, mapHealthOutput, mapEstimationOutput, mapAllocationOutput, } from "../validators.js";
2
+ export class AnalyticsTools {
3
+ analyticsEngine;
4
+ constructor(analyticsEngine) {
5
+ this.analyticsEngine = analyticsEngine;
6
+ }
7
+ getProductivityStats(input) {
8
+ validatePeriodInput(input.period);
9
+ const stats = this.analyticsEngine.getProductivityStats(input.period);
10
+ return mapProductivityOutput(stats);
11
+ }
12
+ getScheduleHealth() {
13
+ const health = this.analyticsEngine.getScheduleHealth();
14
+ return mapHealthOutput(health);
15
+ }
16
+ getEstimationAccuracy(input) {
17
+ validatePeriodInput(input.period);
18
+ const accuracy = this.analyticsEngine.getEstimationAccuracy(input.period);
19
+ return mapEstimationOutput(accuracy);
20
+ }
21
+ getTimeAllocation(input) {
22
+ validatePeriodInput(input.period);
23
+ const allocation = this.analyticsEngine.getTimeAllocation(input.period);
24
+ return mapAllocationOutput(allocation);
25
+ }
26
+ }
27
+ //# sourceMappingURL=analytics-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics-tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/analytics-tools.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,OAAO,cAAc;IACR,eAAe,CAAkB;IAElD,YAAY,eAAgC;QAC1C,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAED,oBAAoB,CAAC,KAAyB;QAC5C,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACtE,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,iBAAiB;QACf,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,CAAC;QACxD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,qBAAqB,CAAC,KAAyB;QAC7C,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1E,OAAO,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,iBAAiB,CAAC,KAAyB;QACzC,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACxE,OAAO,mBAAmB,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;CACF"}
@@ -0,0 +1,55 @@
1
+ import type { ConfigRepository } from "../../storage/config-repository.js";
2
+ import type { ReplanCoordinator } from "../../engine/replan-coordinator.js";
3
+ import { type SetAvailabilityMcpInput, type SetFocusTimeMcpInput, type SetPreferencesMcpInput } from "../validators.js";
4
+ export declare class ConfigTools {
5
+ private readonly configRepo;
6
+ private readonly replanCoordinator;
7
+ constructor(configRepo: ConfigRepository, replanCoordinator: ReplanCoordinator);
8
+ setAvailability(input: SetAvailabilityMcpInput): {
9
+ windows: {
10
+ day: number;
11
+ start_time: string;
12
+ end_time: string;
13
+ }[];
14
+ message: string;
15
+ };
16
+ setFocusTime(input: SetFocusTimeMcpInput): {
17
+ blocks: {
18
+ day: number;
19
+ start_time: string;
20
+ end_time: string;
21
+ }[];
22
+ minimum_block_minutes: number;
23
+ message: string;
24
+ };
25
+ setPreferences(input: SetPreferencesMcpInput): {
26
+ buffer_time_minutes: number;
27
+ default_priority: import("../../models/task.js").TaskPriority;
28
+ default_duration: number;
29
+ scheduling_horizon_weeks: number;
30
+ minimum_block_minutes: number;
31
+ };
32
+ getPreferences(): {
33
+ availability: {
34
+ day: import("../../models/config.js").DayOfWeek;
35
+ start_time: string;
36
+ end_time: string;
37
+ }[];
38
+ focus_time: {
39
+ blocks: {
40
+ day: import("../../models/config.js").DayOfWeek;
41
+ start_time: string;
42
+ end_time: string;
43
+ }[];
44
+ minimum_block_minutes: number;
45
+ };
46
+ preferences: {
47
+ buffer_time_minutes: number;
48
+ default_priority: import("../../models/task.js").TaskPriority;
49
+ default_duration: number;
50
+ scheduling_horizon_weeks: number;
51
+ minimum_block_minutes: number;
52
+ };
53
+ };
54
+ }
55
+ //# sourceMappingURL=config-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/config-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAUL,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmB;IAC9C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;gBAE1C,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB;IAK9E,eAAe,CAAC,KAAK,EAAE,uBAAuB;;;;;;;;IAa9C,YAAY,CAAC,KAAK,EAAE,oBAAoB;;;;;;;;;IAcxC,cAAc,CAAC,KAAK,EAAE,sBAAsB;;;;;;;IAW5C,cAAc;;;;;;;;;;;;;;;;;;;;;;CAQf"}
@@ -0,0 +1,47 @@
1
+ import { validateSetAvailabilityInput, validateSetFocusTimeInput, validateSetPreferencesInput, mapSetAvailabilityInput, mapSetFocusTimeInput, mapSetPreferencesInput, mapAvailabilityOutput, mapFocusTimeOutput, mapPreferencesOutput, } from "../validators.js";
2
+ export class ConfigTools {
3
+ configRepo;
4
+ replanCoordinator;
5
+ constructor(configRepo, replanCoordinator) {
6
+ this.configRepo = configRepo;
7
+ this.replanCoordinator = replanCoordinator;
8
+ }
9
+ setAvailability(input) {
10
+ validateSetAvailabilityInput(input);
11
+ const availability = mapSetAvailabilityInput(input);
12
+ this.configRepo.setAvailability(availability);
13
+ this.replanCoordinator.requestReplan();
14
+ return {
15
+ windows: input.windows,
16
+ message: "Availability updated successfully",
17
+ };
18
+ }
19
+ setFocusTime(input) {
20
+ validateSetFocusTimeInput(input);
21
+ const focusTime = mapSetFocusTimeInput(input);
22
+ this.configRepo.setFocusTime(focusTime);
23
+ this.replanCoordinator.requestReplan();
24
+ return {
25
+ blocks: input.blocks,
26
+ minimum_block_minutes: focusTime.minimumBlockMinutes,
27
+ message: "Focus time updated successfully",
28
+ };
29
+ }
30
+ setPreferences(input) {
31
+ validateSetPreferencesInput(input);
32
+ const partialPrefs = mapSetPreferencesInput(input);
33
+ this.configRepo.setPreferences(partialPrefs);
34
+ this.replanCoordinator.requestReplan();
35
+ const preferences = this.configRepo.getPreferences();
36
+ return mapPreferencesOutput(preferences);
37
+ }
38
+ getPreferences() {
39
+ const config = this.configRepo.getFullConfig();
40
+ return {
41
+ availability: mapAvailabilityOutput(config.availability),
42
+ focus_time: mapFocusTimeOutput(config.focusTime),
43
+ preferences: mapPreferencesOutput(config.preferences),
44
+ };
45
+ }
46
+ }
47
+ //# sourceMappingURL=config-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/config-tools.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB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