aigent-hive 0.8.0-test.1 → 0.9.0-test

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/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # aigent-hive
2
2
 
3
- Aigent Hive 0.8.0 test package 0.8.0-test.1. Install the test CLI with `npm install -g aigent-hive@test`.
3
+ Aigent Hive 0.9.0 package 0.9.0-test. Install the CLI with `npm install -g aigent-hive`.
package/install.cmd CHANGED
@@ -1,6 +1,6 @@
1
1
  @echo off
2
2
  setlocal EnableExtensions DisableDelayedExpansion
3
- set "HIVE_INSTALL_PACKAGE_VERSION=0.8.0-test.1"
3
+ set "HIVE_INSTALL_PACKAGE_VERSION=0.9.0-test"
4
4
  set "HIVE_INSTALL_URL=https://unpkg.com/aigent-hive@%HIVE_INSTALL_PACKAGE_VERSION%/install.ps1"
5
5
  set "HIVE_INSTALL_SCRIPT=%TEMP%\aigent-hive-install-%RANDOM%-%RANDOM%.ps1"
6
6
 
package/install.ps1 CHANGED
@@ -1,14 +1,14 @@
1
1
  param(
2
2
  [ValidatePattern('^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$')]
3
- [string]$Version = "0.8.0",
4
- [ValidatePattern('^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)-test\.[1-9][0-9]*$')]
5
- [string]$PackageVersion = "0.8.0-test.1",
3
+ [string]$Version = "0.9.0",
4
+ [ValidatePattern('^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-test(\.[1-9][0-9]*)?)?$')]
5
+ [string]$PackageVersion = "0.9.0-test",
6
6
  [string]$Prefix = "$env:LOCALAPPDATA\AigentHive"
7
7
  )
8
8
 
9
9
  $ErrorActionPreference = "Stop"
10
10
  $AuthorizedSignerThumbprint = ""
11
- $ExpectedArchiveSha256 = "219df7bf4c45be7a03b583755b6f063c07e4db953248c73776af1d33b488327e"
11
+ $ExpectedArchiveSha256 = "704636aa62ec28c44e2dd9ed2799b5c4187645e589f3954c8a14dc5825b94d4e"
12
12
  if ($AuthorizedSignerThumbprint -like "__AIGENT_HIVE_*") {
13
13
  $AuthorizedSignerThumbprint = ""
14
14
  }
@@ -24,6 +24,12 @@ if ($ExpectedArchiveSha256 -notmatch '^[0-9a-f]{64}$') {
24
24
  if (-not [Environment]::Is64BitOperatingSystem) {
25
25
  throw "Aigent Hive supports Windows x86_64 only"
26
26
  }
27
+ if (
28
+ $PackageVersion -ne $Version -and
29
+ $PackageVersion -notmatch ('^' + [regex]::Escape($Version) + '-test(\.[1-9][0-9]*)?$')
30
+ ) {
31
+ throw "PackageVersion must equal Version or use Version-test[.N]"
32
+ }
27
33
 
28
34
  function Test-HiveVersionOutput {
29
35
  param(
@@ -39,6 +45,33 @@ function Test-HiveVersionOutput {
39
45
  )
40
46
  }
41
47
 
48
+ function Get-FileSha256 {
49
+ param(
50
+ [Parameter(Mandatory = $true)]
51
+ [string]$Path
52
+ )
53
+
54
+ $stream = [IO.File]::Open(
55
+ $Path,
56
+ [IO.FileMode]::Open,
57
+ [IO.FileAccess]::Read,
58
+ [IO.FileShare]::Read
59
+ )
60
+ try {
61
+ $algorithm = [Security.Cryptography.SHA256]::Create()
62
+ try {
63
+ $digest = $algorithm.ComputeHash($stream)
64
+ }
65
+ finally {
66
+ $algorithm.Dispose()
67
+ }
68
+ }
69
+ finally {
70
+ $stream.Dispose()
71
+ }
72
+ return [BitConverter]::ToString($digest).Replace("-", "").ToLowerInvariant()
73
+ }
74
+
42
75
  function Assert-SafeDirectoryChain {
43
76
  param(
44
77
  [Parameter(Mandatory = $true)]
@@ -105,8 +138,11 @@ function Get-ValidatedDirectReceipt {
105
138
  $receipt.owner -ne "direct" -or
106
139
  $receipt.product -ne "aigent-hive" -or
107
140
  $receipt.version -notmatch '^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$' -or
108
- $receipt.package_version -notmatch (
109
- '^' + [regex]::Escape($receipt.version) + '-test\.[1-9][0-9]*$'
141
+ (
142
+ $receipt.package_version -ne $receipt.version -and
143
+ $receipt.package_version -notmatch (
144
+ '^' + [regex]::Escape($receipt.version) + '-test(\.[1-9][0-9]*)?$'
145
+ )
110
146
  ) -or
111
147
  $receipt.artifact_sha256 -notmatch '^sha256:[0-9a-f]{64}$'
112
148
  ) {
@@ -140,7 +176,7 @@ function Assert-ExistingDirectInstall {
140
176
  throw "existing hive binary is not owned by the direct installer"
141
177
  }
142
178
  $priorReceipt = Get-ValidatedDirectReceipt -ReceiptPath $ReceiptPath
143
- $priorDigest = (Get-FileHash -LiteralPath $Destination -Algorithm SHA256).Hash.ToLowerInvariant()
179
+ $priorDigest = Get-FileSha256 -Path $Destination
144
180
  if (
145
181
  $priorReceipt.artifact_sha256 -ne "sha256:$priorDigest"
146
182
  ) {
@@ -227,9 +263,7 @@ function Repair-PendingDirectInstall {
227
263
  -not $destinationItem.PSIsContainer -and
228
264
  -not ($destinationItem.Attributes -band [IO.FileAttributes]::ReparsePoint)
229
265
  ) {
230
- $destinationDigest = (
231
- Get-FileHash -LiteralPath $Destination -Algorithm SHA256
232
- ).Hash.ToLowerInvariant()
266
+ $destinationDigest = Get-FileSha256 -Path $Destination
233
267
  if ($pendingReceipt.artifact_sha256 -eq "sha256:$destinationDigest") {
234
268
  if ($null -ne $receiptItem) {
235
269
  Get-ValidatedDirectReceipt -ReceiptPath $ReceiptPath | Out-Null
@@ -249,9 +283,7 @@ function Repair-PendingDirectInstall {
249
283
  -not $destinationItem.PSIsContainer -and
250
284
  -not ($destinationItem.Attributes -band [IO.FileAttributes]::ReparsePoint)
251
285
  ) {
252
- $destinationDigest = (
253
- Get-FileHash -LiteralPath $Destination -Algorithm SHA256
254
- ).Hash.ToLowerInvariant()
286
+ $destinationDigest = Get-FileSha256 -Path $Destination
255
287
  if ($priorReceipt.artifact_sha256 -eq "sha256:$destinationDigest") {
256
288
  Assert-SafeDirectoryChain -Path $destinationDirectory
257
289
  Assert-SafeDirectoryChain -Path $receiptDirectory
@@ -298,7 +330,7 @@ $stagedReceipt = $null
298
330
  try {
299
331
  $archivePath = Join-Path $work $archive
300
332
  Invoke-WebRequest -UseBasicParsing -Uri "$base/$archive" -OutFile $archivePath
301
- $actual = (Get-FileHash -LiteralPath $archivePath -Algorithm SHA256).Hash.ToLowerInvariant()
333
+ $actual = Get-FileSha256 -Path $archivePath
302
334
  if ($ExpectedArchiveSha256 -ne $actual) {
303
335
  throw "release archive SHA-256 verification failed"
304
336
  }
@@ -368,7 +400,7 @@ try {
368
400
  Assert-SafeDirectoryChain -Path $binDirectory
369
401
  Assert-SafeDirectoryChain -Path $shareDirectory
370
402
  [IO.File]::Copy($binary, $stagedBinary, $false)
371
- $binaryDigest = (Get-FileHash -LiteralPath $binary -Algorithm SHA256).Hash.ToLowerInvariant()
403
+ $binaryDigest = Get-FileSha256 -Path $binary
372
404
  $receiptJson = @{
373
405
  schema_version = 1
374
406
  owner = "direct"
package/install.sh CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/bin/sh
2
2
  set -eu
3
3
 
4
- embedded_product_version='0.8.0'
5
- embedded_package_version='0.8.0-test.1'
4
+ embedded_product_version='0.9.0'
5
+ embedded_package_version='0.9.0-test'
6
6
  version=${AIGENT_HIVE_VERSION:-$embedded_product_version}
7
7
  package_version=${AIGENT_HIVE_PACKAGE_VERSION:-$embedded_package_version}
8
8
  prefix=${AIGENT_HIVE_PREFIX:-"${HOME:?HOME is required}/.local"}
9
9
  authorized_team_id=''
10
- sha_aarch64_apple_darwin='c07efa67c0423cb091fd01a7f33da5c0a567c400b39182858c1528de40aaa32e'
11
- sha_x86_64_apple_darwin='cc0398823a5fecdf3b660e02d5254f1e1c662d31ec2dcb67ea122d51af24539e'
12
- sha_aarch64_linux_musl='407ea1b99c48489226db28df1fc266c7f2d541dfb4df63e82814b8770b897fa7'
13
- sha_x86_64_linux_musl='85d91d38b9e8ac55df89ede59d962e13bae1a2effe11125eb73e97b670e7cc25'
10
+ sha_aarch64_apple_darwin='8c9bdd5f24075564c9b7b6f6e4ba20381753fa6959d608867a8a8029bdfbaa36'
11
+ sha_x86_64_apple_darwin='5cc69947abd97da375b939a03777fa7850a78fcbaccccebef422712b2d5cd3a2'
12
+ sha_aarch64_linux_musl='ba0ce4c98ebe84177ec07524aab0eba399e32680ffe552009eeff2fe732bb5e6'
13
+ sha_x86_64_linux_musl='fa9db846fc5f1b59e1e11e30f8888152eaed733e6f3fd23b73b97adc6373d46a'
14
14
 
15
15
  if ! printf '%s\n' "$version" | awk -F. '
16
16
  NF != 3 { exit 1 }
@@ -26,15 +26,17 @@ if ! printf '%s\n' "$version" | awk -F. '
26
26
  exit 2
27
27
  fi
28
28
  case "$package_version" in
29
+ "$version") ;;
30
+ "$version"-test) ;;
29
31
  "$version"-test.[1-9]*)
30
32
  if ! printf '%s\n' "${package_version#"$version-test."}" |
31
33
  awk '/^[1-9][0-9]*$/ { next } { exit 1 }'; then
32
- echo "AIGENT_HIVE_PACKAGE_VERSION must be PRODUCT_VERSION-test.N" >&2
34
+ echo "AIGENT_HIVE_PACKAGE_VERSION must equal PRODUCT_VERSION or use PRODUCT_VERSION-test[.N]" >&2
33
35
  exit 2
34
36
  fi
35
37
  ;;
36
38
  *)
37
- echo "AIGENT_HIVE_PACKAGE_VERSION must be PRODUCT_VERSION-test.N" >&2
39
+ echo "AIGENT_HIVE_PACKAGE_VERSION must equal PRODUCT_VERSION or use PRODUCT_VERSION-test[.N]" >&2
38
40
  exit 2
39
41
  ;;
40
42
  esac
@@ -193,6 +195,8 @@ parse_receipt() {
193
195
  return 1
194
196
  fi
195
197
  case "$parsed_package_version" in
198
+ "$parsed_version") ;;
199
+ "$parsed_version"-test) ;;
196
200
  "$parsed_version"-test.[1-9]*)
197
201
  if ! printf '%s\n' "${parsed_package_version#"$parsed_version-test."}" |
198
202
  awk '/^[1-9][0-9]*$/ { next } { exit 1 }'; then
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "aigent-hive",
3
- "version": "0.8.0-test.1",
3
+ "version": "0.9.0-test",
4
4
  "aigentHive": {
5
- "productVersion": "0.8.0"
5
+ "productVersion": "0.9.0"
6
6
  },
7
7
  "description": "Provider-neutral local agent harness for subscription-authenticated hosts",
8
8
  "license": "Apache-2.0",
@@ -31,10 +31,10 @@
31
31
  "node": ">=18"
32
32
  },
33
33
  "optionalDependencies": {
34
- "@aigent-hive/darwin-arm64": "0.8.0-test.1",
35
- "@aigent-hive/darwin-x64": "0.8.0-test.1",
36
- "@aigent-hive/linux-arm64": "0.8.0-test.1",
37
- "@aigent-hive/linux-x64": "0.8.0-test.1",
38
- "@aigent-hive/win32-x64": "0.8.0-test.1"
34
+ "@aigent-hive/darwin-arm64": "0.9.0-test",
35
+ "@aigent-hive/darwin-x64": "0.9.0-test",
36
+ "@aigent-hive/linux-arm64": "0.9.0-test",
37
+ "@aigent-hive/linux-x64": "0.9.0-test",
38
+ "@aigent-hive/win32-x64": "0.9.0-test"
39
39
  }
40
40
  }