MCPcopy
hub / github.com/dagger/container-use / FileWrite

Method FileWrite

environment/integration/helpers.go:204–213  ·  view source on GitHub ↗

FileWrite mirrors environment_file_write MCP tool behavior

(envID, targetFile, contents, explanation string)

Source from the content-addressed store, hash-verified

202
203// FileWrite mirrors environment_file_write MCP tool behavior
204func (u *UserActions) FileWrite(envID, targetFile, contents, explanation string) {
205 env, err := u.repo.Get(u.ctx, u.dag, envID)
206 require.NoError(u.t, err, "Failed to get environment %s", envID)
207
208 err = env.FileWrite(u.ctx, explanation, targetFile, contents)
209 require.NoError(u.t, err, "FileWrite should succeed")
210
211 err = u.repo.Update(u.ctx, env, explanation)
212 require.NoError(u.t, err, "repo.Update after FileWrite should succeed")
213}
214
215// RunCommand mirrors environment_run_cmd MCP tool behavior
216func (u *UserActions) RunCommand(envID, command, explanation string) string {

Callers 15

TestRepositoryCheckoutFunction · 0.45
TestRepositoryLogFunction · 0.45
TestRepositoryDiffFunction · 0.45
TestRepositoryMergeFunction · 0.45
TestRepositoryApplyFunction · 0.45
TestGitAuditTrailFunction · 0.45
TestEnvironmentIsolationFunction · 0.45

Calls 2

GetMethod · 0.45
UpdateMethod · 0.45

Tested by 15

TestRepositoryCheckoutFunction · 0.36
TestRepositoryLogFunction · 0.36
TestRepositoryDiffFunction · 0.36
TestRepositoryMergeFunction · 0.36
TestRepositoryApplyFunction · 0.36
TestGitAuditTrailFunction · 0.36
TestEnvironmentIsolationFunction · 0.36