@slothmoney/agent-cli 0.9.0 → 0.9.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 CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.9.1 - 2026-08-15
6
+
7
+ - Clarify how personal and joint category assignments appear in transaction
8
+ results and how assignment scope affects uncategorised filters.
9
+ - Document complete category and line-item assignments, including the
10
+ category-specific `Other` fallback when no more specific line item fits.
11
+ - Extend command-help and clean-installed package checks for the categorisation
12
+ workflow.
13
+
5
14
  ## 0.9.0 - 2026-08-12
6
15
 
7
16
  - Manage owned manual balance and manual transaction accounts through partial
package/README.md CHANGED
@@ -15,7 +15,7 @@ sloth-agent --version
15
15
  For a one-off pinned run:
16
16
 
17
17
  ```bash
18
- npm exec --yes --package=@slothmoney/agent-cli@0.9.0 -- sloth-agent --help
18
+ npm exec --yes --package=@slothmoney/agent-cli@0.9.1 -- sloth-agent --help
19
19
  ```
20
20
 
21
21
  ## Authenticate
@@ -115,6 +115,34 @@ sloth-agent goals update --help
115
115
  sloth-agent ask-partner --help
116
116
  ```
117
117
 
118
+ ### How transaction categorisation is represented
119
+
120
+ Personal and joint category assignments are separate. A personal assignment
121
+ uses the transaction's top-level `categoryId`, `lineItemId`, and
122
+ `categorySplits`. A joint-budget assignment uses the corresponding fields under
123
+ `jointBudgetContribution`.
124
+
125
+ A transaction can have no personal category while its joint-budget contribution
126
+ already has a category and line item. To assess a transaction's categorisation,
127
+ inspect both locations. An included joint contribution with a category and line
128
+ item is already categorised for the joint budget. For example:
129
+
130
+ ```json
131
+ {
132
+ "categoryId": null,
133
+ "lineItemId": null,
134
+ "jointBudgetContribution": {
135
+ "included": true,
136
+ "categoryId": "groceries",
137
+ "lineItemId": "joint-groceries"
138
+ }
139
+ }
140
+ ```
141
+
142
+ This transaction is uncategorised personally but categorised as Groceries for
143
+ the joint budget. The `--uncategorized` filter applies to the selected
144
+ assignment scope; personal is used when `--assignment-scope` is omitted.
145
+
118
146
  ### Categorise a transaction end to end
119
147
 
120
148
  1. Read categories and available budget line items:
@@ -127,23 +155,43 @@ A category is the broader parent. A line item is a child within one category.
127
155
  Line-item names such as `Other` may repeat, so preserve the full choice as
128
156
  `(scope, categoryId, lineItemId)`. Use the personal or joint line-item map that
129
157
  matches the transaction scope. For example, `Bills → Other` and `Subscriptions
130
- → Other` are different choices.
158
+ → Other` are different choices. Choose the most specific suitable line item;
159
+ if none fits, use that category's `Other` line item. Historical assignments
160
+ without a line item should not be treated as a recommendation to omit one.
131
161
 
132
162
  2. Read uncategorised transactions:
133
163
 
134
164
  ```bash
135
- sloth-agent transactions --uncategorized --limit 50
165
+ sloth-agent transactions \
166
+ --assignment-scope personal \
167
+ --uncategorized \
168
+ --limit 50
136
169
  ```
137
170
 
138
- 3. Copy the exact `transactionRef` for the transaction and a `categoryId` from
139
- the earlier outputs into `assignments.json`:
171
+ To read uncategorised joint-budget contributions instead:
172
+
173
+ ```bash
174
+ sloth-agent transactions \
175
+ --assignment-scope joint \
176
+ --uncategorized \
177
+ --limit 50
178
+ ```
179
+
180
+ The remaining example continues with a personal assignment. For a joint
181
+ assignment, set `"assignmentScope": "joint"` in the assignment payload and use
182
+ `--assignment-scope joint` when checking the result.
183
+
184
+ 3. Copy the exact `transactionRef`, `categoryId`, and `lineItemId` from the
185
+ earlier outputs into `assignments.json`:
140
186
 
141
187
  ```json
142
188
  {
143
189
  "assignments": [
144
190
  {
145
191
  "transactionRef": "PASTE_THE_EXACT_TRANSACTION_REF_HERE",
146
- "categoryId": "PASTE_A_CATEGORY_ID_HERE"
192
+ "assignmentScope": "personal",
193
+ "categoryId": "PASTE_A_CATEGORY_ID_HERE",
194
+ "lineItemId": "PASTE_A_LINE_ITEM_ID_HERE"
147
195
  }
148
196
  ]
149
197
  }
@@ -172,17 +220,19 @@ This step requires a token created with **Allow changes**.
172
220
 
173
221
  Inspect every item in the returned `succeeded` and `failed` arrays.
174
222
 
175
- 6. Check the result. Successful assignments update the category and optional
176
- budget line item on the original transaction. See the result in **Sloth
177
- Money Transactions**, or re-run the original transaction query without
178
- `--uncategorized` and inspect its category fields:
223
+ 6. Check the result in the same assignment scope that you changed. Successful
224
+ assignments update the category and optional budget line item on the
225
+ original transaction. See the result in **Sloth Money Transactions**, or
226
+ re-run the original transaction query without `--uncategorized` and inspect
227
+ both the personal and joint category fields:
179
228
 
180
229
  ```bash
181
- sloth-agent transactions --limit 50
230
+ sloth-agent transactions --assignment-scope personal --limit 50
182
231
  ```
183
232
 
184
233
  The transaction should also disappear from the matching `--uncategorized`
185
- query. Assignments do not create a separate list.
234
+ query. Confirm that an existing assignment in the other scope was not changed.
235
+ Assignments do not create a separate list.
186
236
 
187
237
  ### Other workflows
188
238
 
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import { ICON_KEYS } from './category-metadata.js';
4
4
  import { parseApiResponse, validateAssignmentPayload, validateBudgetUpdatePayload, } from './contracts.js';
5
5
  import { createSystemCredentialStore, secureStorageUnavailableError, } from './credential-store.js';
6
6
  import { ApiError, CliError, ConfigError, UsageError, } from './errors.js';
7
- export const CLI_VERSION = '0.9.0';
7
+ export const CLI_VERSION = '0.9.1';
8
8
  const REQUEST_TIMEOUT_MS = 60_000;
9
9
  const API_ORIGIN_HELP_LINES = [
10
10
  '',
@@ -185,6 +185,8 @@ export function categoriesHelpText() {
185
185
  ' Line-item names such as "Other" may repeat. Preserve the full choice as',
186
186
  ' (scope, categoryId, lineItemId), using the personal or joint line-item',
187
187
  ' map matching the transaction scope.',
188
+ ' Choose the most specific suitable line item. If none fits, use that',
189
+ ' category\'s "Other" line item.',
188
190
  '',
189
191
  'Examples:',
190
192
  ' sloth-agent categories',
@@ -463,7 +465,8 @@ export function transactionsHelpText() {
463
465
  ' sloth-agent transactions [options]',
464
466
  '',
465
467
  'Options:',
466
- ' --uncategorized[=true|false] Optional. Filter by state; with no value, use true.',
468
+ ' --uncategorized[=true|false] Optional. Filter the selected assignment scope by state;',
469
+ ' with no value, use true.',
467
470
  ' --limit N Optional. Integer from 1 to 200; omit for API default.',
468
471
  ' --start-date YYYY-MM-DD Optional. Include transactions on or after this date.',
469
472
  ' --end-date YYYY-MM-DD Optional. Include transactions on or before this date.',
@@ -472,6 +475,7 @@ export function transactionsHelpText() {
472
475
  ' --category-id ID Optional. Filter by category ID.',
473
476
  ' --line-item-id ID Optional. Filter primary or split assignments by line-item ID.',
474
477
  ' --assignment-scope SCOPE Optional. Filter assignments by personal or joint.',
478
+ ' Personal is used when omitted.',
475
479
  ' --cursor CURSOR Optional. Continue from a previous nextCursor.',
476
480
  ' --base-url URL Optional. Override the API origin.',
477
481
  ' -h, --help Show this help.',
@@ -487,6 +491,10 @@ export function transactionsHelpText() {
487
491
  'Output:',
488
492
  ' JSON containing transactions, nextCursor, and structured refresh status.',
489
493
  ' Refresh failures do not hide readable cached transactions.',
494
+ ' Personal assignments use the top-level categoryId, lineItemId, and categorySplits.',
495
+ ' Joint assignments appear under jointBudgetContribution.',
496
+ ' A transaction can be uncategorised personally while its joint-budget contribution',
497
+ ' is already categorised. To assess its categorisation, inspect both locations.',
490
498
  ' Use nextCursor with --cursor',
491
499
  ' to request the next page. A null nextCursor means there are no more pages.',
492
500
  '',
@@ -529,29 +537,34 @@ export function assignHelpText() {
529
537
  ' categories output. The example values below are placeholders.',
530
538
  ' Set categoryId to null to clear an assignment.',
531
539
  ' lineItemId is optional and accepts a non-empty string or null.',
540
+ ' When the category has line items, choose the most specific suitable line item.',
541
+ ' If none fits, use that category\'s Other line item from the matching scope.',
532
542
  ' categorySplits is optional and accepts a non-empty array or null.',
533
543
  ' Each split requires categoryId and a positive integer amountPence;',
534
544
  ' a split lineItemId is optional.',
535
545
  ' incomeSubtype is optional and accepts "pay", "interest", or null.',
536
546
  ' assignmentScope is optional and accepts "personal" or "joint".',
547
+ ' Personal is used when assignmentScope is omitted.',
537
548
  '',
538
549
  'Workflow:',
539
550
  ' sloth-agent categories',
540
- ' sloth-agent transactions --uncategorized --limit 50',
551
+ ' sloth-agent transactions --assignment-scope personal --uncategorized --limit 50',
541
552
  ' sloth-agent assign --input assignments.json Preview only',
542
553
  ' sloth-agent assign --input assignments.json --apply Write assignments',
543
- ' sloth-agent transactions --limit 50 Read back the result',
554
+ ' sloth-agent transactions --assignment-scope personal --limit 50 Read back',
544
555
  '',
545
556
  'Example:',
546
557
  ' {',
547
558
  ' "assignments": [',
548
559
  ' {',
549
560
  ' "transactionRef": "PASTE_THE_EXACT_TRANSACTION_REF_HERE",',
550
- ' "categoryId": "PASTE_A_CATEGORY_ID_HERE"',
561
+ ' "assignmentScope": "personal",',
562
+ ' "categoryId": "PASTE_A_CATEGORY_ID_HERE",',
563
+ ' "lineItemId": "PASTE_A_LINE_ITEM_ID_HERE"',
551
564
  ' }',
552
565
  ' ]',
553
566
  ' }',
554
- ' These are placeholders. Replace both values with exact IDs from CLI output.',
567
+ ' These are placeholders. Replace all three values with exact IDs from CLI output.',
555
568
  '',
556
569
  'Output:',
557
570
  ' Preview mode returns dryRun, endpoint, and the validated payload.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slothmoney/agent-cli",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Command-line access to the Sloth Money Agent API.",
5
5
  "type": "module",
6
6
  "bin": {