@mcpcloud/cli 0.25.0 → 0.25.1-next-20260923012614

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 +46 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3376,6 +3376,48 @@ var api = {
3376
3376
  delete: (path, body) => request("DELETE", path, body !== undefined ? { body } : {})
3377
3377
  };
3378
3378
 
3379
+ // src/lib/stdio.ts
3380
+ import { writeSync } from "node:fs";
3381
+ function makeStdioBlocking() {
3382
+ for (const stream of [process.stdout, process.stderr]) {
3383
+ const handle = stream._handle;
3384
+ try {
3385
+ handle?.setBlocking?.(true);
3386
+ } catch {}
3387
+ }
3388
+ }
3389
+ function isBunRuntime() {
3390
+ return typeof process.versions.bun === "string";
3391
+ }
3392
+ var backoff = new Int32Array(new SharedArrayBuffer(4));
3393
+ function writeAllSync(fd, text) {
3394
+ const buffer = Buffer.from(text);
3395
+ let offset = 0;
3396
+ let waits = 0;
3397
+ while (offset < buffer.length) {
3398
+ try {
3399
+ offset += writeSync(fd, buffer, offset, buffer.length - offset);
3400
+ waits = 0;
3401
+ } catch (error) {
3402
+ const code = error.code;
3403
+ if (code === "EPIPE")
3404
+ return;
3405
+ if (code !== "EAGAIN")
3406
+ throw error;
3407
+ waits += 1;
3408
+ Atomics.wait(backoff, 0, 0, Math.min(50, waits));
3409
+ }
3410
+ }
3411
+ }
3412
+ function writeJsonOutput(text) {
3413
+ if (isBunRuntime() && !process.stdout.isTTY) {
3414
+ writeAllSync(1, `${text}
3415
+ `);
3416
+ return;
3417
+ }
3418
+ console.log(text);
3419
+ }
3420
+
3379
3421
  // src/lib/output.ts
3380
3422
  var jsonMode = false;
3381
3423
  function setJsonMode(enabled) {
@@ -3538,10 +3580,10 @@ var c = {
3538
3580
  bold: (s) => paint(process.stdout, ANSI.bold, s)
3539
3581
  };
3540
3582
  function printJson(data) {
3541
- console.log(JSON.stringify(data, null, 2));
3583
+ writeJsonOutput(JSON.stringify(data, null, 2));
3542
3584
  }
3543
3585
  function printJsonLine(data) {
3544
- console.log(JSON.stringify(data));
3586
+ writeJsonOutput(JSON.stringify(data));
3545
3587
  }
3546
3588
  function printLine(text) {
3547
3589
  console.log(text);
@@ -3604,7 +3646,7 @@ function printList(rows, columns, jsonEnvelope) {
3604
3646
  const { rows: projected, columns: cols } = applyFieldProjection(filtered, columns);
3605
3647
  if (fmt === "jsonl") {
3606
3648
  for (const row of projected)
3607
- console.log(JSON.stringify(row));
3649
+ printJsonLine(row);
3608
3650
  return;
3609
3651
  }
3610
3652
  if (fmt === "tsv") {
@@ -41270,6 +41312,7 @@ function maybeGreetFirstRun(argv) {
41270
41312
  return true;
41271
41313
  }
41272
41314
  async function main() {
41315
+ makeStdioBlocking();
41273
41316
  if (maybeGreetFirstRun(process.argv))
41274
41317
  return;
41275
41318
  const program = createProgram();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpcloud/cli",
3
- "version": "0.25.0",
3
+ "version": "0.25.1-next-20260923012614",
4
4
  "description": "The official CLI for MCPCloud — manage projects, servers, skills, and API keys from the terminal",
5
5
  "type": "module",
6
6
  "bin": {