@fuzzle/opencode-accountant 0.1.3 → 0.2.0-next.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 +3 -1
- package/agent/accountant.md +14 -10
- package/dist/index.js +5830 -204
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -199,13 +199,15 @@ The `import-pipeline` tool provides an atomic, safe import workflow using git wo
|
|
|
199
199
|
2. Run `import-pipeline` tool with optional provider/currency filters
|
|
200
200
|
3. The tool automatically:
|
|
201
201
|
- Creates an isolated git worktree
|
|
202
|
+
- Syncs CSV files from main repo to worktree
|
|
202
203
|
- Classifies CSV files by provider/currency
|
|
203
204
|
- Validates all transactions have matching rules
|
|
204
205
|
- Imports transactions to the appropriate year journal
|
|
205
206
|
- Reconciles closing balance (if available in CSV metadata)
|
|
206
207
|
- Merges changes back to main branch with `--no-ff`
|
|
208
|
+
- Deletes processed CSV files from main repo's import/incoming
|
|
207
209
|
- Cleans up the worktree
|
|
208
|
-
4. If any step fails, the worktree is discarded and main branch remains untouched
|
|
210
|
+
4. If any step fails, the worktree is discarded and main branch remains untouched (CSV files are preserved for retry)
|
|
209
211
|
|
|
210
212
|
### Statement Import
|
|
211
213
|
|
package/agent/accountant.md
CHANGED
|
@@ -56,10 +56,10 @@ When working with accounting tasks:
|
|
|
56
56
|
|
|
57
57
|
You have access to specialized MCP tools that MUST be used for their designated tasks. Do NOT attempt to replicate their functionality with bash commands, direct hledger CLI calls, or manual file edits.
|
|
58
58
|
|
|
59
|
-
| Tool
|
|
60
|
-
|
|
|
61
|
-
| `import-pipeline`
|
|
62
|
-
| `fetch-currency-prices`
|
|
59
|
+
| Tool | Use For | NEVER Do Instead |
|
|
60
|
+
| ----------------------- | ---------------------------------------------------- | --------------------------------------------------------- |
|
|
61
|
+
| `import-pipeline` | Full import workflow (classify → import → reconcile) | Manual file moves, `hledger import`, manual journal edits |
|
|
62
|
+
| `fetch-currency-prices` | Fetching exchange rates | `curl` to price APIs, manual price entries |
|
|
63
63
|
|
|
64
64
|
These tools handle validation, deduplication, error checking, and file organization automatically. Bypassing them risks data corruption, duplicate transactions, and inconsistent state.
|
|
65
65
|
|
|
@@ -87,11 +87,13 @@ The `import-pipeline` tool provides an **atomic, safe workflow** using git workt
|
|
|
87
87
|
1. **Prepare**: Drop CSV files into `{paths.import}` (configured in `config/import/providers.yaml`, default: `import/incoming`)
|
|
88
88
|
2. **Run Pipeline**: Execute `import-pipeline` (optionally filter by `provider` and `currency`)
|
|
89
89
|
3. **Automatic Processing**: The tool creates an isolated git worktree and:
|
|
90
|
+
- Syncs CSV files from main repo to worktree
|
|
90
91
|
- Classifies CSV files by provider/currency
|
|
91
92
|
- Validates all transactions have matching rules
|
|
92
93
|
- Imports transactions to the appropriate year journal
|
|
93
94
|
- Reconciles closing balance (if available in CSV metadata)
|
|
94
95
|
- Merges changes back to main branch with `--no-ff`
|
|
96
|
+
- Deletes processed CSV files from main repo's import/incoming
|
|
95
97
|
- Cleans up the worktree
|
|
96
98
|
4. **Handle Failures**: If any step fails (e.g., unknown postings found):
|
|
97
99
|
- Worktree is discarded, main branch remains untouched
|
|
@@ -134,12 +136,14 @@ The following are MCP tools available to you. Always call these tools directly -
|
|
|
134
136
|
**Behavior:**
|
|
135
137
|
|
|
136
138
|
1. Creates isolated git worktree
|
|
137
|
-
2.
|
|
138
|
-
3.
|
|
139
|
-
4.
|
|
140
|
-
5.
|
|
141
|
-
6.
|
|
142
|
-
7.
|
|
139
|
+
2. Syncs CSV files from main repo to worktree
|
|
140
|
+
3. Classifies CSV files (unless `skipClassify: true`)
|
|
141
|
+
4. Validates all transactions have matching rules (dry run)
|
|
142
|
+
5. Imports transactions to year journal
|
|
143
|
+
6. Reconciles closing balance against CSV metadata or manual value
|
|
144
|
+
7. Merges to main with `--no-ff` commit
|
|
145
|
+
8. Deletes processed CSV files from main repo's import/incoming
|
|
146
|
+
9. Cleans up worktree
|
|
143
147
|
|
|
144
148
|
**Output:** Returns step-by-step results with success/failure for each phase
|
|
145
149
|
|