@fuzzle/opencode-accountant 0.13.2 → 0.13.3-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 +7 -7
  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 {
@@ -23819,7 +23816,7 @@ async function importStatements(directory, agent, options, configLoader = loadIm
23819
23816
  totalTransactions,
23820
23817
  matched: totalMatched,
23821
23818
  unknown: 0
23822
- }, `Successfully imported ${totalTransactions} transaction(s) from ${importResult.importedCount} file(s)`);
23819
+ }, totalTransactions === 0 ? "No new transactions to import" : `Successfully imported ${totalTransactions} transaction(s) from ${importResult.importedCount} file(s)`);
23823
23820
  }
23824
23821
  var import_statements_default = tool({
23825
23822
  description: `ACCOUNTANT AGENT ONLY: Import classified bank statement CSVs into hledger using rules files.
@@ -24463,7 +24460,9 @@ var INDENT = " ";
24463
24460
  function formatPostings(postings) {
24464
24461
  const maxAccountLen = postings.reduce((max, p) => Math.max(max, p.account.length), 0);
24465
24462
  return postings.map((p) => {
24466
- const gap = Math.max(MIN_GAP, maxAccountLen - p.account.length + MIN_GAP);
24463
+ const isNegative = p.amount.startsWith("-");
24464
+ const signOffset = isNegative ? 1 : 0;
24465
+ const gap = Math.max(MIN_GAP - signOffset, maxAccountLen - p.account.length + MIN_GAP - signOffset);
24467
24466
  const line = `${INDENT}${p.account}${" ".repeat(gap)}${p.amount}`;
24468
24467
  if (p.comment) {
24469
24468
  return `${line} ${p.comment}`;
@@ -26882,7 +26881,8 @@ async function importPipeline(directory, agent, options, configLoader = loadImpo
26882
26881
  }
26883
26882
  logger.info(`Log file: ${logger.getLogPath()}`);
26884
26883
  logger.endSection();
26885
- return buildPipelineSuccessResult(result, `Successfully imported ${totalTransactions} transaction(s) from ${contextIds.length} file(s)`);
26884
+ const summary = totalTransactions === 0 ? "No new transactions to import" : `Successfully imported ${totalTransactions} transaction(s) from ${contextIds.length} file(s)`;
26885
+ return buildPipelineSuccessResult(result, summary);
26886
26886
  } catch (error45) {
26887
26887
  logger.error("Pipeline step failed", error45);
26888
26888
  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.2",
3
+ "version": "0.13.3-next.1",
4
4
  "description": "An OpenCode accounting agent, specialized in double-entry-bookkepping with hledger",
5
5
  "author": {
6
6
  "name": "ali bengali",