@muthuishere/aos 0.9.1 → 0.11.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/install.cmd +200 -144
- package/install.sh +2 -1
- package/lib/install.js +1 -1
- package/package.json +1 -1
package/install.cmd
CHANGED
|
@@ -1,144 +1,200 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
rem Install aos on Windows from a GitHub release, a local folder, a mirror URL,
|
|
3
|
-
rem or a single aos.exe. No Go toolchain, no administrator.
|
|
4
|
-
rem
|
|
5
|
-
rem curl -fsSL -o install.cmd https://raw.githubusercontent.com/muthuishere/aos/main/install.cmd && install.cmd
|
|
6
|
-
rem install.cmd /version v0.6.0
|
|
7
|
-
rem install.cmd /from C:\path\to\release-folder (goreleaser archives + checksums.txt)
|
|
8
|
-
rem install.cmd /from https://mirror.example/aos/v0.6.0/
|
|
9
|
-
rem install.cmd /from .\aos_0.5.0_windows_arm64.zip (one release archive: unpacked)
|
|
10
|
-
rem install.cmd /from .\aos.exe (copied in as-is)
|
|
11
|
-
rem install.cmd /dir %USERPROFILE%\bin
|
|
12
|
-
rem
|
|
13
|
-
rem --from / --version / --dir work too. Environment equivalents: AOS_FROM,
|
|
14
|
-
rem AOS_VERSION, AOS_INSTALL_DIR. Default dir: %LOCALAPPDATA%\Programs\aos,
|
|
15
|
-
rem added to your user PATH (/no-path or AOS_NO_PATH=1 leaves PATH alone).
|
|
16
|
-
rem
|
|
17
|
-
rem
|
|
18
|
-
rem
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
set "
|
|
22
|
-
set "
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
1
|
+
@echo off
|
|
2
|
+
rem Install aos on Windows from a GitHub release, a local folder, a mirror URL,
|
|
3
|
+
rem or a single aos.exe. No Go toolchain, no administrator.
|
|
4
|
+
rem
|
|
5
|
+
rem curl -fsSL -o install.cmd https://raw.githubusercontent.com/muthuishere/aos/main/install.cmd && install.cmd
|
|
6
|
+
rem install.cmd /version v0.6.0
|
|
7
|
+
rem install.cmd /from C:\path\to\release-folder (goreleaser archives + checksums.txt)
|
|
8
|
+
rem install.cmd /from https://mirror.example/aos/v0.6.0/
|
|
9
|
+
rem install.cmd /from .\aos_0.5.0_windows_arm64.zip (one release archive: unpacked)
|
|
10
|
+
rem install.cmd /from .\aos.exe (copied in as-is)
|
|
11
|
+
rem install.cmd /dir %USERPROFILE%\bin
|
|
12
|
+
rem
|
|
13
|
+
rem --from / --version / --dir work too. Environment equivalents: AOS_FROM,
|
|
14
|
+
rem AOS_VERSION, AOS_INSTALL_DIR. Default dir: %LOCALAPPDATA%\Programs\aos,
|
|
15
|
+
rem added to your user PATH (/no-path or AOS_NO_PATH=1 leaves PATH alone).
|
|
16
|
+
rem
|
|
17
|
+
rem Plain cmd.exe only (no PowerShell): curl.exe, tar.exe and certutil ship
|
|
18
|
+
rem with Windows 10 1803+ and Windows 11.
|
|
19
|
+
setlocal EnableExtensions DisableDelayedExpansion
|
|
20
|
+
|
|
21
|
+
set "REPO=muthuishere/aos"
|
|
22
|
+
set "FROM=%AOS_FROM%"
|
|
23
|
+
if not defined FROM set "FROM=%AOS_DOWNLOAD_BASE%"
|
|
24
|
+
set "VERSION=%AOS_VERSION%"
|
|
25
|
+
set "DIR=%AOS_INSTALL_DIR%"
|
|
26
|
+
if not defined DIR set "DIR=%LOCALAPPDATA%\Programs\aos"
|
|
27
|
+
set "NOPATH=%AOS_NO_PATH%"
|
|
28
|
+
|
|
29
|
+
rem ---- arguments ("/from=X" arrives as two words: cmd splits on '=') ----
|
|
30
|
+
:args
|
|
31
|
+
if "%~1"=="" goto args_done
|
|
32
|
+
set "A=%~1"
|
|
33
|
+
if /i "%A%"=="/from" (set "FROM=%~2" & shift & shift & goto args)
|
|
34
|
+
if /i "%A%"=="--from" (set "FROM=%~2" & shift & shift & goto args)
|
|
35
|
+
if /i "%A%"=="/version" (set "VERSION=%~2" & shift & shift & goto args)
|
|
36
|
+
if /i "%A%"=="--version" (set "VERSION=%~2" & shift & shift & goto args)
|
|
37
|
+
if /i "%A%"=="/dir" (set "DIR=%~2" & shift & shift & goto args)
|
|
38
|
+
if /i "%A%"=="--dir" (set "DIR=%~2" & shift & shift & goto args)
|
|
39
|
+
if /i "%A%"=="/no-path" (set "NOPATH=1" & shift & goto args)
|
|
40
|
+
if /i "%A%"=="--no-path" (set "NOPATH=1" & shift & goto args)
|
|
41
|
+
if /i "%A%"=="/?" goto usage
|
|
42
|
+
if /i "%A%"=="/h" goto usage
|
|
43
|
+
if /i "%A%"=="--help" goto usage
|
|
44
|
+
call :fail "unknown argument: %A%"
|
|
45
|
+
exit /b 1
|
|
46
|
+
:usage
|
|
47
|
+
echo install.cmd [/from ^<folder^|url^|aos.exe^|archive.zip^>] [/version vX.Y.Z] [/dir ^<path^>] [/no-path]
|
|
48
|
+
exit /b 0
|
|
49
|
+
:args_done
|
|
50
|
+
|
|
51
|
+
for %%T in (curl.exe tar.exe certutil.exe) do (
|
|
52
|
+
where %%T >nul 2>nul || (call :fail "%%T is missing; it ships with Windows 10 1803+ and Windows 11" & exit /b 1)
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
set "ARCH=amd64"
|
|
56
|
+
if /i "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "ARCH=arm64"
|
|
57
|
+
if /i "%PROCESSOR_ARCHITEW6432%"=="ARM64" set "ARCH=arm64"
|
|
58
|
+
|
|
59
|
+
set "TMPD=%TEMP%\aos-install-%RANDOM%%RANDOM%"
|
|
60
|
+
mkdir "%TMPD%" >nul 2>nul
|
|
61
|
+
if not exist "%DIR%" mkdir "%DIR%"
|
|
62
|
+
if not exist "%DIR%" (call :fail "could not create %DIR%" & goto cleanup_fail)
|
|
63
|
+
set "TARGET=%DIR%\aos.exe"
|
|
64
|
+
|
|
65
|
+
rem ---- a single local file: an archive or the executable ----
|
|
66
|
+
if defined FROM if exist "%FROM%" if not exist "%FROM%\*" goto from_file
|
|
67
|
+
goto from_release
|
|
68
|
+
|
|
69
|
+
:from_file
|
|
70
|
+
for %%F in ("%FROM%") do set "FEXT=%%~xF"
|
|
71
|
+
if /i "%FEXT%"==".zip" (
|
|
72
|
+
echo ==^> Installing from the archive %FROM%
|
|
73
|
+
mkdir "%TMPD%\x" >nul 2>nul
|
|
74
|
+
tar -xf "%FROM%" -C "%TMPD%\x" || (call :fail "could not unpack %FROM%" & goto cleanup_fail)
|
|
75
|
+
if not exist "%TMPD%\x\aos.exe" (call :fail "%FROM% does not contain aos.exe" & goto cleanup_fail)
|
|
76
|
+
copy /y "%TMPD%\x\aos.exe" "%TARGET%" >nul || (call :fail "could not write %TARGET%" & goto cleanup_fail)
|
|
77
|
+
) else (
|
|
78
|
+
echo ==^> Installing the executable %FROM%
|
|
79
|
+
copy /y "%FROM%" "%TARGET%" >nul || (call :fail "could not write %TARGET%" & goto cleanup_fail)
|
|
80
|
+
)
|
|
81
|
+
goto installed
|
|
82
|
+
|
|
83
|
+
rem ---- a release: GitHub, a mirror URL or a local folder ----
|
|
84
|
+
:from_release
|
|
85
|
+
set "ISURL=0"
|
|
86
|
+
if defined FROM goto have_base
|
|
87
|
+
if not defined VERSION (
|
|
88
|
+
for /f "delims=" %%U in ('curl -fsSL -o nul -w "%%{url_effective}" "https://github.com/%REPO%/releases/latest"') do set "LATEST=%%U"
|
|
89
|
+
)
|
|
90
|
+
if not defined VERSION (
|
|
91
|
+
if not defined LATEST (call :fail "could not resolve the latest release of %REPO%" & goto cleanup_fail)
|
|
92
|
+
for %%V in ("%LATEST:/=" "%") do set "VERSION=%%~V"
|
|
93
|
+
)
|
|
94
|
+
if not "%VERSION:~0,1%"=="v" set "VERSION=v%VERSION%"
|
|
95
|
+
set "BASE=https://github.com/%REPO%/releases/download/%VERSION%"
|
|
96
|
+
set "ISURL=1"
|
|
97
|
+
goto base_ready
|
|
98
|
+
:have_base
|
|
99
|
+
set "BASE=%FROM%"
|
|
100
|
+
if "%BASE:~-1%"=="/" set "BASE=%BASE:~0,-1%"
|
|
101
|
+
if "%BASE:~-1%"=="\" set "BASE=%BASE:~0,-1%"
|
|
102
|
+
if /i "%BASE:~0,7%"=="http://" set "ISURL=1"
|
|
103
|
+
if /i "%BASE:~0,8%"=="https://" set "ISURL=1"
|
|
104
|
+
if "%ISURL%"=="0" if not exist "%BASE%\*" (call :fail "/from %FROM% is not a folder, an executable, or an http(s) URL" & goto cleanup_fail)
|
|
105
|
+
:base_ready
|
|
106
|
+
echo ==^> Installing aos for windows/%ARCH% from %BASE%
|
|
107
|
+
|
|
108
|
+
set "VNUM="
|
|
109
|
+
if defined VERSION set "VNUM=%VERSION:v=%"
|
|
110
|
+
set "ARCHIVE="
|
|
111
|
+
set "SUMS=%TMPD%\checksums.txt"
|
|
112
|
+
call :fetch checksums.txt "%SUMS%"
|
|
113
|
+
if errorlevel 1 goto no_sums
|
|
114
|
+
for /f "usebackq tokens=1,2" %%a in ("%SUMS%") do call :pick "%%b"
|
|
115
|
+
if not defined ARCHIVE (call :fail "no aos archive for windows/%ARCH% at %BASE%" & goto cleanup_fail)
|
|
116
|
+
goto have_archive
|
|
117
|
+
:no_sums
|
|
118
|
+
del "%SUMS%" >nul 2>nul
|
|
119
|
+
if defined VNUM (
|
|
120
|
+
set "ARCHIVE=aos_%VNUM%_windows_%ARCH%.zip"
|
|
121
|
+
goto have_archive
|
|
122
|
+
)
|
|
123
|
+
if "%ISURL%"=="1" (call :fail "%BASE% has no checksums.txt to find the archive by; pass /version" & goto cleanup_fail)
|
|
124
|
+
for /f "delims=" %%n in ('dir /b /a-d "%BASE%\aos_*_windows_%ARCH%.zip" 2^>nul') do if not defined ARCHIVE set "ARCHIVE=%%n"
|
|
125
|
+
if not defined ARCHIVE (call :fail "no aos archive for windows/%ARCH% at %BASE%" & goto cleanup_fail)
|
|
126
|
+
:have_archive
|
|
127
|
+
|
|
128
|
+
set "ZIP=%TMPD%\%ARCHIVE%"
|
|
129
|
+
call :fetch "%ARCHIVE%" "%ZIP%"
|
|
130
|
+
if errorlevel 1 (call :fail "download failed: %BASE%/%ARCHIVE%" & goto cleanup_fail)
|
|
131
|
+
if exist "%SUMS%" (
|
|
132
|
+
call :verify
|
|
133
|
+
if errorlevel 1 goto cleanup_fail
|
|
134
|
+
echo sha256 verified
|
|
135
|
+
) else (
|
|
136
|
+
echo WARNING: %BASE% has no checksums.txt -- installing %ARCHIVE% WITHOUT verifying it 1>&2
|
|
137
|
+
)
|
|
138
|
+
mkdir "%TMPD%\x" >nul 2>nul
|
|
139
|
+
tar -xf "%ZIP%" -C "%TMPD%\x" || (call :fail "could not unpack %ARCHIVE%" & goto cleanup_fail)
|
|
140
|
+
if not exist "%TMPD%\x\aos.exe" (call :fail "%ARCHIVE% does not contain aos.exe" & goto cleanup_fail)
|
|
141
|
+
copy /y "%TMPD%\x\aos.exe" "%TARGET%" >nul || (call :fail "could not write %TARGET%" & goto cleanup_fail)
|
|
142
|
+
|
|
143
|
+
:installed
|
|
144
|
+
rd /s /q "%TMPD%" >nul 2>nul
|
|
145
|
+
echo %TARGET%
|
|
146
|
+
if defined NOPATH goto run_once
|
|
147
|
+
set "UPATH="
|
|
148
|
+
for /f "skip=2 tokens=2,*" %%a in ('reg query HKCU\Environment /v Path 2^>nul') do set "UPATH=%%b"
|
|
149
|
+
echo ;%UPATH%; | find /i ";%DIR%;" >nul && goto run_once
|
|
150
|
+
if defined UPATH (set "NEWPATH=%UPATH%;%DIR%") else (set "NEWPATH=%DIR%")
|
|
151
|
+
rem reg, not setx: setx truncates PATH at 1024 characters.
|
|
152
|
+
reg add HKCU\Environment /v Path /t REG_EXPAND_SZ /d "%NEWPATH%" /f >nul || (call :fail "could not update your user PATH" & exit /b 1)
|
|
153
|
+
rem setx broadcasts the environment change so new terminals see the PATH.
|
|
154
|
+
setx AOS_INSTALLED 1 >nul 2>nul
|
|
155
|
+
reg delete HKCU\Environment /v AOS_INSTALLED /f >nul 2>nul
|
|
156
|
+
echo added %DIR% to your user PATH (open a new terminal to pick it up)
|
|
157
|
+
:run_once
|
|
158
|
+
rem Running it once also installs the bundled agent skill.
|
|
159
|
+
endlocal & set "PATH=%DIR%;%PATH%" & "%DIR%\aos.exe" --version
|
|
160
|
+
exit /b %ERRORLEVEL%
|
|
161
|
+
|
|
162
|
+
rem ---- helpers ----------------------------------------------------------------
|
|
163
|
+
|
|
164
|
+
:fetch
|
|
165
|
+
rem :fetch <name> <dest> -- download or copy one release file; errorlevel 1 on failure
|
|
166
|
+
if "%ISURL%"=="1" (
|
|
167
|
+
curl -fsSL -o "%~2" "%BASE%/%~1" 2>nul || exit /b 1
|
|
168
|
+
) else (
|
|
169
|
+
copy /y "%BASE%\%~1" "%~2" >nul 2>nul || exit /b 1
|
|
170
|
+
)
|
|
171
|
+
exit /b 0
|
|
172
|
+
|
|
173
|
+
:pick
|
|
174
|
+
rem :pick <name> -- the first checksums entry that is this arch's archive (and version)
|
|
175
|
+
if defined ARCHIVE exit /b 0
|
|
176
|
+
set "N=%~1"
|
|
177
|
+
echo %N%| findstr /r /i /c:"^aos_.*_windows_%ARCH%\.zip$" >nul || exit /b 0
|
|
178
|
+
if defined VNUM (
|
|
179
|
+
echo %N%| find "_%VNUM%_" >nul || exit /b 0
|
|
180
|
+
)
|
|
181
|
+
set "ARCHIVE=%N%"
|
|
182
|
+
exit /b 0
|
|
183
|
+
|
|
184
|
+
:verify
|
|
185
|
+
set "WANT="
|
|
186
|
+
for /f "usebackq tokens=1,2" %%a in ("%SUMS%") do if /i "%%b"=="%ARCHIVE%" set "WANT=%%a"
|
|
187
|
+
set "GOT="
|
|
188
|
+
for /f "skip=1 delims=" %%h in ('certutil -hashfile "%ZIP%" SHA256') do if not defined GOT set "GOT=%%h"
|
|
189
|
+
if defined GOT set "GOT=%GOT: =%"
|
|
190
|
+
if not defined WANT (call :fail "%ARCHIVE% is not listed in checksums.txt -- refusing to install" & exit /b 1)
|
|
191
|
+
if /i not "%WANT%"=="%GOT%" (call :fail "checksum mismatch for %ARCHIVE% -- refusing to install" & exit /b 1)
|
|
192
|
+
exit /b 0
|
|
193
|
+
|
|
194
|
+
:fail
|
|
195
|
+
echo install: %~1 1>&2
|
|
196
|
+
exit /b 1
|
|
197
|
+
|
|
198
|
+
:cleanup_fail
|
|
199
|
+
if defined TMPD rd /s /q "%TMPD%" >nul 2>nul
|
|
200
|
+
exit /b 1
|
package/install.sh
CHANGED
|
@@ -184,7 +184,8 @@ install_windows_host() {
|
|
|
184
184
|
if command -v unzip >/dev/null 2>&1; then
|
|
185
185
|
unzip -oq "$tmp/$zip" -d "$tmp/w"
|
|
186
186
|
else
|
|
187
|
-
|
|
187
|
+
# Windows' own tar.exe reads zip archives (no PowerShell).
|
|
188
|
+
tar.exe -xf "$(wslpath -w "$tmp/$zip")" -C "$(wslpath -w "$tmp/w")" >/dev/null
|
|
188
189
|
fi
|
|
189
190
|
[ -f "$tmp/w/aos.exe" ] || die "$zip does not contain aos.exe"
|
|
190
191
|
cp "$tmp/w/aos.exe" "$win_dir/aos.exe"
|
package/lib/install.js
CHANGED
|
@@ -35,7 +35,7 @@ function install() {
|
|
|
35
35
|
});
|
|
36
36
|
// 0.0.0 is the unpublished in-repo version: take the latest release.
|
|
37
37
|
if (version && version !== '0.0.0' && !env.AOS_VERSION) env.AOS_VERSION = 'v' + version;
|
|
38
|
-
// npm's proxy config reaches scripts as npm_config_*; curl
|
|
38
|
+
// npm's proxy config reaches scripts as npm_config_*; curl reads
|
|
39
39
|
// the conventional variables.
|
|
40
40
|
const proxy = env.npm_config_https_proxy || env.npm_config_proxy;
|
|
41
41
|
if (proxy) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muthuishere/aos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Hands for your AI agent: one CLI to drive macOS, Windows and Linux (windows, mouse, keyboard, screenshots, files, processes, services).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://muthuishere.github.io/aos/",
|