@nextclaw/nextclaw-narp-runtime-claude-code-sdk 0.1.1 → 0.1.3

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.
@@ -18,7 +18,7 @@ var ClaudeCodeNarpRuntimeWrapper = class {
18
18
  const providerRoute = promptMeta.providerRoute;
19
19
  const sessionMetadata = promptMeta.sessionMetadata ?? {};
20
20
  const apiKey = readString(providerRoute?.apiKey) ?? readString(process.env.NEXTCLAW_API_KEY) ?? readString(process.env.ANTHROPIC_API_KEY) ?? "";
21
- const apiBase = resolveClaudeCompatibleApiBase(readString(providerRoute?.apiBase) ?? readString(process.env.NEXTCLAW_API_BASE) ?? readString(process.env.ANTHROPIC_BASE_URL) ?? readString(process.env.ANTHROPIC_API_URL));
21
+ const apiBase = resolveClaudeCompatibleApiBase(readString(providerRoute?.apiBase) ?? readString(process.env.NEXTCLAW_API_BASE) ?? readString(process.env.ANTHROPIC_BASE_URL) ?? readString(process.env.ANTHROPIC_API_URL), shouldUseAnthropicGateway(providerRoute?.headers));
22
22
  return {
23
23
  sessionId,
24
24
  apiKey,
@@ -53,10 +53,9 @@ function readString(value) {
53
53
  function normalizeApiBase(value) {
54
54
  return readString(value)?.replace(/\/+$/, "");
55
55
  }
56
- function resolveClaudeCompatibleApiBase(value) {
56
+ function resolveClaudeCompatibleApiBase(value, shouldPreserveOpenAiBase = false) {
57
57
  const apiBase = normalizeApiBase(value);
58
- if (!apiBase) return;
59
- if (!isMiniMaxApiBase(apiBase)) return apiBase;
58
+ if (!apiBase || shouldPreserveOpenAiBase || !isMiniMaxApiBase(apiBase)) return apiBase;
60
59
  if (apiBase.endsWith("/anthropic")) return apiBase;
61
60
  return `${apiBase.replace(/\/v1$/i, "")}/anthropic`;
62
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/nextclaw-narp-runtime-claude-code-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "description": "NARP stdio launcher for the NextClaw Claude Code SDK runtime.",
6
6
  "type": "module",
@@ -19,9 +19,9 @@
19
19
  "README.md"
20
20
  ],
21
21
  "dependencies": {
22
- "@nextclaw/ncp": "0.5.7",
23
- "@nextclaw/nextclaw-narp-stdio-runtime-wrapper": "0.1.1",
24
- "@nextclaw/nextclaw-ncp-runtime-claude-code-sdk": "0.1.27"
22
+ "@nextclaw/ncp": "0.5.8",
23
+ "@nextclaw/nextclaw-ncp-runtime-claude-code-sdk": "0.1.28",
24
+ "@nextclaw/nextclaw-narp-stdio-runtime-wrapper": "0.1.2"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^20.17.6",