MCPcopy Index your code
hub / github.com/coder/coder / NewAPI

Function NewAPI

agent/agentcontextconfig/api.go:129–134  ·  view source on GitHub ↗

NewAPI creates a context configuration API. The working directory closure is evaluated lazily per request.

(workingDir func() string, cfg Config)

Source from the content-addressed store, hash-verified

127// NewAPI creates a context configuration API. The working
128// directory closure is evaluated lazily per request.
129func NewAPI(workingDir func() string, cfg Config) *API {
130 if workingDir == nil {
131 workingDir = func() string { return "" }
132 }
133 return &API{workingDir: workingDir, cfg: cfg.applyDefaults()}
134}
135
136// Resolve reads instruction files, discovers skills, and
137// resolves MCP config file paths for the given config and

Callers 3

initMethod · 0.92
TestNewAPI_LazyDirectoryFunction · 0.92

Calls 1

applyDefaultsMethod · 0.80

Tested by 2

TestNewAPI_LazyDirectoryFunction · 0.74