You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,10 @@ Earlier entries pre-date this convention and only carry their version's compare
15
15
16
16
## [Unreleased]
17
17
18
+
### Changed
19
+
20
+
- Add direct-installer provenance receipts (`agora.install.json`) and make `agora upgrade` use receipt-first install-method detection before falling back to package-manager path inference.
Copy file name to clipboardExpand all lines: docs/automation.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -819,6 +819,55 @@ Example:
819
819
820
820
Returns the updated config object with the same shape as `config get`. Safe branch fields are the same as `config get`.
821
821
822
+
### `upgrade`
823
+
824
+
Example:
825
+
826
+
```bash
827
+
./agora upgrade --json
828
+
./agora upgrade --check --json
829
+
./agora --upgrade-check --json
830
+
```
831
+
832
+
Required `data` fields:
833
+
-`action`
834
+
`upgrade` for the subcommand and `upgrade-check` for the root `--upgrade-check` pseudo-command.
835
+
-`installMethod`
836
+
One of `installer`, `npm`, `homebrew`, `scoop`, `chocolatey`, `winget`, or `unknown`.
837
+
-`installSource`
838
+
`install.sh` / `install.ps1` when read from a valid direct-installer receipt, `path` when inferred from the resolved executable path, or `fallback` when no durable source was available.
839
+
-`installedPath`
840
+
Resolved executable path used for receipt validation and path inference.
841
+
-`upgradeCommand`
842
+
The user-facing command for the owning install channel.
843
+
-`command`
844
+
Backwards-compatible alias for `upgradeCommand`.
845
+
-`status`
846
+
One of `manual`, `dry-run`, `up-to-date`, or `upgraded`.
847
+
848
+
Optional fields:
849
+
-`receiptPath`
850
+
Path to the validated `agora.install.json` receipt when present.
851
+
-`currentVersion`
852
+
Version of the running binary for `agora upgrade`.
853
+
-`latestVersion`
854
+
Latest resolved release version when the command resolves GitHub release metadata.
855
+
-`version`
856
+
Structured version payload for `agora --upgrade-check`.
857
+
-`receiptWarning`
858
+
Nonfatal warning when a direct-installer self-update succeeded but the CLI could not refresh `agora.install.json`.
859
+
860
+
Upgrade behavior:
861
+
- direct-installer installs (`installMethod: "installer"`) self-update in place after downloading the GitHub release archive and verifying it against `checksums.txt`
862
+
- package-manager installs return `status: "manual"` with the owning package-manager command; agents should run that command only after user approval
863
+
-`unknown` means the CLI could not verify the install channel, usually because the binary is a development/test build
Direct installer runs (`install.sh` and `install.ps1`) write `agora.install.json` next to the installed binary after the binary has been downloaded, checksum-verified, installed, and smoke-tested. Direct self-updates refresh the same receipt after replacing the binary. The receipt records the install method, install path, version, timestamp, and installer source so `agora upgrade` can choose the right update path without relying on shell environment variables.
141
+
142
+
`agora upgrade` uses this order:
143
+
144
+
1. Read and validate the adjacent `agora.install.json` receipt.
145
+
2. Fall back to the resolved binary path for package-manager installs (`node_modules`, Homebrew `Cellar`, Scoop, Chocolatey, or winget paths).
146
+
3. Fall back to the direct installer path when the binary is named `agora` / `agora.exe` and no package-manager path is detected.
147
+
4. Report `unknown` for development/test binaries where the install method cannot be verified.
148
+
149
+
Direct-installer installs self-update in place. Package-manager installs print the package-manager command and exit successfully so the package manager remains the owner of the installed files.
0 commit comments