@jacobbd/relay-ai 0.12.8 → 0.12.10
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/{chunk-BK34AFR4.js → chunk-2KEDU24N.js} +2 -2
- package/dist/{chunk-HLPRPOIV.js → chunk-OIL75EGI.js} +57 -10
- package/dist/chunk-OIL75EGI.js.map +1 -0
- package/dist/{chunk-VUEGVJMH.js → chunk-YIEEHFVL.js} +2 -2
- package/dist/cli.js +51 -6
- package/dist/cli.js.map +1 -1
- package/dist/core/index.js +102 -10
- package/dist/core/index.js.map +1 -1
- package/dist/{manual-models-BAWTDEYL.js → manual-models-XV4TB7FB.js} +3 -3
- package/dist/{ui-command-QUT3R4HW.js → ui-command-CJYKHNG6.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-HLPRPOIV.js.map +0 -1
- /package/dist/{chunk-BK34AFR4.js.map → chunk-2KEDU24N.js.map} +0 -0
- /package/dist/{chunk-VUEGVJMH.js.map → chunk-YIEEHFVL.js.map} +0 -0
- /package/dist/{manual-models-BAWTDEYL.js.map → manual-models-XV4TB7FB.js.map} +0 -0
- /package/dist/{ui-command-QUT3R4HW.js.map → ui-command-CJYKHNG6.js.map} +0 -0
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
translateRequest,
|
|
88
88
|
upstreamHttpStatus,
|
|
89
89
|
validateCustomEndpointUrl
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-OIL75EGI.js";
|
|
91
91
|
|
|
92
92
|
// src/registry/google-model-id.ts
|
|
93
93
|
var GOOGLE_MODEL_PREFIX = "models/";
|
|
@@ -9806,4 +9806,4 @@ export {
|
|
|
9806
9806
|
supportsClaudeTransparentMode,
|
|
9807
9807
|
buildHttpProxyRoutes
|
|
9808
9808
|
};
|
|
9809
|
-
//# sourceMappingURL=chunk-
|
|
9809
|
+
//# sourceMappingURL=chunk-2KEDU24N.js.map
|
|
@@ -7,7 +7,7 @@ import { join } from "path";
|
|
|
7
7
|
// package.json
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@jacobbd/relay-ai",
|
|
10
|
-
version: "0.12.
|
|
10
|
+
version: "0.12.10",
|
|
11
11
|
publishConfig: {
|
|
12
12
|
access: "public"
|
|
13
13
|
},
|
|
@@ -3668,14 +3668,14 @@ function xaiDefaultReasoningEffort(modelId) {
|
|
|
3668
3668
|
if (lower === "grok-4.5" || lower.startsWith("grok-4.5-")) return "high";
|
|
3669
3669
|
return "low";
|
|
3670
3670
|
}
|
|
3671
|
-
var DEEPSEEK_V4_REASONING_ID = /^deepseek-v4(?:\.\d+)?-(?:flash|pro)(?:-|$)/;
|
|
3671
|
+
var DEEPSEEK_V4_REASONING_ID = /^(?:[a-z0-9-]+\/)?deepseek-v4(?:\.\d+)?-(?:flash|pro)(?:-|$)/;
|
|
3672
3672
|
function isDeepSeekReasoningModel(modelId) {
|
|
3673
3673
|
const lower = modelId.toLowerCase();
|
|
3674
3674
|
return DEEPSEEK_V4_REASONING_ID.test(lower) || lower === "deepseek-reasoner" || lower === "deepseek-chat";
|
|
3675
3675
|
}
|
|
3676
|
+
var KIMI_REASONING_ID = /^(?:[a-z0-9-]+\/)?kimi-/;
|
|
3676
3677
|
function isKimiReasoningModel(modelId) {
|
|
3677
|
-
|
|
3678
|
-
return lower.startsWith("kimi-");
|
|
3678
|
+
return KIMI_REASONING_ID.test(modelId.toLowerCase().trim());
|
|
3679
3679
|
}
|
|
3680
3680
|
function isGlm52ReasoningModel(modelId) {
|
|
3681
3681
|
const lower = modelId.toLowerCase();
|
|
@@ -3725,10 +3725,11 @@ function openRouterReasoningCapabilities(metadata) {
|
|
|
3725
3725
|
}
|
|
3726
3726
|
function deepSeekAcceptsNativeEfforts(metadata) {
|
|
3727
3727
|
const providerId = metadata?.providerId?.toLowerCase();
|
|
3728
|
-
if (providerId === "go" || providerId === "zen" || providerId === "opencode-go" || providerId === "opencode") {
|
|
3728
|
+
if (providerId === "go" || providerId === "zen" || providerId === "opencode-go" || providerId === "opencode" || providerId === "commandcode") {
|
|
3729
3729
|
return true;
|
|
3730
3730
|
}
|
|
3731
|
-
|
|
3731
|
+
const baseUrl = metadata?.apiBaseUrl;
|
|
3732
|
+
return baseUrl?.includes("opencode.ai") === true || baseUrl?.includes("commandcode.ai") === true;
|
|
3732
3733
|
}
|
|
3733
3734
|
function mapCodexEffortToDeepSeek(effort, nativeEfforts) {
|
|
3734
3735
|
switch (effort) {
|
|
@@ -4531,6 +4532,7 @@ function serializeToolResultContent(content) {
|
|
|
4531
4532
|
|
|
4532
4533
|
// src/codex/upstream-error.ts
|
|
4533
4534
|
var TRACE_FIELD_LIMIT = 4e3;
|
|
4535
|
+
var MAX_ERROR_MESSAGE_CHARS = 2e3;
|
|
4534
4536
|
function clipTraceField(value) {
|
|
4535
4537
|
return value.length <= TRACE_FIELD_LIMIT ? value : `${value.slice(0, TRACE_FIELD_LIMIT)}\u2026`;
|
|
4536
4538
|
}
|
|
@@ -4605,7 +4607,7 @@ function formatUpstreamError(err) {
|
|
|
4605
4607
|
}
|
|
4606
4608
|
if (rec.message) {
|
|
4607
4609
|
const short = sanitizeMessage(rec.message);
|
|
4608
|
-
if (short && !short.includes("file://") && !short.includes("APICallError") && short.length <
|
|
4610
|
+
if (short && !short.includes("file://") && !short.includes("APICallError") && short.length < MAX_ERROR_MESSAGE_CHARS) {
|
|
4609
4611
|
return rec.statusCode ? `${short} (HTTP ${rec.statusCode})` : short;
|
|
4610
4612
|
}
|
|
4611
4613
|
}
|
|
@@ -4723,9 +4725,54 @@ function collapseSchemaUnionTypes(value) {
|
|
|
4723
4725
|
}
|
|
4724
4726
|
return out;
|
|
4725
4727
|
}
|
|
4728
|
+
function isDigit(ch) {
|
|
4729
|
+
return ch !== void 0 && ch >= "0" && ch <= "9";
|
|
4730
|
+
}
|
|
4731
|
+
function rewriteNulEscapesInPattern(pattern) {
|
|
4732
|
+
let out = "";
|
|
4733
|
+
let escaped = false;
|
|
4734
|
+
let changed = false;
|
|
4735
|
+
for (let i = 0; i < pattern.length; i += 1) {
|
|
4736
|
+
const ch = pattern[i];
|
|
4737
|
+
if (escaped) {
|
|
4738
|
+
escaped = false;
|
|
4739
|
+
if (ch === "0" && !isDigit(pattern[i + 1])) {
|
|
4740
|
+
out += "x00";
|
|
4741
|
+
changed = true;
|
|
4742
|
+
} else {
|
|
4743
|
+
out += ch;
|
|
4744
|
+
}
|
|
4745
|
+
continue;
|
|
4746
|
+
}
|
|
4747
|
+
if (ch === "\\") escaped = true;
|
|
4748
|
+
out += ch;
|
|
4749
|
+
}
|
|
4750
|
+
return changed ? out : null;
|
|
4751
|
+
}
|
|
4752
|
+
function rewriteNulPatternEscapes(value) {
|
|
4753
|
+
if (Array.isArray(value)) {
|
|
4754
|
+
let changed2 = false;
|
|
4755
|
+
const out2 = value.map((entry) => {
|
|
4756
|
+
const next = rewriteNulPatternEscapes(entry);
|
|
4757
|
+
if (next !== entry) changed2 = true;
|
|
4758
|
+
return next;
|
|
4759
|
+
});
|
|
4760
|
+
return changed2 ? out2 : value;
|
|
4761
|
+
}
|
|
4762
|
+
if (!value || typeof value !== "object") return value;
|
|
4763
|
+
let changed = false;
|
|
4764
|
+
const out = {};
|
|
4765
|
+
for (const [key, child] of Object.entries(value)) {
|
|
4766
|
+
const next = key === "pattern" && typeof child === "string" ? rewriteNulEscapesInPattern(child) ?? child : rewriteNulPatternEscapes(child);
|
|
4767
|
+
if (next !== child) changed = true;
|
|
4768
|
+
out[key] = next;
|
|
4769
|
+
}
|
|
4770
|
+
return changed ? out : value;
|
|
4771
|
+
}
|
|
4726
4772
|
function normalizeToolSchemaForNpm(schema, npm) {
|
|
4727
|
-
|
|
4728
|
-
|
|
4773
|
+
const portable = rewriteNulPatternEscapes(schema);
|
|
4774
|
+
if (!npm || !GOOGLE_NPM.has(npm)) return portable;
|
|
4775
|
+
return collapseSchemaUnionTypes(portable);
|
|
4729
4776
|
}
|
|
4730
4777
|
|
|
4731
4778
|
// src/sdk-adapter.ts
|
|
@@ -5320,4 +5367,4 @@ export {
|
|
|
5320
5367
|
streamAnthropicResponse,
|
|
5321
5368
|
generateAnthropicResponse
|
|
5322
5369
|
};
|
|
5323
|
-
//# sourceMappingURL=chunk-
|
|
5370
|
+
//# sourceMappingURL=chunk-OIL75EGI.js.map
|