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

Function BuildEnvSection

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

Source from the content-addressed store, hash-verified

596 true,
597 }
598}
599
600func firstRunes(text string, limit int) string {
601 if limit <= 0 {
602 return ""
603 }
604 runes := []rune(text)
605 if len(runes) <= limit {
606 return text
607 }
608 return string(runes[:limit])
609}
610
611func pythonSplitLines(text string) []string {
612 if text == "" {
613 return []string{}
614 }
615 normalized := strings.ReplaceAll(text, "\r\n", "\n")
616 normalized = strings.ReplaceAll(normalized, "\r", "\n")
617 lines := strings.Split(normalized, "\n")
618 if len(lines) > 0 && lines[len(lines)-1] == "" {
619 lines = lines[:len(lines)-1]
620 }
621 return lines
622}
623
624func BuildEnvSection(cwd string) PromptSection {
625 env := GetEnvInfo()
626 displayCwd := cwd
627 if hook := currentPromptHooks().EnvInfo; hook != nil && env["cwd"] != "" {

Callers 2

BuildInitialContextFunction · 0.85

Calls 3

GetEnvInfoFunction · 0.85
currentPromptHooksFunction · 0.85
nowForPromptFunction · 0.85

Tested by

no test coverage detected