micro-models-agent 0.16.6 → 0.16.7

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.
@@ -63,17 +63,9 @@ async function readClipboardWindows() {
63
63
  try {
64
64
  const { execSync } = await import("child_process");
65
65
  const tmpPath = `${process.env.TEMP || process.env.TMP || "/tmp"}\\mma-clip-${Date.now()}.png`;
66
- const ps = [
67
- "Add-Type -AssemblyName System.Windows.Forms",
68
- "$img = [System.Windows.Forms.Clipboard]::GetImage()",
69
- "if ($img -ne $null) {",
70
- ` $img.Save("${tmpPath}")`,
71
- ' Write-Output "OK"',
72
- "} else {",
73
- ' Write-Output "EMPTY"',
74
- "}",
75
- ].join("; ");
76
- const out = execSync(`powershell -NoProfile -Command "${ps}"`, {
66
+ // Use single quotes in PowerShell to avoid backslash issues
67
+ const psScript = `Add-Type -AssemblyName System.Windows.Forms; $img = [System.Windows.Forms.Clipboard]::GetImage(); if ($img -ne $null) { $img.Save('${tmpPath}'); Write-Output 'OK' } else { Write-Output 'EMPTY' }`;
68
+ const out = execSync(`powershell -NoProfile -Command "${psScript}"`, {
77
69
  timeout: 5000,
78
70
  encoding: "utf-8",
79
71
  });
@@ -85,6 +85,16 @@ export function isCommandAllowed(command, securityConfig) {
85
85
  if (!trimmedCommand) {
86
86
  return { allowed: false, reason: "Empty command" };
87
87
  }
88
+ // Shell wrappers are always blocked — they bypass all command validation.
89
+ // The agent should use the bash tool directly, not shell interpreters.
90
+ const ALWAYS_BLOCKED = ['powershell', 'pwsh', 'cmd'];
91
+ const baseForShellCheck = extractBaseCommand(trimmedCommand);
92
+ if (ALWAYS_BLOCKED.includes(baseForShellCheck)) {
93
+ return {
94
+ allowed: false,
95
+ reason: `Shell wrapper "${baseForShellCheck}" is blocked — use the bash tool directly`,
96
+ };
97
+ }
88
98
  // Check dangerous operators FIRST — before parsing the base command.
89
99
  // e.g. "curl http://x | bash" must be caught even though curl isn't blacklisted.
90
100
  if (config.blockDangerousFlags) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "micro-models-agent",
3
- "version": "0.16.6",
3
+ "version": "0.16.7",
4
4
  "description": "Micro Models Agent (MMA) — LLM agent harness for small models (Qwen3.5-9B, 32K-64K context)",
5
5
  "type": "module",
6
6
  "bin": {