@fivetu53/soul-chat 1.0.5 → 1.0.6

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 (2) hide show
  1. package/bin/index.js +3 -11
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -121,17 +121,9 @@ end try`;
121
121
  if (result !== 'ok') return null;
122
122
  } else if (process.platform === 'win32') {
123
123
  // Windows: 用 PowerShell 导出剪贴板图片
124
- // 使用单引号包裹路径,避免转义问题
125
- const psScript = `
126
- Add-Type -AssemblyName System.Windows.Forms
127
- $img = [System.Windows.Forms.Clipboard]::GetImage()
128
- if ($img) {
129
- $img.Save('${tmpFile.replace(/\\/g, '/')}', [System.Drawing.Imaging.ImageFormat]::Png)
130
- Write-Output 'ok'
131
- } else {
132
- Write-Output 'no'
133
- }`;
134
- const result = execSync(`powershell -NoProfile -ExecutionPolicy Bypass -Command "${psScript.replace(/"/g, '\\"').replace(/\n/g, ' ')}"`, { encoding: 'utf8', windowsHide: true }).trim();
124
+ const savePath = tmpFile.replace(/\\/g, '/');
125
+ const psScript = `Add-Type -AssemblyName System.Windows.Forms; $img = [System.Windows.Forms.Clipboard]::GetImage(); if ($img) { $img.Save('${savePath}', [System.Drawing.Imaging.ImageFormat]::Png); Write-Output 'ok' } else { Write-Output 'no' }`;
126
+ const result = execSync(`powershell -NoProfile -ExecutionPolicy Bypass -Command "${psScript}"`, { encoding: 'utf8', windowsHide: true }).trim();
135
127
  if (result !== 'ok') return null;
136
128
  } else {
137
129
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fivetu53/soul-chat",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Soul Chat - 智能 AI 伴侣命令行客户端",
5
5
  "type": "module",
6
6
  "bin": {