@settlemint/sdk-cli 2.6.3 → 2.6.4-pr396848ad

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/README.md CHANGED
@@ -249,7 +249,7 @@ settlemint scs subgraph deploy --accept-defaults <subgraph-name>
249
249
 
250
250
  ## API Reference
251
251
 
252
- See the [documentation](https://github.com/settlemint/sdk/tree/v2.6.3/sdk/cli/docs/settlemint.md) for available commands.
252
+ See the [documentation](https://github.com/settlemint/sdk/tree/v2.6.4/sdk/cli/docs/settlemint.md) for available commands.
253
253
 
254
254
  ## Contributing
255
255
 
package/dist/cli.js CHANGED
@@ -263129,7 +263129,13 @@ function yoctoSpinner(options) {
263129
263129
  // ../utils/dist/terminal.js
263130
263130
  var import_console_table_printer = __toESM(require_dist2(), 1);
263131
263131
  function shouldPrint() {
263132
- return process.env.SETTLEMINT_DISABLE_TERMINAL !== "true";
263132
+ if (process.env.SETTLEMINT_DISABLE_TERMINAL === "true") {
263133
+ return false;
263134
+ }
263135
+ if (process.env.CLAUDECODE || process.env.REPL_ID || process.env.AGENT) {
263136
+ return false;
263137
+ }
263138
+ return true;
263133
263139
  }
263134
263140
  var ascii = () => {
263135
263141
  if (!shouldPrint()) {
@@ -263161,8 +263167,13 @@ var CommandError = class extends Error {
263161
263167
  this.output = output;
263162
263168
  }
263163
263169
  };
263170
+ function isQuietMode() {
263171
+ return !!(process.env.CLAUDECODE || process.env.REPL_ID || process.env.AGENT);
263172
+ }
263164
263173
  async function executeCommand(command, args, options) {
263165
263174
  const { silent, ...spawnOptions } = options ?? {};
263175
+ const quietMode = isQuietMode();
263176
+ const shouldSuppressOutput = quietMode ? silent !== false : !!silent;
263166
263177
  const child = spawn(command, args, {
263167
263178
  ...spawnOptions,
263168
263179
  env: {
@@ -263172,23 +263183,38 @@ async function executeCommand(command, args, options) {
263172
263183
  });
263173
263184
  process.stdin.pipe(child.stdin);
263174
263185
  const output = [];
263186
+ const stdoutOutput = [];
263187
+ const stderrOutput = [];
263175
263188
  return new Promise((resolve, reject) => {
263176
263189
  child.stdout.on("data", (data) => {
263177
263190
  const maskedData = maskTokens(data.toString());
263178
- if (!silent) {
263191
+ if (!shouldSuppressOutput) {
263179
263192
  process.stdout.write(maskedData);
263180
263193
  }
263181
263194
  output.push(maskedData);
263195
+ stdoutOutput.push(maskedData);
263182
263196
  });
263183
263197
  child.stderr.on("data", (data) => {
263184
263198
  const maskedData = maskTokens(data.toString());
263185
- if (!silent) {
263199
+ if (!shouldSuppressOutput) {
263186
263200
  process.stderr.write(maskedData);
263187
263201
  }
263188
263202
  output.push(maskedData);
263203
+ stderrOutput.push(maskedData);
263189
263204
  });
263205
+ const showErrorOutput = () => {
263206
+ if (quietMode && shouldSuppressOutput && output.length > 0) {
263207
+ if (stdoutOutput.length > 0) {
263208
+ process.stdout.write(stdoutOutput.join(""));
263209
+ }
263210
+ if (stderrOutput.length > 0) {
263211
+ process.stderr.write(stderrOutput.join(""));
263212
+ }
263213
+ }
263214
+ };
263190
263215
  child.on("error", (err) => {
263191
263216
  process.stdin.unpipe(child.stdin);
263217
+ showErrorOutput();
263192
263218
  reject(new CommandError(err.message, "code" in err && typeof err.code === "number" ? err.code : 1, output));
263193
263219
  });
263194
263220
  child.on("close", (code) => {
@@ -263197,6 +263223,7 @@ async function executeCommand(command, args, options) {
263197
263223
  resolve(output);
263198
263224
  return;
263199
263225
  }
263226
+ showErrorOutput();
263200
263227
  reject(new CommandError(`Command "${command}" exited with code ${code}`, code, output));
263201
263228
  });
263202
263229
  });
@@ -263209,17 +263236,51 @@ var intro = (msg) => {
263209
263236
  console.log(magentaBright(maskTokens(msg)));
263210
263237
  console.log("");
263211
263238
  };
263239
+ function colorize(msg, level) {
263240
+ if (msg.includes("\x1B[")) {
263241
+ return msg;
263242
+ }
263243
+ if (level === "warn") {
263244
+ return yellowBright(msg);
263245
+ }
263246
+ if (level === "error") {
263247
+ return redBright(msg);
263248
+ }
263249
+ return msg;
263250
+ }
263251
+ function canPrint(level) {
263252
+ if (level !== "info") {
263253
+ return true;
263254
+ }
263255
+ return shouldPrint();
263256
+ }
263257
+ function prepareMessage(value, level) {
263258
+ let text;
263259
+ if (value instanceof Error) {
263260
+ text = value.message;
263261
+ if (level === "error" && value.stack) {
263262
+ text = `${text}
263263
+
263264
+ ${value.stack}`;
263265
+ }
263266
+ } else {
263267
+ text = value;
263268
+ }
263269
+ return maskTokens(text);
263270
+ }
263212
263271
  var note = (message, level = "info") => {
263213
- if (!shouldPrint()) {
263272
+ if (!canPrint(level)) {
263214
263273
  return;
263215
263274
  }
263216
- const maskedMessage = maskTokens(message);
263275
+ const msg = prepareMessage(message, level);
263217
263276
  console.log("");
263218
263277
  if (level === "warn") {
263219
- console.warn(yellowBright(maskedMessage));
263220
- return;
263278
+ console.warn(colorize(msg, level));
263279
+ } else if (level === "error") {
263280
+ console.error(colorize(msg, level));
263281
+ } else {
263282
+ console.log(msg);
263221
263283
  }
263222
- console.log(maskedMessage);
263223
263284
  };
263224
263285
  function list(title, items) {
263225
263286
  const formatItems = (items$1) => {
@@ -263253,11 +263314,8 @@ var SpinnerError = class extends Error {
263253
263314
  };
263254
263315
  var spinner = async (options) => {
263255
263316
  const handleError = (error) => {
263256
- const errorMessage = maskTokens(error.message);
263257
- note(redBright(`${errorMessage}
263258
-
263259
- ${error.stack}`));
263260
- throw new SpinnerError(errorMessage, error);
263317
+ note(error, "error");
263318
+ throw new SpinnerError(error.message, error);
263261
263319
  };
263262
263320
  if (is_in_ci_default || !shouldPrint()) {
263263
263321
  try {
@@ -282006,7 +282064,7 @@ function pruneCurrentEnv(currentEnv, env2) {
282006
282064
  var package_default = {
282007
282065
  name: "@settlemint/sdk-cli",
282008
282066
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
282009
- version: "2.6.3",
282067
+ version: "2.6.4-pr396848ad",
282010
282068
  type: "module",
282011
282069
  private: false,
282012
282070
  license: "FSL-1.1-MIT",
@@ -282060,10 +282118,10 @@ var package_default = {
282060
282118
  "@inquirer/input": "4.2.5",
282061
282119
  "@inquirer/password": "4.0.21",
282062
282120
  "@inquirer/select": "4.4.0",
282063
- "@settlemint/sdk-hasura": "2.6.3",
282064
- "@settlemint/sdk-js": "2.6.3",
282065
- "@settlemint/sdk-utils": "2.6.3",
282066
- "@settlemint/sdk-viem": "2.6.3",
282121
+ "@settlemint/sdk-hasura": "2.6.4-pr396848ad",
282122
+ "@settlemint/sdk-js": "2.6.4-pr396848ad",
282123
+ "@settlemint/sdk-utils": "2.6.4-pr396848ad",
282124
+ "@settlemint/sdk-viem": "2.6.4-pr396848ad",
282067
282125
  "@types/node": "24.10.0",
282068
282126
  "@types/semver": "7.7.1",
282069
282127
  "@types/which": "3.0.4",
@@ -282080,7 +282138,7 @@ var package_default = {
282080
282138
  },
282081
282139
  peerDependencies: {
282082
282140
  hardhat: "<= 4",
282083
- "@settlemint/sdk-js": "2.6.3"
282141
+ "@settlemint/sdk-js": "2.6.4-pr396848ad"
282084
282142
  },
282085
282143
  peerDependenciesMeta: {
282086
282144
  hardhat: {
@@ -282880,7 +282938,7 @@ var parseRequestArgs = (documentOrOptions, variables, requestHeaders) => {
282880
282938
  signal: undefined
282881
282939
  };
282882
282940
  };
282883
- // ../../node_modules/.bun/@0no-co+graphql.web@1.2.0/node_modules/@0no-co/graphql.web/dist/graphql.web.mjs
282941
+ // ../../node_modules/.bun/@0no-co+graphql.web@1.2.0+2e36366335d68c76/node_modules/@0no-co/graphql.web/dist/graphql.web.mjs
282884
282942
  var e = {
282885
282943
  NAME: "Name",
282886
282944
  DOCUMENT: "Document",
@@ -286066,22 +286124,62 @@ async function getPackageManagerExecutable(targetDir) {
286066
286124
  };
286067
286125
  }
286068
286126
  function shouldPrint2() {
286069
- return process.env.SETTLEMINT_DISABLE_TERMINAL !== "true";
286127
+ if (process.env.SETTLEMINT_DISABLE_TERMINAL === "true") {
286128
+ return false;
286129
+ }
286130
+ if (process.env.CLAUDECODE || process.env.REPL_ID || process.env.AGENT) {
286131
+ return false;
286132
+ }
286133
+ return true;
286070
286134
  }
286071
286135
  var maskTokens4 = (output) => {
286072
286136
  return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
286073
286137
  };
286138
+ function colorize2(msg, level) {
286139
+ if (msg.includes("\x1B[")) {
286140
+ return msg;
286141
+ }
286142
+ if (level === "warn") {
286143
+ return yellowBright(msg);
286144
+ }
286145
+ if (level === "error") {
286146
+ return redBright(msg);
286147
+ }
286148
+ return msg;
286149
+ }
286150
+ function canPrint2(level) {
286151
+ if (level !== "info") {
286152
+ return true;
286153
+ }
286154
+ return shouldPrint2();
286155
+ }
286156
+ function prepareMessage2(value2, level) {
286157
+ let text;
286158
+ if (value2 instanceof Error) {
286159
+ text = value2.message;
286160
+ if (level === "error" && value2.stack) {
286161
+ text = `${text}
286162
+
286163
+ ${value2.stack}`;
286164
+ }
286165
+ } else {
286166
+ text = value2;
286167
+ }
286168
+ return maskTokens4(text);
286169
+ }
286074
286170
  var note2 = (message, level = "info") => {
286075
- if (!shouldPrint2()) {
286171
+ if (!canPrint2(level)) {
286076
286172
  return;
286077
286173
  }
286078
- const maskedMessage = maskTokens4(message);
286174
+ const msg = prepareMessage2(message, level);
286079
286175
  console.log("");
286080
286176
  if (level === "warn") {
286081
- console.warn(yellowBright(maskedMessage));
286082
- return;
286177
+ console.warn(colorize2(msg, level));
286178
+ } else if (level === "error") {
286179
+ console.error(colorize2(msg, level));
286180
+ } else {
286181
+ console.log(msg);
286083
286182
  }
286084
- console.log(maskedMessage);
286085
286183
  };
286086
286184
  async function installDependencies(pkgs, cwd) {
286087
286185
  try {
@@ -323319,10 +323417,7 @@ async function onError(sdkcli, argv, error51) {
323319
323417
  process.exit(error51.exitCode);
323320
323418
  }
323321
323419
  if (!(error51 instanceof CancelError || error51 instanceof SpinnerError)) {
323322
- const errorMessage2 = maskTokens(error51.message);
323323
- note(redBright(`Unknown error: ${errorMessage2}
323324
-
323325
- ${error51.stack}`));
323420
+ note(error51, "error");
323326
323421
  }
323327
323422
  const commandPath = sdkcli._lastCommand?._commandPath ?? getCommandPathFromArgv(argv);
323328
323423
  if (commandPath) {
@@ -323365,4 +323460,4 @@ async function sdkCliCommand(argv = process.argv) {
323365
323460
  // src/cli.ts
323366
323461
  sdkCliCommand();
323367
323462
 
323368
- //# debugId=20CB2ECE690394A664756E2164756E21
323463
+ //# debugId=60E8288B45E37B7D64756E2164756E21