MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / loadShellState

Function loadShellState

desktop/pi-threads/shell-state.ts:45–74  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

43}
44
45export async function loadShellState(cwd: string): Promise<ShellState> {
46 const { agentDir, sessionDir } = await getSessionStorage(cwd)
47
48 ensureProject(cwd)
49 scheduleShellIndexSync(cwd)
50 const composer = await getComposerState({ projectId: cwd })
51 const appSettings = loadAppSettings()
52 const [piSettings, piTheme, resolvedCwd, projects] = await Promise.all([
53 loadPiSettings(cwd),
54 loadPiThemeState(cwd),
55 resolveProjectPathForComparison(cwd),
56 enrichProjectsWithResolvedIds(listProjects(cwd)),
57 ])
58 const visibleProjects = disambiguateDuplicateProjectNames(projects)
59
60 return {
61 platform: process.platform,
62 mockMode: false,
63 productName: 'howcode',
64 cwd,
65 resolvedCwd,
66 agentDir,
67 sessionDir,
68 appSettings,
69 piSettings,
70 piTheme,
71 composer,
72 projects: visibleProjects,
73 }
74}

Callers

nothing calls this directly

Calls 12

ensureProjectFunction · 0.90
scheduleShellIndexSyncFunction · 0.90
getComposerStateFunction · 0.90
loadAppSettingsFunction · 0.90
loadPiSettingsFunction · 0.90
loadPiThemeStateFunction · 0.90
listProjectsFunction · 0.90
getSessionStorageFunction · 0.85
allMethod · 0.80

Tested by

no test coverage detected