MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / resolveTemplatePathForCWD

Function resolveTemplatePathForCWD

agentContext/builder.go:102–123  ·  view source on GitHub ↗
(cwd string)

Source from the content-addressed store, hash-verified

100 return getTemplatePath()
101}
102
103func projectTemplatePathForCWD(cwd string) (string, bool) {
104 if cwd != "" {
105 current, err := resolveAbsPath(cwd)
106 if err == nil {
107 if info, statErr := os.Stat(current); statErr == nil && !info.IsDir() {
108 current = filepath.Dir(current)
109 }
110 for {
111 candidate := apppaths.ProjectSystemPrompt(current)
112 if fileExists(candidate) {
113 return candidate, true
114 }
115 parent := filepath.Dir(current)
116 if parent == current {
117 break
118 }
119 current = parent
120 }
121 }
122 }
123 return "", false
124}
125
126type PromptSection struct {

Callers 2

BuildInitialContextFunction · 0.85

Calls 3

resolveAbsPathFunction · 0.85
getTemplatePathFunction · 0.85
fileExistsFunction · 0.70

Tested by

no test coverage detected