@fuzzle/opencode-accountant 0.4.4-next.1 → 0.4.5-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 +14 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5013,7 +5013,7 @@ async function suggestAccountsForPostingsBatch(postings, context) {
5013
5013
  uncachedPostings.push(posting);
5014
5014
  }
5015
5015
  });
5016
- console.log(`[INFO] Account suggestions: ${cachedResults.size} cached, ${uncachedPostings.length} to generate`);
5016
+ context.logger?.info(`Account suggestions: ${cachedResults.size} cached, ${uncachedPostings.length} to generate`);
5017
5017
  let newSuggestions = [];
5018
5018
  if (uncachedPostings.length > 0) {
5019
5019
  try {
@@ -5028,10 +5028,10 @@ async function suggestAccountsForPostingsBatch(postings, context) {
5028
5028
  ---
5029
5029
 
5030
5030
  ${userPrompt}`;
5031
- console.log("[INFO] Invoking LLM for account suggestions...");
5032
- console.log("[DEBUG] Agent model:", agentConfig.model);
5033
- console.log("[DEBUG] Agent temperature:", agentConfig.temperature);
5034
- console.log("[DEBUG] Prompt length:", fullPrompt.length);
5031
+ context.logger?.info("Invoking LLM for account suggestions...");
5032
+ context.logger?.info(`Agent model: ${agentConfig.model}`);
5033
+ context.logger?.info(`Agent temperature: ${agentConfig.temperature}`);
5034
+ context.logger?.info(`Prompt length: ${fullPrompt.length}`);
5035
5035
  const mockResponse = generateMockSuggestions(uncachedPostings);
5036
5036
  newSuggestions = parseBatchSuggestionResponse(mockResponse);
5037
5037
  uncachedPostings.forEach((posting, index) => {
@@ -5041,7 +5041,7 @@ ${userPrompt}`;
5041
5041
  }
5042
5042
  });
5043
5043
  } catch (error45) {
5044
- console.error("[WARN] Failed to generate account suggestions:", error45 instanceof Error ? error45.message : String(error45));
5044
+ context.logger?.error(`[ERROR] Failed to generate account suggestions: ${error45 instanceof Error ? error45.message : String(error45)}`);
5045
5045
  return postings;
5046
5046
  }
5047
5047
  }
@@ -25008,25 +25008,27 @@ async function executeDryRunStep(context, logger) {
25008
25008
  existingAccounts: yearJournalPath ? await loadExistingAccounts2(yearJournalPath) : [],
25009
25009
  rulesFilePath: firstRulesFile,
25010
25010
  existingRules: firstRulesFile ? await extractRulePatternsFromFile2(firstRulesFile) : undefined,
25011
- yearJournalPath
25011
+ yearJournalPath,
25012
+ logger
25012
25013
  };
25013
25014
  postingsWithSuggestions = await suggestAccountsForPostingsBatch2(allUnknownPostings, suggestionContext);
25014
25015
  } catch (error45) {
25015
- console.error("[WARN] Failed to generate account suggestions:", error45 instanceof Error ? error45.message : String(error45));
25016
+ logger?.error(`[ERROR] Failed to generate account suggestions: ${error45 instanceof Error ? error45.message : String(error45)}`);
25016
25017
  postingsWithSuggestions = allUnknownPostings;
25017
25018
  }
25018
25019
  }
25019
25020
  }
25021
+ const detailsLog = postingsWithSuggestions.length > 0 ? formatUnknownPostingsLog(postingsWithSuggestions) : undefined;
25020
25022
  context.result.steps.dryRun = buildStepResult(dryRunParsed.success, message, {
25021
25023
  success: dryRunParsed.success,
25022
25024
  summary: dryRunParsed.summary,
25023
- unknownPostings: postingsWithSuggestions.length > 0 ? postingsWithSuggestions : undefined
25025
+ unknownPostings: postingsWithSuggestions.length > 0 ? postingsWithSuggestions : undefined,
25026
+ detailsLog
25024
25027
  });
25025
25028
  if (!dryRunParsed.success) {
25026
- if (postingsWithSuggestions.length > 0) {
25027
- const detailsLog = formatUnknownPostingsLog(postingsWithSuggestions);
25029
+ if (detailsLog) {
25028
25030
  logger?.error("Dry run found unknown accounts or errors");
25029
- console.log(detailsLog);
25031
+ logger?.info(detailsLog);
25030
25032
  }
25031
25033
  logger?.endSection();
25032
25034
  context.result.error = "Dry run found unknown accounts or errors";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzzle/opencode-accountant",
3
- "version": "0.4.4-next.1",
3
+ "version": "0.4.5-next.1",
4
4
  "description": "An OpenCode accounting agent, specialized in double-entry-bookkepping with hledger",
5
5
  "author": {
6
6
  "name": "ali bengali",