@hasna/terminal 3.3.3 → 3.3.4

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.
@@ -15,8 +15,12 @@ const MAX_OUTPUT_FOR_AI = 6000;
15
15
  function fingerprint(command, output, exitCode) {
16
16
  const trimmed = output.trim();
17
17
  const lines = trimmed.split("\n").filter(l => l.trim());
18
- // Empty output with success = command succeeded silently (build, lint, etc.)
18
+ // Empty output with success provide context-aware confirmation
19
19
  if (lines.length === 0 && (exitCode === 0 || exitCode === undefined)) {
20
+ // Write commands get a specific confirmation
21
+ if (/\btee\b|>\s*\S|>>|cat\s*<<|echo\s.*>|sed\s+-i|cp\b|mv\b|mkdir\b|touch\b/.test(command)) {
22
+ return "✓ Write succeeded (no output)";
23
+ }
20
24
  return "✓ Success (no output)";
21
25
  }
22
26
  // Single-line trivial outputs — pass through without AI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/terminal",
3
- "version": "3.3.3",
3
+ "version": "3.3.4",
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
  "files": [
@@ -41,8 +41,12 @@ function fingerprint(command: string, output: string, exitCode?: number): string
41
41
  const trimmed = output.trim();
42
42
  const lines = trimmed.split("\n").filter(l => l.trim());
43
43
 
44
- // Empty output with success = command succeeded silently (build, lint, etc.)
44
+ // Empty output with success provide context-aware confirmation
45
45
  if (lines.length === 0 && (exitCode === 0 || exitCode === undefined)) {
46
+ // Write commands get a specific confirmation
47
+ if (/\btee\b|>\s*\S|>>|cat\s*<<|echo\s.*>|sed\s+-i|cp\b|mv\b|mkdir\b|touch\b/.test(command)) {
48
+ return "✓ Write succeeded (no output)";
49
+ }
46
50
  return "✓ Success (no output)";
47
51
  }
48
52