MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / NodePathProvider

Class NodePathProvider

packages/node-runtime/src/node-path-provider.ts:42–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42export class NodePathProvider implements PathProvider {
43 private systemDir: string
44 private userDataDir: string
45
46 constructor(userDataDir?: string) {
47 this.systemDir = SYSTEM_DIR
48 this.userDataDir = userDataDir || resolveUserDataDir()
49 }
50
51 getSystemDir(): string {
52 return this.systemDir
53 }
54
55 getUserDataDir(): string {
56 return this.userDataDir
57 }
58
59 getDatabaseDir(): string {
60 return path.join(this.userDataDir, 'databases')
61 }
62
63 getVectorDir(): string {
64 return path.join(this.userDataDir, 'vector')
65 }
66
67 getAiDataDir(): string {
68 return path.join(this.systemDir, 'ai')
69 }
70
71 getSettingsDir(): string {
72 return path.join(this.systemDir, 'settings')
73 }
74
75 getCacheDir(): string {
76 return path.join(this.systemDir, 'cache')
77 }
78
79 getTempDir(): string {
80 return path.join(this.systemDir, 'temp')
81 }
82
83 getLogsDir(): string {
84 return path.join(this.systemDir, 'logs')
85 }
86
87 getDownloadsDir(): string {
88 return path.join(os.homedir(), 'Downloads')
89 }
90
91 /**
92 * 确保系统目录和用户数据目录都存在
93 */
94 ensureAllDirs(): void {
95 const dirs = [
96 this.systemDir,
97 this.userDataDir,
98 this.getDatabaseDir(),
99 this.getVectorDir(),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected