@shin1ohno/sage 0.8.4 → 0.8.6
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/cli/mcp-handler.d.ts.map +1 -1
- package/dist/cli/mcp-handler.js +141 -987
- package/dist/cli/mcp-handler.js.map +1 -1
- package/dist/config/update-validation.d.ts +52 -0
- package/dist/config/update-validation.d.ts.map +1 -0
- package/dist/config/update-validation.js +133 -0
- package/dist/config/update-validation.js.map +1 -0
- package/dist/index.js +163 -1815
- package/dist/index.js.map +1 -1
- package/dist/integrations/calendar-event-creator.d.ts +2 -3
- package/dist/integrations/calendar-event-creator.d.ts.map +1 -1
- package/dist/integrations/calendar-event-creator.js +3 -4
- package/dist/integrations/calendar-event-creator.js.map +1 -1
- package/dist/integrations/calendar-event-deleter.d.ts +2 -3
- package/dist/integrations/calendar-event-deleter.d.ts.map +1 -1
- package/dist/integrations/calendar-event-deleter.js +3 -4
- package/dist/integrations/calendar-event-deleter.js.map +1 -1
- package/dist/integrations/calendar-event-response.d.ts +4 -17
- package/dist/integrations/calendar-event-response.d.ts.map +1 -1
- package/dist/integrations/calendar-event-response.js +3 -4
- package/dist/integrations/calendar-event-response.js.map +1 -1
- package/dist/integrations/notion-mcp.d.ts +28 -3
- package/dist/integrations/notion-mcp.d.ts.map +1 -1
- package/dist/integrations/notion-mcp.js +21 -5
- package/dist/integrations/notion-mcp.js.map +1 -1
- package/dist/integrations/reminder-manager.d.ts.map +1 -1
- package/dist/integrations/reminder-manager.js +2 -0
- package/dist/integrations/reminder-manager.js.map +1 -1
- package/dist/services/container.d.ts +56 -0
- package/dist/services/container.d.ts.map +1 -0
- package/dist/services/container.js +76 -0
- package/dist/services/container.js.map +1 -0
- package/dist/tools/calendar/handlers.d.ts +186 -0
- package/dist/tools/calendar/handlers.d.ts.map +1 -0
- package/dist/tools/calendar/handlers.js +525 -0
- package/dist/tools/calendar/handlers.js.map +1 -0
- package/dist/tools/calendar/index.d.ts +11 -0
- package/dist/tools/calendar/index.d.ts.map +1 -0
- package/dist/tools/calendar/index.js +10 -0
- package/dist/tools/calendar/index.js.map +1 -0
- package/dist/tools/index.d.ts +23 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +24 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/integrations/handlers.d.ts +57 -0
- package/dist/tools/integrations/handlers.d.ts.map +1 -0
- package/dist/tools/integrations/handlers.js +159 -0
- package/dist/tools/integrations/handlers.js.map +1 -0
- package/dist/tools/integrations/index.d.ts +11 -0
- package/dist/tools/integrations/index.d.ts.map +1 -0
- package/dist/tools/integrations/index.js +10 -0
- package/dist/tools/integrations/index.js.map +1 -0
- package/dist/tools/registry.d.ts +8 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +10 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/reminders/handlers.d.ts +61 -0
- package/dist/tools/reminders/handlers.d.ts.map +1 -0
- package/dist/tools/reminders/handlers.js +148 -0
- package/dist/tools/reminders/handlers.js.map +1 -0
- package/dist/tools/reminders/index.d.ts +11 -0
- package/dist/tools/reminders/index.d.ts.map +1 -0
- package/dist/tools/reminders/index.js +10 -0
- package/dist/tools/reminders/index.js.map +1 -0
- package/dist/tools/setup/handlers.d.ts +81 -0
- package/dist/tools/setup/handlers.d.ts.map +1 -0
- package/dist/tools/setup/handlers.js +172 -0
- package/dist/tools/setup/handlers.js.map +1 -0
- package/dist/tools/setup/index.d.ts +11 -0
- package/dist/tools/setup/index.d.ts.map +1 -0
- package/dist/tools/setup/index.js +10 -0
- package/dist/tools/setup/index.js.map +1 -0
- package/dist/tools/tasks/handlers.d.ts +95 -0
- package/dist/tools/tasks/handlers.d.ts.map +1 -0
- package/dist/tools/tasks/handlers.js +197 -0
- package/dist/tools/tasks/handlers.js.map +1 -0
- package/dist/tools/tasks/index.d.ts +11 -0
- package/dist/tools/tasks/index.d.ts.map +1 -0
- package/dist/tools/tasks/index.js +10 -0
- package/dist/tools/tasks/index.js.map +1 -0
- package/dist/tools/types.d.ts +54 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +9 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/types/calendar.d.ts +41 -0
- package/dist/types/calendar.d.ts.map +1 -0
- package/dist/types/calendar.js +18 -0
- package/dist/types/calendar.js.map +1 -0
- package/dist/utils/estimation.d.ts +34 -0
- package/dist/utils/estimation.d.ts.map +1 -1
- package/dist/utils/estimation.js +38 -1
- package/dist/utils/estimation.js.map +1 -1
- package/dist/utils/mcp-response.d.ts +89 -0
- package/dist/utils/mcp-response.d.ts.map +1 -0
- package/dist/utils/mcp-response.js +103 -0
- package/dist/utils/mcp-response.js.map +1 -0
- package/dist/utils/task-splitter.d.ts +65 -4
- package/dist/utils/task-splitter.d.ts.map +1 -1
- package/dist/utils/task-splitter.js +69 -5
- package/dist/utils/task-splitter.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/cli/http-server.d.ts +0 -74
- package/dist/cli/http-server.d.ts.map +0 -1
- package/dist/cli/http-server.js +0 -407
- package/dist/cli/http-server.js.map +0 -1
- package/dist/remote/remote-mcp-server.d.ts +0 -244
- package/dist/remote/remote-mcp-server.d.ts.map +0 -1
- package/dist/remote/remote-mcp-server.js +0 -507
- package/dist/remote/remote-mcp-server.js.map +0 -1
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup Tool Handlers
|
|
3
|
+
*
|
|
4
|
+
* Business logic for setup-related MCP tools.
|
|
5
|
+
* These handlers are decoupled from the MCP server registration
|
|
6
|
+
* to allow reuse between index.ts and mcp-handler.ts.
|
|
7
|
+
*
|
|
8
|
+
* Requirements: 1.1-1.6
|
|
9
|
+
*/
|
|
10
|
+
import { ConfigLoader } from '../../config/loader.js';
|
|
11
|
+
import { SetupWizard } from '../../setup/wizard.js';
|
|
12
|
+
import { createToolResponse, createErrorFromCatch } from '../registry.js';
|
|
13
|
+
/**
|
|
14
|
+
* check_setup_status handler
|
|
15
|
+
*
|
|
16
|
+
* Checks if sage has been configured and returns guidance.
|
|
17
|
+
* Requirement: 1.1, 1.2
|
|
18
|
+
*/
|
|
19
|
+
export async function handleCheckSetupStatus(ctx) {
|
|
20
|
+
const exists = await ConfigLoader.exists();
|
|
21
|
+
const config = ctx.getConfig();
|
|
22
|
+
const isValid = config !== null;
|
|
23
|
+
if (!exists) {
|
|
24
|
+
return createToolResponse({
|
|
25
|
+
setupComplete: false,
|
|
26
|
+
configExists: false,
|
|
27
|
+
message: 'sageの初期設定が必要です。start_setup_wizardを実行してセットアップを開始してください。',
|
|
28
|
+
nextAction: 'start_setup_wizard',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (!isValid) {
|
|
32
|
+
return createToolResponse({
|
|
33
|
+
setupComplete: false,
|
|
34
|
+
configExists: true,
|
|
35
|
+
message: '設定ファイルが見つかりましたが、読み込みに失敗しました。設定を再作成してください。',
|
|
36
|
+
nextAction: 'start_setup_wizard',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return createToolResponse({
|
|
40
|
+
setupComplete: true,
|
|
41
|
+
configExists: true,
|
|
42
|
+
userName: config?.user.name,
|
|
43
|
+
message: 'sageは設定済みです。タスク分析やリマインド設定を開始できます。',
|
|
44
|
+
availableTools: [
|
|
45
|
+
'analyze_tasks',
|
|
46
|
+
'set_reminder',
|
|
47
|
+
'find_available_slots',
|
|
48
|
+
'sync_to_notion',
|
|
49
|
+
'update_config',
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* start_setup_wizard handler
|
|
55
|
+
*
|
|
56
|
+
* Begins the interactive setup process.
|
|
57
|
+
* Requirement: 1.3
|
|
58
|
+
*/
|
|
59
|
+
export async function handleStartSetupWizard(ctx, args) {
|
|
60
|
+
const { mode = 'full' } = args;
|
|
61
|
+
const wizardSession = SetupWizard.createSession(mode);
|
|
62
|
+
ctx.setWizardSession(wizardSession);
|
|
63
|
+
const question = SetupWizard.getCurrentQuestion(wizardSession);
|
|
64
|
+
return createToolResponse({
|
|
65
|
+
sessionId: wizardSession.sessionId,
|
|
66
|
+
currentStep: wizardSession.currentStep,
|
|
67
|
+
totalSteps: wizardSession.totalSteps,
|
|
68
|
+
progress: Math.round((wizardSession.currentStep / wizardSession.totalSteps) * 100),
|
|
69
|
+
question: {
|
|
70
|
+
id: question.id,
|
|
71
|
+
text: question.text,
|
|
72
|
+
type: question.type,
|
|
73
|
+
options: question.options,
|
|
74
|
+
defaultValue: question.defaultValue,
|
|
75
|
+
helpText: question.helpText,
|
|
76
|
+
},
|
|
77
|
+
message: 'セットアップを開始します。以下の質問に回答してください。',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* answer_wizard_question handler
|
|
82
|
+
*
|
|
83
|
+
* Answers a setup wizard question and returns next question.
|
|
84
|
+
* Requirement: 1.3, 1.4
|
|
85
|
+
*/
|
|
86
|
+
export async function handleAnswerWizardQuestion(ctx, args) {
|
|
87
|
+
const { questionId, answer } = args;
|
|
88
|
+
const wizardSession = ctx.getWizardSession();
|
|
89
|
+
if (!wizardSession) {
|
|
90
|
+
return createToolResponse({
|
|
91
|
+
error: true,
|
|
92
|
+
message: 'セットアップセッションが見つかりません。start_setup_wizardを実行してください。',
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const result = SetupWizard.answerQuestion(wizardSession, questionId, answer);
|
|
96
|
+
if (!result.success) {
|
|
97
|
+
return createToolResponse({
|
|
98
|
+
error: true,
|
|
99
|
+
message: result.error,
|
|
100
|
+
currentQuestion: result.currentQuestion,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (result.isComplete) {
|
|
104
|
+
return createToolResponse({
|
|
105
|
+
isComplete: true,
|
|
106
|
+
sessionId: wizardSession.sessionId,
|
|
107
|
+
answers: wizardSession.answers,
|
|
108
|
+
message: 'すべての質問に回答しました。save_configを実行して設定を保存してください。',
|
|
109
|
+
nextAction: 'save_config',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const nextQuestion = SetupWizard.getCurrentQuestion(wizardSession);
|
|
113
|
+
return createToolResponse({
|
|
114
|
+
success: true,
|
|
115
|
+
currentStep: wizardSession.currentStep,
|
|
116
|
+
totalSteps: wizardSession.totalSteps,
|
|
117
|
+
progress: Math.round((wizardSession.currentStep / wizardSession.totalSteps) * 100),
|
|
118
|
+
question: {
|
|
119
|
+
id: nextQuestion.id,
|
|
120
|
+
text: nextQuestion.text,
|
|
121
|
+
type: nextQuestion.type,
|
|
122
|
+
options: nextQuestion.options,
|
|
123
|
+
defaultValue: nextQuestion.defaultValue,
|
|
124
|
+
helpText: nextQuestion.helpText,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* save_config handler
|
|
130
|
+
*
|
|
131
|
+
* Saves the configuration from the setup wizard.
|
|
132
|
+
* Requirement: 1.4, 1.5, 1.6
|
|
133
|
+
*/
|
|
134
|
+
export async function handleSaveConfig(ctx, args) {
|
|
135
|
+
const { confirm } = args;
|
|
136
|
+
if (!confirm) {
|
|
137
|
+
return createToolResponse({
|
|
138
|
+
saved: false,
|
|
139
|
+
message: '設定の保存がキャンセルされました。',
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
const wizardSession = ctx.getWizardSession();
|
|
143
|
+
if (!wizardSession) {
|
|
144
|
+
return createToolResponse({
|
|
145
|
+
error: true,
|
|
146
|
+
message: 'セットアップセッションが見つかりません。start_setup_wizardを実行してください。',
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
try {
|
|
150
|
+
const newConfig = SetupWizard.buildConfig(wizardSession);
|
|
151
|
+
await ConfigLoader.save(newConfig);
|
|
152
|
+
ctx.setConfig(newConfig);
|
|
153
|
+
ctx.setWizardSession(null);
|
|
154
|
+
ctx.initializeServices(newConfig);
|
|
155
|
+
return createToolResponse({
|
|
156
|
+
saved: true,
|
|
157
|
+
configPath: ConfigLoader.getConfigPath(),
|
|
158
|
+
userName: newConfig.user.name,
|
|
159
|
+
message: `設定を保存しました。${newConfig.user.name}さん、sageをご利用いただきありがとうございます!`,
|
|
160
|
+
availableTools: [
|
|
161
|
+
'analyze_tasks',
|
|
162
|
+
'set_reminder',
|
|
163
|
+
'find_available_slots',
|
|
164
|
+
'sync_to_notion',
|
|
165
|
+
],
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
return createErrorFromCatch('設定の保存に失敗しました', error);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../src/tools/setup/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAkB1E;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,GAAiB;IAC5D,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC;IAC3C,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAEhC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,kBAAkB,CAAC;YACxB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,KAAK;YACnB,OAAO,EACL,wDAAwD;YAC1D,UAAU,EAAE,oBAAoB;SACjC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,kBAAkB,CAAC;YACxB,a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EAAE;gBACd,eAAe;gBACf,cAAc;gBACd,sBAAsB;gBACtB,gBAAgB;aACjB;SACF,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,oBAAoB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup Tools Module
|
|
3
|
+
*
|
|
4
|
+
* Exports setup-related tool handlers for reuse between
|
|
5
|
+
* index.ts (stdio transport) and mcp-handler.ts (HTTP transport).
|
|
6
|
+
*
|
|
7
|
+
* Requirements: 1.1-1.6
|
|
8
|
+
*/
|
|
9
|
+
export type { SetupContext, WizardSession } from './handlers.js';
|
|
10
|
+
export { handleCheckSetupStatus, handleStartSetupWizard, handleAnswerWizardQuestion, handleSaveConfig, } from './handlers.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/setup/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup Tools Module
|
|
3
|
+
*
|
|
4
|
+
* Exports setup-related tool handlers for reuse between
|
|
5
|
+
* index.ts (stdio transport) and mcp-handler.ts (HTTP transport).
|
|
6
|
+
*
|
|
7
|
+
* Requirements: 1.1-1.6
|
|
8
|
+
*/
|
|
9
|
+
export { handleCheckSetupStatus, handleStartSetupWizard, handleAnswerWizardQuestion, handleSaveConfig, } from './handlers.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/setup/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Tool Handlers
|
|
3
|
+
*
|
|
4
|
+
* Business logic for task-related MCP tools.
|
|
5
|
+
* These handlers are decoupled from the MCP server registration
|
|
6
|
+
* to allow reuse between index.ts and mcp-handler.ts.
|
|
7
|
+
*
|
|
8
|
+
* Requirements: 2.1-2.6, 3.1-3.2, 4.1-4.5, 12.5, 12.6
|
|
9
|
+
*/
|
|
10
|
+
import type { UserConfig } from '../../types/index.js';
|
|
11
|
+
import type { TodoListManager } from '../../integrations/todo-list-manager.js';
|
|
12
|
+
import type { TaskSynchronizer } from '../../integrations/task-synchronizer.js';
|
|
13
|
+
/**
|
|
14
|
+
* Task context containing shared state and services
|
|
15
|
+
*/
|
|
16
|
+
export interface TaskToolsContext {
|
|
17
|
+
getConfig: () => UserConfig | null;
|
|
18
|
+
getTodoListManager: () => TodoListManager | null;
|
|
19
|
+
getTaskSynchronizer: () => TaskSynchronizer | null;
|
|
20
|
+
initializeServices: (config: UserConfig) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Input type for analyze_tasks
|
|
24
|
+
*/
|
|
25
|
+
export interface AnalyzeTasksInput {
|
|
26
|
+
tasks: Array<{
|
|
27
|
+
title: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
deadline?: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Input type for update_task_status
|
|
34
|
+
*/
|
|
35
|
+
export interface UpdateTaskStatusInput {
|
|
36
|
+
taskId: string;
|
|
37
|
+
status: 'not_started' | 'in_progress' | 'completed' | 'cancelled';
|
|
38
|
+
source: 'apple_reminders' | 'notion' | 'manual';
|
|
39
|
+
syncAcrossSources?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Input type for detect_duplicates
|
|
43
|
+
*/
|
|
44
|
+
export interface DetectDuplicatesInput {
|
|
45
|
+
autoMerge?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* analyze_tasks handler
|
|
49
|
+
*
|
|
50
|
+
* Analyzes tasks and provides prioritization, time estimation, and stakeholder identification.
|
|
51
|
+
* Requirement: 2.1-2.6, 3.1-3.2, 4.1-4.5
|
|
52
|
+
*/
|
|
53
|
+
export declare function handleAnalyzeTasks(ctx: TaskToolsContext, args: AnalyzeTasksInput): Promise<{
|
|
54
|
+
content: {
|
|
55
|
+
type: "text";
|
|
56
|
+
text: string;
|
|
57
|
+
}[];
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* update_task_status handler
|
|
61
|
+
*
|
|
62
|
+
* Updates the status of a task in Apple Reminders or Notion.
|
|
63
|
+
* Requirement: 12.5, 12.6
|
|
64
|
+
*/
|
|
65
|
+
export declare function handleUpdateTaskStatus(ctx: TaskToolsContext, args: UpdateTaskStatusInput): Promise<{
|
|
66
|
+
content: {
|
|
67
|
+
type: "text";
|
|
68
|
+
text: string;
|
|
69
|
+
}[];
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* sync_tasks handler
|
|
73
|
+
*
|
|
74
|
+
* Synchronizes tasks between Apple Reminders and Notion.
|
|
75
|
+
* Requirement: 12.6
|
|
76
|
+
*/
|
|
77
|
+
export declare function handleSyncTasks(ctx: TaskToolsContext): Promise<{
|
|
78
|
+
content: {
|
|
79
|
+
type: "text";
|
|
80
|
+
text: string;
|
|
81
|
+
}[];
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* detect_duplicates handler
|
|
85
|
+
*
|
|
86
|
+
* Detects duplicate tasks between Apple Reminders and Notion.
|
|
87
|
+
* Requirement: 12.5
|
|
88
|
+
*/
|
|
89
|
+
export declare function handleDetectDuplicates(ctx: TaskToolsContext, args: DetectDuplicatesInput): Promise<{
|
|
90
|
+
content: {
|
|
91
|
+
type: "text";
|
|
92
|
+
text: string;
|
|
93
|
+
}[];
|
|
94
|
+
}>;
|
|
95
|
+
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/tools/tasks/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAGhF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC;IACnC,kBAAkB,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IACjD,mBAAmB,EAAE,MAAM,gBAAgB,GAAG,IAAI,CAAC;IACnD,kBAAkB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,KAAK,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,aAAa,GAAG,aAAa,GAAG,WAAW,GAAG,WAAW,CAAC;IAClE,MAAM,EAAE,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAChD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,iBAAiB;;;;;GAiCxB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,qBAAqB;;;;;GAiD5B;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,gBAAgB;;;;;GAmC1D;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,qBAAqB;;;;;GAkE5B"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Tool Handlers
|
|
3
|
+
*
|
|
4
|
+
* Business logic for task-related MCP tools.
|
|
5
|
+
* These handlers are decoupled from the MCP server registration
|
|
6
|
+
* to allow reuse between index.ts and mcp-handler.ts.
|
|
7
|
+
*
|
|
8
|
+
* Requirements: 2.1-2.6, 3.1-3.2, 4.1-4.5, 12.5, 12.6
|
|
9
|
+
*/
|
|
10
|
+
import { TaskAnalyzer } from '../analyze-tasks.js';
|
|
11
|
+
import { createToolResponse, createErrorFromCatch } from '../registry.js';
|
|
12
|
+
/**
|
|
13
|
+
* analyze_tasks handler
|
|
14
|
+
*
|
|
15
|
+
* Analyzes tasks and provides prioritization, time estimation, and stakeholder identification.
|
|
16
|
+
* Requirement: 2.1-2.6, 3.1-3.2, 4.1-4.5
|
|
17
|
+
*/
|
|
18
|
+
export async function handleAnalyzeTasks(ctx, args) {
|
|
19
|
+
const config = ctx.getConfig();
|
|
20
|
+
if (!config) {
|
|
21
|
+
return createToolResponse({
|
|
22
|
+
error: true,
|
|
23
|
+
message: 'sageが設定されていません。check_setup_statusを実行してください。',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const result = await TaskAnalyzer.analyzeTasks(args.tasks, config);
|
|
28
|
+
return createToolResponse({
|
|
29
|
+
success: true,
|
|
30
|
+
summary: result.summary,
|
|
31
|
+
tasks: result.analyzedTasks.map((t) => ({
|
|
32
|
+
title: t.original.title,
|
|
33
|
+
description: t.original.description,
|
|
34
|
+
deadline: t.original.deadline,
|
|
35
|
+
priority: t.priority,
|
|
36
|
+
estimatedMinutes: t.estimatedMinutes,
|
|
37
|
+
stakeholders: t.stakeholders,
|
|
38
|
+
tags: t.tags,
|
|
39
|
+
reasoning: t.reasoning,
|
|
40
|
+
suggestedReminders: t.suggestedReminders,
|
|
41
|
+
})),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
return createErrorFromCatch('タスク分析に失敗しました', error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* update_task_status handler
|
|
50
|
+
*
|
|
51
|
+
* Updates the status of a task in Apple Reminders or Notion.
|
|
52
|
+
* Requirement: 12.5, 12.6
|
|
53
|
+
*/
|
|
54
|
+
export async function handleUpdateTaskStatus(ctx, args) {
|
|
55
|
+
const { taskId, status, source, syncAcrossSources } = args;
|
|
56
|
+
const config = ctx.getConfig();
|
|
57
|
+
if (!config) {
|
|
58
|
+
return createToolResponse({
|
|
59
|
+
error: true,
|
|
60
|
+
message: 'sageが設定されていません。check_setup_statusを実行してください。',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
let todoListManager = ctx.getTodoListManager();
|
|
64
|
+
if (!todoListManager) {
|
|
65
|
+
ctx.initializeServices(config);
|
|
66
|
+
todoListManager = ctx.getTodoListManager();
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
const result = await todoListManager.updateTaskStatus(taskId, status, source);
|
|
70
|
+
if (!result.success) {
|
|
71
|
+
return createToolResponse({
|
|
72
|
+
success: false,
|
|
73
|
+
taskId,
|
|
74
|
+
error: result.error,
|
|
75
|
+
message: `タスクステータスの更新に失敗しました: ${result.error}`,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
// Optionally sync across sources
|
|
79
|
+
let syncResult;
|
|
80
|
+
if (syncAcrossSources) {
|
|
81
|
+
syncResult = await todoListManager.syncTaskAcrossSources(taskId);
|
|
82
|
+
}
|
|
83
|
+
return createToolResponse({
|
|
84
|
+
success: true,
|
|
85
|
+
taskId,
|
|
86
|
+
newStatus: status,
|
|
87
|
+
updatedFields: result.updatedFields,
|
|
88
|
+
syncedSources: result.syncedSources,
|
|
89
|
+
syncResult: syncAcrossSources ? syncResult : undefined,
|
|
90
|
+
message: `タスクのステータスを「${status}」に更新しました。`,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
return createErrorFromCatch('タスクステータスの更新に失敗しました', error);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* sync_tasks handler
|
|
99
|
+
*
|
|
100
|
+
* Synchronizes tasks between Apple Reminders and Notion.
|
|
101
|
+
* Requirement: 12.6
|
|
102
|
+
*/
|
|
103
|
+
export async function handleSyncTasks(ctx) {
|
|
104
|
+
const config = ctx.getConfig();
|
|
105
|
+
if (!config) {
|
|
106
|
+
return createToolResponse({
|
|
107
|
+
error: true,
|
|
108
|
+
message: 'sageが設定されていません。check_setup_statusを実行してください。',
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
let taskSynchronizer = ctx.getTaskSynchronizer();
|
|
112
|
+
if (!taskSynchronizer) {
|
|
113
|
+
ctx.initializeServices(config);
|
|
114
|
+
taskSynchronizer = ctx.getTaskSynchronizer();
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
const result = await taskSynchronizer.syncAllTasks();
|
|
118
|
+
return createToolResponse({
|
|
119
|
+
success: true,
|
|
120
|
+
totalTasks: result.totalTasks,
|
|
121
|
+
syncedTasks: result.syncedTasks,
|
|
122
|
+
conflicts: result.conflicts,
|
|
123
|
+
errors: result.errors,
|
|
124
|
+
durationMs: result.duration,
|
|
125
|
+
message: result.conflicts.length > 0
|
|
126
|
+
? `${result.syncedTasks}件のタスクを同期しました。${result.conflicts.length}件の競合が検出されました。`
|
|
127
|
+
: `${result.syncedTasks}件のタスクを同期しました。`,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
return createErrorFromCatch('タスク同期に失敗しました', error);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* detect_duplicates handler
|
|
136
|
+
*
|
|
137
|
+
* Detects duplicate tasks between Apple Reminders and Notion.
|
|
138
|
+
* Requirement: 12.5
|
|
139
|
+
*/
|
|
140
|
+
export async function handleDetectDuplicates(ctx, args) {
|
|
141
|
+
const { autoMerge } = args;
|
|
142
|
+
const config = ctx.getConfig();
|
|
143
|
+
if (!config) {
|
|
144
|
+
return createToolResponse({
|
|
145
|
+
error: true,
|
|
146
|
+
message: 'sageが設定されていません。check_setup_statusを実行してください。',
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
let taskSynchronizer = ctx.getTaskSynchronizer();
|
|
150
|
+
if (!taskSynchronizer) {
|
|
151
|
+
ctx.initializeServices(config);
|
|
152
|
+
taskSynchronizer = ctx.getTaskSynchronizer();
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
const duplicates = await taskSynchronizer.detectDuplicates();
|
|
156
|
+
// Format duplicates for display
|
|
157
|
+
const formattedDuplicates = duplicates.map((d) => ({
|
|
158
|
+
tasks: d.tasks.map((t) => ({
|
|
159
|
+
id: t.id,
|
|
160
|
+
title: t.title,
|
|
161
|
+
source: t.source,
|
|
162
|
+
status: t.status,
|
|
163
|
+
priority: t.priority,
|
|
164
|
+
})),
|
|
165
|
+
similarity: Math.round(d.similarity * 100),
|
|
166
|
+
confidence: d.confidence,
|
|
167
|
+
suggestedMerge: {
|
|
168
|
+
title: d.suggestedMerge.title,
|
|
169
|
+
priority: d.suggestedMerge.priority,
|
|
170
|
+
status: d.suggestedMerge.status,
|
|
171
|
+
tags: d.suggestedMerge.tags,
|
|
172
|
+
},
|
|
173
|
+
}));
|
|
174
|
+
// Auto-merge high-confidence duplicates if requested
|
|
175
|
+
let mergeResults;
|
|
176
|
+
if (autoMerge) {
|
|
177
|
+
const highConfidenceDuplicates = duplicates.filter((d) => d.confidence === 'high');
|
|
178
|
+
if (highConfidenceDuplicates.length > 0) {
|
|
179
|
+
mergeResults =
|
|
180
|
+
await taskSynchronizer.mergeDuplicates(highConfidenceDuplicates);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return createToolResponse({
|
|
184
|
+
success: true,
|
|
185
|
+
duplicatesFound: duplicates.length,
|
|
186
|
+
duplicates: formattedDuplicates,
|
|
187
|
+
mergeResults: autoMerge ? mergeResults : undefined,
|
|
188
|
+
message: duplicates.length > 0
|
|
189
|
+
? `${duplicates.length}件の重複タスクが検出されました。`
|
|
190
|
+
: '重複タスクは見つかりませんでした。',
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
return createErrorFromCatch('重複検出に失敗しました', error);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../src/tools/tasks/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAwC1E;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAAqB,EACrB,IAAuB;IAEvB,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;IAE/B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,kBAAkB,CAAC;YACxB,KAAK,EAAE,I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AAS,EAAE,CAAC;YACd,MAAM,wBAAwB,GAAG,UAAU,CAAC,MAAM,CAChD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,CAC/B,CAAC;YACF,IAAI,wBAAwB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxC,YAAY;oBACV,MAAM,gBAAiB,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;QAED,OAAO,kBAAkB,CAAC;YACxB,OAAO,EAAE,IAAI;YACb,eAAe,EAAE,UAAU,CAAC,MAAM;YAClC,UAAU,EAAE,mBAAmB;YAC/B,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;YAClD,OAAO,EACL,UAAU,CAAC,MAAM,GAAG,CAAC;gBACnB,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,kBAAkB;gBACxC,CAAC,CAAC,mBAAmB;SAC1B,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,oBAAoB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Tools Module
|
|
3
|
+
*
|
|
4
|
+
* Exports task-related tool handlers for reuse between
|
|
5
|
+
* index.ts (stdio transport) and mcp-handler.ts (HTTP transport).
|
|
6
|
+
*
|
|
7
|
+
* Requirements: 2.1-2.6, 3.1-3.2, 4.1-4.5, 12.5, 12.6
|
|
8
|
+
*/
|
|
9
|
+
export type { TaskToolsContext, AnalyzeTasksInput, UpdateTaskStatusInput, DetectDuplicatesInput, } from './handlers.js';
|
|
10
|
+
export { handleAnalyzeTasks, handleUpdateTaskStatus, handleSyncTasks, handleDetectDuplicates, } from './handlers.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/tasks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,GACvB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Tools Module
|
|
3
|
+
*
|
|
4
|
+
* Exports task-related tool handlers for reuse between
|
|
5
|
+
* index.ts (stdio transport) and mcp-handler.ts (HTTP transport).
|
|
6
|
+
*
|
|
7
|
+
* Requirements: 2.1-2.6, 3.1-3.2, 4.1-4.5, 12.5, 12.6
|
|
8
|
+
*/
|
|
9
|
+
export { handleAnalyzeTasks, handleUpdateTaskStatus, handleSyncTasks, handleDetectDuplicates, } from './handlers.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/tasks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,GACvB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Types
|
|
3
|
+
*
|
|
4
|
+
* Common type definitions for MCP tool handlers.
|
|
5
|
+
* These types provide documentation and organization
|
|
6
|
+
* for tool implementations.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* MCP Tool Response content item
|
|
10
|
+
*/
|
|
11
|
+
export interface ToolResponseContent {
|
|
12
|
+
type: 'text';
|
|
13
|
+
text: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* MCP Tool Response
|
|
17
|
+
*
|
|
18
|
+
* Standard response format for all MCP tools.
|
|
19
|
+
*/
|
|
20
|
+
export interface ToolResponse {
|
|
21
|
+
content: ToolResponseContent[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Tool category for organization
|
|
25
|
+
*/
|
|
26
|
+
export type ToolCategory = 'setup' | 'config' | 'tasks' | 'calendar' | 'reminders' | 'todos' | 'integrations';
|
|
27
|
+
/**
|
|
28
|
+
* Tool metadata for documentation
|
|
29
|
+
*/
|
|
30
|
+
export interface ToolMetadata {
|
|
31
|
+
/** Tool category */
|
|
32
|
+
category: ToolCategory;
|
|
33
|
+
/** Requirement IDs this tool implements */
|
|
34
|
+
requirements?: string[];
|
|
35
|
+
/** Related tools */
|
|
36
|
+
relatedTools?: string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Service dependencies that tools may need
|
|
40
|
+
*
|
|
41
|
+
* Tools receive these services to avoid global state.
|
|
42
|
+
*/
|
|
43
|
+
export interface ToolServices {
|
|
44
|
+
config: import('../types/index.js').UserConfig | null;
|
|
45
|
+
reminderManager: import('../integrations/reminder-manager.js').ReminderManager | null;
|
|
46
|
+
calendarService: import('../integrations/calendar-service.js').CalendarService | null;
|
|
47
|
+
calendarSourceManager: import('../integrations/calendar-source-manager.js').CalendarSourceManager | null;
|
|
48
|
+
notionService: import('../integrations/notion-mcp.js').NotionMCPService | null;
|
|
49
|
+
todoListManager: import('../integrations/todo-list-manager.js').TodoListManager | null;
|
|
50
|
+
taskSynchronizer: import('../integrations/task-synchronizer.js').TaskSynchronizer | null;
|
|
51
|
+
calendarEventResponseService: import('../integrations/calendar-event-response.js').CalendarEventResponseService | null;
|
|
52
|
+
workingCadenceService: import('../services/working-cadence.js').WorkingCadenceService | null;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":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../src/tools/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar Service Common Types
|
|
3
|
+
*
|
|
4
|
+
* Shared type definitions for calendar event services
|
|
5
|
+
* (creator, deleter, response).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Supported platform types for calendar operations
|
|
9
|
+
*/
|
|
10
|
+
export type CalendarPlatform = 'macos' | 'ios' | 'ipados' | 'web' | 'unknown';
|
|
11
|
+
/**
|
|
12
|
+
* Base platform info shared by all calendar services
|
|
13
|
+
*/
|
|
14
|
+
export interface CalendarPlatformInfo {
|
|
15
|
+
platform: CalendarPlatform;
|
|
16
|
+
hasEventKitAccess: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Calendar type identifiers
|
|
20
|
+
*/
|
|
21
|
+
export type CalendarType = 'google' | 'icloud' | 'exchange' | 'local';
|
|
22
|
+
/**
|
|
23
|
+
* Participant status in calendar events
|
|
24
|
+
*/
|
|
25
|
+
export type EventParticipantStatus = 'accepted' | 'declined' | 'tentative' | 'pending' | 'unknown';
|
|
26
|
+
/**
|
|
27
|
+
* Event response types
|
|
28
|
+
*/
|
|
29
|
+
export type EventResponseType = 'accept' | 'decline' | 'tentative';
|
|
30
|
+
/**
|
|
31
|
+
* Default retry options for calendar operations
|
|
32
|
+
*
|
|
33
|
+
* Used by creator, deleter, and response services for
|
|
34
|
+
* consistent retry behavior with AppleScript/EventKit.
|
|
35
|
+
*/
|
|
36
|
+
export declare const CALENDAR_RETRY_OPTIONS: {
|
|
37
|
+
readonly maxAttempts: 3;
|
|
38
|
+
readonly initialDelay: 500;
|
|
39
|
+
readonly maxDelay: 5000;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=calendar.d.ts.map
|