FileWrite mirrors environment_file_write MCP tool behavior
(envID, targetFile, contents, explanation string)
| 202 | |
| 203 | // FileWrite mirrors environment_file_write MCP tool behavior |
| 204 | func (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 |
| 216 | func (u *UserActions) RunCommand(envID, command, explanation string) string { |