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

Function NewEngine

pkg/coder/engine/engine.go:116–124  ·  view source on GitHub ↗

NewEngine creates an Engine that writes to the given writers. workspaceRoot defines the boundary for path validation; empty defaults to cwd.

(out, errOut io.Writer, workspaceRoot string)

Source from the content-addressed store, hash-verified

114// NewEngine creates an Engine that writes to the given writers.
115// workspaceRoot defines the boundary for path validation; empty defaults to cwd.
116func NewEngine(out, errOut io.Writer, workspaceRoot string) *Engine {
117 root := workspaceRoot
118 if root == "" {
119 if wd, err := os.Getwd(); err == nil {
120 root = wd
121 }
122 }
123 return &Engine{Out: out, Err: errOut, WorkspaceRoot: root}
124}
125
126// validatePath checks that a file path is within the workspace boundary and not sensitive.
127func (e *Engine) validatePath(target string) error {

Callers 15

ExecuteWithStreamMethod · 0.92
ExecuteWithStreamMethod · 0.92
ExecuteWithStreamMethod · 0.92
ExecuteWithStreamMethod · 0.92
smartCommitScriptFunction · 0.92
reviewChangesScriptFunction · 0.92
diffReviewScriptFunction · 0.92
scanLintScriptFunction · 0.92
auditDepsScriptFunction · 0.92
updateDepsScriptFunction · 0.92
whyDepScriptFunction · 0.92

Calls

no outgoing calls

Tested by 8

newGitTestEngineFunction · 0.56
newWsEngineFunction · 0.56
newTestEngineFunction · 0.56
TestEngineExecuteUnknownFunction · 0.56