MCPcopy
hub / github.com/AutoMaker-Org/automaker / getClaudeAuthIndicators

Function getClaudeAuthIndicators

libs/platform/src/system-paths.ts:1033–1187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1031}
1032
1033export async function getClaudeAuthIndicators(): Promise<ClaudeAuthIndicators> {
1034 const settingsPath = getClaudeSettingsPath();
1035 const statsCachePath = getClaudeStatsCachePath();
1036 const projectsDir = getClaudeProjectsDir();
1037 const credentialPaths = getClaudeCredentialPaths();
1038
1039 // Initialize checks with paths
1040 const settingsFileCheck: FileCheckResult = {
1041 path: settingsPath,
1042 exists: false,
1043 readable: false,
1044 };
1045
1046 const statsCacheCheck: FileCheckResult & { hasDailyActivity?: boolean } = {
1047 path: statsCachePath,
1048 exists: false,
1049 readable: false,
1050 };
1051
1052 const projectsDirCheck: DirectoryCheckResult = {
1053 path: projectsDir,
1054 exists: false,
1055 readable: false,
1056 entryCount: 0,
1057 };
1058
1059 const credentialFileChecks: FileCheckResult[] = credentialPaths.map((p) => ({
1060 path: p,
1061 exists: false,
1062 readable: false,
1063 }));
1064
1065 const result: ClaudeAuthIndicators = {
1066 hasCredentialsFile: false,
1067 hasSettingsFile: false,
1068 hasStatsCacheWithActivity: false,
1069 hasProjectsSessions: false,
1070 credentials: null,
1071 checks: {
1072 settingsFile: settingsFileCheck,
1073 statsCache: statsCacheCheck,
1074 projectsDir: projectsDirCheck,
1075 credentialFiles: credentialFileChecks,
1076 },
1077 };
1078
1079 // Check settings file
1080 // First check existence, then try to read to confirm it's actually readable
1081 try {
1082 if (await systemPathAccess(settingsPath)) {
1083 settingsFileCheck.exists = true;
1084 // Try to actually read the file to confirm read permissions
1085 try {
1086 await systemPathReadFile(settingsPath);
1087 settingsFileCheck.readable = true;
1088 result.hasSettingsFile = true;
1089 } catch (readErr) {
1090 // File exists but cannot be read (permission denied, etc.)

Callers 6

index.tsFile · 0.90
detectInstallationMethod · 0.90
getClaudeStatusFunction · 0.90
createAuthClaudeHandlerFunction · 0.85

Calls 7

getClaudeSettingsPathFunction · 0.85
getClaudeStatsCachePathFunction · 0.85
getClaudeProjectsDirFunction · 0.85
getClaudeCredentialPathsFunction · 0.85
systemPathAccessFunction · 0.85
systemPathReadFileFunction · 0.85
systemPathReaddirFunction · 0.85

Tested by

no test coverage detected