@slothmoney/agent-cli 0.18.0 → 0.18.1
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/CHANGELOG.md +7 -0
- package/README.md +4 -3
- package/dist/cli.js +1 -1
- package/dist/contracts.js +1 -62
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.1 - 2026-08-25
|
|
4
|
+
|
|
5
|
+
- Require the deployed historical-activity response for `budget status` and
|
|
6
|
+
remove the temporary validator for the retired current-only response.
|
|
7
|
+
- Report every PATH-resolved `sloth-agent` installation during release
|
|
8
|
+
preflight, so Homebrew and Node-version-manager copies cannot silently drift.
|
|
9
|
+
|
|
3
10
|
## 0.18.0 - 2026-08-25
|
|
4
11
|
|
|
5
12
|
- Add optional `--period YYYY-MM` to `budget status` for current and historical
|
package/README.md
CHANGED
|
@@ -805,9 +805,10 @@ npm run release:preflight
|
|
|
805
805
|
`npm run test:package` packs the exact npm artifact, installs it into a clean
|
|
806
806
|
temporary project, and runs the installed binary.
|
|
807
807
|
|
|
808
|
-
`npm run release:preflight` reports the local, packed,
|
|
809
|
-
|
|
810
|
-
fails when a parent help page stops advertising one of its
|
|
808
|
+
`npm run release:preflight` reports the local, packed, npm-registry, and every
|
|
809
|
+
PATH-resolved globally installed version, then exercises every parser command's
|
|
810
|
+
nested help. It fails when a parent help page stops advertising one of its
|
|
811
|
+
child commands.
|
|
811
812
|
|
|
812
813
|
## Releasing
|
|
813
814
|
|
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ import { ICON_KEYS } from './category-metadata.js';
|
|
|
6
6
|
import { parseApiResponse, parseAssignmentOperationResponse, toLegacyAssignmentResponse, validateAssignmentPayload, validateBudgetMovementResponse, validateBudgetUpdatePayload, validateNotificationRulePayload, validateReceiptConfirmation, } from './contracts.js';
|
|
7
7
|
import { createSystemCredentialStore, secureStorageUnavailableError, } from './credential-store.js';
|
|
8
8
|
import { ApiError, CliError, ConfigError, UsageError, } from './errors.js';
|
|
9
|
-
export const CLI_VERSION = '0.18.
|
|
9
|
+
export const CLI_VERSION = '0.18.1';
|
|
10
10
|
const REQUEST_TIMEOUT_MS = 60_000;
|
|
11
11
|
const MAX_CONTRACT_PDF_BYTES = 6_000_000;
|
|
12
12
|
const API_ORIGIN_HELP_LINES = [
|
package/dist/contracts.js
CHANGED
|
@@ -696,64 +696,6 @@ function isBudgetResponse(value) {
|
|
|
696
696
|
&& Array.isArray(value.categories)
|
|
697
697
|
&& value.categories.every(isBudgetCategory));
|
|
698
698
|
}
|
|
699
|
-
function isLegacyBudgetStatusResponse(value) {
|
|
700
|
-
if (!isObject(value)
|
|
701
|
-
|| !hasOnlyFields(value, [
|
|
702
|
-
'scope',
|
|
703
|
-
'periodKey',
|
|
704
|
-
'periodStatus',
|
|
705
|
-
'currency',
|
|
706
|
-
'effectiveFromPeriodKey',
|
|
707
|
-
'funding',
|
|
708
|
-
'activity',
|
|
709
|
-
'refresh',
|
|
710
|
-
'categories',
|
|
711
|
-
]))
|
|
712
|
-
return false;
|
|
713
|
-
return ((value.scope === 'personal' || value.scope === 'joint')
|
|
714
|
-
&& typeof value.periodKey === 'string'
|
|
715
|
-
&& /^\d{4}-(0[1-9]|1[0-2])$/.test(value.periodKey)
|
|
716
|
-
&& value.periodStatus === 'current'
|
|
717
|
-
&& isCurrency(value.currency)
|
|
718
|
-
&& typeof value.effectiveFromPeriodKey === 'string'
|
|
719
|
-
&& /^\d{4}-(0[1-9]|1[0-2])$/.test(value.effectiveFromPeriodKey)
|
|
720
|
-
&& isBudgetFunding(value.funding)
|
|
721
|
-
&& isObject(value.activity)
|
|
722
|
-
&& hasOnlyFields(value.activity, [
|
|
723
|
-
'startDate',
|
|
724
|
-
'endDate',
|
|
725
|
-
'transactionCount',
|
|
726
|
-
'uncategorizedSpentPence',
|
|
727
|
-
'unmappedSpentPence',
|
|
728
|
-
])
|
|
729
|
-
&& isIsoDate(value.activity.startDate)
|
|
730
|
-
&& isIsoDate(value.activity.endDate)
|
|
731
|
-
&& value.activity.startDate <= value.activity.endDate
|
|
732
|
-
&& isNonnegativeSafeInteger(value.activity.transactionCount)
|
|
733
|
-
&& isSafeInteger(value.activity.uncategorizedSpentPence)
|
|
734
|
-
&& isSafeInteger(value.activity.unmappedSpentPence)
|
|
735
|
-
&& isRefreshStatus(value.refresh)
|
|
736
|
-
&& Array.isArray(value.categories)
|
|
737
|
-
&& value.categories.every((category) => (isObject(category)
|
|
738
|
-
&& hasOnlyFields(category, [
|
|
739
|
-
'id',
|
|
740
|
-
'name',
|
|
741
|
-
'plannedPence',
|
|
742
|
-
'assignedPence',
|
|
743
|
-
'spentPence',
|
|
744
|
-
'availablePence',
|
|
745
|
-
])
|
|
746
|
-
&& typeof category.id === 'string'
|
|
747
|
-
&& category.id.trim().length > 0
|
|
748
|
-
&& typeof category.name === 'string'
|
|
749
|
-
&& category.name.trim().length > 0
|
|
750
|
-
&& isNonnegativeSafeInteger(category.plannedPence)
|
|
751
|
-
&& isSafeInteger(category.assignedPence)
|
|
752
|
-
&& isSafeInteger(category.spentPence)
|
|
753
|
-
&& isSafeInteger(category.availablePence)
|
|
754
|
-
&& Number.isSafeInteger(category.assignedPence - category.spentPence)
|
|
755
|
-
&& category.availablePence === category.assignedPence - category.spentPence)));
|
|
756
|
-
}
|
|
757
699
|
function isActivityAmounts(value) {
|
|
758
700
|
return isObject(value)
|
|
759
701
|
&& hasOnlyFields(value, ['moneyInPence', 'moneyOutPence', 'netPence'])
|
|
@@ -827,9 +769,6 @@ function isBudgetActivityStatusResponse(value) {
|
|
|
827
769
|
? value.refresh === null
|
|
828
770
|
: isRefreshStatus(value.refresh));
|
|
829
771
|
}
|
|
830
|
-
function isBudgetStatusResponse(value) {
|
|
831
|
-
return isLegacyBudgetStatusResponse(value) || isBudgetActivityStatusResponse(value);
|
|
832
|
-
}
|
|
833
772
|
function isBudgetMovementResponse(value) {
|
|
834
773
|
return (isObject(value)
|
|
835
774
|
&& hasOnlyFields(value, [
|
|
@@ -1071,7 +1010,7 @@ export function parseApiResponse(command, value) {
|
|
|
1071
1010
|
: command === 'budget' || command === 'budget-update'
|
|
1072
1011
|
? isBudgetResponse(value)
|
|
1073
1012
|
: command === 'budget-status'
|
|
1074
|
-
?
|
|
1013
|
+
? isBudgetActivityStatusResponse(value)
|
|
1075
1014
|
: command === 'budget-move'
|
|
1076
1015
|
? isBudgetMovementResponse(value)
|
|
1077
1016
|
: command === 'categories'
|