@birdmichael/ccsync 1.0.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/README.md +241 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +5 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +5 -0
- package/dist/commands/config.d.ts +18 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +111 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/dashboard.d.ts +9 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +51 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/hello/index.d.ts +13 -0
- package/dist/commands/hello/index.d.ts.map +1 -0
- package/dist/commands/hello/index.js +20 -0
- package/dist/commands/hello/index.js.map +1 -0
- package/dist/commands/hello/world.d.ts +9 -0
- package/dist/commands/hello/world.d.ts.map +1 -0
- package/dist/commands/hello/world.js +15 -0
- package/dist/commands/hello/world.js.map +1 -0
- package/dist/commands/logs.d.ts +16 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +101 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/menu.d.ts +13 -0
- package/dist/commands/menu.d.ts.map +1 -0
- package/dist/commands/menu.js +190 -0
- package/dist/commands/menu.js.map +1 -0
- package/dist/commands/setup.d.ts +7 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +270 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/start.d.ts +7 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +16 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +63 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/stop.d.ts +7 -0
- package/dist/commands/stop.d.ts.map +1 -0
- package/dist/commands/stop.js +16 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/commands/sync.d.ts +7 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +33 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/test.d.ts +8 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/test.js +27 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/commands/toggle.d.ts +7 -0
- package/dist/commands/toggle.d.ts.map +1 -0
- package/dist/commands/toggle.js +22 -0
- package/dist/commands/toggle.js.map +1 -0
- package/dist/core/config-manager.d.ts +19 -0
- package/dist/core/config-manager.d.ts.map +1 -0
- package/dist/core/config-manager.js +174 -0
- package/dist/core/config-manager.js.map +1 -0
- package/dist/core/launch-agent.d.ts +12 -0
- package/dist/core/launch-agent.d.ts.map +1 -0
- package/dist/core/launch-agent.js +89 -0
- package/dist/core/launch-agent.js.map +1 -0
- package/dist/core/permission-manager.d.ts +18 -0
- package/dist/core/permission-manager.d.ts.map +1 -0
- package/dist/core/permission-manager.js +94 -0
- package/dist/core/permission-manager.js.map +1 -0
- package/dist/core/service-manager.d.ts +33 -0
- package/dist/core/service-manager.d.ts.map +1 -0
- package/dist/core/service-manager.js +108 -0
- package/dist/core/service-manager.js.map +1 -0
- package/dist/core/sync-service.d.ts +29 -0
- package/dist/core/sync-service.d.ts.map +1 -0
- package/dist/core/sync-service.js +180 -0
- package/dist/core/sync-service.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/syncers/base-syncer.d.ts +5 -0
- package/dist/syncers/base-syncer.d.ts.map +1 -0
- package/dist/syncers/base-syncer.js +3 -0
- package/dist/syncers/base-syncer.js.map +1 -0
- package/dist/syncers/mcp-syncer.d.ts +16 -0
- package/dist/syncers/mcp-syncer.d.ts.map +1 -0
- package/dist/syncers/mcp-syncer.js +116 -0
- package/dist/syncers/mcp-syncer.js.map +1 -0
- package/dist/syncers/skills-syncer.d.ts +13 -0
- package/dist/syncers/skills-syncer.d.ts.map +1 -0
- package/dist/syncers/skills-syncer.js +153 -0
- package/dist/syncers/skills-syncer.js.map +1 -0
- package/dist/types/config.d.ts +53 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +33 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/mcp.d.ts +20 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +3 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/sync.d.ts +44 -0
- package/dist/types/sync.d.ts.map +1 -0
- package/dist/types/sync.js +3 -0
- package/dist/types/sync.js.map +1 -0
- package/dist/types/ui.d.ts +263 -0
- package/dist/types/ui.d.ts.map +1 -0
- package/dist/types/ui.js +3 -0
- package/dist/types/ui.js.map +1 -0
- package/dist/ui/config/index.d.ts +12 -0
- package/dist/ui/config/index.d.ts.map +1 -0
- package/dist/ui/config/index.js +43 -0
- package/dist/ui/config/index.js.map +1 -0
- package/dist/ui/dashboard/index.d.ts +14 -0
- package/dist/ui/dashboard/index.d.ts.map +1 -0
- package/dist/ui/dashboard/index.js +90 -0
- package/dist/ui/dashboard/index.js.map +1 -0
- package/dist/ui/error/index.d.ts +13 -0
- package/dist/ui/error/index.d.ts.map +1 -0
- package/dist/ui/error/index.js +27 -0
- package/dist/ui/error/index.js.map +1 -0
- package/dist/ui/setup/index.d.ts +11 -0
- package/dist/ui/setup/index.d.ts.map +1 -0
- package/dist/ui/setup/index.js +18 -0
- package/dist/ui/setup/index.js.map +1 -0
- package/dist/utils/error-handler.d.ts +21 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +178 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/file-watcher.d.ts +17 -0
- package/dist/utils/file-watcher.d.ts.map +1 -0
- package/dist/utils/file-watcher.js +92 -0
- package/dist/utils/file-watcher.js.map +1 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +72 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/texts.d.ts +263 -0
- package/dist/utils/texts.d.ts.map +1 -0
- package/dist/utils/texts.js +270 -0
- package/dist/utils/texts.js.map +1 -0
- package/dist/utils/time-helper.d.ts +8 -0
- package/dist/utils/time-helper.d.ts.map +1 -0
- package/dist/utils/time-helper.js +67 -0
- package/dist/utils/time-helper.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ConfigUIProps {
|
|
3
|
+
skillsClaude: boolean;
|
|
4
|
+
skillsCodex: boolean;
|
|
5
|
+
mcpPlatforms: string[];
|
|
6
|
+
syncInterval: number;
|
|
7
|
+
autostart: boolean;
|
|
8
|
+
logLevel: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function ConfigUI({ skillsClaude, skillsCodex, mcpPlatforms, syncInterval, autostart, logLevel, }: ConfigUIProps): React.JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/config/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,aAAa;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,QAAQ,CAAC,EACvB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,GACT,EAAE,aAAa,qBAgEf"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { TEXTS } from '../../utils/texts';
|
|
4
|
+
export function ConfigUI({ skillsClaude, skillsCodex, mcpPlatforms, syncInterval, autostart, logLevel, }) {
|
|
5
|
+
return (React.createElement(Box, { flexDirection: "column", padding: 1 },
|
|
6
|
+
React.createElement(Box, { borderStyle: "double", borderColor: "blue", paddingX: 1 },
|
|
7
|
+
React.createElement(Text, { bold: true, color: "blue" }, TEXTS.commands.config)),
|
|
8
|
+
React.createElement(Box, { marginTop: 1, flexDirection: "column" },
|
|
9
|
+
React.createElement(Box, null,
|
|
10
|
+
React.createElement(Text, { bold: true }, "Skills \u540C\u6B65\u914D\u7F6E")),
|
|
11
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
12
|
+
React.createElement(Text, null,
|
|
13
|
+
"Claude Skills: ",
|
|
14
|
+
skillsClaude ? '✓' : '✗')),
|
|
15
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
16
|
+
React.createElement(Text, null,
|
|
17
|
+
"Codex Skills: ",
|
|
18
|
+
skillsCodex ? '✓' : '✗'))),
|
|
19
|
+
React.createElement(Box, { marginTop: 1, flexDirection: "column" },
|
|
20
|
+
React.createElement(Box, null,
|
|
21
|
+
React.createElement(Text, { bold: true }, "MCP \u540C\u6B65\u914D\u7F6E")),
|
|
22
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
23
|
+
React.createElement(Text, null,
|
|
24
|
+
"\u5E73\u53F0: ",
|
|
25
|
+
mcpPlatforms.join(', ')))),
|
|
26
|
+
React.createElement(Box, { marginTop: 1, flexDirection: "column" },
|
|
27
|
+
React.createElement(Box, null,
|
|
28
|
+
React.createElement(Text, { bold: true }, "\u670D\u52A1\u8BBE\u7F6E")),
|
|
29
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
30
|
+
React.createElement(Text, null,
|
|
31
|
+
"\u540C\u6B65\u95F4\u9694: ",
|
|
32
|
+
syncInterval,
|
|
33
|
+
" \u79D2")),
|
|
34
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
35
|
+
React.createElement(Text, null,
|
|
36
|
+
"\u5F00\u673A\u542F\u52A8: ",
|
|
37
|
+
autostart ? '✓' : '✗')),
|
|
38
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
39
|
+
React.createElement(Text, null,
|
|
40
|
+
"\u65E5\u5FD7\u7EA7\u522B: ",
|
|
41
|
+
logLevel)))));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/config/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAW1C,MAAM,UAAU,QAAQ,CAAC,EACvB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,GACM;IACd,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC;QACpC,oBAAC,GAAG,IAAC,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC;YACtD,oBAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,IACpB,KAAK,CAAC,QAAQ,CAAC,MAAM,CACjB,CACH;QAEN,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ;YACvC,oBAAC,GAAG;gBACF,oBAAC,IAAI,IAAC,IAAI,4CAAmB,CACzB;YAEN,oBAAC,GAAG,IAAC,UAAU,EAAE,CAAC;gBAChB,oBAAC,IAAI;;oBACa,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CACnC,CACH;YAEN,oBAAC,GAAG,IAAC,UAAU,EAAE,CAAC;gBAChB,oBAAC,IAAI;;oBACY,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CACjC,CACH,CACF;QAEN,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ;YACvC,oBAAC,GAAG;gBACF,oBAAC,IAAI,IAAC,IAAI,yCAAgB,CACtB;YAEN,oBAAC,GAAG,IAAC,UAAU,EAAE,CAAC;gBAChB,oBAAC,IAAI;;oBACE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CACvB,CACH,CACF;QAEN,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ;YACvC,oBAAC,GAAG;gBACF,oBAAC,IAAI,IAAC,IAAI,qCAAY,CAClB;YAEN,oBAAC,GAAG,IAAC,UAAU,EAAE,CAAC;gBAChB,oBAAC,IAAI;;oBACI,YAAY;8BACd,CACH;YAEN,oBAAC,GAAG,IAAC,UAAU,EAAE,CAAC;gBAChB,oBAAC,IAAI;;oBACI,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CACvB,CACH;YAEN,oBAAC,GAAG,IAAC,UAAU,EAAE,CAAC;gBAChB,oBAAC,IAAI;;oBACI,QAAQ,CACV,CACH,CACF,CACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface DashboardProps {
|
|
3
|
+
running: boolean;
|
|
4
|
+
skillsCount: number;
|
|
5
|
+
mcpCount: number;
|
|
6
|
+
errors: number;
|
|
7
|
+
uptime: number;
|
|
8
|
+
syncInterval: number;
|
|
9
|
+
autostart: boolean;
|
|
10
|
+
logLevel: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Dashboard({ running, skillsCount, mcpCount, errors, uptime, syncInterval, autostart, logLevel, }: DashboardProps): React.JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/dashboard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,UAAU,cAAc;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,WAAW,EACX,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,SAAS,EACT,QAAQ,GACT,EAAE,cAAc,qBAuHhB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { TEXTS } from '../../utils/texts';
|
|
4
|
+
export function Dashboard({ running, skillsCount, mcpCount, errors, uptime, syncInterval, autostart, logLevel, }) {
|
|
5
|
+
const [currentTime, setCurrentTime] = useState(new Date());
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const timer = setInterval(() => {
|
|
8
|
+
setCurrentTime(new Date());
|
|
9
|
+
}, 1000);
|
|
10
|
+
return () => clearInterval(timer);
|
|
11
|
+
}, []);
|
|
12
|
+
const formatUptime = (seconds) => {
|
|
13
|
+
const hours = Math.floor(seconds / 3600);
|
|
14
|
+
const minutes = Math.floor((seconds % 3600) / 60);
|
|
15
|
+
const secs = seconds % 60;
|
|
16
|
+
if (hours > 0) {
|
|
17
|
+
return `${hours}小时${minutes}分钟`;
|
|
18
|
+
}
|
|
19
|
+
if (minutes > 0) {
|
|
20
|
+
return `${minutes}分钟${secs}秒`;
|
|
21
|
+
}
|
|
22
|
+
return `${secs}秒`;
|
|
23
|
+
};
|
|
24
|
+
return (React.createElement(Box, { flexDirection: "column", padding: 1 },
|
|
25
|
+
React.createElement(Box, { borderStyle: "double", borderColor: "green", paddingX: 1 },
|
|
26
|
+
React.createElement(Text, { bold: true, color: "green" }, TEXTS.dashboard.title)),
|
|
27
|
+
React.createElement(Box, { marginTop: 1, flexDirection: "column" },
|
|
28
|
+
React.createElement(Box, null,
|
|
29
|
+
React.createElement(Text, { bold: true },
|
|
30
|
+
TEXTS.dashboard.status.section,
|
|
31
|
+
"\uFF1A"),
|
|
32
|
+
React.createElement(Text, null, running ? (React.createElement(Text, { color: "green" }, TEXTS.dashboard.status.running)) : (React.createElement(Text, { color: "red" }, TEXTS.dashboard.status.stopped)))),
|
|
33
|
+
running && (React.createElement(React.Fragment, null,
|
|
34
|
+
React.createElement(Box, null,
|
|
35
|
+
React.createElement(Text, null,
|
|
36
|
+
TEXTS.dashboard.status.uptime,
|
|
37
|
+
"\uFF1A"),
|
|
38
|
+
React.createElement(Text, null, formatUptime(uptime)))))),
|
|
39
|
+
React.createElement(Box, { marginTop: 1, flexDirection: "column" },
|
|
40
|
+
React.createElement(Box, null,
|
|
41
|
+
React.createElement(Text, { bold: true }, TEXTS.dashboard.skills.section)),
|
|
42
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
43
|
+
React.createElement(Text, null,
|
|
44
|
+
TEXTS.dashboard.skills.total,
|
|
45
|
+
" ",
|
|
46
|
+
skillsCount,
|
|
47
|
+
" ",
|
|
48
|
+
TEXTS.dashboard.skills.skills))),
|
|
49
|
+
React.createElement(Box, { marginTop: 1, flexDirection: "column" },
|
|
50
|
+
React.createElement(Box, null,
|
|
51
|
+
React.createElement(Text, { bold: true }, TEXTS.dashboard.mcp.section)),
|
|
52
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
53
|
+
React.createElement(Text, null,
|
|
54
|
+
TEXTS.dashboard.mcp.serversSynced,
|
|
55
|
+
" ",
|
|
56
|
+
mcpCount))),
|
|
57
|
+
React.createElement(Box, { marginTop: 1, flexDirection: "column" },
|
|
58
|
+
React.createElement(Box, null,
|
|
59
|
+
React.createElement(Text, { bold: true }, TEXTS.dashboard.settings.section)),
|
|
60
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
61
|
+
React.createElement(Text, null,
|
|
62
|
+
TEXTS.dashboard.settings.syncInterval,
|
|
63
|
+
"\uFF1A",
|
|
64
|
+
syncInterval,
|
|
65
|
+
" ",
|
|
66
|
+
TEXTS.dashboard.settings.seconds)),
|
|
67
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
68
|
+
React.createElement(Text, null,
|
|
69
|
+
TEXTS.dashboard.settings.autostart,
|
|
70
|
+
"\uFF1A",
|
|
71
|
+
autostart ? '✓' : '✗')),
|
|
72
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
73
|
+
React.createElement(Text, null,
|
|
74
|
+
TEXTS.dashboard.settings.logLevel,
|
|
75
|
+
"\uFF1A",
|
|
76
|
+
logLevel))),
|
|
77
|
+
errors > 0 && (React.createElement(Box, { marginTop: 1 },
|
|
78
|
+
React.createElement(Text, { color: "red" },
|
|
79
|
+
TEXTS.status.errors,
|
|
80
|
+
"\uFF1A",
|
|
81
|
+
errors))),
|
|
82
|
+
React.createElement(Box, { marginTop: 1 },
|
|
83
|
+
React.createElement(Text, { dimColor: true },
|
|
84
|
+
currentTime.toLocaleTimeString(),
|
|
85
|
+
" - ",
|
|
86
|
+
TEXTS.dashboard.status.autoRefresh)),
|
|
87
|
+
React.createElement(Box, { marginTop: 1, borderStyle: "single", borderColor: "blue", paddingX: 1 },
|
|
88
|
+
React.createElement(Text, { bold: true, color: "blue" }, TEXTS.dashboard.actions.section))));
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/dashboard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA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AAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,QAAQ;gBACX,WAAW,CAAC,kBAAkB,EAAE;;gBAAK,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CACnE,CACH;QAEN,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC;YACpE,oBAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,IACpB,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAC3B,CACH,CACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ErrorUIProps {
|
|
3
|
+
title: string;
|
|
4
|
+
message: string;
|
|
5
|
+
actions: Array<{
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
onSelect: () => void;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export declare function ErrorUI({ title, message, actions }: ErrorUIProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/error/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;CAC9E;AAED,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,YAAY,qBAqChE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { TEXTS } from '../../utils/texts';
|
|
4
|
+
export function ErrorUI({ title, message, actions }) {
|
|
5
|
+
return (React.createElement(Box, { flexDirection: "column", padding: 1 },
|
|
6
|
+
React.createElement(Box, { borderStyle: "single", borderColor: "red", paddingX: 1 },
|
|
7
|
+
React.createElement(Text, { bold: true, color: "red" }, TEXTS.errors.title)),
|
|
8
|
+
React.createElement(Box, { marginTop: 1, flexDirection: "column" },
|
|
9
|
+
React.createElement(Box, null,
|
|
10
|
+
React.createElement(Text, { bold: true, color: "red" }, title)),
|
|
11
|
+
React.createElement(Box, null,
|
|
12
|
+
React.createElement(Text, null, message))),
|
|
13
|
+
React.createElement(Box, { marginTop: 1, flexDirection: "column" },
|
|
14
|
+
React.createElement(Box, null,
|
|
15
|
+
React.createElement(Text, { bold: true }, TEXTS.errors.question)),
|
|
16
|
+
actions.map((action, index) => (React.createElement(Box, { key: index, marginTop: 1, flexDirection: "column" },
|
|
17
|
+
React.createElement(Box, null,
|
|
18
|
+
React.createElement(Text, { color: "yellow" },
|
|
19
|
+
index + 1,
|
|
20
|
+
"."),
|
|
21
|
+
React.createElement(Text, { bold: true, color: "yellow" },
|
|
22
|
+
" ",
|
|
23
|
+
action.label)),
|
|
24
|
+
React.createElement(Box, { marginLeft: 2 },
|
|
25
|
+
React.createElement(Text, { dimColor: true }, action.description))))))));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/error/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAQ1C,MAAM,UAAU,OAAO,CAA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,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface SetupUIProps {
|
|
3
|
+
step: number;
|
|
4
|
+
totalSteps: number;
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function SetupUI({ step, totalSteps, title, subtitle, children }: SetupUIProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/setup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,YAAY,qBAwBpF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export function SetupUI({ step, totalSteps, title, subtitle, children }) {
|
|
4
|
+
return (React.createElement(Box, { flexDirection: "column", padding: 1 },
|
|
5
|
+
React.createElement(Box, { borderStyle: "double", borderColor: "green", paddingX: 1 },
|
|
6
|
+
React.createElement(Text, { bold: true, color: "green" }, title)),
|
|
7
|
+
subtitle && (React.createElement(Box, { marginTop: 1 },
|
|
8
|
+
React.createElement(Text, { dimColor: true }, subtitle))),
|
|
9
|
+
React.createElement(Box, { marginTop: 1, marginBottom: 1 },
|
|
10
|
+
React.createElement(Text, null,
|
|
11
|
+
React.createElement(Text, { color: "cyan" },
|
|
12
|
+
"\u6B65\u9AA4 ",
|
|
13
|
+
step,
|
|
14
|
+
"/",
|
|
15
|
+
totalSteps))),
|
|
16
|
+
children));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/setup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAWhC,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAgB;IACnF,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC;QACpC,oBAAC,GAAG,IAAC,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAC,OAAO,EAAC,QAAQ,EAAE,CAAC;YACvD,oBAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,OAAO,IACrB,KAAK,CACD,CACH;QAEL,QAAQ,IAAI,CACX,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,QAAQ,UAAE,QAAQ,CAAQ,CAC5B,CACP;QAED,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC;YAChC,oBAAC,IAAI;gBACH,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM;;oBAAK,IAAI;;oBAAG,UAAU,CAAQ,CAC3C,CACH;QAEL,QAAQ,CACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare enum ErrorType {
|
|
2
|
+
CRITICAL_ERROR = "critical_error",
|
|
3
|
+
DATABASE_BUSY = "database_busy",
|
|
4
|
+
DATABASE_NOT_FOUND = "database_not_found",
|
|
5
|
+
FILE_PERMISSION = "file_permission",
|
|
6
|
+
INVALID_CONFIG = "invalid_config",
|
|
7
|
+
MISSING_PERMISSIONS = "missing_permissions",
|
|
8
|
+
NETWORK_ERROR = "network_error"
|
|
9
|
+
}
|
|
10
|
+
export interface ErrorAction {
|
|
11
|
+
description: string;
|
|
12
|
+
label: string;
|
|
13
|
+
type: 'fix' | 'retry' | 'skip' | 'stop';
|
|
14
|
+
}
|
|
15
|
+
export declare function classifyError(error: Error): ErrorType;
|
|
16
|
+
export declare function getErrorActions(errorType: ErrorType): ErrorAction[];
|
|
17
|
+
export declare function getErrorMessage(errorType: ErrorType): {
|
|
18
|
+
message: string;
|
|
19
|
+
title: string;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=error-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/utils/error-handler.ts"],"names":[],"mappings":"AAEA,oBAAY,SAAS;IACnB,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;IACjC,mBAAmB,wBAAwB;IAC3C,aAAa,kBAAkB;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;CACzC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAwBrD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW,EAAE,CA0GnE;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;CAAE,CAqDzF"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { TEXTS } from './texts';
|
|
2
|
+
export var ErrorType;
|
|
3
|
+
(function (ErrorType) {
|
|
4
|
+
ErrorType["CRITICAL_ERROR"] = "critical_error";
|
|
5
|
+
ErrorType["DATABASE_BUSY"] = "database_busy";
|
|
6
|
+
ErrorType["DATABASE_NOT_FOUND"] = "database_not_found";
|
|
7
|
+
ErrorType["FILE_PERMISSION"] = "file_permission";
|
|
8
|
+
ErrorType["INVALID_CONFIG"] = "invalid_config";
|
|
9
|
+
ErrorType["MISSING_PERMISSIONS"] = "missing_permissions";
|
|
10
|
+
ErrorType["NETWORK_ERROR"] = "network_error";
|
|
11
|
+
})(ErrorType || (ErrorType = {}));
|
|
12
|
+
export function classifyError(error) {
|
|
13
|
+
const message = error.message.toLowerCase();
|
|
14
|
+
if (message.includes('database is locked') || message.includes('sqlite_busy')) {
|
|
15
|
+
return ErrorType.DATABASE_BUSY;
|
|
16
|
+
}
|
|
17
|
+
if (message.includes('enoent') || message.includes('no such file')) {
|
|
18
|
+
return ErrorType.DATABASE_NOT_FOUND;
|
|
19
|
+
}
|
|
20
|
+
if (message.includes('eacces') || message.includes('permission denied')) {
|
|
21
|
+
return ErrorType.FILE_PERMISSION;
|
|
22
|
+
}
|
|
23
|
+
if (message.includes('yaml') || message.includes('parse error')) {
|
|
24
|
+
return ErrorType.INVALID_CONFIG;
|
|
25
|
+
}
|
|
26
|
+
if (message.includes('critical') || message.includes('fatal')) {
|
|
27
|
+
return ErrorType.CRITICAL_ERROR;
|
|
28
|
+
}
|
|
29
|
+
return ErrorType.MISSING_PERMISSIONS;
|
|
30
|
+
}
|
|
31
|
+
export function getErrorActions(errorType) {
|
|
32
|
+
const { errors } = TEXTS;
|
|
33
|
+
switch (errorType) {
|
|
34
|
+
case ErrorType.CRITICAL_ERROR: {
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
description: '查看错误详情和日志',
|
|
38
|
+
label: '查看详情',
|
|
39
|
+
type: 'fix',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
description: '立即停止同步服务',
|
|
43
|
+
label: '停止服务',
|
|
44
|
+
type: 'stop',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
case ErrorType.DATABASE_BUSY: {
|
|
49
|
+
return [
|
|
50
|
+
{
|
|
51
|
+
description: '再次尝试操作',
|
|
52
|
+
label: '重试',
|
|
53
|
+
type: 'retry',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
description: '尝试自动修复问题',
|
|
57
|
+
label: '自动修复',
|
|
58
|
+
type: 'fix',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
description: '跳过此操作',
|
|
62
|
+
label: '跳过',
|
|
63
|
+
type: 'skip',
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
case ErrorType.DATABASE_NOT_FOUND: {
|
|
68
|
+
return [
|
|
69
|
+
{
|
|
70
|
+
description: '打开配置向导',
|
|
71
|
+
label: '重新配置',
|
|
72
|
+
type: 'fix',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
description: '停止同步服务',
|
|
76
|
+
label: '停止服务',
|
|
77
|
+
type: 'stop',
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
case ErrorType.FILE_PERMISSION:
|
|
82
|
+
case ErrorType.MISSING_PERMISSIONS: {
|
|
83
|
+
return [
|
|
84
|
+
{
|
|
85
|
+
description: '尝试自动修复权限问题',
|
|
86
|
+
label: '自动修复',
|
|
87
|
+
type: 'fix',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
description: '尝试再次操作',
|
|
91
|
+
label: '我已手动修复',
|
|
92
|
+
type: 'retry',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
description: '立即停止同步服务',
|
|
96
|
+
label: '停止服务',
|
|
97
|
+
type: 'stop',
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
case ErrorType.INVALID_CONFIG: {
|
|
102
|
+
return [
|
|
103
|
+
{
|
|
104
|
+
description: '手动修改配置文件',
|
|
105
|
+
label: '编辑配置',
|
|
106
|
+
type: 'fix',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
description: '停止同步服务',
|
|
110
|
+
label: '停止服务',
|
|
111
|
+
type: 'stop',
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
default: {
|
|
116
|
+
return [
|
|
117
|
+
{
|
|
118
|
+
description: '尝试再次操作',
|
|
119
|
+
label: '重试',
|
|
120
|
+
type: 'retry',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
description: '跳过此操作',
|
|
124
|
+
label: '跳过',
|
|
125
|
+
type: 'skip',
|
|
126
|
+
},
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
export function getErrorMessage(errorType) {
|
|
132
|
+
const { errors } = TEXTS;
|
|
133
|
+
switch (errorType) {
|
|
134
|
+
case ErrorType.CRITICAL_ERROR: {
|
|
135
|
+
return {
|
|
136
|
+
message: errors.errorTypes.criticalError.message,
|
|
137
|
+
title: errors.errorTypes.criticalError.title,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
case ErrorType.DATABASE_BUSY: {
|
|
141
|
+
return {
|
|
142
|
+
message: errors.errorTypes.databaseBusy.message,
|
|
143
|
+
title: errors.errorTypes.databaseBusy.title,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
case ErrorType.DATABASE_NOT_FOUND: {
|
|
147
|
+
return {
|
|
148
|
+
message: errors.errorTypes.databaseNotFound.message,
|
|
149
|
+
title: errors.errorTypes.databaseNotFound.title,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
case ErrorType.FILE_PERMISSION: {
|
|
153
|
+
return {
|
|
154
|
+
message: errors.errorTypes.filePermission.message,
|
|
155
|
+
title: errors.errorTypes.filePermission.title,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
case ErrorType.INVALID_CONFIG: {
|
|
159
|
+
return {
|
|
160
|
+
message: errors.errorTypes.invalidConfig.message,
|
|
161
|
+
title: errors.errorTypes.invalidConfig.title,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
case ErrorType.MISSING_PERMISSIONS: {
|
|
165
|
+
return {
|
|
166
|
+
message: errors.errorTypes.missingPermissions.message,
|
|
167
|
+
title: errors.errorTypes.missingPermissions.title,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
default: {
|
|
171
|
+
return {
|
|
172
|
+
message: '发生未知错误',
|
|
173
|
+
title: '未知错误',
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=error-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/utils/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,CAAN,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,8CAAiC,CAAA;IACjC,4CAA+B,CAAA;IAC/B,sDAAyC,CAAA;IACzC,gDAAmC,CAAA;IACnC,8CAAiC,CAAA;IACjC,wDAA2C,CAAA;IAC3C,4CAA+B,CAAA;AACjC,CAAC,EARW,SAAS,KAAT,SAAS,QAQpB;AAQD,MAAM,UAAU,aAAa,CAAC,KAAY;IACxC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAE5C,IAAI,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9E,OAAO,SAAS,CAAC,aAAa,CAAC;IACjC,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,QAAQ,C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AM,CAAC,UAAU,CAAC,kBAAkB,CAAC,OAAO;gBACrD,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC,KAAK;aAClD,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACR,OAAO;gBACL,OAAO,EAAE,QAAQ;gBACjB,KAAK,EAAE,MAAM;aACd,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface FileWatcherEvents {
|
|
2
|
+
onDatabaseChange?: () => void;
|
|
3
|
+
onSkillsChange?: () => void;
|
|
4
|
+
}
|
|
5
|
+
declare class FileWatcher {
|
|
6
|
+
private dbPath;
|
|
7
|
+
private dbWatcher;
|
|
8
|
+
private skillsPaths;
|
|
9
|
+
private skillsWatchers;
|
|
10
|
+
constructor(dbPath: string, skillsPaths: string[]);
|
|
11
|
+
stop(): void;
|
|
12
|
+
watch(events: FileWatcherEvents): void;
|
|
13
|
+
protected watchDatabase(events: FileWatcherEvents): void;
|
|
14
|
+
protected watchSkillsDirectory(events: FileWatcherEvents): void;
|
|
15
|
+
}
|
|
16
|
+
export { FileWatcher };
|
|
17
|
+
//# sourceMappingURL=file-watcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-watcher.d.ts","sourceRoot":"","sources":["../../src/utils/file-watcher.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,cAAM,WAAW;IACf,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,WAAW,CAAW;IAC9B,OAAO,CAAC,cAAc,CAAa;gBAEvB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE;IAKjD,IAAI,IAAI,IAAI;IAmBZ,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAQtC,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IA4BxD,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;CAsChE;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import chokidar from 'chokidar';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import { logger } from './logger';
|
|
4
|
+
class FileWatcher {
|
|
5
|
+
dbPath;
|
|
6
|
+
dbWatcher = null;
|
|
7
|
+
skillsPaths;
|
|
8
|
+
skillsWatchers = [];
|
|
9
|
+
constructor(dbPath, skillsPaths) {
|
|
10
|
+
this.dbPath = dbPath;
|
|
11
|
+
this.skillsPaths = skillsPaths;
|
|
12
|
+
}
|
|
13
|
+
stop() {
|
|
14
|
+
logger.info('停止文件监控...');
|
|
15
|
+
// 停止数据库监控
|
|
16
|
+
if (this.dbWatcher) {
|
|
17
|
+
this.dbWatcher.close();
|
|
18
|
+
this.dbWatcher = null;
|
|
19
|
+
}
|
|
20
|
+
// 停止 Skills 目录监控
|
|
21
|
+
for (const watcher of this.skillsWatchers) {
|
|
22
|
+
watcher.close();
|
|
23
|
+
}
|
|
24
|
+
this.skillsWatchers = [];
|
|
25
|
+
logger.success('文件监控已停止');
|
|
26
|
+
}
|
|
27
|
+
watch(events) {
|
|
28
|
+
// 监控数据库文件
|
|
29
|
+
this.watchDatabase(events);
|
|
30
|
+
// 监控 Skills 目录
|
|
31
|
+
this.watchSkillsDirectory(events);
|
|
32
|
+
}
|
|
33
|
+
watchDatabase(events) {
|
|
34
|
+
if (!events.onDatabaseChange)
|
|
35
|
+
return;
|
|
36
|
+
try {
|
|
37
|
+
logger.info('开始监控数据库文件...');
|
|
38
|
+
this.dbWatcher = chokidar.watch(this.dbPath, {
|
|
39
|
+
ignoreInitial: false,
|
|
40
|
+
persistent: true,
|
|
41
|
+
});
|
|
42
|
+
this.dbWatcher.on('change', (path) => {
|
|
43
|
+
logger.debug(`数据库文件已修改:${path}`);
|
|
44
|
+
if (events.onDatabaseChange) {
|
|
45
|
+
events.onDatabaseChange();
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
this.dbWatcher.on('error', (error) => {
|
|
49
|
+
logger.error('数据库监控错误', { error: error.message });
|
|
50
|
+
});
|
|
51
|
+
logger.success('数据库文件监控已启动');
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
logger.error('启动数据库监控失败', { error: error.message });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
watchSkillsDirectory(events) {
|
|
58
|
+
if (!events.onSkillsChange)
|
|
59
|
+
return;
|
|
60
|
+
try {
|
|
61
|
+
logger.info('开始监控 Skills 目录...');
|
|
62
|
+
for (const skillsPath of this.skillsPaths) {
|
|
63
|
+
if (!fs.existsSync(skillsPath)) {
|
|
64
|
+
logger.warn(`Skills 目录不存在,跳过:${skillsPath}`);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const watcher = chokidar.watch(skillsPath, {
|
|
68
|
+
ignoreInitial: false,
|
|
69
|
+
persistent: true,
|
|
70
|
+
});
|
|
71
|
+
watcher.on('all', (eventName, path) => {
|
|
72
|
+
if (eventName === 'add' || eventName === 'unlink') {
|
|
73
|
+
logger.debug(`Skills 目录变化:${eventName} ${path}`);
|
|
74
|
+
if (events.onSkillsChange) {
|
|
75
|
+
events.onSkillsChange();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
watcher.on('error', (error) => {
|
|
80
|
+
logger.error(`Skills 目录监控错误 (${skillsPath})`, { error: error.message });
|
|
81
|
+
});
|
|
82
|
+
this.skillsWatchers.push(watcher);
|
|
83
|
+
}
|
|
84
|
+
logger.success('Skills 目录监控已启动');
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
logger.error('启动 Skills 目录监控失败', { error: error.message });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export { FileWatcher };
|
|
92
|
+
//# sourceMappingURL=file-watcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-watcher.js","sourceRoot":"","sources":["../../src/utils/file-watcher.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,MAAM,UAAU,CAAC;AAG1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC,MAAM,WAAW;IACP,MAAM,CAAS;IACf,SAAS,GAAQ,IAAI,CAAC;IACtB,WAAW,CAAW;IACtB,cAAc,GAAU,EAAE,CAAC;IAEnC,YAAY,MAAc,EAAE,WAAqB;QAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,IAAI;QACF,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEzB,UAAU;QACV,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;YACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC;QAED,iBAAiB;QACjB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YAC1C,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QAEzB,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,MAAyB;QAC7B,UAAU;QACV,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAE3B,eAAe;QACf,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAES,aAAa,CAAC,MAAyB;QAC/C,IAAI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AC,mBAAmB,UAAU,EAAE,CAAC,CAAC;oBAC7C,SAAS;gBACX,CAAC;gBAED,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,UAAU,EAAE;oBACzC,aAAa,EAAE,KAAK;oBACpB,UAAU,EAAE,IAAI;iBACjB,CAAC,CAAC;gBAEH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,SAAiB,EAAE,IAAY,EAAE,EAAE;oBACpD,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;wBAClD,MAAM,CAAC,KAAK,CAAC,eAAe,SAAS,IAAI,IAAI,EAAE,CAAC,CAAC;wBACjD,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;4BAC1B,MAAM,CAAC,cAAc,EAAE,CAAC;wBAC1B,CAAC;oBACH,CAAC;gBACH,CAAC,CAAC,CAAC;gBAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAU,EAAE,EAAE;oBACjC,MAAM,CAAC,KAAK,CAAC,kBAAkB,UAAU,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC1E,CAAC,CAAC,CAAC;gBAEH,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACpC,CAAC;YAED,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;CACF;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare class Logger {
|
|
2
|
+
private logger;
|
|
3
|
+
constructor(logLevel?: string);
|
|
4
|
+
debug(message: string, meta?: Record<string, any>): void;
|
|
5
|
+
error(message: string, meta?: Record<string, any>): void;
|
|
6
|
+
info(message: string, meta?: Record<string, any>): void;
|
|
7
|
+
success(message: string): void;
|
|
8
|
+
warn(message: string, meta?: Record<string, any>): void;
|
|
9
|
+
private getLevelColor;
|
|
10
|
+
private getLevelIcon;
|
|
11
|
+
}
|
|
12
|
+
export declare const logger: Logger;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAOA,cAAM,MAAM;IACV,OAAO,CAAC,MAAM,CAAiB;gBAEnB,QAAQ,GAAE,MAAe;IA6CrC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAIxD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAIxD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAIvD,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK9B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAIvD,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,YAAY;CASrB;AAED,eAAO,MAAM,MAAM,QAAe,CAAC"}
|