mcpal 1.2.16 → 1.3.2
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/README.md +12 -0
- package/dist/index.js +19 -13
- package/dist/index.js.map +1 -1
- package/dist/scripts/setup-notifier.d.ts +5 -1
- package/dist/scripts/setup-notifier.d.ts.map +1 -1
- package/dist/scripts/setup-notifier.js +154 -66
- package/dist/scripts/setup-notifier.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,18 @@ Add to your MCP Config:
|
|
|
17
17
|
}
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
### Claude Code
|
|
21
|
+
|
|
22
|
+
Add MCPal directly via the CLI:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Project scope (current project only)
|
|
26
|
+
claude mcp add mcpal -- npx -y mcpal
|
|
27
|
+
|
|
28
|
+
# User scope (available in all projects)
|
|
29
|
+
claude mcp add mcpal --scope user -- npx -y mcpal
|
|
30
|
+
```
|
|
31
|
+
|
|
20
32
|
## Tool: `send_notification`
|
|
21
33
|
|
|
22
34
|
Send native notifications with optional features.
|
package/dist/index.js
CHANGED
|
@@ -5,21 +5,25 @@ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
|
5
5
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
7
|
const notify_js_1 = require("./notify.js");
|
|
8
|
+
const setup_notifier_js_1 = require("./scripts/setup-notifier.js");
|
|
8
9
|
const server = new mcp_js_1.McpServer({
|
|
9
10
|
name: "mcpal",
|
|
10
11
|
version: "1.0.0",
|
|
11
12
|
}, {
|
|
12
|
-
instructions: `MCPal
|
|
13
|
-
|
|
14
|
-
IMPORTANT: When you need user input (questions, clarifications, or feedback), use reply=true to let them type a response directly in the notification. This is the fastest way to continue a conversation without switching windows.
|
|
13
|
+
instructions: `MCPal sends a friendly native desktop notifications to the user.
|
|
15
14
|
|
|
16
15
|
Use cases:
|
|
17
16
|
- Task complete → simple notification
|
|
18
17
|
- Need a decision → actions (Yes/No buttons)
|
|
19
|
-
- Need free-form input → reply=true (PREFERRED
|
|
18
|
+
- Need free-form input → reply=true (PREFERRED)
|
|
19
|
+
|
|
20
|
+
Tone: MCPal is opinionated, quirky and snarky. Use "we" instead of "I". Examples:
|
|
21
|
+
- "Should we move on to the next feature?"
|
|
22
|
+
- "We've finished the auth middleware. What's next?"
|
|
23
|
+
- "We're ready to deploy. Want us to proceed?"`,
|
|
20
24
|
});
|
|
21
25
|
server.registerTool("send_notification", {
|
|
22
|
-
description: `Send a native desktop notification. Use reply=true when
|
|
26
|
+
description: `Send a native desktop notification. Use reply=true when we need user input — they can type back without leaving their flow.`,
|
|
23
27
|
title: "MCPal Notification",
|
|
24
28
|
inputSchema: {
|
|
25
29
|
message: zod_1.z.string().describe("The notification body text"),
|
|
@@ -35,7 +39,7 @@ server.registerTool("send_notification", {
|
|
|
35
39
|
reply: zod_1.z
|
|
36
40
|
.boolean()
|
|
37
41
|
.optional()
|
|
38
|
-
.describe("RECOMMENDED: Enable text reply input. Use this when
|
|
42
|
+
.describe("RECOMMENDED: Enable text reply input. Use this when we need free-form user input — they can respond without switching windows. It's what we're here for."),
|
|
39
43
|
timeout: zod_1.z
|
|
40
44
|
.number()
|
|
41
45
|
.optional()
|
|
@@ -57,24 +61,24 @@ server.registerTool("send_notification", {
|
|
|
57
61
|
});
|
|
58
62
|
// Build a friendly response
|
|
59
63
|
const parts = [];
|
|
60
|
-
parts.push(`
|
|
64
|
+
parts.push(`Done! We got the message to the user.`);
|
|
61
65
|
parts.push(`Title: "${title ?? "MCPal"}"`);
|
|
62
66
|
parts.push(`Message: "${message}"`);
|
|
63
67
|
// Describe user's response
|
|
64
68
|
if (result.activationType === "contentsClicked") {
|
|
65
|
-
parts.push(`The user clicked the notification
|
|
69
|
+
parts.push(`The user clicked the notification. Curious one, aren't they?`);
|
|
66
70
|
}
|
|
67
71
|
else if (result.activationType === "actionClicked") {
|
|
68
|
-
parts.push(`The user clicked: ${result.response}
|
|
72
|
+
parts.push(`The user clicked: ${result.response}. Decision made!`);
|
|
69
73
|
}
|
|
70
74
|
else if (result.activationType === "replied") {
|
|
71
|
-
parts.push(`The user replied: "${result.reply}"
|
|
75
|
+
parts.push(`The user replied: "${result.reply}". Look at us, having a conversation.`);
|
|
72
76
|
}
|
|
73
77
|
else if (result.response === "timeout") {
|
|
74
|
-
parts.push(`The notification timed out
|
|
78
|
+
parts.push(`The notification timed out. They're busy. We get it.`);
|
|
75
79
|
}
|
|
76
80
|
else if (result.response === "closed") {
|
|
77
|
-
parts.push(`The user dismissed the notification.`);
|
|
81
|
+
parts.push(`The user dismissed the notification. Rude, but fair.`);
|
|
78
82
|
}
|
|
79
83
|
else {
|
|
80
84
|
parts.push(`User response: ${result.response}`);
|
|
@@ -88,7 +92,7 @@ server.registerTool("send_notification", {
|
|
|
88
92
|
content: [
|
|
89
93
|
{
|
|
90
94
|
type: "text",
|
|
91
|
-
text: `
|
|
95
|
+
text: `Well, that didn't go as planned. We couldn't deliver that notification. Error: ${error}`,
|
|
92
96
|
},
|
|
93
97
|
],
|
|
94
98
|
isError: true,
|
|
@@ -96,6 +100,8 @@ server.registerTool("send_notification", {
|
|
|
96
100
|
}
|
|
97
101
|
});
|
|
98
102
|
async function main() {
|
|
103
|
+
// Ensure MCPal.app is set up (handles npx installs where postinstall doesn't run)
|
|
104
|
+
await (0, setup_notifier_js_1.ensureMcpalAppSetup)();
|
|
99
105
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
100
106
|
await server.connect(transport);
|
|
101
107
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,oEAAoE;AACpE,wEAAiF;AACjF,6BAAwB;AAExB,2CAA+D;
|
|
1
|
+
{"version":3,"file":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EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;SACpD,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,kFAAkF,KAAK,EAAE;iBAChG;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,kFAAkF;IAClF,MAAM,IAAA,uCAAmB,GAAE,CAAC;IAE5B,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Ensure MCPal.app is set up correctly for macOS notifications.
|
|
4
|
+
* This function can be called at runtime (not just postinstall).
|
|
5
|
+
*/
|
|
6
|
+
export declare function ensureMcpalAppSetup(): Promise<void>;
|
|
3
7
|
//# sourceMappingURL=setup-notifier.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-notifier.d.ts","sourceRoot":"","sources":["../../src/scripts/setup-notifier.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"setup-notifier.d.ts","sourceRoot":"","sources":["../../src/scripts/setup-notifier.ts"],"names":[],"mappings":";AAoLA;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAoEzD"}
|
|
@@ -4,40 +4,112 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ensureMcpalAppSetup = ensureMcpalAppSetup;
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const os_1 = __importDefault(require("os"));
|
|
8
10
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
// Get the package root (where src/assets lives)
|
|
12
|
+
const packageRoot = path_1.default.resolve(__dirname, "..", "..");
|
|
13
|
+
/**
|
|
14
|
+
* Find all potential locations where node-notifier's terminal-notifier.app might be located.
|
|
15
|
+
* Searches both local node_modules and npx cache directories.
|
|
16
|
+
*/
|
|
17
|
+
function findAllTerminalNotifierPaths() {
|
|
18
|
+
const paths = [];
|
|
19
|
+
// 1. Local node_modules (npm/yarn)
|
|
20
|
+
paths.push(path_1.default.join(packageRoot, "node_modules", "node-notifier", "vendor", "mac.noindex", "terminal-notifier.app"));
|
|
21
|
+
// 2. Local node_modules (pnpm)
|
|
22
|
+
const localPnpmDir = path_1.default.join(packageRoot, "node_modules", ".pnpm");
|
|
23
|
+
if (fs_1.default.existsSync(localPnpmDir)) {
|
|
24
|
+
try {
|
|
25
|
+
const entries = fs_1.default.readdirSync(localPnpmDir);
|
|
26
|
+
const nodeNotifierDir = entries.find((e) => e.startsWith("node-notifier@"));
|
|
27
|
+
if (nodeNotifierDir) {
|
|
28
|
+
paths.push(path_1.default.join(localPnpmDir, nodeNotifierDir, "node_modules", "node-notifier", "vendor", "mac.noindex", "terminal-notifier.app"));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// Ignore errors
|
|
33
|
+
}
|
|
20
34
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
// 3. npx cache locations
|
|
36
|
+
const npxCacheDirs = [
|
|
37
|
+
// npm npx cache
|
|
38
|
+
path_1.default.join(os_1.default.homedir(), ".npm", "_npx"),
|
|
39
|
+
// pnpm dlx cache
|
|
40
|
+
path_1.default.join(os_1.default.homedir(), "Library", "Caches", "pnpm", "dlx"),
|
|
41
|
+
];
|
|
42
|
+
for (const cacheDir of npxCacheDirs) {
|
|
43
|
+
if (!fs_1.default.existsSync(cacheDir)) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
// Search recursively for node-notifier in cache
|
|
48
|
+
const cacheEntries = fs_1.default.readdirSync(cacheDir);
|
|
49
|
+
for (const entry of cacheEntries) {
|
|
50
|
+
const entryPath = path_1.default.join(cacheDir, entry);
|
|
51
|
+
// Check for node-notifier in standard npm structure
|
|
52
|
+
const npmPath = path_1.default.join(entryPath, "node_modules", "node-notifier", "vendor", "mac.noindex", "terminal-notifier.app");
|
|
53
|
+
if (fs_1.default.existsSync(npmPath)) {
|
|
54
|
+
paths.push(npmPath);
|
|
55
|
+
}
|
|
56
|
+
// Check for node-notifier in mcpal's node_modules (npx installs mcpal which has node-notifier as dep)
|
|
57
|
+
const mcpalPath = path_1.default.join(entryPath, "node_modules", "mcpal", "node_modules", "node-notifier", "vendor", "mac.noindex", "terminal-notifier.app");
|
|
58
|
+
if (fs_1.default.existsSync(mcpalPath)) {
|
|
59
|
+
paths.push(mcpalPath);
|
|
60
|
+
}
|
|
61
|
+
// Check pnpm structure in cache
|
|
62
|
+
const pnpmDir = path_1.default.join(entryPath, "node_modules", ".pnpm");
|
|
63
|
+
if (fs_1.default.existsSync(pnpmDir)) {
|
|
64
|
+
try {
|
|
65
|
+
const pnpmEntries = fs_1.default.readdirSync(pnpmDir);
|
|
66
|
+
const nodeNotifierDir = pnpmEntries.find((e) => e.startsWith("node-notifier@"));
|
|
67
|
+
if (nodeNotifierDir) {
|
|
68
|
+
paths.push(path_1.default.join(pnpmDir, nodeNotifierDir, "node_modules", "node-notifier", "vendor", "mac.noindex", "terminal-notifier.app"));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// Ignore errors
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// Ignore errors reading cache directories
|
|
28
79
|
}
|
|
29
80
|
}
|
|
30
|
-
|
|
31
|
-
|
|
81
|
+
return paths;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Find the first existing terminal-notifier.app or MCPal.app
|
|
85
|
+
*/
|
|
86
|
+
function findNotifierApp() {
|
|
87
|
+
const searchPaths = findAllTerminalNotifierPaths();
|
|
88
|
+
for (const appPath of searchPaths) {
|
|
89
|
+
// Check if already renamed to MCPal.app
|
|
90
|
+
const mcpalPath = path_1.default.join(path_1.default.dirname(appPath), "MCPal.app");
|
|
91
|
+
if (fs_1.default.existsSync(mcpalPath)) {
|
|
92
|
+
return { path: mcpalPath, isRenamed: true };
|
|
93
|
+
}
|
|
94
|
+
// Check if terminal-notifier.app exists
|
|
95
|
+
if (fs_1.default.existsSync(appPath)) {
|
|
96
|
+
return { path: appPath, isRenamed: false };
|
|
97
|
+
}
|
|
32
98
|
}
|
|
33
|
-
return
|
|
99
|
+
return null;
|
|
34
100
|
}
|
|
35
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Find the icon source file. Checks multiple locations since the package
|
|
103
|
+
* structure differs between development and installed contexts.
|
|
104
|
+
*/
|
|
105
|
+
function findIconSource() {
|
|
36
106
|
const possiblePaths = [
|
|
37
|
-
//
|
|
38
|
-
path_1.default.join(
|
|
39
|
-
//
|
|
40
|
-
|
|
107
|
+
// Development: src/assets/mcpal.icns
|
|
108
|
+
path_1.default.join(packageRoot, "src", "assets", "mcpal.icns"),
|
|
109
|
+
// Built/installed: dist/assets/mcpal.icns
|
|
110
|
+
path_1.default.join(packageRoot, "dist", "assets", "mcpal.icns"),
|
|
111
|
+
// Relative to this script in dist
|
|
112
|
+
path_1.default.join(__dirname, "..", "assets", "mcpal.icns"),
|
|
41
113
|
];
|
|
42
114
|
for (const p of possiblePaths) {
|
|
43
115
|
if (fs_1.default.existsSync(p)) {
|
|
@@ -46,46 +118,62 @@ function findTerminalNotifier() {
|
|
|
46
118
|
}
|
|
47
119
|
return null;
|
|
48
120
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
//
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Ensure MCPal.app is set up correctly for macOS notifications.
|
|
123
|
+
* This function can be called at runtime (not just postinstall).
|
|
124
|
+
*/
|
|
125
|
+
async function ensureMcpalAppSetup() {
|
|
126
|
+
// Only run on macOS
|
|
127
|
+
if (process.platform !== "darwin") {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const notifierApp = findNotifierApp();
|
|
131
|
+
if (!notifierApp) {
|
|
132
|
+
console.error("[MCPal] terminal-notifier.app not found, skipping setup");
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
// If already renamed and configured, we're done
|
|
136
|
+
if (notifierApp.isRenamed) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const icnsSource = findIconSource();
|
|
140
|
+
if (!icnsSource) {
|
|
141
|
+
console.error("[MCPal] Icon file not found, skipping setup");
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
try {
|
|
145
|
+
const terminalNotifierApp = notifierApp.path;
|
|
146
|
+
const parentDir = path_1.default.dirname(terminalNotifierApp);
|
|
147
|
+
const mcpalApp = path_1.default.join(parentDir, "MCPal.app");
|
|
148
|
+
// Rename to MCPal.app
|
|
149
|
+
fs_1.default.renameSync(terminalNotifierApp, mcpalApp);
|
|
150
|
+
console.error("[MCPal] Renamed app bundle to MCPal.app");
|
|
151
|
+
const resourcesDir = path_1.default.join(mcpalApp, "Contents", "Resources");
|
|
152
|
+
const infoPlist = path_1.default.join(mcpalApp, "Contents", "Info.plist");
|
|
153
|
+
// Copy the new icon
|
|
154
|
+
const icnsDest = path_1.default.join(resourcesDir, "mcpal.icns");
|
|
155
|
+
fs_1.default.copyFileSync(icnsSource, icnsDest);
|
|
156
|
+
// Update Info.plist
|
|
157
|
+
let plistContent = fs_1.default.readFileSync(infoPlist, "utf8");
|
|
158
|
+
// Replace icon reference
|
|
159
|
+
plistContent = plistContent.replace(/<key>CFBundleIconFile<\/key>\s*<string>[^<]+<\/string>/, "<key>CFBundleIconFile</key>\n\t<string>mcpal</string>");
|
|
160
|
+
// Update bundle identifier
|
|
161
|
+
plistContent = plistContent.replace(/<key>CFBundleIdentifier<\/key>\s*<string>[^<]+<\/string>/, "<key>CFBundleIdentifier</key>\n\t<string>com.mcpal</string>");
|
|
162
|
+
// Update bundle name (shown in System Preferences > Notifications)
|
|
163
|
+
plistContent = plistContent.replace(/<key>CFBundleName<\/key>\s*<string>[^<]+<\/string>/, "<key>CFBundleName</key>\n\t<string>MCPal</string>");
|
|
164
|
+
fs_1.default.writeFileSync(infoPlist, plistContent);
|
|
165
|
+
console.error("[MCPal] macOS notification setup complete!");
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
169
|
+
console.error("[MCPal] Failed to setup notification icon:", message);
|
|
170
|
+
// Don't throw - notification will still work, just with default branding
|
|
171
|
+
}
|
|
84
172
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
173
|
+
// Run directly if called as a script (postinstall)
|
|
174
|
+
if (require.main === module) {
|
|
175
|
+
ensureMcpalAppSetup()
|
|
176
|
+
.then(() => process.exit(0))
|
|
177
|
+
.catch(() => process.exit(0)); // Don't fail install
|
|
90
178
|
}
|
|
91
179
|
//# sourceMappingURL=setup-notifier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-notifier.js","sourceRoot":"","sources":["../../src/scripts/setup-notifier.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"setup-notifier.js","sourceRoot":"","sources":["../../src/scripts/setup-notifier.ts"],"names":[],"mappings":";;;;;;AAwLA,kDAoEC;AA1PD,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AAExB,gDAAgD;AAChD,MAAM,WAAW,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAExD;;;GAGG;AACH,SAAS,4BAA4B;IACnC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,mCAAmC;IACnC,KAAK,CAAC,IAAI,CACR,cAAI,CAAC,IAAI,CACP,WAAW,EACX,cAAc,EACd,eAAe,EACf,QAAQ,EACR,aAAa,EACb,uBAAuB,CACxB,CACF,CAAC;IAEF,+BAA+B;IAC/B,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACrE,IAAI,YAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,YAAE,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YAC7C,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACzC,CAAC,CAAC,UAAU,CA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