claws-code 0.8.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/.claude/commands/claws-auto.md +90 -0
- package/.claude/commands/claws-bin.md +28 -0
- package/.claude/commands/claws-cleanup.md +28 -0
- package/.claude/commands/claws-do.md +82 -0
- package/.claude/commands/claws-fix.md +40 -0
- package/.claude/commands/claws-goal.md +111 -0
- package/.claude/commands/claws-help.md +54 -0
- package/.claude/commands/claws-plan.md +103 -0
- package/.claude/commands/claws-report.md +29 -0
- package/.claude/commands/claws-status.md +37 -0
- package/.claude/commands/claws-update.md +32 -0
- package/.claude/commands/claws.md +64 -0
- package/.claude/rules/claws-default-behavior.md +76 -0
- package/.claude/settings.json +112 -0
- package/.claude/settings.local.json +19 -0
- package/.claude/skills/claws-auto-engine/SKILL.md +97 -0
- package/.claude/skills/claws-goal-tracker/SKILL.md +106 -0
- package/.claude/skills/claws-prompt-templates/SKILL.md +203 -0
- package/.claude/skills/claws-wave-lead/SKILL.md +126 -0
- package/.claude/skills/claws-wave-subworker/SKILL.md +60 -0
- package/CHANGELOG.md +1949 -0
- package/LICENSE +21 -0
- package/README.md +420 -0
- package/bin/cli.js +84 -0
- package/cli.js +223 -0
- package/docs/ARCHITECTURE.md +511 -0
- package/docs/event-protocol.md +588 -0
- package/docs/features.md +562 -0
- package/docs/guide.md +891 -0
- package/docs/index.html +716 -0
- package/docs/protocol.md +323 -0
- package/extension/.vscodeignore +15 -0
- package/extension/CHANGELOG.md +1906 -0
- package/extension/LICENSE +21 -0
- package/extension/README.md +137 -0
- package/extension/docs/features.md +424 -0
- package/extension/docs/protocol.md +197 -0
- package/extension/esbuild.mjs +25 -0
- package/extension/icon.png +0 -0
- package/extension/native/.metadata.json +10 -0
- package/extension/native/node-pty/LICENSE +69 -0
- package/extension/native/node-pty/README.md +165 -0
- package/extension/native/node-pty/lib/conpty_console_list_agent.js +16 -0
- package/extension/native/node-pty/lib/conpty_console_list_agent.js.map +1 -0
- package/extension/native/node-pty/lib/eventEmitter2.js +47 -0
- package/extension/native/node-pty/lib/eventEmitter2.js.map +1 -0
- package/extension/native/node-pty/lib/index.js +52 -0
- package/extension/native/node-pty/lib/index.js.map +1 -0
- package/extension/native/node-pty/lib/interfaces.js +7 -0
- package/extension/native/node-pty/lib/interfaces.js.map +1 -0
- package/extension/native/node-pty/lib/shared/conout.js +11 -0
- package/extension/native/node-pty/lib/shared/conout.js.map +1 -0
- package/extension/native/node-pty/lib/terminal.js +190 -0
- package/extension/native/node-pty/lib/terminal.js.map +1 -0
- package/extension/native/node-pty/lib/types.js +7 -0
- package/extension/native/node-pty/lib/types.js.map +1 -0
- package/extension/native/node-pty/lib/unixTerminal.js +346 -0
- package/extension/native/node-pty/lib/unixTerminal.js.map +1 -0
- package/extension/native/node-pty/lib/utils.js +39 -0
- package/extension/native/node-pty/lib/utils.js.map +1 -0
- package/extension/native/node-pty/lib/windowsConoutConnection.js +125 -0
- package/extension/native/node-pty/lib/windowsConoutConnection.js.map +1 -0
- package/extension/native/node-pty/lib/windowsPtyAgent.js +320 -0
- package/extension/native/node-pty/lib/windowsPtyAgent.js.map +1 -0
- package/extension/native/node-pty/lib/windowsTerminal.js +199 -0
- package/extension/native/node-pty/lib/windowsTerminal.js.map +1 -0
- package/extension/native/node-pty/lib/worker/conoutSocketWorker.js +22 -0
- package/extension/native/node-pty/lib/worker/conoutSocketWorker.js.map +1 -0
- package/extension/native/node-pty/package.json +64 -0
- package/extension/native/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
- package/extension/native/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
- package/extension/native/node-pty/prebuilds/darwin-x64/pty.node +0 -0
- package/extension/native/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
- package/extension/native/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
- package/extension/native/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
- package/extension/native/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
- package/extension/native/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
- package/extension/native/node-pty/prebuilds/win32-arm64/pty.node +0 -0
- package/extension/native/node-pty/prebuilds/win32-arm64/winpty-agent.exe +0 -0
- package/extension/native/node-pty/prebuilds/win32-arm64/winpty.dll +0 -0
- package/extension/native/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
- package/extension/native/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
- package/extension/native/node-pty/prebuilds/win32-x64/conpty.node +0 -0
- package/extension/native/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
- package/extension/native/node-pty/prebuilds/win32-x64/pty.node +0 -0
- package/extension/native/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
- package/extension/native/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
- package/extension/package-lock.json +605 -0
- package/extension/package.json +343 -0
- package/extension/scripts/bundle-native.mjs +104 -0
- package/extension/scripts/deploy-dev.mjs +60 -0
- package/extension/src/ansi-strip.ts +52 -0
- package/extension/src/backends/vscode/claws-pty.ts +483 -0
- package/extension/src/backends/vscode/status-bar.ts +99 -0
- package/extension/src/backends/vscode/vscode-backend.ts +282 -0
- package/extension/src/capture-store.ts +125 -0
- package/extension/src/event-log.ts +629 -0
- package/extension/src/event-schemas.ts +478 -0
- package/extension/src/extension.js +492 -0
- package/extension/src/extension.ts +873 -0
- package/extension/src/lifecycle-engine.ts +60 -0
- package/extension/src/lifecycle-rules.ts +171 -0
- package/extension/src/lifecycle-store.ts +506 -0
- package/extension/src/peer-registry.ts +176 -0
- package/extension/src/pipeline-registry.ts +82 -0
- package/extension/src/platform.ts +64 -0
- package/extension/src/protocol.ts +532 -0
- package/extension/src/server-config.ts +98 -0
- package/extension/src/server.ts +2210 -0
- package/extension/src/task-registry.ts +51 -0
- package/extension/src/terminal-backend.ts +211 -0
- package/extension/src/terminal-manager.ts +395 -0
- package/extension/src/topic-registry.ts +70 -0
- package/extension/src/topic-utils.ts +46 -0
- package/extension/src/transport.ts +45 -0
- package/extension/src/uninstall-cleanup.ts +232 -0
- package/extension/src/wave-registry.ts +314 -0
- package/extension/src/websocket-transport.ts +153 -0
- package/extension/tsconfig.json +23 -0
- package/lib/capabilities.js +145 -0
- package/lib/dry-run.js +43 -0
- package/lib/install.js +1018 -0
- package/lib/mcp-setup.js +92 -0
- package/lib/platform.js +240 -0
- package/lib/preflight.js +152 -0
- package/lib/shell-hook.js +343 -0
- package/lib/uninstall.js +162 -0
- package/lib/verify.js +166 -0
- package/mcp_server.js +3529 -0
- package/package.json +48 -0
- package/rules/claws-default-behavior.md +72 -0
- package/scripts/_helpers/atomic-file.mjs +137 -0
- package/scripts/_helpers/fix-repair.js +64 -0
- package/scripts/_helpers/json-safe.mjs +218 -0
- package/scripts/bump-version.sh +84 -0
- package/scripts/codegen/gen-docs.mjs +61 -0
- package/scripts/codegen/gen-json-schema.mjs +62 -0
- package/scripts/codegen/gen-mcp-tools.mjs +358 -0
- package/scripts/codegen/gen-types.mjs +172 -0
- package/scripts/codegen/index.mjs +42 -0
- package/scripts/dev-hooks/check-extension-dirs.js +77 -0
- package/scripts/dev-hooks/check-open-claws-terminals.js +70 -0
- package/scripts/dev-hooks/check-stale-main.js +55 -0
- package/scripts/dev-hooks/check-tag-pushed.js +51 -0
- package/scripts/dev-hooks/check-tag-vs-main.js +56 -0
- package/scripts/dev-vsix-install.sh +60 -0
- package/scripts/fix.sh +702 -0
- package/scripts/gen-client-types.mjs +81 -0
- package/scripts/git-hooks/pre-commit +31 -0
- package/scripts/hooks/lifecycle-state.js +61 -0
- package/scripts/hooks/package.json +4 -0
- package/scripts/hooks/post-tool-use-claws.js +292 -0
- package/scripts/hooks/pre-bash-no-verify-block.js +72 -0
- package/scripts/hooks/pre-tool-use-claws.js +206 -0
- package/scripts/hooks/session-start-claws.js +97 -0
- package/scripts/hooks/stop-claws.js +88 -0
- package/scripts/inject-claude-md.js +205 -0
- package/scripts/inject-dev-hooks.js +96 -0
- package/scripts/inject-global-claude-md.js +140 -0
- package/scripts/inject-settings-hooks.js +370 -0
- package/scripts/install.ps1 +146 -0
- package/scripts/install.sh +1729 -0
- package/scripts/monitor-arm-watch.js +155 -0
- package/scripts/rebuild-node-pty.sh +245 -0
- package/scripts/report.sh +232 -0
- package/scripts/shell-hook.fish +164 -0
- package/scripts/shell-hook.ps1 +33 -0
- package/scripts/shell-hook.sh +232 -0
- package/scripts/stream-events.js +399 -0
- package/scripts/terminal-wrapper.sh +36 -0
- package/scripts/test-enforcement.sh +132 -0
- package/scripts/test-install.sh +174 -0
- package/scripts/test-installer-parity.sh +135 -0
- package/scripts/test-template-enforcement.sh +76 -0
- package/scripts/uninstall.sh +143 -0
- package/scripts/update.sh +337 -0
- package/scripts/verify-release.sh +323 -0
- package/scripts/verify-wrapped.sh +194 -0
- package/templates/CLAUDE.global.md +135 -0
- package/templates/CLAUDE.project.md +37 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
#Requires -Version 5.1
|
|
2
|
+
# Claws — Windows PowerShell installer
|
|
3
|
+
# Usage: iwr https://raw.githubusercontent.com/neunaha/claws/v0.8-alpha/scripts/install.ps1 | iex
|
|
4
|
+
#
|
|
5
|
+
# Env overrides:
|
|
6
|
+
# $env:CLAWS_BRANCH — branch/tag to install (default: v0.8-alpha)
|
|
7
|
+
# $env:CLAWS_VSCODE_CLI — full path to Code.cmd (overrides auto-detection)
|
|
8
|
+
|
|
9
|
+
$ErrorActionPreference = 'Stop'
|
|
10
|
+
|
|
11
|
+
# Without SilentlyContinue, PS 5.1 redraws the progress bar every chunk (20-50x slower)
|
|
12
|
+
$ProgressPreference = 'SilentlyContinue'
|
|
13
|
+
|
|
14
|
+
# Branch override (PS 5.1: no ?? operator)
|
|
15
|
+
if ($env:CLAWS_BRANCH) { $BRANCH = $env:CLAWS_BRANCH } else { $BRANCH = 'v0.8-alpha' }
|
|
16
|
+
|
|
17
|
+
# Banner (ASCII-only — Unicode box chars render as ? in PS 5.1 / legacy consoles)
|
|
18
|
+
Write-Host ""
|
|
19
|
+
Write-Host " +-------------------------------------------+" -ForegroundColor Cyan
|
|
20
|
+
Write-Host " | |" -ForegroundColor Cyan
|
|
21
|
+
Write-Host " | CLAWS -- Terminal Control Bridge |" -ForegroundColor Cyan
|
|
22
|
+
Write-Host " | Project-local orchestration setup |" -ForegroundColor Cyan
|
|
23
|
+
Write-Host " | |" -ForegroundColor Cyan
|
|
24
|
+
Write-Host " +-------------------------------------------+" -ForegroundColor Cyan
|
|
25
|
+
Write-Host ""
|
|
26
|
+
|
|
27
|
+
# Preflight
|
|
28
|
+
Write-Host "Checking dependencies..." -ForegroundColor White
|
|
29
|
+
|
|
30
|
+
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
|
|
31
|
+
Write-Host " ERROR: 'node' not found in PATH." -ForegroundColor Red
|
|
32
|
+
Write-Host " Install Node.js 18+ from: https://nodejs.org/" -ForegroundColor Yellow
|
|
33
|
+
exit 1
|
|
34
|
+
}
|
|
35
|
+
$NodeVersionStr = (& node --version 2>&1).ToString().TrimStart('v')
|
|
36
|
+
$NodeMajor = [int]($NodeVersionStr.Split('.')[0])
|
|
37
|
+
if ($NodeMajor -lt 18) {
|
|
38
|
+
Write-Host (" ERROR: Node.js v" + $NodeVersionStr + " is too old -- Claws requires Node 18+.") -ForegroundColor Red
|
|
39
|
+
Write-Host " Upgrade from: https://nodejs.org/" -ForegroundColor Yellow
|
|
40
|
+
exit 1
|
|
41
|
+
}
|
|
42
|
+
Write-Host (" OK node v" + $NodeVersionStr) -ForegroundColor Green
|
|
43
|
+
|
|
44
|
+
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
|
|
45
|
+
Write-Host " ERROR: 'git' not found in PATH." -ForegroundColor Red
|
|
46
|
+
Write-Host " Install Git from: https://git-scm.com/download/win" -ForegroundColor Yellow
|
|
47
|
+
exit 1
|
|
48
|
+
}
|
|
49
|
+
$GitVersionStr = (& git --version 2>&1).ToString() -replace 'git version ', ''
|
|
50
|
+
Write-Host (" OK git " + $GitVersionStr) -ForegroundColor Green
|
|
51
|
+
|
|
52
|
+
# MSVC preflight — node-pty requires C++ build tools; warn-not-block if absent
|
|
53
|
+
$HasMSVC = (Get-Command 'cl.exe' -ErrorAction SilentlyContinue) -or
|
|
54
|
+
(Get-Command 'msbuild.exe' -ErrorAction SilentlyContinue)
|
|
55
|
+
if (-not $HasMSVC) {
|
|
56
|
+
Write-Host " WARN: C++ build tools not found -- node-pty may not compile." -ForegroundColor Yellow
|
|
57
|
+
Write-Host " Install: winget install Microsoft.VisualStudio.BuildTools" -ForegroundColor DarkGray
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
Write-Host (" Project: " + (Get-Location).Path) -ForegroundColor DarkGray
|
|
61
|
+
Write-Host ""
|
|
62
|
+
|
|
63
|
+
# Download + extract + delegate
|
|
64
|
+
$TempDir = $null
|
|
65
|
+
try {
|
|
66
|
+
$TempDir = Join-Path $env:TEMP ("claws-install-" + [System.Guid]::NewGuid().ToString('N').Substring(0, 8))
|
|
67
|
+
New-Item -ItemType Directory -Path $TempDir -Force | Out-Null
|
|
68
|
+
|
|
69
|
+
$TarballUrl = "https://codeload.github.com/neunaha/claws/tar.gz/refs/heads/" + $BRANCH
|
|
70
|
+
$TarballPath = Join-Path $TempDir "claws.tar.gz"
|
|
71
|
+
$ExtractDir = Join-Path $TempDir "extract"
|
|
72
|
+
|
|
73
|
+
Write-Host ("Downloading branch '" + $BRANCH + "'...") -ForegroundColor White
|
|
74
|
+
Invoke-WebRequest -Uri $TarballUrl -OutFile $TarballPath -UseBasicParsing
|
|
75
|
+
|
|
76
|
+
Write-Host "Extracting..." -ForegroundColor White
|
|
77
|
+
New-Item -ItemType Directory -Path $ExtractDir -Force | Out-Null
|
|
78
|
+
& tar -xzf $TarballPath -C $ExtractDir
|
|
79
|
+
if ($LASTEXITCODE -ne 0) { throw ("tar extraction failed (exit " + $LASTEXITCODE + ")") }
|
|
80
|
+
|
|
81
|
+
# GitHub tarballs unpack to one top-level directory (e.g. neunaha-claws-<sha>)
|
|
82
|
+
$RepoRoot = Get-ChildItem -Path $ExtractDir -Directory | Select-Object -First 1 -ExpandProperty FullName
|
|
83
|
+
if (-not $RepoRoot) { throw ("No directory found in extracted archive at " + $ExtractDir) }
|
|
84
|
+
|
|
85
|
+
$NodeCli = Join-Path $RepoRoot "bin\cli.js"
|
|
86
|
+
if (-not (Test-Path $NodeCli)) { throw ("bin\cli.js not found at " + $NodeCli) }
|
|
87
|
+
|
|
88
|
+
# Detect VS Code CLI: env override → LOCALAPPDATA → ProgramFiles → PATH
|
|
89
|
+
$CodePath = ''
|
|
90
|
+
if ($env:CLAWS_VSCODE_CLI) {
|
|
91
|
+
$CodePath = $env:CLAWS_VSCODE_CLI
|
|
92
|
+
} elseif (Test-Path "$env:LOCALAPPDATA\Programs\Microsoft VS Code\bin\Code.cmd") {
|
|
93
|
+
$CodePath = "$env:LOCALAPPDATA\Programs\Microsoft VS Code\bin\Code.cmd"
|
|
94
|
+
} elseif (Test-Path "$env:ProgramFiles\Microsoft VS Code\bin\Code.cmd") {
|
|
95
|
+
$CodePath = "$env:ProgramFiles\Microsoft VS Code\bin\Code.cmd"
|
|
96
|
+
} elseif (Get-Command 'Code.cmd' -ErrorAction SilentlyContinue) {
|
|
97
|
+
$CodePath = (Get-Command 'Code.cmd').Source
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (-not $CodePath) {
|
|
101
|
+
Write-Host " WARN: VS Code CLI not found -- extension install will be skipped." -ForegroundColor Yellow
|
|
102
|
+
Write-Host " After install: VS Code > 'Shell Command: Install code command in PATH'" -ForegroundColor DarkGray
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
# Pre-install: kill stale worker mcp_server.js processes from prior sessions.
|
|
106
|
+
# Only kills node.exe processes whose CommandLine contains the project's
|
|
107
|
+
# .claws-bin\mcp_server.js path — prevents collateral kills of other projects.
|
|
108
|
+
# (lib/install.js repeats this check with CLAWS_TERMINAL_CORR_ID env filtering
|
|
109
|
+
# on platforms where PowerShell env introspection is not needed.)
|
|
110
|
+
$ClawsCleanKilled = 0
|
|
111
|
+
$ClawsProjectRoot = (Get-Location).Path
|
|
112
|
+
$ClawsMcpPath = Join-Path $ClawsProjectRoot ".claws-bin\mcp_server.js"
|
|
113
|
+
try {
|
|
114
|
+
$ClawsMyPid = $PID
|
|
115
|
+
Get-CimInstance Win32_Process -Filter "Name='node.exe'" | ForEach-Object {
|
|
116
|
+
$proc = $_
|
|
117
|
+
if ($proc.CommandLine -and $proc.CommandLine.Contains($ClawsMcpPath) -and
|
|
118
|
+
$proc.ProcessId -ne $ClawsMyPid) {
|
|
119
|
+
$shortCmd = $proc.CommandLine.Substring(0, [Math]::Min(80, $proc.CommandLine.Length))
|
|
120
|
+
Write-Host (" [claws-clean] kill PID " + $proc.ProcessId + ": " + $shortCmd) -ForegroundColor DarkGray
|
|
121
|
+
Stop-Process -Id $proc.ProcessId -Force -ErrorAction SilentlyContinue
|
|
122
|
+
$ClawsCleanKilled++
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
} catch {
|
|
126
|
+
# Non-fatal — cleanup is best-effort; node installer will run regardless
|
|
127
|
+
}
|
|
128
|
+
Write-Host (" [claws-clean] killed " + $ClawsCleanKilled + " stale processes") -ForegroundColor DarkGray
|
|
129
|
+
|
|
130
|
+
# Delegate to Node installer; lib/install.js owns VSIX build, phases, and final output
|
|
131
|
+
Write-Host "Running installer..." -ForegroundColor White
|
|
132
|
+
$NodeArgs = @($NodeCli, 'install', '--vscode-cli', $CodePath) + $args
|
|
133
|
+
& node @NodeArgs
|
|
134
|
+
if ($LASTEXITCODE -ne 0) { throw ("node installer exited with code " + $LASTEXITCODE) }
|
|
135
|
+
|
|
136
|
+
Remove-Item -Recurse -Force -Path $TempDir -ErrorAction SilentlyContinue
|
|
137
|
+
$TempDir = $null
|
|
138
|
+
} catch {
|
|
139
|
+
Write-Host ""
|
|
140
|
+
Write-Host (" INSTALL FAILED: " + $_) -ForegroundColor Red
|
|
141
|
+
if ($TempDir -and (Test-Path $TempDir)) {
|
|
142
|
+
Write-Host (" Extract dir left for debugging: " + $TempDir) -ForegroundColor Yellow
|
|
143
|
+
}
|
|
144
|
+
Write-Host ""
|
|
145
|
+
exit 1
|
|
146
|
+
}
|