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.
package/dist/index.js CHANGED
@@ -69565,10 +69565,7 @@ function createOAuthClient(config2) {
69565
69565
  config2.authorizationEndpoint ?? DEFAULT_AUTHORIZATION_ENDPOINT,
69566
69566
  "authorizationEndpoint"
69567
69567
  ),
69568
- tokenEndpoint: validateHttpUrl(
69569
- config2.tokenEndpoint ?? DEFAULT_TOKEN_ENDPOINT,
69570
- "tokenEndpoint"
69571
- )
69568
+ tokenEndpoint: validateHttpUrl(config2.tokenEndpoint ?? DEFAULT_TOKEN_ENDPOINT, "tokenEndpoint")
69572
69569
  };
69573
69570
  return {
69574
69571
  authorize: () => startAuthorization(normalizedConfig, fetchFn)
@@ -69694,7 +69691,7 @@ async function exchangeOAuthCode(options) {
69694
69691
  if (apiKey === void 0 || apiKey.length === 0) {
69695
69692
  throw new Error("Token response missing api_key field");
69696
69693
  }
69697
- if (apiKeyExpiresIn !== void 0 && !isValidExpiresIn(apiKeyExpiresIn)) {
69694
+ if (apiKeyExpiresIn !== void 0 && apiKeyExpiresIn !== null && !isValidExpiresIn(apiKeyExpiresIn)) {
69698
69695
  throw new Error("Token response invalid api_key_expires_in field");
69699
69696
  }
69700
69697
  return {
@@ -95652,10 +95649,14 @@ function validateOutputFormats(formats) {
95652
95649
  );
95653
95650
  }
95654
95651
  if (BUILT_IN_OUTPUT_FORMATS.includes(name)) {
95655
- throw new ToolcraftBugError(`Custom output format "${name}" conflicts with a built-in format.`);
95652
+ throw new ToolcraftBugError(
95653
+ `Custom output format "${name}" conflicts with a built-in format.`
95654
+ );
95656
95655
  }
95657
95656
  if (typeof renderer !== "function") {
95658
- throw new ToolcraftBugError(`Custom output format "${name}" must define a renderer function.`);
95657
+ throw new ToolcraftBugError(
95658
+ `Custom output format "${name}" must define a renderer function.`
95659
+ );
95659
95660
  }
95660
95661
  }
95661
95662
  }
@@ -96485,10 +96486,8 @@ ${formatHelpOptionList(optionRows)}`);
96485
96486
  }
96486
96487
  const secretRows = formatSecretRows(command.secrets);
96487
96488
  if (secretRows.length > 0) {
96488
- sections.push(
96489
- `${text.section("Secrets (environment):")}
96490
- ${formatHelpOptionList(secretRows)}`
96491
- );
96489
+ sections.push(`${text.section("Secrets (environment):")}
96490
+ ${formatHelpOptionList(secretRows)}`);
96492
96491
  }
96493
96492
  if (command.examples.length > 0) {
96494
96493
  sections.push(
@@ -97568,8 +97567,7 @@ function renderCliErrorPattern(pattern, outputEmitter) {
97568
97567
  if (pattern.kind === "definition") {
97569
97568
  logger2.error(
97570
97569
  `Command definition error: ${pattern.error.message}
97571
- This is a bug in the generated command definition, not in your command arguments.
97572
- Run with --debug for a stack trace.`
97570
+ This is a bug in the generated command definition, not in your command arguments.` + (pattern.debugControlEnabled ? "\nRun with --debug for a stack trace." : "")
97573
97571
  );
97574
97572
  if (pattern.debugStackMode !== void 0 && pattern.error.stack) {
97575
97573
  process.stderr.write(`${formatDebugStack(pattern.error.stack, pattern.debugStackMode)}
@@ -97581,7 +97579,7 @@ Run with --debug for a stack trace.`
97581
97579
  if (pattern.kind === "toolcraft-bug") {
97582
97580
  logger2.error(
97583
97581
  `toolcraft hit an internal invariant: ${pattern.error.message}
97584
- 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.`
97582
+ 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.")
97585
97583
  );
97586
97584
  if (pattern.debugStackMode !== void 0 && pattern.error.stack) {
97587
97585
  process.stderr.write(`${formatDebugStack(pattern.error.stack, pattern.debugStackMode)}
@@ -97591,7 +97589,7 @@ This is a bug in toolcraft or in the command definition; it cannot be worked aro
97591
97589
  return;
97592
97590
  }
97593
97591
  logger2.error(
97594
- pattern.debugStackMode !== void 0 ? pattern.message : `${pattern.message} Use --debug for a stack trace.`
97592
+ pattern.debugStackMode !== void 0 || !pattern.debugControlEnabled ? pattern.message : `${pattern.message} Use --debug for a stack trace.`
97595
97593
  );
97596
97594
  if (pattern.debugStackMode !== void 0 && pattern.stack !== void 0) {
97597
97595
  process.stderr.write(`${formatDebugStack(pattern.stack, pattern.debugStackMode)}
@@ -98680,6 +98678,7 @@ async function handleRunError(error3, options) {
98680
98678
  options.userErrorPattern === "definition" ? {
98681
98679
  kind: "definition",
98682
98680
  error: error3,
98681
+ debugControlEnabled: options.debugControlEnabled,
98683
98682
  debugStackMode: options.debugStackMode
98684
98683
  } : options.userErrorPattern === "usage" ? {
98685
98684
  kind: "usage",
@@ -98699,6 +98698,7 @@ async function handleRunError(error3, options) {
98699
98698
  {
98700
98699
  kind: "toolcraft-bug",
98701
98700
  error: error3,
98701
+ debugControlEnabled: options.debugControlEnabled,
98702
98702
  debugStackMode: options.debugStackMode
98703
98703
  },
98704
98704
  options.outputEmitter
@@ -98751,6 +98751,7 @@ async function handleRunError(error3, options) {
98751
98751
  kind: "unexpected",
98752
98752
  message: message2,
98753
98753
  stack: error3 instanceof Error ? error3.stack : void 0,
98754
+ debugControlEnabled: options.debugControlEnabled,
98754
98755
  debugStackMode: options.debugStackMode
98755
98756
  },
98756
98757
  options.outputEmitter
@@ -99147,7 +99148,8 @@ async function runCLI(roots, options = {}) {
99147
99148
  `);
99148
99149
  }
99149
99150
  await handleRunError(error3, {
99150
- debugStackMode: resolvedFlags !== void 0 ? resolveDebugStackMode(resolvedFlags.debug) : getDebugStackModeFromArgv(argv),
99151
+ debugControlEnabled: controls.debug,
99152
+ debugStackMode: controls.debug ? resolvedFlags !== void 0 ? resolveDebugStackMode(resolvedFlags.debug) : getDebugStackModeFromArgv(argv) : void 0,
99151
99153
  output: resolvedFlags !== void 0 ? resolveOutput(resolvedFlags) : resolveOutputFromArgv(argv, controls.outputFormats),
99152
99154
  verbose: resolvedFlags ? Boolean(resolvedFlags.verbose) : argv.includes("--verbose"),
99153
99155
  program,
@@ -151310,7 +151312,7 @@ var init_package2 = __esm({
151310
151312
  "package.json"() {
151311
151313
  package_default2 = {
151312
151314
  name: "poe-code",
151313
- version: "4.0.28",
151315
+ version: "4.0.29",
151314
151316
  description: "CLI tool to configure Poe API for developer workflows.",
151315
151317
  license: "MIT",
151316
151318
  type: "module",