@laylzj777/my-apple-apple-eventkit 1.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.
- package/CHANGELOG.md +575 -0
- package/LICENSE +21 -0
- package/README.md +304 -0
- package/README.zh-CN.md +270 -0
- package/bin/event +0 -0
- package/bin/event-disclaim +0 -0
- package/dist/bin/apple-calendar.d.ts +6 -0
- package/dist/bin/apple-calendar.js +8 -0
- package/dist/bin/apple-calendar.js.map +1 -0
- package/dist/bin/apple-reminders.d.ts +7 -0
- package/dist/bin/apple-reminders.js +9 -0
- package/dist/bin/apple-reminders.js.map +1 -0
- package/dist/bootstrap.d.ts +11 -0
- package/dist/bootstrap.js +44 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/server/handlers.d.ts +12 -0
- package/dist/server/handlers.js +58 -0
- package/dist/server/handlers.js.map +1 -0
- package/dist/server/mode.d.ts +19 -0
- package/dist/server/mode.js +47 -0
- package/dist/server/mode.js.map +1 -0
- package/dist/server/promptAbstractions.d.ts +61 -0
- package/dist/server/promptAbstractions.js +140 -0
- package/dist/server/promptAbstractions.js.map +1 -0
- package/dist/server/prompts.d.ts +13 -0
- package/dist/server/prompts.js +461 -0
- package/dist/server/prompts.js.map +1 -0
- package/dist/server/server.d.ts +61 -0
- package/dist/server/server.js +112 -0
- package/dist/server/server.js.map +1 -0
- package/dist/tools/definitions.d.ts +9 -0
- package/dist/tools/definitions.js +272 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/handlers/calendarHandlers.d.ts +11 -0
- package/dist/tools/handlers/calendarHandlers.js +151 -0
- package/dist/tools/handlers/calendarHandlers.js.map +1 -0
- package/dist/tools/handlers/formatters.d.ts +24 -0
- package/dist/tools/handlers/formatters.js +105 -0
- package/dist/tools/handlers/formatters.js.map +1 -0
- package/dist/tools/handlers/index.d.ts +8 -0
- package/dist/tools/handlers/index.js +9 -0
- package/dist/tools/handlers/index.js.map +1 -0
- package/dist/tools/handlers/listHandlers.d.ts +10 -0
- package/dist/tools/handlers/listHandlers.js +47 -0
- package/dist/tools/handlers/listHandlers.js.map +1 -0
- package/dist/tools/handlers/reminderHandlers.d.ts +10 -0
- package/dist/tools/handlers/reminderHandlers.js +219 -0
- package/dist/tools/handlers/reminderHandlers.js.map +1 -0
- package/dist/tools/handlers/shared.d.ts +28 -0
- package/dist/tools/handlers/shared.js +57 -0
- package/dist/tools/handlers/shared.js.map +1 -0
- package/dist/tools/handlers/subtaskHandlers.d.ts +12 -0
- package/dist/tools/handlers/subtaskHandlers.js +113 -0
- package/dist/tools/handlers/subtaskHandlers.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.js +74 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types/index.d.ts +263 -0
- package/dist/types/index.js +42 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/prompts.d.ts +88 -0
- package/dist/types/prompts.js +6 -0
- package/dist/types/prompts.js.map +1 -0
- package/dist/types/repository.d.ts +197 -0
- package/dist/types/repository.js +14 -0
- package/dist/types/repository.js.map +1 -0
- package/dist/utils/binaryValidator.d.ts +52 -0
- package/dist/utils/binaryValidator.js +185 -0
- package/dist/utils/binaryValidator.js.map +1 -0
- package/dist/utils/calendarRepository.d.ts +49 -0
- package/dist/utils/calendarRepository.js +226 -0
- package/dist/utils/calendarRepository.js.map +1 -0
- package/dist/utils/constants.d.ts +79 -0
- package/dist/utils/constants.js +80 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/dateFiltering.d.ts +41 -0
- package/dist/utils/dateFiltering.js +129 -0
- package/dist/utils/dateFiltering.js.map +1 -0
- package/dist/utils/dateUtils.d.ts +27 -0
- package/dist/utils/dateUtils.js +71 -0
- package/dist/utils/dateUtils.js.map +1 -0
- package/dist/utils/errorHandling.d.ts +27 -0
- package/dist/utils/errorHandling.js +88 -0
- package/dist/utils/errorHandling.js.map +1 -0
- package/dist/utils/eventCli.d.ts +40 -0
- package/dist/utils/eventCli.js +294 -0
- package/dist/utils/eventCli.js.map +1 -0
- package/dist/utils/helpers.d.ts +35 -0
- package/dist/utils/helpers.js +61 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/looseDateParser.d.ts +19 -0
- package/dist/utils/looseDateParser.js +149 -0
- package/dist/utils/looseDateParser.js.map +1 -0
- package/dist/utils/projectUtils.d.ts +13 -0
- package/dist/utils/projectUtils.js +92 -0
- package/dist/utils/projectUtils.js.map +1 -0
- package/dist/utils/reminderDateParser.d.ts +8 -0
- package/dist/utils/reminderDateParser.js +89 -0
- package/dist/utils/reminderDateParser.js.map +1 -0
- package/dist/utils/reminderRepository.d.ts +33 -0
- package/dist/utils/reminderRepository.js +262 -0
- package/dist/utils/reminderRepository.js.map +1 -0
- package/dist/utils/subtaskUtils.d.ts +103 -0
- package/dist/utils/subtaskUtils.js +253 -0
- package/dist/utils/subtaskUtils.js.map +1 -0
- package/dist/utils/tagUtils.d.ts +58 -0
- package/dist/utils/tagUtils.js +177 -0
- package/dist/utils/tagUtils.js.map +1 -0
- package/dist/utils/timeHelpers.d.ts +40 -0
- package/dist/utils/timeHelpers.js +136 -0
- package/dist/utils/timeHelpers.js.map +1 -0
- package/dist/validation/schemas.d.ts +385 -0
- package/dist/validation/schemas.js +579 -0
- package/dist/validation/schemas.js.map +1 -0
- package/package.json +96 -0
- package/scripts/build-event.mjs +513 -0
- package/scripts/disclaim.c +69 -0
- package/scripts/event-Info.plist +29 -0
- package/scripts/event.entitlements +10 -0
- package/scripts/postinstall.mjs +91 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bootstrap.ts(fork 增量)
|
|
3
|
+
* 共享启动逻辑:读 package.json → 解析子模块模式 → 起 MCP server。
|
|
4
|
+
* 三个入口共用:index.ts(缺省 all)、bin/apple-calendar.ts、bin/apple-reminders.ts。
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync } from 'node:fs';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { parseServerModeFlag } from './server/mode.js';
|
|
9
|
+
import { startServer } from './server/server.js';
|
|
10
|
+
import { findProjectRoot } from './utils/projectUtils.js';
|
|
11
|
+
/**
|
|
12
|
+
* 启动 server。`fixedMode` 是 bin shim 钉死的模式;显式 `--mode` 参数优先于它
|
|
13
|
+
* (便于调试时用同一个 bin 切模式)。
|
|
14
|
+
*/
|
|
15
|
+
export function runServer(fixedMode) {
|
|
16
|
+
let mode;
|
|
17
|
+
try {
|
|
18
|
+
mode = parseServerModeFlag(process.argv) ?? fixedMode ?? 'all';
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
22
|
+
process.stderr.write(`${message}\n`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
// Find project root and load package.json
|
|
26
|
+
const projectRoot = findProjectRoot();
|
|
27
|
+
let packageJson;
|
|
28
|
+
try {
|
|
29
|
+
packageJson = JSON.parse(readFileSync(join(projectRoot, 'package.json'), 'utf-8'));
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
33
|
+
throw new Error(`Failed to parse package.json: ${detail}`);
|
|
34
|
+
}
|
|
35
|
+
// Start the application
|
|
36
|
+
startServer({
|
|
37
|
+
name: packageJson.name,
|
|
38
|
+
version: packageJson.version,
|
|
39
|
+
mode,
|
|
40
|
+
}).catch(() => {
|
|
41
|
+
process.exit(1);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EA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O;QAC5B,IAAI;KACL,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* index.ts
|
|
4
|
+
* Entry point for the Apple Reminders MCP server
|
|
5
|
+
*
|
|
6
|
+
* fork:缺省 'all' 模式(上游兼容,暴露全部工具),支持 `--mode calendar|reminders`
|
|
7
|
+
* 切子模块;产品分发走 bin/apple-calendar.ts、bin/apple-reminders.ts 两个钉死
|
|
8
|
+
* 模式的入口(见 server/mode.ts)。
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* index.ts
|
|
4
|
+
* Entry point for the Apple Reminders MCP server
|
|
5
|
+
*
|
|
6
|
+
* fork:缺省 'all' 模式(上游兼容,暴露全部工具),支持 `--mode calendar|reminders`
|
|
7
|
+
* 切子模块;产品分发走 bin/apple-calendar.ts、bin/apple-reminders.ts 两个钉死
|
|
8
|
+
* 模式的入口(见 server/mode.ts)。
|
|
9
|
+
*/
|
|
10
|
+
import { runServer } from './bootstrap.js';
|
|
11
|
+
runServer();
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* server/handlers.ts
|
|
3
|
+
* Request handlers for the MCP server
|
|
4
|
+
*/
|
|
5
|
+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
6
|
+
import { type ServerMode } from './mode.js';
|
|
7
|
+
/**
|
|
8
|
+
* Registers all request handlers for the MCP server
|
|
9
|
+
* @param server - The MCP server instance
|
|
10
|
+
* @param mode - 子模块模式(fork):按域过滤工具/prompts,越界调用给出指路错误
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerHandlers(server: Server, mode: ServerMode): void;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* server/handlers.ts
|
|
3
|
+
* Request handlers for the MCP server
|
|
4
|
+
*/
|
|
5
|
+
import { CallToolRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
import { handleToolCall } from '../tools/index.js';
|
|
7
|
+
import { isToolAllowedInMode } from './mode.js';
|
|
8
|
+
import { buildPromptResponse, getPromptDefinition, getPromptListForMode, } from './prompts.js';
|
|
9
|
+
import { getToolsForMode } from './server.js';
|
|
10
|
+
/**
|
|
11
|
+
* Registers all request handlers for the MCP server
|
|
12
|
+
* @param server - The MCP server instance
|
|
13
|
+
* @param mode - 子模块模式(fork):按域过滤工具/prompts,越界调用给出指路错误
|
|
14
|
+
*/
|
|
15
|
+
export function registerHandlers(server, mode) {
|
|
16
|
+
// Handler for listing available tools
|
|
17
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
18
|
+
tools: getToolsForMode(mode),
|
|
19
|
+
}));
|
|
20
|
+
// Handler for calling a tool
|
|
21
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
22
|
+
const { name } = request.params;
|
|
23
|
+
// 域守卫:list 里没有 ≠ 调不到——防串域调用(如日历 server 被喊去改提醒),
|
|
24
|
+
// 错误文案指明该去哪个 server,模型可自纠。
|
|
25
|
+
if (!isToolAllowedInMode(name, mode)) {
|
|
26
|
+
const otherServer = mode === 'calendar' ? 'reminders' : 'calendar';
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: 'text',
|
|
31
|
+
text: `Tool "${name}" is not available on this server (mode: ${mode}). It belongs to the ${otherServer} MCP server — call it there instead.`,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
isError: true,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return handleToolCall(name, request.params.arguments ?? {});
|
|
38
|
+
});
|
|
39
|
+
// Handler for listing available prompts
|
|
40
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
41
|
+
prompts: getPromptListForMode(mode),
|
|
42
|
+
}));
|
|
43
|
+
// Handler for getting a specific prompt
|
|
44
|
+
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
45
|
+
// `name` is required by `GetPromptRequestSchema` and already validated by
|
|
46
|
+
// the SDK before reaching this handler — no defensive guard needed.
|
|
47
|
+
const { name, arguments: args } = request.params;
|
|
48
|
+
// 与 ListPrompts 同一份按域清单:calendar 模式下所有工作流 prompt 均不暴露。
|
|
49
|
+
const promptDefinition = getPromptListForMode(mode).some((p) => p.name === name)
|
|
50
|
+
? getPromptDefinition(name)
|
|
51
|
+
: undefined;
|
|
52
|
+
if (!promptDefinition) {
|
|
53
|
+
throw new Error(`Unknown prompt: ${name}`);
|
|
54
|
+
}
|
|
55
|
+
return buildPromptResponse(promptDefinition, args);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/server/handlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAQnD,OAAO,EAAE,mBAAmB,EAAmB,MAAM,WAAW,CA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E,KAAK,EAAE,OAAO,EAAE,EAAE;QACjE,0EAA0E;QAC1E,oEAAoE;QACpE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QAEjD,uDAAuD;QACvD,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC,IAAI,CACtD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CACvB;YACC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC;YAC3B,CAAC,CAAC,SAAS,CAAC;QAEd,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,mBAAmB,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* server/mode.ts(fork 增量)
|
|
3
|
+
* 子模块运行模式:同一个包按启动命令拆成「日历」「提醒事项」两个 MCP server,
|
|
4
|
+
* 各自只暴露本域工具——TCC 授权(日历/提醒是两个独立系统权限)随之天然分开,
|
|
5
|
+
* 上层连接器可以按域单独引导授权。
|
|
6
|
+
*
|
|
7
|
+
* 模式来源(优先级从高到低):
|
|
8
|
+
* 1. 显式 `--mode calendar|reminders|all` / `--mode=xxx`
|
|
9
|
+
* 2. bin 入口 shim 传入的固定模式(apple-calendar-mcp / apple-reminders-mcp)
|
|
10
|
+
* 3. 缺省 'all'(上游兼容:单 server 暴露全部工具)
|
|
11
|
+
*/
|
|
12
|
+
export type ServerMode = 'all' | 'calendar' | 'reminders';
|
|
13
|
+
/**
|
|
14
|
+
* 从 argv 解析 `--mode`。非法取值直接抛错(启动期 fail-fast,MCP 宿主能在
|
|
15
|
+
* stderr 看到原因),未提供返回 undefined 交由调用方兜底。
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseServerModeFlag(argv: readonly string[]): ServerMode | undefined;
|
|
18
|
+
/** 工具按名字前缀归域:calendar_* 归日历,其余(reminders_*)归提醒。 */
|
|
19
|
+
export declare function isToolAllowedInMode(toolName: string, mode: ServerMode): boolean;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* server/mode.ts(fork 增量)
|
|
3
|
+
* 子模块运行模式:同一个包按启动命令拆成「日历」「提醒事项」两个 MCP server,
|
|
4
|
+
* 各自只暴露本域工具——TCC 授权(日历/提醒是两个独立系统权限)随之天然分开,
|
|
5
|
+
* 上层连接器可以按域单独引导授权。
|
|
6
|
+
*
|
|
7
|
+
* 模式来源(优先级从高到低):
|
|
8
|
+
* 1. 显式 `--mode calendar|reminders|all` / `--mode=xxx`
|
|
9
|
+
* 2. bin 入口 shim 传入的固定模式(apple-calendar-mcp / apple-reminders-mcp)
|
|
10
|
+
* 3. 缺省 'all'(上游兼容:单 server 暴露全部工具)
|
|
11
|
+
*/
|
|
12
|
+
const VALID_MODES = ['all', 'calendar', 'reminders'];
|
|
13
|
+
const isServerMode = (value) => VALID_MODES.includes(value);
|
|
14
|
+
/**
|
|
15
|
+
* 从 argv 解析 `--mode`。非法取值直接抛错(启动期 fail-fast,MCP 宿主能在
|
|
16
|
+
* stderr 看到原因),未提供返回 undefined 交由调用方兜底。
|
|
17
|
+
*/
|
|
18
|
+
export function parseServerModeFlag(argv) {
|
|
19
|
+
for (let i = 0; i < argv.length; i++) {
|
|
20
|
+
const arg = argv[i];
|
|
21
|
+
if (arg === undefined)
|
|
22
|
+
continue;
|
|
23
|
+
let raw;
|
|
24
|
+
if (arg === '--mode') {
|
|
25
|
+
raw = argv[i + 1];
|
|
26
|
+
}
|
|
27
|
+
else if (arg.startsWith('--mode=')) {
|
|
28
|
+
raw = arg.slice('--mode='.length);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (raw === undefined || !isServerMode(raw)) {
|
|
34
|
+
throw new Error(`Invalid --mode "${raw ?? ''}": expected one of ${VALID_MODES.join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
return raw;
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
/** 工具按名字前缀归域:calendar_* 归日历,其余(reminders_*)归提醒。 */
|
|
41
|
+
export function isToolAllowedInMode(toolName, mode) {
|
|
42
|
+
if (mode === 'all')
|
|
43
|
+
return true;
|
|
44
|
+
const isCalendarTool = toolName.startsWith('calendar_');
|
|
45
|
+
return mode === 'calendar' ? isCalendarTool : !isCalendarTool;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode.js","sourceRoot":"","sources":["../../src/server/mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,MAAM,WAAW,GAA0B,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AAE5E,MAAM,YAAY,GAAG,CAAC,KAAa,EAAuB,EAAE,CACzD,WAAiC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAErD;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAuB;IAEvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,KAAK,SAAS;YAAE,SAAS;QAChC,IAAI,GAAuB,CAAC;QAC5B,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YACrB,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACpB,CAAC;aAAM,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACrC,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,SAAS;QACX,CAAC;QACD,IAAI,GAAG,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CACb,mBAAmB,GAAG,IAAI,EAAE,sBAAsB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC3E,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,mBAAmB,CACjC,QAAgB,EAChB,IAAgB;IAEhB,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAChC,MAAM,cAAc,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACxD,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard confidence system constraints
|
|
3
|
+
* Decision priority: (1) If scope is ambiguous → confirm, (2) Then apply confidence thresholds
|
|
4
|
+
*/
|
|
5
|
+
export declare const CONFIDENCE_CONSTRAINTS: string[];
|
|
6
|
+
/**
|
|
7
|
+
* AskUserQuestion tool usage examples
|
|
8
|
+
*/
|
|
9
|
+
export declare const ASK_USER_QUESTION_EXAMPLES: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Standard note formatting constraints (compressed from 14 lines to 5 lines)
|
|
12
|
+
*/
|
|
13
|
+
export declare const NOTE_FORMATTING_CONSTRAINTS: string[];
|
|
14
|
+
/**
|
|
15
|
+
* Standard batching and idempotency constraints
|
|
16
|
+
*/
|
|
17
|
+
export declare const BATCHING_CONSTRAINTS: string[];
|
|
18
|
+
export declare const TASK_BATCHING_CONSTRAINTS: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Standard calibration guidance for overwhelming workloads
|
|
21
|
+
*/
|
|
22
|
+
export declare const WORKLOAD_CALIBRATION: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Standard calibration for missing context
|
|
25
|
+
*/
|
|
26
|
+
export declare const CONTEXT_CALIBRATION: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Apple Reminders limitations reminder
|
|
29
|
+
*/
|
|
30
|
+
export declare const APPLE_REMINDERS_LIMITATIONS: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Core constraints applied to all prompts
|
|
33
|
+
*/
|
|
34
|
+
export declare const CORE_CONSTRAINTS: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Deep work time block execution details (trigger rules moved to TIME_BLOCK_CREATION_CONSTRAINTS)
|
|
37
|
+
*/
|
|
38
|
+
export declare const DEEP_WORK_CONSTRAINTS: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Shallow tasks time block creation guidelines
|
|
41
|
+
* Encompasses all non-deep-work activities: quick wins, routine tasks, administrative work
|
|
42
|
+
*/
|
|
43
|
+
export declare const SHALLOW_TASKS_CONSTRAINTS: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Daily capacity and workload balancing constraints
|
|
46
|
+
* Includes implicit 20% buffer time allocation
|
|
47
|
+
*/
|
|
48
|
+
export declare const DAILY_CAPACITY_CONSTRAINTS: string[];
|
|
49
|
+
/**
|
|
50
|
+
* Time format specification (single source of truth)
|
|
51
|
+
* Format includes explicit timezone offset to prevent ambiguity in containerized environments
|
|
52
|
+
*/
|
|
53
|
+
export declare const TIME_FORMAT_SPEC = "YYYY-MM-DD HH:mm:ss\u00B1HH:MM (with explicit timezone offset, e.g., \"2025-11-17 14:00:00-05:00\" for 2PM EST)";
|
|
54
|
+
/**
|
|
55
|
+
* Time block creation strict rules (includes trigger conditions from former DEEP_WORK_CONSTRAINTS)
|
|
56
|
+
*/
|
|
57
|
+
export declare const TIME_BLOCK_CREATION_CONSTRAINTS: string[];
|
|
58
|
+
export declare const buildStandardOutputFormat: (currentDate: string) => {
|
|
59
|
+
actionQueue: string[];
|
|
60
|
+
verificationLog: string;
|
|
61
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard confidence system constraints
|
|
3
|
+
* Decision priority: (1) If scope is ambiguous → confirm, (2) Then apply confidence thresholds
|
|
4
|
+
*/
|
|
5
|
+
export const CONFIDENCE_CONSTRAINTS = [
|
|
6
|
+
'Assess confidence for each action (high >80%, medium 60-80%, low <60%).',
|
|
7
|
+
'HIGH CONFIDENCE (>80%): You MUST make actual MCP tool calls immediately. Do not just describe the action - execute it by calling the reminders_tasks or reminders_lists tool with the appropriate parameters.',
|
|
8
|
+
'MEDIUM CONFIDENCE (60-80%): Provide recommendations in tool-ready format with rationale.',
|
|
9
|
+
'LOW CONFIDENCE (<60%): Use AskUserQuestion tool to present options to the user. Do not list them as text descriptions - convert them into interactive questions.',
|
|
10
|
+
'Provide brief rationale for medium-confidence actions.',
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* AskUserQuestion tool usage examples
|
|
14
|
+
*/
|
|
15
|
+
export const ASK_USER_QUESTION_EXAMPLES = [
|
|
16
|
+
'Use AskUserQuestion tool for decisions requiring user input.',
|
|
17
|
+
'Example: AskUserQuestion with options: ["Mark as complete", "Keep open", "Need more info"]',
|
|
18
|
+
'Each option should have a clear description of what will happen if selected.',
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* Standard note formatting constraints (compressed from 14 lines to 5 lines)
|
|
22
|
+
*/
|
|
23
|
+
export const NOTE_FORMATTING_CONSTRAINTS = [
|
|
24
|
+
'Edit notes only when essential and confidence >80%; user has not objected.',
|
|
25
|
+
'For new reminders, add only user-supplied context; no rationale, priority, or scheduling commentary.',
|
|
26
|
+
'Allowed lines: See: [URL], Note: [brief context], Duration: [time estimate].',
|
|
27
|
+
'Only include Note: or Duration: if the user explicitly provided them.',
|
|
28
|
+
'Never include priority/urgency labels (Priority/P0/Urgent/etc.).',
|
|
29
|
+
'No markdown; plain text only, use "-" bullets and "\\n" line breaks.',
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Standard batching and idempotency constraints
|
|
33
|
+
*/
|
|
34
|
+
export const BATCHING_CONSTRAINTS = [
|
|
35
|
+
'Run idempotency checks before creating: search for duplicates by normalized title.',
|
|
36
|
+
'Batch tool calls when executing multiple changes to reduce overhead and keep actions atomic by concern (e.g., all creates, then updates).',
|
|
37
|
+
];
|
|
38
|
+
export const TASK_BATCHING_CONSTRAINTS = [
|
|
39
|
+
'**Task batching strategy**: Group similar tasks in dedicated blocks to reduce context switching.',
|
|
40
|
+
' - Naming pattern: "Code Review Batch — 3 PRs", "Email Processing — Inbox Zero", "Admin Batch — 5 tasks"',
|
|
41
|
+
' - Avoid batching unrelated tasks that require different mental modes',
|
|
42
|
+
];
|
|
43
|
+
/**
|
|
44
|
+
* Standard calibration guidance for overwhelming workloads
|
|
45
|
+
*/
|
|
46
|
+
export const WORKLOAD_CALIBRATION = [
|
|
47
|
+
'When workload is overwhelming, prioritize critical-path tasks and defer non-essential items.',
|
|
48
|
+
'If similar tasks exist, recommend consolidation or batching.',
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* Standard calibration for missing context
|
|
52
|
+
*/
|
|
53
|
+
export const CONTEXT_CALIBRATION = [
|
|
54
|
+
'When creating reminders for unknown tasks, use clear, descriptive titles and suggest appropriate list placement.',
|
|
55
|
+
];
|
|
56
|
+
/**
|
|
57
|
+
* Apple Reminders limitations reminder
|
|
58
|
+
*/
|
|
59
|
+
export const APPLE_REMINDERS_LIMITATIONS = [
|
|
60
|
+
'Remember: Apple Reminders does not support priority fields. Do NOT add priority information to notes or titles.',
|
|
61
|
+
];
|
|
62
|
+
/**
|
|
63
|
+
* Core constraints applied to all prompts
|
|
64
|
+
*/
|
|
65
|
+
export const CORE_CONSTRAINTS = [
|
|
66
|
+
...CONFIDENCE_CONSTRAINTS,
|
|
67
|
+
...NOTE_FORMATTING_CONSTRAINTS,
|
|
68
|
+
...BATCHING_CONSTRAINTS,
|
|
69
|
+
];
|
|
70
|
+
/**
|
|
71
|
+
* Deep work time block execution details (trigger rules moved to TIME_BLOCK_CREATION_CONSTRAINTS)
|
|
72
|
+
*/
|
|
73
|
+
export const DEEP_WORK_CONSTRAINTS = [
|
|
74
|
+
'**Deep work execution details**:',
|
|
75
|
+
' - Duration: >=60 minutes; ideal 90-120; split >120.',
|
|
76
|
+
' - Schedule in peak hours (9am-12pm) when possible; max 4 hours/day.',
|
|
77
|
+
' - Breaks: 15-30 minutes between blocks; longer after 4 hours total.',
|
|
78
|
+
' - Include a clear objective in notes and anchor start time to due time minus duration.',
|
|
79
|
+
' - Naming pattern: "Deep Work — [Project Name]".',
|
|
80
|
+
];
|
|
81
|
+
/**
|
|
82
|
+
* Shallow tasks time block creation guidelines
|
|
83
|
+
* Encompasses all non-deep-work activities: quick wins, routine tasks, administrative work
|
|
84
|
+
*/
|
|
85
|
+
export const SHALLOW_TASKS_CONSTRAINTS = [
|
|
86
|
+
'**Shallow tasks time block guidelines**:',
|
|
87
|
+
' - Duration: 15-60 minutes; batch similar tasks when possible.',
|
|
88
|
+
' - Scheduling: fill gaps, use lower-energy windows (e.g., 2-4pm).',
|
|
89
|
+
' - Naming pattern: "Shallow Task — [Task Description]" or "Shallow Tasks — [Category]".',
|
|
90
|
+
];
|
|
91
|
+
/**
|
|
92
|
+
* Daily capacity and workload balancing constraints
|
|
93
|
+
* Includes implicit 20% buffer time allocation
|
|
94
|
+
*/
|
|
95
|
+
export const DAILY_CAPACITY_CONSTRAINTS = [
|
|
96
|
+
'**Daily capacity limits and workload balancing**:',
|
|
97
|
+
' - Deep Work maximum: 4 hours per day; leave ~20% buffer as natural gaps.',
|
|
98
|
+
' - Shallow tasks fill remaining time after deep work and buffer.',
|
|
99
|
+
' - Warn when overcommitted and suggest prioritization.',
|
|
100
|
+
' - Buffer time handling: Do not create explicit "Buffer Time" calendar events.',
|
|
101
|
+
];
|
|
102
|
+
/**
|
|
103
|
+
* Time format specification (single source of truth)
|
|
104
|
+
* Format includes explicit timezone offset to prevent ambiguity in containerized environments
|
|
105
|
+
*/
|
|
106
|
+
export const TIME_FORMAT_SPEC = 'YYYY-MM-DD HH:mm:ss±HH:MM (with explicit timezone offset, e.g., "2025-11-17 14:00:00-05:00" for 2PM EST)';
|
|
107
|
+
/**
|
|
108
|
+
* Time block creation strict rules (includes trigger conditions from former DEEP_WORK_CONSTRAINTS)
|
|
109
|
+
*/
|
|
110
|
+
export const TIME_BLOCK_CREATION_CONSTRAINTS = [
|
|
111
|
+
'**Time block creation triggers**: Create calendar_events blocks when tasks meet ANY criteria:',
|
|
112
|
+
' - Duration >=60 minutes due today, or deep-work keywords (development, design, analysis, planning, refactor, architecture).',
|
|
113
|
+
' - Multiple related tasks due today totaling >=60 minutes, or explicit focus/uninterrupted cues.',
|
|
114
|
+
` - Use ${TIME_FORMAT_SPEC} format for startDate and endDate.`,
|
|
115
|
+
' - Anchor start time to due time minus duration; if past, move forward but keep duration.',
|
|
116
|
+
' - Use "Deep Work — [Project]" for deep work and "Shallow Task — [Task Description]" for shallow tasks.',
|
|
117
|
+
' - Follow confidence gating (execute >80%, recommend 60-80, confirm <60).',
|
|
118
|
+
];
|
|
119
|
+
const ACTION_QUEUE_FORMAT = [
|
|
120
|
+
'### Action queue',
|
|
121
|
+
'',
|
|
122
|
+
'**HIGH CONFIDENCE (>80%)**: Execute immediately with tool calls. After execution, show:',
|
|
123
|
+
'✓ Action description',
|
|
124
|
+
' - Tool: tool_name, key parameters',
|
|
125
|
+
' - Rationale: brief reason',
|
|
126
|
+
'',
|
|
127
|
+
'**MEDIUM CONFIDENCE (60-80%)**: Recommend with tool-ready format:',
|
|
128
|
+
'- [MEDIUM, XX%] Action description',
|
|
129
|
+
' - Tool: tool_name, key parameters',
|
|
130
|
+
' - Rationale: brief reason',
|
|
131
|
+
'',
|
|
132
|
+
'**LOW CONFIDENCE (<60%)**: Use AskUserQuestion tool to present options.',
|
|
133
|
+
'',
|
|
134
|
+
` - Use ${TIME_FORMAT_SPEC} format for dueDate (e.g., "2025-11-04 18:00:00-05:00").`,
|
|
135
|
+
];
|
|
136
|
+
export const buildStandardOutputFormat = (currentDate) => ({
|
|
137
|
+
actionQueue: ACTION_QUEUE_FORMAT,
|
|
138
|
+
verificationLog: `### Verification log — bullet list confirming that each executed due date marked "today" uses ${currentDate} in the tool call output and persisted value (include reminder title + due date).`,
|
|
139
|
+
});
|
|
140
|
+
//# sourceMappingURL=promptAbstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptAbstractions.js","sourceRoot":"","sources":["../../src/server/promptAbstractions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,yEAAyE;IACzE,+MAA+M;IAC/M,0FAA0F;IAC1F,kKAAkK;IAClK,wDAAwD;CACzD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,8DAA8D;IAC9D,4FAA4F;IAC5F,8EAA8E;CAC/E,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,4EAA4E;IAC5E,sGAAsG;IACtG,8EAA8E;IAC9E,uEAAuE;IACvE,kEAAkE;IAClE,sEAAsE;CACvE,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,oFAAoF;IACpF,2IAA2I;CAC5I,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,kGAAkG;IAClG,2GAA2G;IAC3G,wEAAwE;CACzE,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,8FAA8F;IAC9F,8DAA8D;CAC/D,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,kH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,EAAE,mBAAmB;IAChC,eAAe,EAAE,iGAAiG,WAAW,mFAAmF;CACjN,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* server/prompts.ts
|
|
3
|
+
* Central registry for MCP prompts and their runtime helpers
|
|
4
|
+
*/
|
|
5
|
+
import type { PromptMetadata, PromptName, PromptResponse, PromptTemplate } from '../types/prompts.js';
|
|
6
|
+
export declare const PROMPT_LIST: PromptMetadata[];
|
|
7
|
+
/**
|
|
8
|
+
* 按子模块模式过滤 prompts(fork):现有 4 个均为提醒事项工作流(日历仅作
|
|
9
|
+
* 时间块参考),calendar 模式全部不暴露——引用不存在工具的 prompt 只会误导模型。
|
|
10
|
+
*/
|
|
11
|
+
export declare const getPromptListForMode: (mode: import("./mode.js").ServerMode) => PromptMetadata[];
|
|
12
|
+
export declare const getPromptDefinition: (name: string) => PromptTemplate<PromptName> | undefined;
|
|
13
|
+
export declare const buildPromptResponse: <Name extends PromptName>(template: PromptTemplate<Name>, rawArgs: Record<string, unknown> | null | undefined) => PromptResponse;
|