scream-code 0.3.4 → 0.3.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.
package/icon.ico ADDED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scream-code",
3
- "version": "0.3.4",
3
+ "version": "0.3.7",
4
4
  "description": "The Starting Point for Next-Gen Agents",
5
5
  "license": "MIT",
6
6
  "author": "ScreamCli",
@@ -23,10 +23,12 @@
23
23
  "tui"
24
24
  ],
25
25
  "bin": {
26
- "scream": "dist/main.mjs"
26
+ "scream": "dist/main.mjs",
27
+ "scream-desktop-mcp": "dist/mcp-servers/desktop-server.mjs"
27
28
  },
28
29
  "files": [
29
30
  "dist",
31
+ "icon.ico",
30
32
  "scripts/postinstall.mjs",
31
33
  "scripts/postinstall"
32
34
  ],
@@ -51,6 +53,7 @@
51
53
  "test": "pnpm -w run build:packages && vitest run",
52
54
  "e2e": "pnpm -w run build:packages && SCREAM_E2E=1 vitest run test/e2e",
53
55
  "e2e:real": "pnpm -w run build:packages && SCREAM_E2E_REAL=1 vitest run test/e2e/real-llm-smoke.e2e.test.ts",
56
+ "preinstall": "node -e \"console.log('\\n📦 正在安装 scream-code,请稍候...\\n')\"",
54
57
  "postinstall": "node scripts/postinstall.mjs",
55
58
  "smoke": "node dist/main.mjs --version"
56
59
  },
@@ -65,6 +68,8 @@
65
68
  "zod": "^4.3.6"
66
69
  },
67
70
  "devDependencies": {
71
+ "@modelcontextprotocol/sdk": "^1.29.0",
72
+ "@scream-cli/agent-core": "workspace:^",
68
73
  "@scream-cli/config": "workspace:^",
69
74
  "@scream-cli/migration-legacy": "workspace:^",
70
75
  "@scream-cli/scream-code-sdk": "workspace:^",
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Create a desktop shortcut for Scream Code on Windows.
3
+ *
4
+ * Only runs on Win32 and for global installs. Never fails the install —
5
+ * errors are caught and swallowed.
6
+ */
7
+
8
+ import { execFileSync } from 'node:child_process';
9
+ import { resolve } from 'node:path';
10
+ import { existsSync } from 'node:fs';
11
+
12
+ export function createDesktopShortcut() {
13
+ if (process.platform !== 'win32') return;
14
+
15
+ const iconPath = resolve(import.meta.dirname, '../../icon.ico');
16
+
17
+ try {
18
+ execFileSync(
19
+ 'powershell.exe',
20
+ [
21
+ '-NoProfile',
22
+ '-ExecutionPolicy', 'Bypass',
23
+ '-Command',
24
+ shortcutPowerShellScript.replace(
25
+ '__ICON_LOCATION__',
26
+ existsSync(iconPath) ? iconPath : '',
27
+ ),
28
+ ],
29
+ { stdio: 'ignore', timeout: 10_000 },
30
+ );
31
+ } catch {
32
+ // Never fail the install over a shortcut.
33
+ }
34
+ }
35
+
36
+ const shortcutPowerShellScript = `
37
+ $ErrorActionPreference = 'Stop'
38
+
39
+ $DesktopPath = [Environment]::GetFolderPath('Desktop')
40
+ $ShortcutPath = "$DesktopPath\\Scream Code.lnk"
41
+ $WshShell = New-Object -ComObject WScript.Shell
42
+ $Shortcut = $WshShell.CreateShortcut($ShortcutPath)
43
+
44
+ $wt = Get-Command wt.exe -ErrorAction SilentlyContinue
45
+ $pwsh7 = Get-Command pwsh.exe -ErrorAction SilentlyContinue
46
+ $ps5 = Get-Command powershell.exe -ErrorAction SilentlyContinue
47
+
48
+ if ($wt) {
49
+ $Shortcut.TargetPath = $wt.Source
50
+ $Shortcut.Arguments = '--title "Scream Code" cmd /k "chcp 65001 > nul && scream"'
51
+ }
52
+ elseif ($pwsh7) {
53
+ $Shortcut.TargetPath = $pwsh7.Source
54
+ $Shortcut.Arguments = '-NoExit -Command "chcp 65001 > $null; scream"'
55
+ }
56
+ elseif ($ps5) {
57
+ $Shortcut.TargetPath = $ps5.Source
58
+ $Shortcut.Arguments = '-NoExit -Command "chcp 65001 > $null; [Console]::OutputEncoding = [Console]::InputEncoding = [Text.Encoding]::UTF8; $Host.UI.RawUI.WindowTitle = ''Scream Code''; scream"'
59
+ }
60
+ else {
61
+ $Shortcut.TargetPath = 'powershell.exe'
62
+ $Shortcut.Arguments = '-NoExit -Command "chcp 65001 > $null; [Console]::OutputEncoding = [Console]::InputEncoding = [Text.Encoding]::UTF8; $Host.UI.RawUI.WindowTitle = ''Scream Code''; scream"'
63
+ }
64
+
65
+ $Shortcut.WorkingDirectory = $env:USERPROFILE
66
+ $Shortcut.Description = 'Scream Code - AI 命令行助手'
67
+
68
+ $IconPath = '__ICON_LOCATION__'
69
+ if ($IconPath -and (Test-Path $IconPath)) {
70
+ $Shortcut.IconLocation = $IconPath
71
+ }
72
+
73
+ $Shortcut.Save()
74
+ `.trim();
@@ -113,6 +113,7 @@ import {
113
113
  detectLegacyShims,
114
114
  renameInPlace,
115
115
  } from './postinstall/migrate.mjs';
116
+ import { createDesktopShortcut } from './postinstall/shortcut.mjs';
116
117
  import {
117
118
  logForeignScreamInTheWay,
118
119
  logMigrationBlocked,
@@ -263,6 +264,12 @@ async function main() {
263
264
  );
264
265
  }
265
266
 
267
+ try {
268
+ createDesktopShortcut();
269
+ } catch {
270
+ // Never fail the install over a shortcut.
271
+ }
272
+
266
273
  main().catch((err) => {
267
274
  const message = err instanceof Error ? err.message : String(err);
268
275
  notify(`[scream-code] postinstall warning: ${message}`);