skalpel 2.0.19 → 2.0.21

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/cli/index.js CHANGED
@@ -62,7 +62,9 @@ var init_dispatcher = __esm({
62
62
  keepAliveTimeout: 1e4,
63
63
  keepAliveMaxTimeout: 6e4,
64
64
  connections: 100,
65
- pipelining: 1
65
+ pipelining: 1,
66
+ allowH2: false
67
+ // Force HTTP/1.1 to prevent GCP LB WebSocket downgrade
66
68
  });
67
69
  }
68
70
  });
@@ -1606,7 +1608,7 @@ function configureCodex(agent, proxyConfig, direct = false) {
1606
1608
  const oauth = validateCodexOAuth();
1607
1609
  if (!oauth.present) {
1608
1610
  process.stderr.write("OAuth not configured. Run: codex login\n");
1609
- process.stderr.write(" Then re-run: skalpel configure\n");
1611
+ process.stderr.write(" Then re-run: npx skalpel\n");
1610
1612
  process.stderr.write(" (Skalpel will fall back to OPENAI_API_KEY env var if OAuth missing.)\n");
1611
1613
  }
1612
1614
  }
@@ -1721,6 +1723,7 @@ function unconfigureAgent(agent) {
1721
1723
  import fs10 from "fs";
1722
1724
  import path11 from "path";
1723
1725
  import os8 from "os";
1726
+ import crypto from "crypto";
1724
1727
  var BEGIN_MARKER = "# BEGIN SKALPEL PROXY - do not edit manually";
1725
1728
  var END_MARKER = "# END SKALPEL PROXY";
1726
1729
  var PS_BEGIN_MARKER = "# BEGIN SKALPEL PROXY - do not edit manually";
@@ -1745,11 +1748,18 @@ function getPowerShellProfilePath() {
1745
1748
  if (fs10.existsSync(wpProfile)) return wpProfile;
1746
1749
  return psProfile;
1747
1750
  }
1751
+ function randomPlaceholder() {
1752
+ return `sk-codex-skalpel-${crypto.randomBytes(8).toString("hex")}`;
1753
+ }
1748
1754
  function generateUnixBlock(proxyConfig) {
1749
1755
  return [
1750
1756
  BEGIN_MARKER,
1751
1757
  `export ANTHROPIC_BASE_URL="http://localhost:${proxyConfig.anthropicPort}"`,
1752
1758
  `export OPENAI_BASE_URL="http://localhost:${proxyConfig.openaiPort}"`,
1759
+ // `:-` only evaluates the default when OPENAI_API_KEY is unset or empty,
1760
+ // so a user-provided key always wins. Bash, zsh, and POSIX sh all
1761
+ // support this syntax.
1762
+ `export OPENAI_API_KEY="\${OPENAI_API_KEY:-${randomPlaceholder()}}"`,
1753
1763
  END_MARKER
1754
1764
  ].join("\n");
1755
1765
  }
@@ -1758,6 +1768,9 @@ function generatePowerShellBlock(proxyConfig) {
1758
1768
  PS_BEGIN_MARKER,
1759
1769
  `$env:ANTHROPIC_BASE_URL = "http://localhost:${proxyConfig.anthropicPort}"`,
1760
1770
  `$env:OPENAI_BASE_URL = "http://localhost:${proxyConfig.openaiPort}"`,
1771
+ // Conditional assignment — only set when the user hasn't already
1772
+ // exported OPENAI_API_KEY in their session or parent profile.
1773
+ `if (-not $env:OPENAI_API_KEY) { $env:OPENAI_API_KEY = "${randomPlaceholder()}" }`,
1761
1774
  PS_END_MARKER
1762
1775
  ].join("\n");
1763
1776
  }
@@ -2326,12 +2339,10 @@ async function runWizard(options) {
2326
2339
  print11("");
2327
2340
  const codexConfigured = agentsToConfigure.some((a) => a.name === "codex");
2328
2341
  if (codexConfigured) {
2329
- print11(" [!] Codex auth: recommended -> run 'codex login' first to enable ChatGPT plan billing.");
2330
- print11(" The OPENAI_API_KEY env var (placeholder OK) is still required for Codex startup");
2331
- print11(" but is ignored by Skalpel when OAuth is present.");
2332
- if (!process.env.OPENAI_API_KEY) {
2333
- print11(" example: export OPENAI_API_KEY=sk-codex-placeholder-skalpel");
2334
- }
2342
+ print11(" [!] Codex auth: recommended -> run 'codex login' to enable ChatGPT plan billing.");
2343
+ print11(" Without OAuth, Skalpel uses the OPENAI_API_KEY env var; if not already set,");
2344
+ print11(" Skalpel exports a placeholder so Codex starts. A real sk-... key is only");
2345
+ print11(" needed if you have no ChatGPT plan and want pay-as-you-go API billing.");
2335
2346
  print11("");
2336
2347
  }
2337
2348
  }