@coderule/mcp 2.2.0 → 2.2.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.
package/dist/mcp-cli.cjs CHANGED
@@ -2471,34 +2471,51 @@ ${statusText2}`
2471
2471
  );
2472
2472
  lastStatus = status.status;
2473
2473
  if (status.status === "READY") {
2474
- const bushBuffer = await withDeadline2(
2475
- runtime.clients.sync.downloadSnapshotBush(currentHash),
2476
- deadline
2477
- );
2478
- await fs5.mkdir(path2.dirname(filePath), { recursive: true });
2479
- await fs5.writeFile(filePath, Buffer.from(bushBuffer));
2480
- runtime.logger.info(
2481
- {
2482
- filePath,
2483
- snapshotHash: currentHash,
2484
- bytes: bushBuffer.byteLength
2485
- },
2486
- "HDF5 bush file saved"
2487
- );
2488
- const skill = await withDeadline2(
2489
- runtime.clients.sync.getHdf5BushReaderSkill(),
2490
- deadline
2491
- );
2492
- return {
2493
- content: [
2474
+ try {
2475
+ const bushBuffer = await withDeadline2(
2476
+ runtime.clients.sync.downloadSnapshotBush(currentHash),
2477
+ deadline
2478
+ );
2479
+ await fs5.mkdir(path2.dirname(filePath), { recursive: true });
2480
+ await fs5.writeFile(filePath, Buffer.from(bushBuffer));
2481
+ runtime.logger.info(
2494
2482
  {
2495
- type: "text",
2496
- text: `HDF5 bush saved to ${filePath} (${bushBuffer.byteLength} bytes, snapshot ${currentHash}).
2483
+ filePath,
2484
+ snapshotHash: currentHash,
2485
+ bytes: bushBuffer.byteLength
2486
+ },
2487
+ "HDF5 bush file saved"
2488
+ );
2489
+ const skill = await withDeadline2(
2490
+ runtime.clients.sync.getHdf5BushReaderSkill(),
2491
+ deadline
2492
+ );
2493
+ return {
2494
+ content: [
2495
+ {
2496
+ type: "text",
2497
+ text: `HDF5 bush saved to ${filePath} (${bushBuffer.byteLength} bytes, snapshot ${currentHash}).
2497
2498
 
2498
2499
  ${skill}`
2499
- }
2500
- ]
2501
- };
2500
+ }
2501
+ ]
2502
+ };
2503
+ } catch (error) {
2504
+ const message = error instanceof Error ? error.message : "Unknown error";
2505
+ runtime.logger.error(
2506
+ { err: error, snapshotHash: currentHash },
2507
+ "Bush download failed"
2508
+ );
2509
+ return {
2510
+ content: [
2511
+ {
2512
+ type: "text",
2513
+ text: `Failed to download bush for snapshot ${currentHash}: ${message}`
2514
+ }
2515
+ ],
2516
+ isError: true
2517
+ };
2518
+ }
2502
2519
  }
2503
2520
  if (status.status === "FAILED") {
2504
2521
  while (Date.now() < deadline) {