// View file contents
const content = await computer.system.editor.viewFile({
path: '/path/to/file',
viewRange: [1, 10] // optional: view specific lines
});
// Create a new file
await computer.system.editor.createFile({
path: '/path/to/new/file',
content: 'Hello, World!' // optional
});
// Replace text in a file
await computer.system.editor.replaceString({
path: '/path/to/file',
oldStr: 'old',
newStr: 'new'
});
// Insert text at a specific line
await computer.system.editor.insertText({
path: '/path/to/file',
line: 5,
text: 'New line content'
});
// Undo last edit
await computer.system.editor.undoLastEdit();