clew-code 0.3.5 → 0.4.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clew-code",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
4
4
  "description": "ClewCode — multi-provider AI coding agent CLI",
5
5
  "main": "./dist/main.js",
6
6
  "type": "module",
@@ -29,7 +29,7 @@
29
29
  "dev": "bun run prebuild-version && node scripts/bun-run.mjs --watch",
30
30
  "start": "bun run prebuild-version && node scripts/bun-run.mjs",
31
31
  "dev:channels": "bun run prebuild-version && node scripts/bun-run.mjs -- --dangerously-load-development-channels server:clew-orc",
32
- "build": "bun run prebuild-version && NODE_ENV=production bun build --production --define.TRANSCRIPT_CLASSIFIER=true --define.CHICAGO_MCP=true --define.VOICE_MODE=true src/main.tsx --outdir ./dist --target bun --external electron --external 'chromium-bidi*' --external '@ant/claude-for-chrome-mcp' --external '@anthropic-ai/bedrock-sdk' --external '@anthropic-ai/foundry-sdk' --external '@anthropic-ai/vertex-sdk' --external '@anthropic-ai/mcpb' --external '@aws-sdk/client-bedrock-runtime' --external 'google-auth-library' --external 'sharp' --external 'asciichart' --external 'audio-capture-napi' --external 'modifiers-napi' --external '@xenova/transformers' --external 'onnxruntime-node' --external playwright --external 'playwright-core' --external 'node-pty' && node scripts/postbuild-inject-macro.mjs",
32
+ "build": "bun run prebuild-version && NODE_ENV=production bun build --production --define.TRANSCRIPT_CLASSIFIER=true --define.CHICAGO_MCP=true --define.VOICE_MODE=true --define.AWAY_SUMMARY=true src/main.tsx --outdir ./dist --target bun --external electron --external 'chromium-bidi*' --external '@ant/claude-for-chrome-mcp' --external '@anthropic-ai/bedrock-sdk' --external '@anthropic-ai/foundry-sdk' --external '@anthropic-ai/vertex-sdk' --external '@anthropic-ai/mcpb' --external '@aws-sdk/client-bedrock-runtime' --external 'google-auth-library' --external 'sharp' --external 'asciichart' --external 'audio-capture-napi' --external 'modifiers-napi' --external '@xenova/transformers' --external 'onnxruntime-node' --external playwright --external 'playwright-core' --external 'node-pty' && node scripts/postbuild-inject-macro.mjs",
33
33
  "prepublishOnly": "bun run build",
34
34
  "test": "bun test",
35
35
  "lint": "biome lint --write src/",
@@ -64,14 +64,14 @@
64
64
  "author": "Dek1milliontoken",
65
65
  "license": "SEE LICENSE.md",
66
66
  "dependencies": {
67
- "@agentclientprotocol/sdk": "^0.25.1",
68
- "@ai-sdk/anthropic": "^3.0.84",
69
- "@ai-sdk/google": "^3.0.82",
70
- "@ai-sdk/openai": "^3.0.71",
71
- "@anthropic-ai/sandbox-runtime": "0.0.54",
72
- "@anthropic-ai/sdk": "^0.104.1",
73
- "@aws-sdk/client-bedrock": "^3.1068.0",
74
- "@aws-sdk/client-sts": "^3.1068.0",
67
+ "@agentclientprotocol/sdk": "^0.29.0",
68
+ "@ai-sdk/anthropic": "^3.0.86",
69
+ "@ai-sdk/google": "^3.0.83",
70
+ "@ai-sdk/openai": "^3.0.74",
71
+ "@anthropic-ai/sandbox-runtime": "0.0.59",
72
+ "@anthropic-ai/sdk": "^0.104.2",
73
+ "@aws-sdk/client-bedrock": "^3.1075.0",
74
+ "@aws-sdk/client-sts": "^3.1075.0",
75
75
  "@azure/identity": "^4.13.1",
76
76
  "@commander-js/extra-typings": "^15.0.0",
77
77
  "@google/generative-ai": "0.24.1",
@@ -96,27 +96,24 @@
96
96
  "@opentelemetry/sdk-trace-base": "2.8.0",
97
97
  "@opentelemetry/sdk-trace-node": "2.8.0",
98
98
  "@opentelemetry/semantic-conventions": "1.41.1",
99
- "@sentry/node": "^10.57.0",
99
+ "@sentry/node": "^10.60.0",
100
100
  "@types/react": "^19.2.17",
101
101
  "@types/react-dom": "^19.2.3",
102
102
  "@types/ws": "^8.18.1",
103
103
  "@xenova/transformers": "^2.17.2",
104
+ "ansis": "^4.3.1",
104
105
  "asciichart": "^1.5.25",
105
- "axios": "^1.17.0",
106
106
  "bidi-js": "1.0.3",
107
- "chalk": "^5.6.2",
108
107
  "chokidar": "5.0.0",
109
108
  "commander": "^15.0.0",
110
109
  "conf": "^15.1.0",
111
110
  "diff": "^9.0.0",
112
111
  "dotenv": "^17.4.2",
113
- "execa": "^9.6.1",
114
- "fast-deep-equal": "^3.1.3",
115
112
  "fflate": "^0.8.3",
116
113
  "fuse.js": "^7.4.2",
117
114
  "https-proxy-agent": "^9.1.0",
118
115
  "ignore": "^7.0.5",
119
- "ink": "^5.2.1",
116
+ "ink": "^7.1.0",
120
117
  "ink-divider": "^4.1.1",
121
118
  "ink-markdown": "^1.0.4",
122
119
  "ink-select-input": "^6.2.0",
@@ -126,25 +123,24 @@
126
123
  "is-wsl": "^3.1.1",
127
124
  "jsonc-parser": "^3.3.1",
128
125
  "jsonrepair": "^3.14.0",
129
- "lodash-es": "^4.18.1",
130
126
  "lru-cache": "^11.5.1",
131
- "lucide-react": "^1.18.0",
132
- "node-fetch": "^3.3.2",
127
+ "lucide-react": "^1.21.0",
128
+ "nano-spawn": "^2.1.0",
133
129
  "node-pty": "^1.1.0",
130
+ "ofetch": "^1.5.1",
134
131
  "open": "^11.0.0",
135
- "openai": "^6.42.0",
136
- "ora": "^9.4.0",
132
+ "openai": "^6.44.0",
137
133
  "p-map": "^7.0.4",
138
134
  "picomatch": "^4.0.4",
139
- "playwright": "^1.60.0",
135
+ "playwright": "^1.61.1",
140
136
  "proper-lockfile": "^4.1.2",
141
137
  "qrcode": "^1.5.4",
142
138
  "react": "^19.2.7",
143
139
  "react-dom": "^19.2.7",
144
140
  "react-markdown": "^10.1.0",
145
141
  "react-reconciler": "0.33.0",
146
- "react-syntax-highlighter": "^16.1.1",
147
142
  "shell-quote": "^1.8.4",
143
+ "signal-exit": "^4.1.0",
148
144
  "tree-kill": "^1.2.2",
149
145
  "turndown": "^7.2.4",
150
146
  "usehooks-ts": "^3.1.1",
@@ -156,10 +152,9 @@
156
152
  "react-reconciler": "0.33.0"
157
153
  },
158
154
  "devDependencies": {
159
- "@ast-grep/cli": "^0.43.0",
160
- "@biomejs/biome": "^2.5.0",
155
+ "@ast-grep/cli": "^0.44.0",
156
+ "@biomejs/biome": "^2.5.1",
161
157
  "@types/bun": "latest",
162
- "@types/lodash-es": "^4.17.12",
163
158
  "@types/semver": "^7.7.1"
164
159
  },
165
160
  "optionalDependencies": {}
@@ -25,7 +25,7 @@ const macroJson = JSON.stringify({
25
25
  ISSUES_EXPLAINER: 'visit https://github.com/ClewCode/ClewCode/issues',
26
26
  });
27
27
 
28
- const args = ['run', '--define', `MACRO:${macroJson}`];
28
+ const args = ['run', '--define', `MACRO:${macroJson}`, '--define.AWAY_SUMMARY=true'];
29
29
  if (isWatch) args.push('--watch');
30
30
  args.push(join(root, 'src/main.tsx'), ...extraArgs);
31
31
 
@@ -1,40 +1,148 @@
1
1
  #!/usr/bin/env pwsh
2
2
  #Requires -PSEdition Desktop
3
- #Requires -RunAsAdministrator
4
3
 
5
4
  $ErrorActionPreference = 'Stop'
6
5
 
7
- function Write-Info { Write-Host " $($args -join ' ')" -ForegroundColor Green }
8
- function Write-Warn { Write-Host " $($args -join ' ')" -ForegroundColor Yellow }
9
- function Write-Error { Write-Host "✗ $($args -join ' ')" -ForegroundColor Red; exit 1 }
6
+ function Write-Info { Write-Host "[OK] $($args -join ' ')" -ForegroundColor Green }
7
+ function Write-Warn { Write-Host "[!] $($args -join ' ')" -ForegroundColor Yellow }
8
+ function Write-Fail {
9
+ Write-Host "[X] $($args -join ' ')" -ForegroundColor Red
10
+ exit 1
11
+ }
12
+
13
+ function Split-PathList([string]$PathValue) {
14
+ if ([string]::IsNullOrWhiteSpace($PathValue)) {
15
+ return @()
16
+ }
17
+ return $PathValue.Split([IO.Path]::PathSeparator) |
18
+ Where-Object { -not [string]::IsNullOrWhiteSpace($_) } |
19
+ ForEach-Object { $_.Trim().Trim('"').TrimEnd('\') }
20
+ }
21
+
22
+ function Test-PathListContains([string]$PathValue, [string]$Needle) {
23
+ if ([string]::IsNullOrWhiteSpace($Needle)) {
24
+ return $false
25
+ }
26
+ $normalizedNeedle = $Needle.Trim().Trim('"').TrimEnd('\')
27
+ foreach ($entry in (Split-PathList $PathValue)) {
28
+ if ([string]::Equals($entry, $normalizedNeedle, [StringComparison]::OrdinalIgnoreCase)) {
29
+ return $true
30
+ }
31
+ }
32
+ return $false
33
+ }
34
+
35
+ function Get-BunGlobalBin {
36
+ try {
37
+ $bin = (& bun pm bin -g 2>$null | Select-Object -First 1).Trim()
38
+ if (-not [string]::IsNullOrWhiteSpace($bin)) {
39
+ return $bin
40
+ }
41
+ } catch {
42
+ # Fall through to Bun's default Windows global bin.
43
+ }
44
+ return (Join-Path $env:USERPROFILE '.bun\bin')
45
+ }
46
+
47
+ function Get-ClewCommandPath([string]$BinDir) {
48
+ $command = Get-Command clew -ErrorAction SilentlyContinue
49
+ if ($command) {
50
+ return $command.Source
51
+ }
52
+
53
+ foreach ($name in @('clew.cmd', 'clew.exe', 'clew')) {
54
+ $candidate = Join-Path $BinDir $name
55
+ if (Test-Path $candidate) {
56
+ return $candidate
57
+ }
58
+ }
59
+
60
+ return $null
61
+ }
62
+
63
+ function Get-ClewVersion([string]$CommandPath) {
64
+ if ([string]::IsNullOrWhiteSpace($CommandPath)) {
65
+ return 'unknown'
66
+ }
67
+
68
+ try {
69
+ $versionOutput = (& $CommandPath --version 2>$null | Select-Object -First 1).Trim()
70
+ if (-not [string]::IsNullOrWhiteSpace($versionOutput)) {
71
+ return $versionOutput
72
+ }
73
+ } catch {
74
+ # Keep installer completion non-fatal if version probing fails.
75
+ }
76
+
77
+ return 'unknown'
78
+ }
79
+
80
+ Write-Host 'Setting up Clew Code...'
81
+ Write-Host ''
10
82
 
11
- # ── Install bun if missing ───────────────────────────────────────────────────
12
83
  if (-not (Get-Command bun -ErrorAction SilentlyContinue)) {
13
- Write-Info 'Bun not found installing...'
84
+ Write-Info 'Bun not found - installing...'
14
85
  try {
15
- $null = & powershell -NoProfile -Command "irm bun.sh/install.ps1 | iex" 2>&1
86
+ $null = & powershell -NoProfile -Command 'irm bun.sh/install.ps1 | iex' 2>&1
16
87
  } catch {
17
- Write-Error "Bun install failed: $($_.Exception.Message)"
88
+ Write-Fail "Bun install failed: $($_.Exception.Message)"
18
89
  }
19
- # Refresh PATH so bun is available immediately
90
+
20
91
  $env:Path = [Environment]::GetEnvironmentVariable('Path', 'User') +
21
- ';' + [Environment]::GetEnvironmentVariable('Path', 'Machine')
92
+ [IO.Path]::PathSeparator +
93
+ [Environment]::GetEnvironmentVariable('Path', 'Machine')
94
+
95
+ $bunDefaultBin = Join-Path $env:USERPROFILE '.bun\bin'
96
+ if (-not (Test-PathListContains $env:Path $bunDefaultBin)) {
97
+ $env:Path = "$bunDefaultBin$([IO.Path]::PathSeparator)$env:Path"
98
+ }
99
+
22
100
  if (-not (Get-Command bun -ErrorAction SilentlyContinue)) {
23
- Write-Error 'Bun installed but not found in PATH. Restart your shell and try again.'
101
+ Write-Fail 'Bun installed but was not found in PATH. Restart your shell and try again.'
24
102
  }
25
- Write-Info "Bun $(& bun --version) installed"
26
- } else {
27
- Write-Info "Bun $(& bun --version) found"
28
103
  }
29
104
 
30
- # ── Install clew-code ───────────────────────────────────────────────────────
31
- Write-Info 'Installing clew-code via bun...'
105
+ Write-Info "Bun $(& bun --version) found"
106
+ Write-Info 'Installing clew-code via Bun...'
107
+
32
108
  # --ignore-scripts skips sharp (from @xenova/transformers) install script,
33
- # which fails on Node.js <14 or missing build tools. clew imports sharp
34
- # dynamically it's only needed for image/ComputerUse features.
109
+ # which is only needed for image/ComputerUse features and can fail on machines
110
+ # without native build tooling.
35
111
  & bun install -g clew-code --ignore-scripts
36
112
 
37
- Write-Host "`nDone! Opening a new terminal with clew ready..." -ForegroundColor Green
113
+ $bunGlobalBin = Get-BunGlobalBin
114
+ if (-not (Test-PathListContains $env:Path $bunGlobalBin)) {
115
+ $env:Path = "$bunGlobalBin$([IO.Path]::PathSeparator)$env:Path"
116
+ }
117
+
118
+ $clewPath = Get-ClewCommandPath $bunGlobalBin
119
+ if ([string]::IsNullOrWhiteSpace($clewPath)) {
120
+ Write-Fail "clew-code installed, but the clew command was not found in $bunGlobalBin."
121
+ }
122
+
123
+ $clewVersion = Get-ClewVersion $clewPath
124
+
125
+ Write-Host ''
126
+ Write-Host 'Clew Code successfully installed!' -ForegroundColor Green
127
+ Write-Host ''
128
+ Write-Host " Version: $clewVersion"
129
+ Write-Host " Location: $clewPath"
130
+ Write-Host ''
131
+ Write-Host ' Next: Run clew --help to get started'
132
+ Write-Host ''
133
+
134
+ $userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
135
+ $machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine')
136
+ $isOnPermanentPath =
137
+ (Test-PathListContains $userPath $bunGlobalBin) -or
138
+ (Test-PathListContains $machinePath $bunGlobalBin)
139
+
140
+ if (-not $isOnPermanentPath) {
141
+ Write-Warn 'Setup notes:'
142
+ Write-Host " - Native installation exists but $bunGlobalBin is not in your PATH."
143
+ Write-Host ' Add it via System Properties -> Environment Variables -> User PATH -> New.'
144
+ Write-Host ' Then restart your terminal.'
145
+ Write-Host ''
146
+ }
38
147
 
39
- # ── Open new terminal with clew ready ──────────────────────────────────────
40
- Start-Process pwsh -ArgumentList "-NoExit", "clew"
148
+ Write-Host 'Installation complete!' -ForegroundColor Green