API reference
API reference
The API reference documents both functions.
Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| function | reportedVersion() | Read an installed CLI’s complete version line for update and rollback checks. |
| function | expectReportedVersion() | Check that a newly installed CLI reports the current label and exact version. |
reportedVersion()function
Section titled “reportedVersion()”function reportedVersion(stdout): | { label: "fungi" | "Spore"; version: string; } | undefined;Read an installed CLI’s complete version line for update and rollback checks.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
stdout |
string |
Captured command output, trimmed before validation. |
Returns
Section titled “Returns”The fungi or previous Spore label and valid semver token, or undefined
when the complete output does not match the bounded contract.
Type Literal
Section titled “Type Literal”{ label: "fungi" | "Spore"; version: string;}| Name | Type | Description |
|---|---|---|
label |
"fungi" | "Spore" |
Installed command label, including the previous label used for rollback. |
version |
string |
Complete version token accepted by semver validation. |
undefined
expectReportedVersion()function
Section titled “expectReportedVersion()”function expectReportedVersion(stdout, expected): boolean;Check that a newly installed CLI reports the current label and exact version.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
stdout |
string |
Captured command output. |
expected |
string |
Exact version expected by the updater or launch proof. |
Returns
Section titled “Returns”boolean
Whether the output reports fungi with exactly the expected version.