paisa-mcp 0.4.8 → 0.4.9

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/dist/index.js CHANGED
@@ -58659,6 +58659,11 @@ function entityRule(e2, bag) {
58659
58659
  return bag.merchantRules[e2.merchantId] ?? null;
58660
58660
  return bag.personRules[e2.personId] ?? null;
58661
58661
  }
58662
+ // ../reconciliation/src/income.ts
58663
+ var SALARY = /\bSALARY\b|\bPAYROLL\b|\bSAL\s?CR\b/i;
58664
+ function salaryCreditIds(rows) {
58665
+ return rows.filter((r2) => r2.type === "credit" && !r2.categoryId && !r2.isTransfer && !r2.isIgnored && SALARY.test(r2.description)).map((r2) => r2.id);
58666
+ }
58662
58667
  // ../reconciliation/src/match.ts
58663
58668
  var DEFAULT_DATE_TOLERANCE = 2;
58664
58669
  var DEFAULT_AMOUNT_TOLERANCE = 0.02;
@@ -60931,6 +60936,20 @@ async function runRescan(client, crypto4) {
60931
60936
  });
60932
60937
  });
60933
60938
  await postLinks(client, links);
60939
+ const salaryIds = salaryCreditIds(allRows);
60940
+ if (salaryIds.length > 0) {
60941
+ const salary = (await loadCategoryIndex(client)).bySlug.get("salary");
60942
+ if (salary) {
60943
+ for (let i2 = 0;i2 < salaryIds.length; i2 += 200) {
60944
+ await client.patch("/api/transactions/bulk", {
60945
+ ids: salaryIds.slice(i2, i2 + 200),
60946
+ categoryId: salary.id,
60947
+ categoryType: salary.type
60948
+ });
60949
+ }
60950
+ categorized += salaryIds.length;
60951
+ }
60952
+ }
60934
60953
  return { linked: links.length, categorized, unresolved: plan.unresolvedCount };
60935
60954
  }
60936
60955
  var TRUNCATED_WARNING = "TRUNCATED: the API capped this result, so it is INCOMPLETE. Do not import/reconcile/resolve against it — narrow the query (smaller date range) and re-run.";
@@ -62288,7 +62307,7 @@ function registerResources2(server2, tools) {
62288
62307
  // package.json
62289
62308
  var package_default = {
62290
62309
  name: "paisa-mcp",
62291
- version: "0.4.8",
62310
+ version: "0.4.9",
62292
62311
  repository: {
62293
62312
  type: "git",
62294
62313
  url: "git+https://github.com/nimit9/paisa.git",
@@ -62387,5 +62406,5 @@ main().catch((err) => {
62387
62406
  process.exit(1);
62388
62407
  });
62389
62408
 
62390
- //# debugId=C59CD090C0030F9764756E2164756E21
62409
+ //# debugId=42F8B288CDC176C264756E2164756E21
62391
62410
  //# sourceMappingURL=index.js.map