@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.
Files changed (110) hide show
  1. package/dist/cli/mcp-handler.d.ts.map +1 -1
  2. package/dist/cli/mcp-handler.js +141 -987
  3. package/dist/cli/mcp-handler.js.map +1 -1
  4. package/dist/config/update-validation.d.ts +52 -0
  5. package/dist/config/update-validation.d.ts.map +1 -0
  6. package/dist/config/update-validation.js +133 -0
  7. package/dist/config/update-validation.js.map +1 -0
  8. package/dist/index.js +163 -1815
  9. package/dist/index.js.map +1 -1
  10. package/dist/integrations/calendar-event-creator.d.ts +2 -3
  11. package/dist/integrations/calendar-event-creator.d.ts.map +1 -1
  12. package/dist/integrations/calendar-event-creator.js +3 -4
  13. package/dist/integrations/calendar-event-creator.js.map +1 -1
  14. package/dist/integrations/calendar-event-deleter.d.ts +2 -3
  15. package/dist/integrations/calendar-event-deleter.d.ts.map +1 -1
  16. package/dist/integrations/calendar-event-deleter.js +3 -4
  17. package/dist/integrations/calendar-event-deleter.js.map +1 -1
  18. package/dist/integrations/calendar-event-response.d.ts +4 -17
  19. package/dist/integrations/calendar-event-response.d.ts.map +1 -1
  20. package/dist/integrations/calendar-event-response.js +3 -4
  21. package/dist/integrations/calendar-event-response.js.map +1 -1
  22. package/dist/integrations/notion-mcp.d.ts +28 -3
  23. package/dist/integrations/notion-mcp.d.ts.map +1 -1
  24. package/dist/integrations/notion-mcp.js +21 -5
  25. package/dist/integrations/notion-mcp.js.map +1 -1
  26. package/dist/integrations/reminder-manager.d.ts.map +1 -1
  27. package/dist/integrations/reminder-manager.js +2 -0
  28. package/dist/integrations/reminder-manager.js.map +1 -1
  29. package/dist/services/container.d.ts +56 -0
  30. package/dist/services/container.d.ts.map +1 -0
  31. package/dist/services/container.js +76 -0
  32. package/dist/services/container.js.map +1 -0
  33. package/dist/tools/calendar/handlers.d.ts +186 -0
  34. package/dist/tools/calendar/handlers.d.ts.map +1 -0
  35. package/dist/tools/calendar/handlers.js +525 -0
  36. package/dist/tools/calendar/handlers.js.map +1 -0
  37. package/dist/tools/calendar/index.d.ts +11 -0
  38. package/dist/tools/calendar/index.d.ts.map +1 -0
  39. package/dist/tools/calendar/index.js +10 -0
  40. package/dist/tools/calendar/index.js.map +1 -0
  41. package/dist/tools/index.d.ts +23 -0
  42. package/dist/tools/index.d.ts.map +1 -0
  43. package/dist/tools/index.js +24 -0
  44. package/dist/tools/index.js.map +1 -0
  45. package/dist/tools/integrations/handlers.d.ts +57 -0
  46. package/dist/tools/integrations/handlers.d.ts.map +1 -0
  47. package/dist/tools/integrations/handlers.js +159 -0
  48. package/dist/tools/integrations/handlers.js.map +1 -0
  49. package/dist/tools/integrations/index.d.ts +11 -0
  50. package/dist/tools/integrations/index.d.ts.map +1 -0
  51. package/dist/tools/integrations/index.js +10 -0
  52. package/dist/tools/integrations/index.js.map +1 -0
  53. package/dist/tools/registry.d.ts +8 -0
  54. package/dist/tools/registry.d.ts.map +1 -0
  55. package/dist/tools/registry.js +10 -0
  56. package/dist/tools/registry.js.map +1 -0
  57. package/dist/tools/reminders/handlers.d.ts +61 -0
  58. package/dist/tools/reminders/handlers.d.ts.map +1 -0
  59. package/dist/tools/reminders/handlers.js +148 -0
  60. package/dist/tools/reminders/handlers.js.map +1 -0
  61. package/dist/tools/reminders/index.d.ts +11 -0
  62. package/dist/tools/reminders/index.d.ts.map +1 -0
  63. package/dist/tools/reminders/index.js +10 -0
  64. package/dist/tools/reminders/index.js.map +1 -0
  65. package/dist/tools/setup/handlers.d.ts +81 -0
  66. package/dist/tools/setup/handlers.d.ts.map +1 -0
  67. package/dist/tools/setup/handlers.js +172 -0
  68. package/dist/tools/setup/handlers.js.map +1 -0
  69. package/dist/tools/setup/index.d.ts +11 -0
  70. package/dist/tools/setup/index.d.ts.map +1 -0
  71. package/dist/tools/setup/index.js +10 -0
  72. package/dist/tools/setup/index.js.map +1 -0
  73. package/dist/tools/tasks/handlers.d.ts +95 -0
  74. package/dist/tools/tasks/handlers.d.ts.map +1 -0
  75. package/dist/tools/tasks/handlers.js +197 -0
  76. package/dist/tools/tasks/handlers.js.map +1 -0
  77. package/dist/tools/tasks/index.d.ts +11 -0
  78. package/dist/tools/tasks/index.d.ts.map +1 -0
  79. package/dist/tools/tasks/index.js +10 -0
  80. package/dist/tools/tasks/index.js.map +1 -0
  81. package/dist/tools/types.d.ts +54 -0
  82. package/dist/tools/types.d.ts.map +1 -0
  83. package/dist/tools/types.js +9 -0
  84. package/dist/tools/types.js.map +1 -0
  85. package/dist/types/calendar.d.ts +41 -0
  86. package/dist/types/calendar.d.ts.map +1 -0
  87. package/dist/types/calendar.js +18 -0
  88. package/dist/types/calendar.js.map +1 -0
  89. package/dist/utils/estimation.d.ts +34 -0
  90. package/dist/utils/estimation.d.ts.map +1 -1
  91. package/dist/utils/estimation.js +38 -1
  92. package/dist/utils/estimation.js.map +1 -1
  93. package/dist/utils/mcp-response.d.ts +89 -0
  94. package/dist/utils/mcp-response.d.ts.map +1 -0
  95. package/dist/utils/mcp-response.js +103 -0
  96. package/dist/utils/mcp-response.js.map +1 -0
  97. package/dist/utils/task-splitter.d.ts +65 -4
  98. package/dist/utils/task-splitter.d.ts.map +1 -1
  99. package/dist/utils/task-splitter.js +69 -5
  100. package/dist/utils/task-splitter.js.map +1 -1
  101. package/dist/version.js +1 -1
  102. package/package.json +1 -1
  103. package/dist/cli/http-server.d.ts +0 -74
  104. package/dist/cli/http-server.d.ts.map +0 -1
  105. package/dist/cli/http-server.js +0 -407
  106. package/dist/cli/http-server.js.map +0 -1
  107. package/dist/remote/remote-mcp-server.d.ts +0 -244
  108. package/dist/remote/remote-mcp-server.d.ts.map +0 -1
  109. package/dist/remote/remote-mcp-server.js +0 -507
  110. package/dist/remote/remote-mcp-server.js.map +0 -1
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Integration Tool Handlers
3
+ *
4
+ * Business logic for integration-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: 8.1-8.5, 10.1-10.6
9
+ */
10
+ import type { UserConfig } from '../../types/index.js';
11
+ import type { NotionMCPService } from '../../integrations/notion-mcp.js';
12
+ /**
13
+ * Integration context containing shared state and services
14
+ */
15
+ export interface IntegrationToolsContext {
16
+ getConfig: () => UserConfig | null;
17
+ setConfig: (config: UserConfig) => void;
18
+ getNotionService: () => NotionMCPService | null;
19
+ initializeServices: (config: UserConfig) => void;
20
+ }
21
+ export interface SyncToNotionInput {
22
+ taskTitle: string;
23
+ description?: string;
24
+ priority?: 'P0' | 'P1' | 'P2' | 'P3';
25
+ dueDate?: string;
26
+ stakeholders?: string[];
27
+ estimatedMinutes?: number;
28
+ }
29
+ export interface UpdateConfigInput {
30
+ section: 'user' | 'calendar' | 'priorityRules' | 'integrations' | 'team' | 'preferences';
31
+ updates: Record<string, unknown>;
32
+ }
33
+ /**
34
+ * sync_to_notion handler
35
+ *
36
+ * Sync a task to Notion database for long-term tracking.
37
+ * Requirement: 8.1-8.5
38
+ */
39
+ export declare function handleSyncToNotion(ctx: IntegrationToolsContext, args: SyncToNotionInput): Promise<{
40
+ content: {
41
+ type: "text";
42
+ text: string;
43
+ }[];
44
+ }>;
45
+ /**
46
+ * update_config handler
47
+ *
48
+ * Update sage configuration settings.
49
+ * Requirement: 10.1-10.6
50
+ */
51
+ export declare function handleUpdateConfig(ctx: IntegrationToolsContext, args: UpdateConfigInput): Promise<{
52
+ content: {
53
+ type: "text";
54
+ text: string;
55
+ }[];
56
+ }>;
57
+ //# sourceMappingURL=handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/tools/integrations/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAY,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAQzE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,gBAAgB,EAAE,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAChD,kBAAkB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CAClD;AAMD,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EACH,MAAM,GACN,UAAU,GACV,eAAe,GACf,cAAc,GACd,MAAM,GACN,aAAa,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAMD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,uBAAuB,EAC5B,IAAI,EAAE,iBAAiB;;;;;GAiHxB;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,uBAAuB,EAC5B,IAAI,EAAE,iBAAiB;;;;;GA6CxB"}
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Integration Tool Handlers
3
+ *
4
+ * Business logic for integration-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: 8.1-8.5, 10.1-10.6
9
+ */
10
+ import { ConfigLoader } from '../../config/loader.js';
11
+ import { validateConfigUpdate, applyConfigUpdates, } from '../../config/update-validation.js';
12
+ import { createToolResponse, createErrorFromCatch } from '../registry.js';
13
+ // ============================================================
14
+ // Handler Functions
15
+ // ============================================================
16
+ /**
17
+ * sync_to_notion handler
18
+ *
19
+ * Sync a task to Notion database for long-term tracking.
20
+ * Requirement: 8.1-8.5
21
+ */
22
+ export async function handleSyncToNotion(ctx, args) {
23
+ const { taskTitle, description, priority, dueDate, stakeholders, estimatedMinutes, } = args;
24
+ const config = ctx.getConfig();
25
+ if (!config) {
26
+ return createToolResponse({
27
+ error: true,
28
+ message: 'sageが設定されていません。check_setup_statusを実行してください。',
29
+ });
30
+ }
31
+ if (!config.integrations.notion.enabled) {
32
+ return createToolResponse({
33
+ error: true,
34
+ message: 'Notion統合が有効になっていません。update_configでNotion設定を更新してください。',
35
+ });
36
+ }
37
+ let notionService = ctx.getNotionService();
38
+ if (!notionService) {
39
+ ctx.initializeServices(config);
40
+ notionService = ctx.getNotionService();
41
+ }
42
+ try {
43
+ // Check if Notion MCP is available
44
+ const isAvailable = await notionService.isAvailable();
45
+ // Build properties for Notion page
46
+ const properties = notionService.buildNotionProperties({
47
+ title: taskTitle,
48
+ priority: priority,
49
+ deadline: dueDate,
50
+ stakeholders,
51
+ estimatedMinutes,
52
+ description,
53
+ });
54
+ if (!isAvailable) {
55
+ // Generate fallback template for manual copy
56
+ const fallbackText = notionService.generateFallbackTemplate({
57
+ title: taskTitle,
58
+ priority: priority,
59
+ deadline: dueDate,
60
+ stakeholders,
61
+ estimatedMinutes,
62
+ description,
63
+ });
64
+ return createToolResponse({
65
+ success: false,
66
+ method: 'fallback',
67
+ message: 'Notion MCP統合が利用できません。以下のテンプレートを手動でNotionにコピーしてください。',
68
+ fallbackText,
69
+ task: {
70
+ taskTitle,
71
+ priority: priority ?? 'P3',
72
+ dueDate,
73
+ stakeholders: stakeholders ?? [],
74
+ estimatedMinutes,
75
+ },
76
+ });
77
+ }
78
+ // Create page in Notion via MCP
79
+ const result = await notionService.createPage({
80
+ databaseId: config.integrations.notion.databaseId,
81
+ title: taskTitle,
82
+ properties,
83
+ });
84
+ if (result.success) {
85
+ return createToolResponse({
86
+ success: true,
87
+ method: 'mcp',
88
+ pageId: result.pageId,
89
+ pageUrl: result.pageUrl,
90
+ message: `Notionにタスクを同期しました: ${taskTitle}`,
91
+ });
92
+ }
93
+ // MCP call failed, provide fallback
94
+ const fallbackText = notionService.generateFallbackTemplate({
95
+ title: taskTitle,
96
+ priority: priority,
97
+ deadline: dueDate,
98
+ stakeholders,
99
+ estimatedMinutes,
100
+ description,
101
+ });
102
+ return createToolResponse({
103
+ success: false,
104
+ method: 'fallback',
105
+ error: result.error,
106
+ message: 'Notion MCP呼び出しに失敗しました。以下のテンプレートを手動でコピーしてください。',
107
+ fallbackText,
108
+ });
109
+ }
110
+ catch (error) {
111
+ return createErrorFromCatch('Notion同期に失敗しました', error);
112
+ }
113
+ }
114
+ /**
115
+ * update_config handler
116
+ *
117
+ * Update sage configuration settings.
118
+ * Requirement: 10.1-10.6
119
+ */
120
+ export async function handleUpdateConfig(ctx, args) {
121
+ const { section, updates } = args;
122
+ const config = ctx.getConfig();
123
+ if (!config) {
124
+ return createToolResponse({
125
+ error: true,
126
+ message: 'sageが設定されていません。check_setup_statusを実行してください。',
127
+ });
128
+ }
129
+ try {
130
+ // Validate section-specific updates
131
+ const validationResult = validateConfigUpdate(section, updates);
132
+ if (!validationResult.valid) {
133
+ return createToolResponse({
134
+ error: true,
135
+ message: `設定の検証に失敗しました: ${validationResult.error}`,
136
+ invalidFields: validationResult.invalidFields,
137
+ });
138
+ }
139
+ // Apply updates to config
140
+ const updatedConfig = applyConfigUpdates(config, section, updates);
141
+ // Save the updated config
142
+ await ConfigLoader.save(updatedConfig);
143
+ ctx.setConfig(updatedConfig);
144
+ // Re-initialize services if integrations changed
145
+ if (section === 'integrations') {
146
+ ctx.initializeServices(updatedConfig);
147
+ }
148
+ return createToolResponse({
149
+ success: true,
150
+ section,
151
+ updatedFields: Object.keys(updates),
152
+ message: `設定を更新しました: ${section}`,
153
+ });
154
+ }
155
+ catch (error) {
156
+ return createErrorFromCatch('設定の更新に失敗しました', error);
157
+ }
158
+ }
159
+ //# sourceMappingURL=handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../src/tools/integrations/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAoC1E,+DAA+D;AAC/D,oBAAoB;AACpB,+DAA+D;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAA4B,EAC5B,IAAuB;IAEvB,MAAM,EACJ,SAAS,EACT,WAAW,EACX,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,gBAAgB,GACjB,GAAG,IAAI,CAAC;IACT,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;IAE/B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,kBAAkB,CAAC;YACxB,KAAK,EAAE,IAAI;YACX,OAAO,EACL,6CAA6C;SAChD,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACxC,OAAO,kBAAkB,CAAC;YACxB,KAAK,EAAE,IAAI;YACX,OAAO,EACL,sDAAsD;SACzD,CAAC,CAAC;IACL,CAAC;IAED,IAAI,aAAa,GAAG,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC3C,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,GAAG,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC/B,aAAa,GAAG,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACzC,CAAC;IAED,IAAI,CAAC;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O,EAAE,OAAO,CAAC,CAAC;QAEnE,0BAA0B;QAC1B,MAAM,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACvC,GAAG,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QAE7B,iDAAiD;QACjD,IAAI,OAAO,KAAK,cAAc,EAAE,CAAC;YAC/B,GAAG,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,kBAAkB,CAAC;YACxB,OAAO,EAAE,IAAI;YACb,OAAO;YACP,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;YACnC,OAAO,EAAE,cAAc,OAAO,EAAE;SACjC,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
+ * Integration Tools Module
3
+ *
4
+ * Exports integration-related tool handlers for reuse between
5
+ * index.ts (stdio transport) and mcp-handler.ts (HTTP transport).
6
+ *
7
+ * Requirements: 8.1-8.5, 10.1-10.6
8
+ */
9
+ export type { IntegrationToolsContext, SyncToNotionInput, UpdateConfigInput, } from './handlers.js';
10
+ export { handleSyncToNotion, handleUpdateConfig } from './handlers.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/integrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Integration Tools Module
3
+ *
4
+ * Exports integration-related tool handlers for reuse between
5
+ * index.ts (stdio transport) and mcp-handler.ts (HTTP transport).
6
+ *
7
+ * Requirements: 8.1-8.5, 10.1-10.6
8
+ */
9
+ export { handleSyncToNotion, handleUpdateConfig } from './handlers.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/integrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Tool Registry
3
+ *
4
+ * Helper functions for tool response creation.
5
+ * Re-exports from mcp-response.ts for convenience.
6
+ */
7
+ export { createResponse as createToolResponse, createErrorResponse, createErrorFromCatch, createSuccessResponse, getErrorMessage, } from '../utils/mcp-response.js';
8
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EACL,cAAc,IAAI,kBAAkB,EACpC,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,GAChB,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Tool Registry
3
+ *
4
+ * Helper functions for tool response creation.
5
+ * Re-exports from mcp-response.ts for convenience.
6
+ */
7
+ // Re-export response utilities from mcp-response
8
+ // These are the primary utilities for tool handlers
9
+ export { createResponse as createToolResponse, createErrorResponse, createErrorFromCatch, createSuccessResponse, getErrorMessage, } from '../utils/mcp-response.js';
10
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,iDAAiD;AACjD,oDAAoD;AACpD,OAAO,EACL,cAAc,IAAI,kBAAkB,EACpC,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,GAChB,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Reminder & Todo Tool Handlers
3
+ *
4
+ * Business logic for reminder and todo-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: 5.1-5.6, 12.1-12.8
9
+ */
10
+ import type { UserConfig } from '../../types/index.js';
11
+ import type { ReminderManager } from '../../integrations/reminder-manager.js';
12
+ import type { TodoListManager } from '../../integrations/todo-list-manager.js';
13
+ /**
14
+ * Reminder/Todo context containing shared state and services
15
+ */
16
+ export interface ReminderTodoContext {
17
+ getConfig: () => UserConfig | null;
18
+ getReminderManager: () => ReminderManager | null;
19
+ getTodoListManager: () => TodoListManager | null;
20
+ initializeServices: (config: UserConfig) => void;
21
+ }
22
+ export interface SetReminderInput {
23
+ taskTitle: string;
24
+ dueDate?: string;
25
+ reminderType?: '1_hour_before' | '3_hours_before' | '1_day_before' | '3_days_before' | '1_week_before';
26
+ list?: string;
27
+ priority?: 'P0' | 'P1' | 'P2' | 'P3';
28
+ notes?: string;
29
+ }
30
+ export interface ListTodosInput {
31
+ priority?: Array<'P0' | 'P1' | 'P2' | 'P3'>;
32
+ status?: Array<'not_started' | 'in_progress' | 'completed' | 'cancelled'>;
33
+ source?: Array<'apple_reminders' | 'notion' | 'manual'>;
34
+ todayOnly?: boolean;
35
+ tags?: string[];
36
+ }
37
+ /**
38
+ * set_reminder handler
39
+ *
40
+ * Set a reminder for a task in Apple Reminders or Notion.
41
+ * Requirement: 5.1-5.6
42
+ */
43
+ export declare function handleSetReminder(ctx: ReminderTodoContext, args: SetReminderInput): Promise<{
44
+ content: {
45
+ type: "text";
46
+ text: string;
47
+ }[];
48
+ }>;
49
+ /**
50
+ * list_todos handler
51
+ *
52
+ * List TODO items from Apple Reminders and Notion with optional filtering.
53
+ * Requirement: 12.1, 12.2, 12.3, 12.4, 12.7, 12.8
54
+ */
55
+ export declare function handleListTodos(ctx: ReminderTodoContext, args: ListTodosInput): Promise<{
56
+ content: {
57
+ type: "text";
58
+ text: string;
59
+ }[];
60
+ }>;
61
+ //# sourceMappingURL=handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/tools/reminders/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAY,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG/E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC;IACnC,kBAAkB,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IACjD,kBAAkB,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IACjD,kBAAkB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CAClD;AAMD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EACT,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,eAAe,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,aAAa,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;IAC1E,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAMD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,mBAAmB,EACxB,IAAI,EAAE,gBAAgB;;;;;GAsEvB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,mBAAmB,EACxB,IAAI,EAAE,cAAc;;;;;GAiErB"}
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Reminder & Todo Tool Handlers
3
+ *
4
+ * Business logic for reminder and todo-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: 5.1-5.6, 12.1-12.8
9
+ */
10
+ import { createToolResponse, createErrorFromCatch } from '../registry.js';
11
+ // ============================================================
12
+ // Handler Functions
13
+ // ============================================================
14
+ /**
15
+ * set_reminder handler
16
+ *
17
+ * Set a reminder for a task in Apple Reminders or Notion.
18
+ * Requirement: 5.1-5.6
19
+ */
20
+ export async function handleSetReminder(ctx, args) {
21
+ const { taskTitle, dueDate, reminderType, list, priority, notes } = args;
22
+ const config = ctx.getConfig();
23
+ if (!config) {
24
+ return createToolResponse({
25
+ error: true,
26
+ message: 'sageが設定されていません。check_setup_statusを実行してください。',
27
+ });
28
+ }
29
+ let reminderManager = ctx.getReminderManager();
30
+ if (!reminderManager) {
31
+ ctx.initializeServices(config);
32
+ reminderManager = ctx.getReminderManager();
33
+ }
34
+ try {
35
+ const result = await reminderManager.setReminder({
36
+ taskTitle,
37
+ targetDate: dueDate,
38
+ reminderType,
39
+ list: list ?? config.integrations.appleReminders.defaultList,
40
+ priority: priority,
41
+ notes,
42
+ });
43
+ if (result.success) {
44
+ // Check if this is a delegation request for Notion
45
+ if (result.delegateToNotion && result.notionRequest) {
46
+ return createToolResponse({
47
+ success: true,
48
+ destination: 'notion_mcp',
49
+ method: 'delegate',
50
+ delegateToNotion: true,
51
+ notionRequest: result.notionRequest,
52
+ message: `Notionへの追加はClaude Codeが直接notion-create-pagesツールを使用してください。`,
53
+ instruction: `notion-create-pagesツールを以下のパラメータで呼び出してください:
54
+ - parent: { "type": "data_source_id", "data_source_id": "${result.notionRequest.databaseId.replace(/-/g, '')}" }
55
+ - pages: [{ "properties": ${JSON.stringify(result.notionRequest.properties)} }]`,
56
+ });
57
+ }
58
+ return createToolResponse({
59
+ success: true,
60
+ destination: result.destination,
61
+ method: result.method,
62
+ reminderId: result.reminderId,
63
+ reminderUrl: result.reminderUrl ?? result.pageUrl,
64
+ message: result.destination === 'apple_reminders'
65
+ ? `Apple Remindersにリマインダーを作成しました: ${taskTitle}`
66
+ : `Notionにタスクを作成しました: ${taskTitle}`,
67
+ });
68
+ }
69
+ return createToolResponse({
70
+ success: false,
71
+ destination: result.destination,
72
+ error: result.error,
73
+ fallbackText: result.fallbackText,
74
+ message: result.fallbackText
75
+ ? '自動作成に失敗しました。以下のテキストを手動でコピーしてください。'
76
+ : `リマインダー作成に失敗しました: ${result.error}`,
77
+ });
78
+ }
79
+ catch (error) {
80
+ return createErrorFromCatch('リマインダー設定に失敗しました', error);
81
+ }
82
+ }
83
+ /**
84
+ * list_todos handler
85
+ *
86
+ * List TODO items from Apple Reminders and Notion with optional filtering.
87
+ * Requirement: 12.1, 12.2, 12.3, 12.4, 12.7, 12.8
88
+ */
89
+ export async function handleListTodos(ctx, args) {
90
+ const { priority, status, source, todayOnly, tags } = args;
91
+ const config = ctx.getConfig();
92
+ if (!config) {
93
+ return createToolResponse({
94
+ error: true,
95
+ message: 'sageが設定されていません。check_setup_statusを実行してください。',
96
+ });
97
+ }
98
+ let todoListManager = ctx.getTodoListManager();
99
+ if (!todoListManager) {
100
+ ctx.initializeServices(config);
101
+ todoListManager = ctx.getTodoListManager();
102
+ }
103
+ try {
104
+ let todos;
105
+ if (todayOnly) {
106
+ todos = await todoListManager.getTodaysTasks();
107
+ }
108
+ else {
109
+ todos = await todoListManager.listTodos({
110
+ priority: priority,
111
+ status,
112
+ source,
113
+ tags,
114
+ });
115
+ }
116
+ // Format todos for display
117
+ const formattedTodos = todos.map((todo) => ({
118
+ id: todo.id,
119
+ title: todo.title,
120
+ priority: todo.priority,
121
+ status: todo.status,
122
+ dueDate: todo.dueDate,
123
+ source: todo.source,
124
+ tags: todo.tags,
125
+ estimatedMinutes: todo.estimatedMinutes,
126
+ stakeholders: todo.stakeholders,
127
+ }));
128
+ return createToolResponse({
129
+ success: true,
130
+ totalCount: todos.length,
131
+ todos: formattedTodos,
132
+ message: todos.length > 0
133
+ ? `${todos.length}件のタスクが見つかりました。`
134
+ : 'タスクが見つかりませんでした。',
135
+ filters: {
136
+ priority,
137
+ status,
138
+ source,
139
+ todayOnly,
140
+ tags,
141
+ },
142
+ });
143
+ }
144
+ catch (error) {
145
+ return createErrorFromCatch('TODOリストの取得に失敗しました', error);
146
+ }
147
+ }
148
+ //# sourceMappingURL=handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../src/tools/reminders/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAsC1E,+DAA+D;AAC/D,oBAAoB;AACpB,+DAA+D;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAwB,EACxB,IAAsB;IAEtB,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACzE,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;IAE/B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,kBAAkB,CAAC;YACxB,KAAK,EAAE,IAAI;YACX,OAAO,EACL,6CAA6C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dio transport) and mcp-handler.ts (HTTP transport).
6
+ *
7
+ * Requirements: 5.1-5.6, 12.1-12.8
8
+ */
9
+ export type { ReminderTodoContext, SetReminderInput, ListTodosInput, } from './handlers.js';
10
+ export { handleSetReminder, handleListTodos } from './handlers.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/reminders/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,GACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Reminder & Todo Tools Module
3
+ *
4
+ * Exports reminder and todo-related tool handlers for reuse between
5
+ * index.ts (stdio transport) and mcp-handler.ts (HTTP transport).
6
+ *
7
+ * Requirements: 5.1-5.6, 12.1-12.8
8
+ */
9
+ export { handleSetReminder, handleListTodos } from './handlers.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/reminders/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,81 @@
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 { SetupWizard } from '../../setup/wizard.js';
11
+ import type { UserConfig } from '../../types/index.js';
12
+ /**
13
+ * Wizard session type (from SetupWizard)
14
+ */
15
+ export type WizardSession = ReturnType<typeof SetupWizard.createSession>;
16
+ /**
17
+ * Setup context containing shared state
18
+ */
19
+ export interface SetupContext {
20
+ getConfig: () => UserConfig | null;
21
+ setConfig: (config: UserConfig) => void;
22
+ getWizardSession: () => WizardSession | null;
23
+ setWizardSession: (session: WizardSession | null) => void;
24
+ initializeServices: (config: UserConfig) => void;
25
+ }
26
+ /**
27
+ * check_setup_status handler
28
+ *
29
+ * Checks if sage has been configured and returns guidance.
30
+ * Requirement: 1.1, 1.2
31
+ */
32
+ export declare function handleCheckSetupStatus(ctx: SetupContext): Promise<{
33
+ content: {
34
+ type: "text";
35
+ text: string;
36
+ }[];
37
+ }>;
38
+ /**
39
+ * start_setup_wizard handler
40
+ *
41
+ * Begins the interactive setup process.
42
+ * Requirement: 1.3
43
+ */
44
+ export declare function handleStartSetupWizard(ctx: SetupContext, args: {
45
+ mode?: 'full' | 'quick';
46
+ }): Promise<{
47
+ content: {
48
+ type: "text";
49
+ text: string;
50
+ }[];
51
+ }>;
52
+ /**
53
+ * answer_wizard_question handler
54
+ *
55
+ * Answers a setup wizard question and returns next question.
56
+ * Requirement: 1.3, 1.4
57
+ */
58
+ export declare function handleAnswerWizardQuestion(ctx: SetupContext, args: {
59
+ questionId: string;
60
+ answer: string | string[];
61
+ }): Promise<{
62
+ content: {
63
+ type: "text";
64
+ text: string;
65
+ }[];
66
+ }>;
67
+ /**
68
+ * save_config handler
69
+ *
70
+ * Saves the configuration from the setup wizard.
71
+ * Requirement: 1.4, 1.5, 1.6
72
+ */
73
+ export declare function handleSaveConfig(ctx: SetupContext, args: {
74
+ confirm: boolean;
75
+ }): Promise<{
76
+ content: {
77
+ type: "text";
78
+ text: string;
79
+ }[];
80
+ }>;
81
+ //# sourceMappingURL=handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/tools/setup/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,C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