MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / findOpencodeDir

Function findOpencodeDir

lib/prompts/store.ts:153–173  ·  view source on GitHub ↗
(startDir: string)

Source from the content-addressed store, hash-verified

151}
152
153function findOpencodeDir(startDir: string): string | null {
154 let current = startDir
155 while (current !== "/") {
156 const candidate = join(current, ".opencode")
157 if (existsSync(candidate)) {
158 try {
159 if (statSync(candidate).isDirectory()) {
160 return candidate
161 }
162 } catch {
163 // ignore inaccessible entries while walking upward
164 }
165 }
166 const parent = dirname(current)
167 if (parent === current) {
168 break
169 }
170 current = parent
171 }
172 return null
173}
174
175function resolvePromptPaths(workingDirectory: string): PromptPaths {
176 const configHome = process.env.XDG_CONFIG_HOME || join(homedir(), ".config")

Callers 1

resolvePromptPathsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected