tradeblocks-mcp 2.2.5 → 2.2.6

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.
@@ -1,12 +1,14 @@
1
1
  import {
2
2
  deleteSyncMetadata,
3
3
  getAllSyncedBlockIds,
4
+ getBlocksDir,
4
5
  getSyncMetadata,
5
6
  hashFileContent,
7
+ setBlocksDir,
6
8
  syncAllBlocks,
7
9
  syncBlock,
8
10
  upsertSyncMetadata
9
- } from "./chunk-UGHXXLLR.js";
11
+ } from "./chunk-FIKAXL2L.js";
10
12
  import "./chunk-MIVAK2ZU.js";
11
13
  import "./chunk-PWM4JHGO.js";
12
14
  import "./chunk-KRHCV4RF.js";
@@ -15,10 +17,12 @@ import "./chunk-5WRI5ZAA.js";
15
17
  export {
16
18
  deleteSyncMetadata,
17
19
  getAllSyncedBlockIds,
20
+ getBlocksDir,
18
21
  getSyncMetadata,
19
22
  hashFileContent,
23
+ setBlocksDir,
20
24
  syncAllBlocks,
21
25
  syncBlock,
22
26
  upsertSyncMetadata
23
27
  };
24
- //# sourceMappingURL=sync-OPFBFM2P.js.map
28
+ //# sourceMappingURL=sync-2TUYF36I.js.map
@@ -27,7 +27,7 @@ import {
27
27
  upgradeToReadWrite,
28
28
  upsertMarketImportMetadata,
29
29
  upsertProfile
30
- } from "./chunk-UGHXXLLR.js";
30
+ } from "./chunk-FIKAXL2L.js";
31
31
  import "./chunk-MIVAK2ZU.js";
32
32
  import "./chunk-PWM4JHGO.js";
33
33
  import "./chunk-KRHCV4RF.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tradeblocks-mcp",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "description": "MCP server for options trade analysis",
5
5
  "author": "David Romeo <davidmromeo@gmail.com>",
6
6
  "type": "module",
@@ -26304,13 +26304,16 @@ async function detectBlockChanges(conn, baseDir) {
26304
26304
  const folderNames = /* @__PURE__ */ new Set();
26305
26305
  for (const entry of entries) {
26306
26306
  if (!entry.isDirectory()) continue;
26307
- if (entry.name.startsWith(".")) continue;
26308
- if (entry.name === "_marketdata") continue;
26307
+ if (entry.name.startsWith(".") || entry.name.startsWith("_")) continue;
26308
+ if (entry.name.includes(".")) continue;
26309
26309
  const blockId = entry.name;
26310
26310
  folderNames.add(blockId);
26311
26311
  const blockPath = path4.join(baseDir, blockId);
26312
26312
  if (!syncedBlockIds.has(blockId)) {
26313
- toSync.push(blockId);
26313
+ const tradelog = await findTradelogFile(blockPath);
26314
+ if (tradelog) {
26315
+ toSync.push(blockId);
26316
+ }
26314
26317
  continue;
26315
26318
  }
26316
26319
  const tradelogFilename = await findTradelogFile(blockPath);
@@ -26369,11 +26372,19 @@ async function cleanupDeletedBlocks(conn, deletedBlockIds) {
26369
26372
  }
26370
26373
 
26371
26374
  // src/sync/index.ts
26375
+ var _blocksDir = null;
26376
+ function setBlocksDir(dir) {
26377
+ _blocksDir = dir;
26378
+ }
26379
+ function getBlocksDir(baseDir) {
26380
+ return _blocksDir ?? baseDir;
26381
+ }
26372
26382
  async function syncAllBlocks(baseDir) {
26373
26383
  const conn = await getConnection(baseDir);
26384
+ const blocksDir = getBlocksDir(baseDir);
26374
26385
  const results = [];
26375
26386
  const errors = [];
26376
- const { toSync, toDelete } = await detectBlockChanges(conn, baseDir);
26387
+ const { toSync, toDelete } = await detectBlockChanges(conn, blocksDir);
26377
26388
  for (const blockId of toDelete) {
26378
26389
  try {
26379
26390
  await cleanupDeletedBlocks(conn, [blockId]);
@@ -26384,7 +26395,7 @@ async function syncAllBlocks(baseDir) {
26384
26395
  }
26385
26396
  }
26386
26397
  for (const blockId of toSync) {
26387
- const blockPath = path5.join(baseDir, blockId);
26398
+ const blockPath = path5.join(blocksDir, blockId);
26388
26399
  const result = await syncBlockInternal(conn, blockId, blockPath);
26389
26400
  results.push(result);
26390
26401
  if (result.status === "error" && result.error) {
@@ -26402,7 +26413,8 @@ async function syncAllBlocks(baseDir) {
26402
26413
  }
26403
26414
  async function syncBlock(blockId, baseDir) {
26404
26415
  const conn = await getConnection(baseDir);
26405
- const blockPath = path5.join(baseDir, blockId);
26416
+ const blocksDir = getBlocksDir(baseDir);
26417
+ const blockPath = path5.join(blocksDir, blockId);
26406
26418
  try {
26407
26419
  await fs6.access(blockPath);
26408
26420
  } catch {
@@ -26471,6 +26483,8 @@ export {
26471
26483
  deleteSyncMetadata,
26472
26484
  getAllSyncedBlockIds,
26473
26485
  upsertMarketImportMetadata,
26486
+ setBlocksDir,
26487
+ getBlocksDir,
26474
26488
  syncAllBlocks,
26475
26489
  syncBlock
26476
26490
  };
@@ -26485,4 +26499,4 @@ decimal.js/decimal.mjs:
26485
26499
  * MIT Licence
26486
26500
  *)
26487
26501
  */
26488
- //# sourceMappingURL=chunk-RM33HDCX.js.map
26502
+ //# sourceMappingURL=chunk-IBEPOZZK.js.map