poe-code 4.0.28 → 4.0.29

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.
@@ -6397,10 +6397,14 @@ function validateOutputFormats(formats) {
6397
6397
  );
6398
6398
  }
6399
6399
  if (BUILT_IN_OUTPUT_FORMATS.includes(name)) {
6400
- throw new ToolcraftBugError(`Custom output format "${name}" conflicts with a built-in format.`);
6400
+ throw new ToolcraftBugError(
6401
+ `Custom output format "${name}" conflicts with a built-in format.`
6402
+ );
6401
6403
  }
6402
6404
  if (typeof renderer !== "function") {
6403
- throw new ToolcraftBugError(`Custom output format "${name}" must define a renderer function.`);
6405
+ throw new ToolcraftBugError(
6406
+ `Custom output format "${name}" must define a renderer function.`
6407
+ );
6404
6408
  }
6405
6409
  }
6406
6410
  }
@@ -7232,10 +7236,8 @@ ${formatHelpOptionList(optionRows)}`);
7232
7236
  }
7233
7237
  const secretRows = formatSecretRows(command.secrets);
7234
7238
  if (secretRows.length > 0) {
7235
- sections.push(
7236
- `${text.section("Secrets (environment):")}
7237
- ${formatHelpOptionList(secretRows)}`
7238
- );
7239
+ sections.push(`${text.section("Secrets (environment):")}
7240
+ ${formatHelpOptionList(secretRows)}`);
7239
7241
  }
7240
7242
  if (command.examples.length > 0) {
7241
7243
  sections.push(
@@ -8315,8 +8317,7 @@ function renderCliErrorPattern(pattern, outputEmitter) {
8315
8317
  if (pattern.kind === "definition") {
8316
8318
  logger2.error(
8317
8319
  `Command definition error: ${pattern.error.message}
8318
- This is a bug in the generated command definition, not in your command arguments.
8319
- Run with --debug for a stack trace.`
8320
+ This is a bug in the generated command definition, not in your command arguments.` + (pattern.debugControlEnabled ? "\nRun with --debug for a stack trace." : "")
8320
8321
  );
8321
8322
  if (pattern.debugStackMode !== void 0 && pattern.error.stack) {
8322
8323
  process.stderr.write(`${formatDebugStack(pattern.error.stack, pattern.debugStackMode)}
@@ -8328,7 +8329,7 @@ Run with --debug for a stack trace.`
8328
8329
  if (pattern.kind === "toolcraft-bug") {
8329
8330
  logger2.error(
8330
8331
  `toolcraft hit an internal invariant: ${pattern.error.message}
8331
- This is a bug in toolcraft or in the command definition; it cannot be worked around by changing argv. Re-run with --debug for a stack trace and file an issue.`
8332
+ This is a bug in toolcraft or in the command definition; it cannot be worked around by changing argv.` + (pattern.debugControlEnabled ? ` Re-run with --debug for a stack trace and file an issue.` : " File an issue.")
8332
8333
  );
8333
8334
  if (pattern.debugStackMode !== void 0 && pattern.error.stack) {
8334
8335
  process.stderr.write(`${formatDebugStack(pattern.error.stack, pattern.debugStackMode)}
@@ -8338,7 +8339,7 @@ This is a bug in toolcraft or in the command definition; it cannot be worked aro
8338
8339
  return;
8339
8340
  }
8340
8341
  logger2.error(
8341
- pattern.debugStackMode !== void 0 ? pattern.message : `${pattern.message} Use --debug for a stack trace.`
8342
+ pattern.debugStackMode !== void 0 || !pattern.debugControlEnabled ? pattern.message : `${pattern.message} Use --debug for a stack trace.`
8342
8343
  );
8343
8344
  if (pattern.debugStackMode !== void 0 && pattern.stack !== void 0) {
8344
8345
  process.stderr.write(`${formatDebugStack(pattern.stack, pattern.debugStackMode)}
@@ -9427,6 +9428,7 @@ async function handleRunError(error3, options) {
9427
9428
  options.userErrorPattern === "definition" ? {
9428
9429
  kind: "definition",
9429
9430
  error: error3,
9431
+ debugControlEnabled: options.debugControlEnabled,
9430
9432
  debugStackMode: options.debugStackMode
9431
9433
  } : options.userErrorPattern === "usage" ? {
9432
9434
  kind: "usage",
@@ -9446,6 +9448,7 @@ async function handleRunError(error3, options) {
9446
9448
  {
9447
9449
  kind: "toolcraft-bug",
9448
9450
  error: error3,
9451
+ debugControlEnabled: options.debugControlEnabled,
9449
9452
  debugStackMode: options.debugStackMode
9450
9453
  },
9451
9454
  options.outputEmitter
@@ -9498,6 +9501,7 @@ async function handleRunError(error3, options) {
9498
9501
  kind: "unexpected",
9499
9502
  message: message2,
9500
9503
  stack: error3 instanceof Error ? error3.stack : void 0,
9504
+ debugControlEnabled: options.debugControlEnabled,
9501
9505
  debugStackMode: options.debugStackMode
9502
9506
  },
9503
9507
  options.outputEmitter
@@ -9894,7 +9898,8 @@ async function runCLI(roots, options = {}) {
9894
9898
  `);
9895
9899
  }
9896
9900
  await handleRunError(error3, {
9897
- debugStackMode: resolvedFlags !== void 0 ? resolveDebugStackMode(resolvedFlags.debug) : getDebugStackModeFromArgv(argv),
9901
+ debugControlEnabled: controls.debug,
9902
+ debugStackMode: controls.debug ? resolvedFlags !== void 0 ? resolveDebugStackMode(resolvedFlags.debug) : getDebugStackModeFromArgv(argv) : void 0,
9898
9903
  output: resolvedFlags !== void 0 ? resolveOutput(resolvedFlags) : resolveOutputFromArgv(argv, controls.outputFormats),
9899
9904
  verbose: resolvedFlags ? Boolean(resolvedFlags.verbose) : argv.includes("--verbose"),
9900
9905
  program,