MCPcopy Create free account
hub / github.com/diillson/chatcli / NewContextBuilder

Function NewContextBuilder

cli/workspace/context_builder.go:31–48  ·  view source on GitHub ↗

NewContextBuilder creates a new context builder. workspaceDir is the detected project root (or CWD) where the session started.

(bootstrap *BootstrapLoader, memory *MemoryStore, workspaceDir string)

Source from the content-addressed store, hash-verified

29// NewContextBuilder creates a new context builder.
30// workspaceDir is the detected project root (or CWD) where the session started.
31func NewContextBuilder(bootstrap *BootstrapLoader, memory *MemoryStore, workspaceDir string) *ContextBuilder {
32 cb := &ContextBuilder{
33 bootstrap: bootstrap,
34 memory: memory,
35 workspaceDir: workspaceDir,
36 }
37
38 // Initialize path-specific rules loader
39 if bootstrap != nil {
40 globalDir := ""
41 if bootstrap.globalDir != "" {
42 globalDir = bootstrap.globalDir
43 }
44 cb.rules = NewRulesLoader(workspaceDir, globalDir, bootstrap.logger)
45 }
46
47 return cb
48}
49
50// WorkspaceDir returns the current workspace directory.
51func (cb *ContextBuilder) WorkspaceDir() string {

Calls 1

NewRulesLoaderFunction · 0.85