wip: remove opencode, searxng, resources; fix user settings read
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,11 +16,6 @@ export const getClaudeDir = (email: string) => join(DATA_PATH, email, 'chat_sess
|
||||
export const getSessionDir = (email: string, sessionId: string) =>
|
||||
join(DATA_PATH, email, 'chat_sessions', 'claude', sessionId);
|
||||
|
||||
export const getOpencodeDir = (email: string) => join(DATA_PATH, email, 'chat_sessions', 'opencode');
|
||||
|
||||
export const getOpencodeSessionDir = (email: string, sessionId: string) =>
|
||||
join(DATA_PATH, email, 'chat_sessions', 'opencode', sessionId);
|
||||
|
||||
export const getPiMonoDir = (email: string) => join(DATA_PATH, email, 'chat_sessions', 'pi-mono');
|
||||
|
||||
export const getPiMonoSessionDir = (email: string, sessionId: string) =>
|
||||
@@ -38,8 +33,6 @@ export const getUserPiConfigDir = (email: string) => join(DATA_PATH, email, 'hom
|
||||
|
||||
export const getUserSettingsDir = (email: string) => join(DATA_PATH, email, 'settings');
|
||||
|
||||
export const getUserSettingsFile = (email: string) => join(DATA_PATH, email, 'settings', 'settings.json');
|
||||
|
||||
export const getUserStateDir = (email: string) => join(DATA_PATH, email, 'state');
|
||||
|
||||
export const getUserStateFile = (email: string) => join(DATA_PATH, email, 'state', 'state.json');
|
||||
@@ -80,20 +73,13 @@ export const getGlobalProcessesDir = () => join(DATA_PATH, 'processes');
|
||||
|
||||
export const getUserProcessesDir = (email: string) => join(DATA_PATH, email, 'processes');
|
||||
|
||||
export const getNativeResourcesDir = () => join(SEED_PATH, 'resources');
|
||||
|
||||
export const getGlobalResourcesDir = () => join(DATA_PATH, 'resources');
|
||||
|
||||
export const getResourcesDir = () => join(DATA_PATH, 'resources');
|
||||
|
||||
export const getTaskLogsDir = (email: string) => join(DATA_PATH, email, 'logs', 'tasks');
|
||||
|
||||
export const getTmpAttachmentsDir = (email: string) => join(DATA_PATH, email, 'chat_sessions', 'tmp_attachments');
|
||||
|
||||
export const getAttachmentsDir = (email: string, provider: 'claude' | 'opencode' | 'pi-mono', sessionId: string) =>
|
||||
export const getAttachmentsDir = (email: string, provider: 'claude' | 'pi-mono', sessionId: string) =>
|
||||
join(DATA_PATH, email, 'chat_sessions', provider, sessionId, 'attachments');
|
||||
|
||||
|
||||
export const getUserEmailDir = (email: string) => join(DATA_PATH, email, 'Gmail', 'emails');
|
||||
|
||||
export const getMaildirPath = (email: string) => join(DATA_PATH, email, 'Gmail', 'Maildir');
|
||||
@@ -102,7 +88,13 @@ export const getMaildirPath = (email: string) => join(DATA_PATH, email, 'Gmail',
|
||||
export const toShellUsername = (username: string, email: string): string => {
|
||||
const raw = username || email.split('@')[0]!;
|
||||
// Replace invalid chars, lowercase, truncate to 32 chars
|
||||
return raw.replace(/@.*$/, '').replace(/[^a-zA-Z0-9._-]/g, '_').toLowerCase().slice(0, 32) || 'officer';
|
||||
return (
|
||||
raw
|
||||
.replace(/@.*$/, '')
|
||||
.replace(/[^a-zA-Z0-9._-]/g, '_')
|
||||
.toLowerCase()
|
||||
.slice(0, 32) || 'officer'
|
||||
);
|
||||
};
|
||||
|
||||
export const getUserAppsDir = (email: string) => join(DATA_PATH, email, 'apps');
|
||||
|
||||
Reference in New Issue
Block a user