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.
@@ -6390,10 +6390,14 @@ function validateOutputFormats(formats) {
6390
6390
  );
6391
6391
  }
6392
6392
  if (BUILT_IN_OUTPUT_FORMATS.includes(name)) {
6393
- throw new ToolcraftBugError(`Custom output format "${name}" conflicts with a built-in format.`);
6393
+ throw new ToolcraftBugError(
6394
+ `Custom output format "${name}" conflicts with a built-in format.`
6395
+ );
6394
6396
  }
6395
6397
  if (typeof renderer !== "function") {
6396
- throw new ToolcraftBugError(`Custom output format "${name}" must define a renderer function.`);
6398
+ throw new ToolcraftBugError(
6399
+ `Custom output format "${name}" must define a renderer function.`
6400
+ );
6397
6401
  }
6398
6402
  }
6399
6403
  }
@@ -7225,10 +7229,8 @@ ${formatHelpOptionList(optionRows)}`);
7225
7229
  }
7226
7230
  const secretRows = formatSecretRows(command.secrets);
7227
7231
  if (secretRows.length > 0) {
7228
- sections.push(
7229
- `${text.section("Secrets (environment):")}
7230
- ${formatHelpOptionList(secretRows)}`
7231
- );
7232
+ sections.push(`${text.section("Secrets (environment):")}
7233
+ ${formatHelpOptionList(secretRows)}`);
7232
7234
  }
7233
7235
  if (command.examples.length > 0) {
7234
7236
  sections.push(
@@ -8308,8 +8310,7 @@ function renderCliErrorPattern(pattern, outputEmitter) {
8308
8310
  if (pattern.kind === "definition") {
8309
8311
  logger2.error(
8310
8312
  `Command definition error: ${pattern.error.message}
8311
- This is a bug in the generated command definition, not in your command arguments.
8312
- Run with --debug for a stack trace.`
8313
+ This is a bug in the generated command definition, not in your command arguments.` + (pattern.debugControlEnabled ? "\nRun with --debug for a stack trace." : "")
8313
8314
  );
8314
8315
  if (pattern.debugStackMode !== void 0 && pattern.error.stack) {
8315
8316
  process.stderr.write(`${formatDebugStack(pattern.error.stack, pattern.debugStackMode)}
@@ -8321,7 +8322,7 @@ Run with --debug for a stack trace.`
8321
8322
  if (pattern.kind === "toolcraft-bug") {
8322
8323
  logger2.error(
8323
8324
  `toolcraft hit an internal invariant: ${pattern.error.message}
8324
- 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.`
8325
+ 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.")
8325
8326
  );
8326
8327
  if (pattern.debugStackMode !== void 0 && pattern.error.stack) {
8327
8328
  process.stderr.write(`${formatDebugStack(pattern.error.stack, pattern.debugStackMode)}
@@ -8331,7 +8332,7 @@ This is a bug in toolcraft or in the command definition; it cannot be worked aro
8331
8332
  return;
8332
8333
  }
8333
8334
  logger2.error(
8334
- pattern.debugStackMode !== void 0 ? pattern.message : `${pattern.message} Use --debug for a stack trace.`
8335
+ pattern.debugStackMode !== void 0 || !pattern.debugControlEnabled ? pattern.message : `${pattern.message} Use --debug for a stack trace.`
8335
8336
  );
8336
8337
  if (pattern.debugStackMode !== void 0 && pattern.stack !== void 0) {
8337
8338
  process.stderr.write(`${formatDebugStack(pattern.stack, pattern.debugStackMode)}
@@ -9420,6 +9421,7 @@ async function handleRunError(error3, options) {
9420
9421
  options.userErrorPattern === "definition" ? {
9421
9422
  kind: "definition",
9422
9423
  error: error3,
9424
+ debugControlEnabled: options.debugControlEnabled,
9423
9425
  debugStackMode: options.debugStackMode
9424
9426
  } : options.userErrorPattern === "usage" ? {
9425
9427
  kind: "usage",
@@ -9439,6 +9441,7 @@ async function handleRunError(error3, options) {
9439
9441
  {
9440
9442
  kind: "toolcraft-bug",
9441
9443
  error: error3,
9444
+ debugControlEnabled: options.debugControlEnabled,
9442
9445
  debugStackMode: options.debugStackMode
9443
9446
  },
9444
9447
  options.outputEmitter
@@ -9491,6 +9494,7 @@ async function handleRunError(error3, options) {
9491
9494
  kind: "unexpected",
9492
9495
  message: message2,
9493
9496
  stack: error3 instanceof Error ? error3.stack : void 0,
9497
+ debugControlEnabled: options.debugControlEnabled,
9494
9498
  debugStackMode: options.debugStackMode
9495
9499
  },
9496
9500
  options.outputEmitter
@@ -9887,7 +9891,8 @@ async function runCLI(roots, options = {}) {
9887
9891
  `);
9888
9892
  }
9889
9893
  await handleRunError(error3, {
9890
- debugStackMode: resolvedFlags !== void 0 ? resolveDebugStackMode(resolvedFlags.debug) : getDebugStackModeFromArgv(argv),
9894
+ debugControlEnabled: controls.debug,
9895
+ debugStackMode: controls.debug ? resolvedFlags !== void 0 ? resolveDebugStackMode(resolvedFlags.debug) : getDebugStackModeFromArgv(argv) : void 0,
9891
9896
  output: resolvedFlags !== void 0 ? resolveOutput(resolvedFlags) : resolveOutputFromArgv(argv, controls.outputFormats),
9892
9897
  verbose: resolvedFlags ? Boolean(resolvedFlags.verbose) : argv.includes("--verbose"),
9893
9898
  program,