
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@iyulab/oops
Advanced tools
Core SDK for Oops - Safe text file editing with automatic backup and simple undo.
npm install @iyulab/oops
import { Oops } from '@iyulab/oops';
const oops = new Oops();
// Initialize workspace
await oops.initWorkspace();
// Start tracking a file
await oops.begin('/path/to/file.txt');
// Check for changes
const hasChanges = await oops.hasChanges('/path/to/file.txt');
// Get diff
const diff = await oops.diff('/path/to/file.txt');
// Apply changes
await oops.keep('/path/to/file.txt');
// Or undo changes
await oops.undo('/path/to/file.txt');
initWorkspace()
Initialize a new workspace for tracking files.
begin(filePath: string)
Start tracking a file by creating a backup.
hasChanges(filePath: string): Promise<boolean>
Check if a tracked file has changes.
diff(filePath: string): Promise<DiffResult>
Generate diff information for a tracked file.
keep(filePath: string)
Apply changes and stop tracking the file.
undo(filePath: string)
Revert file to backup and stop tracking.
abort(filePath: string)
Stop tracking without reverting changes.
keepAll()
Apply changes to all tracked files.
undoAll()
Revert all tracked files to their backups.
abortAll()
Stop tracking all files without reverting.
getWorkspaceInfo(): Promise<WorkspaceInfo>
Get information about the current workspace.
isWorkspaceHealthy(): Promise<boolean>
Check if the workspace is in a healthy state.
cleanWorkspace()
Clean up the workspace and all tracking data.
getWorkspaceSize(): Promise<{files: number, sizeBytes: number}>
Get workspace size information.
getConfig(): OopsConfig
Get current configuration.
setConfig(key: string, value: any)
Set configuration values (supports nested keys like 'safety.confirmKeep').
interface OopsConfig {
workspace: {
useTemp: boolean; // Use temporary directory
path: string | null; // Custom workspace path
};
safety: {
confirmKeep: boolean; // Confirm before applying changes
confirmUndo: boolean; // Confirm before undoing
autoBackup: boolean; // Automatic backup creation
};
diff: {
tool: string; // External diff tool ('auto', 'code', 'vimdiff', etc.)
context: number; // Number of context lines in diff
};
}
Oops.createTempWorkspace(): Promise<Oops>
Create an instance with a temporary workspace.
Oops.createLocalWorkspace(basePath: string): Promise<Oops>
Create an instance with a local workspace.
The SDK provides specific error types for better error handling:
FileNotFoundError
FileAlreadyTrackedError
FileNotTrackedError
WorkspaceNotInitializedError
WorkspaceCorruptedError
GitOperationError
This package is written in TypeScript and includes complete type definitions.
MIT - see LICENSE for details.
FAQs
Core SDK for Oops - Safe text file editing with automatic backup
The npm package @iyulab/oops receives a total of 0 weekly downloads. As such, @iyulab/oops popularity was classified as not popular.
We found that @iyulab/oops demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.