@probelabs/probe 0.6.0-rc255 → 0.6.0-rc257

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 (31) hide show
  1. package/README.md +5 -5
  2. package/bin/binaries/probe-v0.6.0-rc257-aarch64-apple-darwin.tar.gz +0 -0
  3. package/bin/binaries/probe-v0.6.0-rc257-aarch64-unknown-linux-musl.tar.gz +0 -0
  4. package/bin/binaries/probe-v0.6.0-rc257-x86_64-apple-darwin.tar.gz +0 -0
  5. package/bin/binaries/{probe-v0.6.0-rc255-x86_64-pc-windows-msvc.zip → probe-v0.6.0-rc257-x86_64-pc-windows-msvc.zip} +0 -0
  6. package/bin/binaries/probe-v0.6.0-rc257-x86_64-unknown-linux-musl.tar.gz +0 -0
  7. package/build/agent/FallbackManager.js +4 -4
  8. package/build/agent/ProbeAgent.js +23 -17
  9. package/build/agent/bashDefaults.js +175 -97
  10. package/build/agent/bashPermissions.js +98 -45
  11. package/build/agent/index.js +335 -205
  12. package/build/agent/mcp/xmlBridge.js +3 -2
  13. package/build/agent/schemaUtils.js +127 -0
  14. package/build/tools/bash.js +2 -2
  15. package/build/tools/common.js +20 -3
  16. package/cjs/agent/ProbeAgent.cjs +343 -203
  17. package/cjs/index.cjs +343 -203
  18. package/package.json +1 -1
  19. package/src/agent/FallbackManager.js +4 -4
  20. package/src/agent/ProbeAgent.js +23 -17
  21. package/src/agent/bashDefaults.js +175 -97
  22. package/src/agent/bashPermissions.js +98 -45
  23. package/src/agent/index.js +4 -4
  24. package/src/agent/mcp/xmlBridge.js +3 -2
  25. package/src/agent/schemaUtils.js +127 -0
  26. package/src/tools/bash.js +2 -2
  27. package/src/tools/common.js +20 -3
  28. package/bin/binaries/probe-v0.6.0-rc255-aarch64-apple-darwin.tar.gz +0 -0
  29. package/bin/binaries/probe-v0.6.0-rc255-aarch64-unknown-linux-musl.tar.gz +0 -0
  30. package/bin/binaries/probe-v0.6.0-rc255-x86_64-apple-darwin.tar.gz +0 -0
  31. package/bin/binaries/probe-v0.6.0-rc255-x86_64-unknown-linux-musl.tar.gz +0 -0
package/README.md CHANGED
@@ -91,7 +91,7 @@ const agent = new ProbeAgent({
91
91
  sessionId: 'my-session', // Optional: for conversation continuity
92
92
  path: '/path/to/your/project',
93
93
  provider: 'anthropic', // or 'openai', 'google'
94
- model: 'claude-3-5-sonnet-20241022', // Optional: override model
94
+ model: 'claude-sonnet-4-6', // Optional: override model
95
95
  allowEdit: true, // Optional: enable edit + create tools for code modification
96
96
  debug: true, // Optional: enable debug logging
97
97
  allowedTools: ['*'], // Optional: filter available tools (see Tool Filtering below)
@@ -128,7 +128,7 @@ export GOOGLE_API_KEY=your_google_key
128
128
  export FORCE_PROVIDER=anthropic
129
129
 
130
130
  # Optional: Override model name
131
- export MODEL_NAME=claude-3-5-sonnet-20241022
131
+ export MODEL_NAME=claude-sonnet-4-6
132
132
  ```
133
133
 
134
134
  **ProbeAgent Features:**
@@ -204,12 +204,12 @@ const agent = new ProbeAgent({
204
204
  region: 'us-west-2',
205
205
  accessKeyId: process.env.AWS_ACCESS_KEY_ID,
206
206
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
207
- model: 'anthropic.claude-sonnet-4-20250514-v1:0'
207
+ model: 'anthropic.claude-sonnet-4-6'
208
208
  },
209
209
  {
210
210
  provider: 'openai',
211
211
  apiKey: process.env.OPENAI_API_KEY,
212
- model: 'gpt-4o'
212
+ model: 'gpt-5.2'
213
213
  }
214
214
  ],
215
215
  maxTotalAttempts: 15 // Maximum attempts across all providers
@@ -919,7 +919,7 @@ const extractTool = tools.createExtractTool();
919
919
 
920
920
  // Create a ChatOpenAI instance with tools
921
921
  const model = new ChatOpenAI({
922
- modelName: "gpt-4o",
922
+ modelName: "gpt-5.2",
923
923
  temperature: 0.7
924
924
  }).withTools([searchTool, queryTool, extractTool]);
925
925
 
@@ -41,10 +41,10 @@ export const FALLBACK_STRATEGIES = {
41
41
  * Default model mappings for each provider
42
42
  */
43
43
  const DEFAULT_MODELS = {
44
- anthropic: 'claude-sonnet-4-5-20250929',
45
- openai: 'gpt-4o',
46
- google: 'gemini-2.0-flash-exp',
47
- bedrock: 'anthropic.claude-sonnet-4-20250514-v1:0'
44
+ anthropic: 'claude-sonnet-4-6',
45
+ openai: 'gpt-5.2',
46
+ google: 'gemini-2.5-flash',
47
+ bedrock: 'anthropic.claude-sonnet-4-6'
48
48
  };
49
49
 
50
50
  /**
@@ -83,7 +83,8 @@ import {
83
83
  isJsonSchemaDefinition,
84
84
  createSchemaDefinitionCorrectionPrompt,
85
85
  validateAndFixMermaidResponse,
86
- tryAutoWrapForSimpleSchema
86
+ tryAutoWrapForSimpleSchema,
87
+ tryExtractValidJsonPrefix
87
88
  } from './schemaUtils.js';
88
89
  import { removeThinkingTags, extractThinkingContent } from './xmlParsingUtils.js';
89
90
  import { predefinedPrompts } from './shared/prompts.js';
@@ -718,7 +719,7 @@ export class ProbeAgent {
718
719
  // Set provider to claude-code
719
720
  this.clientApiProvider = 'claude-code';
720
721
  this.provider = null;
721
- this.model = this.clientApiModel || 'claude-3-5-sonnet-20241022';
722
+ this.model = this.clientApiModel || 'claude-sonnet-4-6';
722
723
  this.apiType = 'claude-code';
723
724
  } else if (codexAvailable) {
724
725
  if (this.debug) {
@@ -728,7 +729,7 @@ export class ProbeAgent {
728
729
  // Set provider to codex
729
730
  this.clientApiProvider = 'codex';
730
731
  this.provider = null;
731
- this.model = this.clientApiModel || 'gpt-4o';
732
+ this.model = this.clientApiModel || 'gpt-5.2';
732
733
  this.apiType = 'codex';
733
734
  } else {
734
735
  // Neither API keys nor CLI commands available
@@ -1040,7 +1041,7 @@ export class ProbeAgent {
1040
1041
  // Claude Code engine will be initialized lazily in getEngine()
1041
1042
  // Set minimal defaults for compatibility
1042
1043
  this.provider = null;
1043
- this.model = modelName || 'claude-3-5-sonnet-20241022';
1044
+ this.model = modelName || 'claude-sonnet-4-6';
1044
1045
  this.apiType = 'claude-code';
1045
1046
  if (this.debug) {
1046
1047
  console.log('[DEBUG] Claude Code engine selected - will use built-in access if available');
@@ -1498,7 +1499,7 @@ export class ProbeAgent {
1498
1499
  apiKey: apiKey,
1499
1500
  ...(apiUrl && { baseURL: apiUrl }),
1500
1501
  });
1501
- this.model = modelName || 'claude-sonnet-4-5-20250929';
1502
+ this.model = modelName || 'claude-sonnet-4-6';
1502
1503
  this.apiType = 'anthropic';
1503
1504
 
1504
1505
  if (this.debug) {
@@ -1515,7 +1516,7 @@ export class ProbeAgent {
1515
1516
  apiKey: apiKey,
1516
1517
  ...(apiUrl && { baseURL: apiUrl }),
1517
1518
  });
1518
- this.model = modelName || 'gpt-5-thinking';
1519
+ this.model = modelName || 'gpt-5.2';
1519
1520
  this.apiType = 'openai';
1520
1521
 
1521
1522
  if (this.debug) {
@@ -1645,7 +1646,7 @@ export class ProbeAgent {
1645
1646
  }
1646
1647
 
1647
1648
  this.provider = createAmazonBedrock(config);
1648
- this.model = modelName || 'anthropic.claude-sonnet-4-20250514-v1:0';
1649
+ this.model = modelName || 'anthropic.claude-sonnet-4-6';
1649
1650
  this.apiType = 'bedrock';
1650
1651
 
1651
1652
  if (this.debug) {
@@ -1714,7 +1715,7 @@ export class ProbeAgent {
1714
1715
  sessionId: this.options?.sessionId,
1715
1716
  debug: this.debug,
1716
1717
  allowedTools: this.allowedTools, // Pass tool filtering configuration
1717
- model: this.model // Pass model name (e.g., gpt-4o, o3, etc.)
1718
+ model: this.model // Pass model name (e.g., gpt-5.2, o3, etc.)
1718
1719
  });
1719
1720
  if (this.debug) {
1720
1721
  console.log('[DEBUG] Using Codex CLI engine with Probe tools');
@@ -3027,8 +3028,9 @@ Follow these instructions carefully:
3027
3028
  // +1 for schema formatting
3028
3029
  // +2 for potential Mermaid validation retries (can be multiple diagrams)
3029
3030
  // +1 for potential JSON correction
3030
- const baseMaxIterations = this.maxIterations || MAX_TOOL_ITERATIONS;
3031
- const maxIterations = options.schema ? baseMaxIterations + 4 : baseMaxIterations;
3031
+ // _maxIterationsOverride: used by correction calls to cap iterations (issue #447)
3032
+ const baseMaxIterations = options._maxIterationsOverride || this.maxIterations || MAX_TOOL_ITERATIONS;
3033
+ const maxIterations = (options._maxIterationsOverride) ? baseMaxIterations : (options.schema ? baseMaxIterations + 4 : baseMaxIterations);
3032
3034
 
3033
3035
  // Check if we're using CLI-based engines which handle their own agentic loop
3034
3036
  const isClaudeCode = this.clientApiProvider === 'claude-code' || process.env.USE_CLAUDE_CODE === 'true';
@@ -3247,9 +3249,7 @@ Follow these instructions carefully:
3247
3249
  if (!maxResponseTokens) {
3248
3250
  // Use model-based defaults if not explicitly configured
3249
3251
  maxResponseTokens = 4000;
3250
- if (this.model && this.model.includes('opus') || this.model && this.model.includes('sonnet') || this.model && this.model.startsWith('gpt-4-')) {
3251
- maxResponseTokens = 8192;
3252
- } else if (this.model && this.model.startsWith('gpt-4o')) {
3252
+ if (this.model && this.model.includes('opus') || this.model && this.model.includes('sonnet') || this.model && this.model.startsWith('gpt-4') || this.model && this.model.startsWith('gpt-5')) {
3253
3253
  maxResponseTokens = 8192;
3254
3254
  } else if (this.model && this.model.startsWith('gemini')) {
3255
3255
  maxResponseTokens = 32000;
@@ -4693,11 +4693,14 @@ Convert your previous response content into actual JSON data that follows this s
4693
4693
  0
4694
4694
  );
4695
4695
 
4696
+ // Strip schema from correction options to prevent inflated iteration budget (issue #447)
4697
+ const { schema: _unusedSchema1, ...schemaDefCorrectionOptions } = options;
4696
4698
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
4697
- ...options,
4699
+ ...schemaDefCorrectionOptions,
4698
4700
  _schemaFormatted: true,
4699
4701
  _skipValidation: true, // Skip validation in recursive correction calls to prevent loops
4700
- _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4702
+ _completionPromptProcessed: true, // Prevent cascading completion prompts in retry calls
4703
+ _maxIterationsOverride: 3 // Correction should complete in 1-2 iterations (issue #447)
4701
4704
  });
4702
4705
  finalResult = cleanSchemaResponse(finalResult);
4703
4706
  validation = validateJsonResponse(finalResult);
@@ -4753,12 +4756,15 @@ Convert your previous response content into actual JSON data that follows this s
4753
4756
  );
4754
4757
  }
4755
4758
 
4759
+ // Strip schema from correction options to prevent inflated iteration budget (issue #447)
4760
+ const { schema: _unusedSchema2, ...correctionOptions } = options;
4756
4761
  finalResult = await this.answer(correctionPrompt, [], {
4757
- ...options,
4762
+ ...correctionOptions,
4758
4763
  _schemaFormatted: true,
4759
4764
  _skipValidation: true, // Skip validation in recursive correction calls to prevent loops
4760
4765
  _disableTools: true, // Only allow attempt_completion - prevent AI from using search/query tools
4761
- _completionPromptProcessed: true // Prevent cascading completion prompts in retry calls
4766
+ _completionPromptProcessed: true, // Prevent cascading completion prompts in retry calls
4767
+ _maxIterationsOverride: 3 // Correction should complete in 1-2 iterations (issue #447)
4762
4768
  });
4763
4769
  finalResult = cleanSchemaResponse(finalResult);
4764
4770
 
@@ -1,6 +1,14 @@
1
1
  /**
2
2
  * Default allow and deny patterns for bash command execution
3
3
  * @module agent/bashDefaults
4
+ *
5
+ * Pattern syntax: colon-separated parts matching command + args.
6
+ * 'git:push' — matches 'git push', 'git push origin main', etc.
7
+ * 'git:push:--force' — matches 'git push --force ...'
8
+ * 'git:branch:*' — wildcard matches any arg (or no arg) at that position
9
+ *
10
+ * NOTE: 'X' and 'X:*' are functionally identical — the shorter form is preferred.
11
+ * A pattern only checks the parts it specifies; extra args are ignored.
4
12
  */
5
13
 
6
14
  /**
@@ -8,36 +16,68 @@
8
16
  */
9
17
  export const DEFAULT_ALLOW_PATTERNS = [
10
18
  // Basic navigation and listing
11
- 'ls', 'dir', 'pwd', 'cd', 'cd:*',
12
-
19
+ 'ls', 'dir', 'pwd', 'cd',
20
+
13
21
  // File reading commands
14
- 'cat', 'cat:*', 'head', 'head:*', 'tail', 'tail:*',
22
+ 'cat', 'head', 'tail',
15
23
  'less', 'more', 'view',
16
-
24
+
17
25
  // File information and metadata
18
- 'file', 'file:*', 'stat', 'stat:*', 'wc', 'wc:*',
19
- 'du', 'du:*', 'df', 'df:*', 'realpath', 'realpath:*',
20
-
21
- // Search and find commands (read-only) - find restricted to safe operations
22
- 'find', 'find:-name:*', 'find:-type:*', 'find:-size:*', 'find:-mtime:*', 'find:-newer:*',
23
- 'find:-path:*', 'find:-iname:*', 'find:-maxdepth:*', 'find:-mindepth:*', 'find:-print',
24
- 'grep', 'grep:*', 'egrep', 'egrep:*', 'fgrep', 'fgrep:*',
25
- 'rg', 'rg:*', 'ag', 'ag:*', 'ack', 'ack:*',
26
- 'which', 'which:*', 'whereis', 'whereis:*', 'locate', 'locate:*',
27
- 'type', 'type:*', 'command', 'command:*',
28
-
26
+ 'file', 'stat', 'wc',
27
+ 'du', 'df', 'realpath',
28
+
29
+ // Search and find commands (read-only)
30
+ // Note: bare 'find' allows all find variants; dangerous ones (find -exec) are blocked by deny list
31
+ 'find',
32
+ 'grep', 'egrep', 'fgrep',
33
+ 'rg', 'ag', 'ack',
34
+ 'which', 'whereis', 'locate',
35
+ 'type', 'command',
36
+
29
37
  // Tree and structure visualization
30
- 'tree', 'tree:*',
31
-
38
+ 'tree',
39
+
32
40
  // Git read-only operations
33
- 'git:status', 'git:log', 'git:log:*', 'git:diff', 'git:diff:*',
34
- 'git:show', 'git:show:*', 'git:branch', 'git:branch:*',
35
- 'git:tag', 'git:tag:*', 'git:describe', 'git:describe:*',
36
- 'git:remote', 'git:remote:*', 'git:config:*',
37
- 'git:blame', 'git:blame:*', 'git:shortlog', 'git:reflog',
38
- 'git:ls-files', 'git:ls-tree', 'git:rev-parse', 'git:rev-list',
39
- 'git:--version', 'git:help', 'git:help:*',
40
-
41
+ 'git:status', 'git:log', 'git:diff',
42
+ 'git:show', 'git:branch',
43
+ 'git:tag', 'git:describe',
44
+ 'git:remote', 'git:config',
45
+ 'git:blame', 'git:shortlog', 'git:reflog',
46
+ 'git:ls-files', 'git:ls-tree',
47
+ 'git:ls-remote',
48
+ 'git:rev-parse', 'git:rev-list',
49
+ 'git:cat-file',
50
+ 'git:diff-tree', 'git:diff-files',
51
+ 'git:diff-index',
52
+ 'git:for-each-ref',
53
+ 'git:merge-base',
54
+ 'git:name-rev',
55
+ 'git:count-objects',
56
+ 'git:verify-commit', 'git:verify-tag',
57
+ 'git:check-ignore', 'git:check-attr',
58
+ 'git:stash:list', 'git:stash:show',
59
+ 'git:worktree:list',
60
+ 'git:notes:list', 'git:notes:show',
61
+ 'git:--version', 'git:help',
62
+
63
+ // GitHub CLI (gh) read-only operations
64
+ 'gh:--version', 'gh:help', 'gh:status',
65
+ 'gh:auth:status',
66
+ 'gh:issue:list', 'gh:issue:view',
67
+ 'gh:issue:status',
68
+ 'gh:pr:list', 'gh:pr:view',
69
+ 'gh:pr:status', 'gh:pr:diff',
70
+ 'gh:pr:checks',
71
+ 'gh:repo:list', 'gh:repo:view',
72
+ 'gh:release:list', 'gh:release:view',
73
+ 'gh:run:list', 'gh:run:view',
74
+ 'gh:workflow:list', 'gh:workflow:view',
75
+ 'gh:gist:list', 'gh:gist:view',
76
+ 'gh:search:issues', 'gh:search:prs',
77
+ 'gh:search:repos', 'gh:search:code',
78
+ 'gh:search:commits',
79
+ 'gh:api',
80
+
41
81
  // Package managers (information only)
42
82
  'npm:list', 'npm:ls', 'npm:view', 'npm:info', 'npm:show',
43
83
  'npm:outdated', 'npm:audit', 'npm:--version',
@@ -48,7 +88,7 @@ export const DEFAULT_ALLOW_PATTERNS = [
48
88
  'gem:list', 'gem:--version',
49
89
  'bundle:list', 'bundle:show', 'bundle:--version',
50
90
  'composer:show', 'composer:--version',
51
-
91
+
52
92
  // Language and runtime versions
53
93
  'node:--version', 'node:-v',
54
94
  'python:--version', 'python:-V', 'python3:--version', 'python3:-V',
@@ -58,51 +98,51 @@ export const DEFAULT_ALLOW_PATTERNS = [
58
98
  'java:--version', 'java:-version', 'javac:--version',
59
99
  'mvn:--version', 'gradle:--version',
60
100
  'php:--version', 'dotnet:--version', 'dotnet:list',
61
-
101
+
62
102
  // Database client versions (connection info only)
63
103
  'psql:--version', 'mysql:--version', 'redis-cli:--version',
64
104
  'mongo:--version', 'sqlite3:--version',
65
-
105
+
66
106
  // System information
67
- 'uname', 'uname:*', 'hostname', 'whoami', 'id', 'groups',
68
- 'date', 'cal', 'uptime', 'w', 'users', 'sleep', 'sleep:*',
69
-
107
+ 'uname', 'hostname', 'whoami', 'id', 'groups',
108
+ 'date', 'cal', 'uptime', 'w', 'users', 'sleep',
109
+
70
110
  // Environment and shell
71
- 'env', 'printenv', 'echo', 'echo:*', 'printf', 'printf:*',
72
- 'export', 'export:*', 'set', 'unset',
73
-
111
+ 'env', 'printenv', 'echo', 'printf',
112
+ 'export', 'set', 'unset',
113
+
74
114
  // Process information (read-only)
75
- 'ps', 'ps:*', 'pgrep', 'pgrep:*', 'jobs', 'top:-n:1',
76
-
115
+ 'ps', 'pgrep', 'jobs', 'top:-n:1',
116
+
77
117
  // Network information (read-only)
78
118
  'ifconfig', 'ip:addr', 'ip:link', 'hostname:-I',
79
119
  'ping:-c:*', 'traceroute', 'nslookup', 'dig',
80
-
120
+
81
121
  // Text processing and utilities (awk removed - too powerful)
82
- 'sed:-n:*', 'cut', 'cut:*', 'sort', 'sort:*',
83
- 'uniq', 'uniq:*', 'tr', 'tr:*', 'column', 'column:*',
84
- 'paste', 'paste:*', 'join', 'join:*', 'comm', 'comm:*',
85
- 'diff', 'diff:*', 'cmp', 'cmp:*', 'patch:--dry-run:*',
86
-
122
+ 'sed:-n:*', 'cut', 'sort',
123
+ 'uniq', 'tr', 'column',
124
+ 'paste', 'join', 'comm',
125
+ 'diff', 'cmp', 'patch:--dry-run:*',
126
+
87
127
  // Hashing and encoding (read-only)
88
- 'md5sum', 'md5sum:*', 'sha1sum', 'sha1sum:*', 'sha256sum', 'sha256sum:*',
89
- 'base64', 'base64:-d', 'od', 'od:*', 'hexdump', 'hexdump:*',
90
-
128
+ 'md5sum', 'sha1sum', 'sha256sum',
129
+ 'base64', 'base64:-d', 'od', 'hexdump',
130
+
91
131
  // Archive and compression (list/view only)
92
132
  'tar:-tf:*', 'tar:-tzf:*', 'unzip:-l:*', 'zip:-l:*',
93
133
  'gzip:-l:*', 'gunzip:-l:*',
94
-
134
+
95
135
  // Help and documentation
96
- 'man', 'man:*', '--help', 'help', 'info', 'info:*',
97
- 'whatis', 'whatis:*', 'apropos', 'apropos:*',
98
-
136
+ 'man', '--help', 'help', 'info',
137
+ 'whatis', 'apropos',
138
+
99
139
  // Make (dry run and info)
100
140
  'make:-n', 'make:--dry-run', 'make:-p', 'make:--print-data-base',
101
-
141
+
102
142
  // Docker (read-only operations)
103
143
  'docker:ps', 'docker:images', 'docker:version', 'docker:info',
104
144
  'docker:logs:*', 'docker:inspect:*',
105
-
145
+
106
146
  // Test runners (list/info only)
107
147
  'jest:--listTests', 'mocha:--help', 'pytest:--collect-only'
108
148
  ];
@@ -112,21 +152,22 @@ export const DEFAULT_ALLOW_PATTERNS = [
112
152
  */
113
153
  export const DEFAULT_DENY_PATTERNS = [
114
154
  // Dangerous file operations
115
- 'rm:-rf', 'rm:-f:/', 'rm:/', 'rm:-rf:*', 'rmdir',
155
+ 'rm:-rf', 'rm:-f:/', 'rm:/', 'rmdir',
116
156
  'chmod:777', 'chmod:-R:777', 'chown', 'chgrp',
117
- 'dd', 'dd:*', 'shred', 'shred:*',
118
-
157
+ 'dd', 'shred',
158
+
119
159
  // Dangerous find operations that can execute arbitrary commands
120
- 'find:-exec:*', 'find:*:-exec:*', 'find:-execdir:*', 'find:*:-execdir:*',
121
- 'find:-ok:*', 'find:*:-ok:*', 'find:-okdir:*', 'find:*:-okdir:*',
122
-
160
+ 'find:-exec', 'find:*:-exec', 'find:-execdir', 'find:*:-execdir',
161
+ 'find:-ok', 'find:*:-ok', 'find:-okdir', 'find:*:-okdir',
162
+
123
163
  // Powerful scripting tools that can execute arbitrary commands
124
- 'awk', 'awk:*', 'perl', 'perl:*', 'python:-c:*', 'node:-e:*',
125
-
164
+ 'awk', 'perl', 'python:-c:*', 'node:-e:*',
165
+
126
166
  // System administration and modification
127
- 'sudo:*', 'su', 'su:*', 'passwd', 'adduser', 'useradd',
167
+ 'sudo', 'su',
168
+ 'passwd', 'adduser', 'useradd',
128
169
  'userdel', 'usermod', 'groupadd', 'groupdel', 'visudo',
129
-
170
+
130
171
  // Package installation and removal
131
172
  'npm:install', 'npm:i', 'npm:uninstall', 'npm:publish',
132
173
  'npm:unpublish', 'npm:link', 'npm:update',
@@ -137,66 +178,103 @@ export const DEFAULT_DENY_PATTERNS = [
137
178
  'gem:install', 'gem:uninstall', 'gem:update',
138
179
  'bundle:install', 'bundle:update',
139
180
  'composer:install', 'composer:update', 'composer:remove',
140
- 'apt:*', 'apt-get:*', 'yum:*', 'dnf:*', 'zypper:*',
181
+ 'apt', 'apt-get', 'yum', 'dnf', 'zypper',
141
182
  'brew:install', 'brew:uninstall', 'brew:upgrade',
142
183
  'conda:install', 'conda:remove', 'conda:update',
143
-
184
+
144
185
  // Service and system control
145
- 'systemctl:*', 'service:*', 'chkconfig:*',
146
- 'initctl:*', 'upstart:*',
147
-
186
+ 'systemctl', 'service', 'chkconfig',
187
+ 'initctl', 'upstart',
188
+
148
189
  // Network operations that could be dangerous
149
190
  'curl:-d:*', 'curl:--data:*', 'curl:-X:POST:*', 'curl:-X:PUT:*',
150
191
  'wget:-O:/', 'wget:--post-data:*',
151
- 'ssh', 'ssh:*', 'scp', 'scp:*', 'sftp', 'sftp:*', 'rsync:*',
152
- 'nc', 'nc:*', 'netcat', 'netcat:*', 'telnet', 'telnet:*',
153
- 'ftp', 'ftp:*',
154
-
192
+ 'ssh', 'scp', 'sftp', 'rsync',
193
+ 'nc', 'netcat', 'telnet',
194
+ 'ftp',
195
+
155
196
  // Process control and termination
156
- 'kill', 'kill:*', 'killall', 'killall:*', 'pkill', 'pkill:*',
157
- 'nohup:*', 'disown:*',
158
-
197
+ 'kill', 'killall', 'pkill',
198
+ 'nohup', 'disown',
199
+
159
200
  // System control and shutdown
160
- 'shutdown', 'shutdown:*', 'reboot', 'halt', 'poweroff',
201
+ 'shutdown', 'reboot', 'halt', 'poweroff',
161
202
  'init', 'telinit',
162
-
203
+
163
204
  // Kernel and module operations
164
- 'insmod', 'insmod:*', 'rmmod', 'rmmod:*', 'modprobe', 'modprobe:*',
205
+ 'insmod', 'rmmod', 'modprobe',
165
206
  'sysctl:-w:*',
166
-
207
+
167
208
  // Dangerous git operations
168
- 'git:push', 'git:push:*', 'git:force', 'git:reset:--hard:*',
169
- 'git:clean:-fd', 'git:rm:*', 'git:commit', 'git:merge',
170
- 'git:rebase', 'git:cherry-pick', 'git:stash:drop',
171
-
209
+ 'git:push', 'git:force', 'git:reset',
210
+ 'git:clean', 'git:rm',
211
+ 'git:commit', 'git:merge',
212
+ 'git:rebase', 'git:cherry-pick',
213
+ 'git:stash:drop', 'git:stash:pop',
214
+ 'git:stash:push', 'git:stash:clear',
215
+ 'git:branch:-d', 'git:branch:-D',
216
+ 'git:branch:--delete',
217
+ 'git:tag:-d', 'git:tag:--delete',
218
+ 'git:remote:remove', 'git:remote:rm',
219
+ 'git:checkout:--force',
220
+ 'git:checkout:-f',
221
+ 'git:submodule:deinit',
222
+ 'git:notes:add', 'git:notes:remove',
223
+ 'git:worktree:add',
224
+ 'git:worktree:remove',
225
+
226
+ // Dangerous GitHub CLI (gh) write operations
227
+ 'gh:issue:create', 'gh:issue:close',
228
+ 'gh:issue:delete', 'gh:issue:edit',
229
+ 'gh:issue:reopen',
230
+ 'gh:issue:comment',
231
+ 'gh:pr:create', 'gh:pr:close',
232
+ 'gh:pr:merge', 'gh:pr:edit',
233
+ 'gh:pr:reopen', 'gh:pr:review',
234
+ 'gh:pr:comment',
235
+ 'gh:repo:create', 'gh:repo:delete',
236
+ 'gh:repo:fork', 'gh:repo:rename',
237
+ 'gh:repo:archive', 'gh:repo:clone',
238
+ 'gh:release:create', 'gh:release:delete',
239
+ 'gh:release:edit',
240
+ 'gh:run:cancel', 'gh:run:rerun',
241
+ 'gh:workflow:run',
242
+ 'gh:workflow:enable', 'gh:workflow:disable',
243
+ 'gh:gist:create', 'gh:gist:delete',
244
+ 'gh:gist:edit',
245
+ 'gh:secret:set', 'gh:secret:delete',
246
+ 'gh:variable:set', 'gh:variable:delete',
247
+ 'gh:label:create', 'gh:label:delete',
248
+ 'gh:ssh-key:add', 'gh:ssh-key:delete',
249
+
172
250
  // File system mounting and partitioning
173
- 'mount', 'mount:*', 'umount', 'umount:*', 'fdisk', 'fdisk:*',
174
- 'parted', 'parted:*', 'mkfs', 'mkfs:*', 'fsck', 'fsck:*',
175
-
251
+ 'mount', 'umount', 'fdisk',
252
+ 'parted', 'mkfs', 'fsck',
253
+
176
254
  // Cron and scheduling
177
- 'crontab', 'crontab:*', 'at', 'at:*', 'batch', 'batch:*',
178
-
255
+ 'crontab', 'at', 'batch',
256
+
179
257
  // Compression with potential overwrite
180
- 'tar:-xf:*', 'unzip', 'unzip:*', 'gzip:*', 'gunzip:*',
181
-
258
+ 'tar:-xf:*', 'unzip', 'gzip', 'gunzip',
259
+
182
260
  // Build and compilation that might modify files
183
261
  'make', 'make:install', 'make:clean', 'cargo:build', 'cargo:install',
184
262
  'npm:run:build', 'yarn:build', 'mvn:install', 'gradle:build',
185
-
263
+
186
264
  // Docker operations that could modify state
187
- 'docker:run', 'docker:run:*', 'docker:exec', 'docker:exec:*',
188
- 'docker:build', 'docker:build:*', 'docker:pull', 'docker:push',
265
+ 'docker:run', 'docker:exec',
266
+ 'docker:build', 'docker:pull', 'docker:push',
189
267
  'docker:rm', 'docker:rmi', 'docker:stop', 'docker:start',
190
-
268
+
191
269
  // Database operations
192
270
  'mysql:-e:DROP', 'psql:-c:DROP', 'redis-cli:FLUSHALL',
193
271
  'mongo:--eval:*',
194
-
272
+
195
273
  // Text editors that could modify files
196
- 'vi', 'vi:*', 'vim', 'vim:*', 'nano', 'nano:*', 'emacs', 'emacs:*',
274
+ 'vi', 'vim', 'nano', 'emacs',
197
275
  'sed:-i:*', 'perl:-i:*',
198
-
276
+
199
277
  // Potentially dangerous utilities
200
- 'eval', 'eval:*', 'exec', 'exec:*', 'source', 'source:*',
278
+ 'eval', 'exec', 'source',
201
279
  'bash:-c:*', 'sh:-c:*', 'zsh:-c:*'
202
- ];
280
+ ];