@fuzzle/opencode-accountant 0.13.3 → 0.13.4-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.
Files changed (2) hide show
  1. package/dist/index.js +12 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -23600,10 +23600,7 @@ async function executeImports(fileResults, directory, pendingDir, doneDir, hledg
23600
23600
  continue;
23601
23601
  const year = fileResult.transactionYear;
23602
23602
  if (!year) {
23603
- return {
23604
- success: false,
23605
- error: `No transactions found in ${fileResult.csv}`
23606
- };
23603
+ continue;
23607
23604
  }
23608
23605
  let yearJournalPath;
23609
23606
  try {
@@ -23642,6 +23639,14 @@ async function executeImports(fileResults, directory, pendingDir, doneDir, hledg
23642
23639
  const destDir = path9.dirname(destPath);
23643
23640
  ensureDirectory(destDir);
23644
23641
  fs10.renameSync(csvFile, destPath);
23642
+ if (csvFile.endsWith("-filtered.csv")) {
23643
+ const originalCsv = csvFile.replace(/-filtered\.csv$/, ".csv");
23644
+ if (fs10.existsSync(originalCsv)) {
23645
+ const originalRelative = path9.relative(pendingDir, originalCsv);
23646
+ const originalDest = path9.join(doneDir, originalRelative);
23647
+ fs10.renameSync(originalCsv, originalDest);
23648
+ }
23649
+ }
23645
23650
  }
23646
23651
  return {
23647
23652
  success: true,
@@ -23819,7 +23824,7 @@ async function importStatements(directory, agent, options, configLoader = loadIm
23819
23824
  totalTransactions,
23820
23825
  matched: totalMatched,
23821
23826
  unknown: 0
23822
- }, `Successfully imported ${totalTransactions} transaction(s) from ${importResult.importedCount} file(s)`);
23827
+ }, totalTransactions === 0 ? "No new transactions to import" : `Successfully imported ${totalTransactions} transaction(s) from ${importResult.importedCount} file(s)`);
23823
23828
  }
23824
23829
  var import_statements_default = tool({
23825
23830
  description: `ACCOUNTANT AGENT ONLY: Import classified bank statement CSVs into hledger using rules files.
@@ -26884,7 +26889,8 @@ async function importPipeline(directory, agent, options, configLoader = loadImpo
26884
26889
  }
26885
26890
  logger.info(`Log file: ${logger.getLogPath()}`);
26886
26891
  logger.endSection();
26887
- return buildPipelineSuccessResult(result, `Successfully imported ${totalTransactions} transaction(s) from ${contextIds.length} file(s)`);
26892
+ const summary = totalTransactions === 0 ? "No new transactions to import" : `Successfully imported ${totalTransactions} transaction(s) from ${contextIds.length} file(s)`;
26893
+ return buildPipelineSuccessResult(result, summary);
26888
26894
  } catch (error45) {
26889
26895
  logger.error("Pipeline step failed", error45);
26890
26896
  logger.info(`Log file: ${logger.getLogPath()}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzzle/opencode-accountant",
3
- "version": "0.13.3",
3
+ "version": "0.13.4-next.1",
4
4
  "description": "An OpenCode accounting agent, specialized in double-entry-bookkepping with hledger",
5
5
  "author": {
6
6
  "name": "ali bengali",