@hasna/terminal 1.6.4 → 1.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/ai.js +3 -0
  2. package/package.json +1 -1
  3. package/src/ai.ts +3 -0
package/dist/ai.js CHANGED
@@ -54,6 +54,9 @@ const SAFE_OVERRIDES = [
54
54
  /\bfind\b.*-exec\s+(wc|cat|head|tail|grep|stat|file|du|ls)\b/,
55
55
  // find without -exec is always safe
56
56
  /^\s*find\b(?!.*-exec\s+(rm|mv|chmod|chown|sed))/,
57
+ // xargs with read-only tools is safe
58
+ /\bxargs\s+(wc|cat|head|tail|grep|stat|file|du|ls|git\s+log|git\s+show|git\s+blame)\b/,
59
+ /\bxargs\s+-I\s*\S+\s+(wc|cat|head|tail|grep|stat|git)\b/,
57
60
  ];
58
61
  export function isIrreversible(command) {
59
62
  // Safe overrides take priority
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/terminal",
3
- "version": "1.6.4",
3
+ "version": "1.6.5",
4
4
  "description": "Smart terminal wrapper for AI agents and humans — structured output, token compression, MCP server, natural language",
5
5
  "type": "module",
6
6
  "bin": {
package/src/ai.ts CHANGED
@@ -63,6 +63,9 @@ const SAFE_OVERRIDES = [
63
63
  /\bfind\b.*-exec\s+(wc|cat|head|tail|grep|stat|file|du|ls)\b/,
64
64
  // find without -exec is always safe
65
65
  /^\s*find\b(?!.*-exec\s+(rm|mv|chmod|chown|sed))/,
66
+ // xargs with read-only tools is safe
67
+ /\bxargs\s+(wc|cat|head|tail|grep|stat|file|du|ls|git\s+log|git\s+show|git\s+blame)\b/,
68
+ /\bxargs\s+-I\s*\S+\s+(wc|cat|head|tail|grep|stat|git)\b/,
66
69
  ];
67
70
 
68
71
  export function isIrreversible(command: string): boolean {