github kenryu42/cc-safety-net v2.1.0

4 hours ago

Adds a cc-safety-net/api library entry so Node.js hosts can check a command in-process without installing an agent integration, and hardens --delete-source so it can no longer remove files a concurrent process added.

Added

  • Added the cc-safety-net/api package entry exporting checkCommand({ command, cwd }), which returns an allow or deny decision for a single shell command without executing it, writing audit data, changing configuration, or making network requests. Denials include a display reason and an optional ruleId. (#89)
  • Added an absolute-path cwd requirement to checkCommand, which anchors relative command targets and selects the project policy so the check never falls back to hidden process state. An unusable directory fails closed with a deny. (#89)
  • Added TypeScript declarations for the new entry, so checkCommand and CheckCommandResult type-check from cc-safety-net/api alone without any optional agent-integration packages installed. The entry requires Node.js 18 or later and ESM; there is no CommonJS build. (#89)

Fixed

  • Fixed --delete-source recursively deleting files that a concurrent process added to a rulebook source directory after the pre-sync safeguard ran but before the delete. The safeguard now re-runs at delete time, an unexpected file refuses the delete with the existing "delete manually" error and a clean configuration rollback, and only the validated rulebook.json plus the then-empty directory are removed. (#88)
  • Fixed --delete-source reporting a failure when the source directory was already removed during the sync, which is the requested end state. (#88)

Don't miss a new cc-safety-net release

NewReleases is sending notifications on new releases.