@fuzzle/opencode-accountant 0.1.0-next.1 → 0.1.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/README.md +1 -1
- package/agent/accountant.md +6 -6
- package/dist/index.js +799 -434
- package/docs/tools/{update-prices.md → fetch-currency-prices.md} +10 -10
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# fetch-currency-prices Tool
|
|
2
2
|
|
|
3
|
-
The `
|
|
3
|
+
The `fetch-currency-prices` tool fetches end-of-day currency exchange rates and updates the price journals in `ledger/currencies/`. It uses the external `pricehist` tool to fetch data from various sources (Yahoo Finance, CoinMarketCap, ECB, etc.).
|
|
4
4
|
|
|
5
5
|
This tool is **restricted to the accountant agent only**.
|
|
6
6
|
|
|
@@ -135,9 +135,9 @@ When called by the wrong agent:
|
|
|
135
135
|
**Example:**
|
|
136
136
|
|
|
137
137
|
```
|
|
138
|
-
|
|
138
|
+
fetch-currency-prices()
|
|
139
139
|
# or
|
|
140
|
-
|
|
140
|
+
fetch-currency-prices(backfill: false)
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
**Use when:**
|
|
@@ -159,7 +159,7 @@ update-prices(backfill: false)
|
|
|
159
159
|
**Example:**
|
|
160
160
|
|
|
161
161
|
```
|
|
162
|
-
|
|
162
|
+
fetch-currency-prices(backfill: true)
|
|
163
163
|
```
|
|
164
164
|
|
|
165
165
|
**Use when:**
|
|
@@ -342,7 +342,7 @@ ledger/
|
|
|
342
342
|
|
|
343
343
|
**Goal:** Keep prices current with daily/weekly updates
|
|
344
344
|
|
|
345
|
-
1. Run `
|
|
345
|
+
1. Run `fetch-currency-prices()` (or `fetch-currency-prices(backfill: false)`)
|
|
346
346
|
2. Check output for any errors
|
|
347
347
|
3. Verify prices were added:
|
|
348
348
|
```bash
|
|
@@ -366,14 +366,14 @@ ledger/
|
|
|
366
366
|
file: gbp.journal
|
|
367
367
|
backfill_date: '2024-01-01'
|
|
368
368
|
```
|
|
369
|
-
2. Run `
|
|
369
|
+
2. Run `fetch-currency-prices(backfill: true)` to fetch historical data
|
|
370
370
|
3. Check output and verify `ledger/currencies/gbp.journal` created
|
|
371
371
|
4. Inspect file to confirm date range:
|
|
372
372
|
```bash
|
|
373
373
|
head -3 ledger/currencies/gbp.journal
|
|
374
374
|
tail -3 ledger/currencies/gbp.journal
|
|
375
375
|
```
|
|
376
|
-
5. Subsequent updates: use daily mode (`
|
|
376
|
+
5. Subsequent updates: use daily mode (`fetch-currency-prices()`)
|
|
377
377
|
|
|
378
378
|
### Scenario 3: Fixing Missing Dates
|
|
379
379
|
|
|
@@ -384,7 +384,7 @@ ledger/
|
|
|
384
384
|
cat ledger/currencies/eur.journal
|
|
385
385
|
# Notice: prices for Feb 15-20 are missing
|
|
386
386
|
```
|
|
387
|
-
2. Run `
|
|
387
|
+
2. Run `fetch-currency-prices(backfill: true)` to fill gaps
|
|
388
388
|
3. Deduplication ensures:
|
|
389
389
|
- Existing prices preserved
|
|
390
390
|
- Missing dates added
|
|
@@ -398,7 +398,7 @@ ledger/
|
|
|
398
398
|
|
|
399
399
|
**Goal:** Recover from partial failures
|
|
400
400
|
|
|
401
|
-
1. Run `
|
|
401
|
+
1. Run `fetch-currency-prices()`
|
|
402
402
|
2. Output shows `success: false` with partial results:
|
|
403
403
|
```json
|
|
404
404
|
{
|