@fudrouter/fsrouter 0.6.56 → 0.6.57
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/open-sse/services/thinkingBudget.js +6 -2
- package/dist/open-sse/translator/request/claude-to-kiro.js +1 -1
- package/dist/open-sse/translator/request/openai-to-kiro.js +2 -2
- package/open-sse/services/thinkingBudget.js +6 -2
- package/open-sse/translator/request/claude-to-kiro.js +1 -1
- package/open-sse/translator/request/openai-to-kiro.js +2 -2
- package/package.json +1 -1
|
@@ -221,13 +221,18 @@ function applyAdaptiveBudget(body, cfg) {
|
|
|
221
221
|
);
|
|
222
222
|
return setCustomBudget(body, budget);
|
|
223
223
|
}
|
|
224
|
-
function hasThinkingCapableModel(body) {
|
|
224
|
+
export function hasThinkingCapableModel(body) {
|
|
225
225
|
const model = getStringField(toRecord(body), "model");
|
|
226
226
|
const resolved = getResolvedModelCapabilities(model);
|
|
227
227
|
if (resolved.supportsThinking === true) return true;
|
|
228
228
|
if (resolved.supportsThinking === false) return false;
|
|
229
229
|
return model.includes("claude") || model.includes("o1") || model.includes("o3") || model.includes("o4") || model.includes("gemini") || model.endsWith("-thinking") || model.includes("thinking");
|
|
230
230
|
}
|
|
231
|
+
export function resolveKiroThinkingBudget(body, headers, model) {
|
|
232
|
+
return isThinkingEnabled(body, headers, model)
|
|
233
|
+
? KIRO_THINKING_BUDGET_DEFAULT
|
|
234
|
+
: 0;
|
|
235
|
+
}
|
|
231
236
|
export {
|
|
232
237
|
DEFAULT_THINKING_CONFIG,
|
|
233
238
|
EFFORT_BUDGETS,
|
|
@@ -236,7 +241,6 @@ export {
|
|
|
236
241
|
applyThinkingBudget,
|
|
237
242
|
ensureThinkingConfig,
|
|
238
243
|
getThinkingBudgetConfig,
|
|
239
|
-
hasThinkingCapableModel,
|
|
240
244
|
hydrateThinkingBudgetConfig,
|
|
241
245
|
normalizeThinkingLevel,
|
|
242
246
|
setThinkingBudgetConfig
|
|
@@ -27,11 +27,11 @@ import { FORMATS } from "../formats.js";
|
|
|
27
27
|
import { v4 as uuidv4 } from "uuid";
|
|
28
28
|
import {
|
|
29
29
|
resolveKiroModel,
|
|
30
|
-
resolveKiroThinkingBudget,
|
|
31
30
|
buildThinkingSystemPrefix,
|
|
32
31
|
KIRO_AGENTIC_SYSTEM_PROMPT,
|
|
33
32
|
resolveDefaultProfileArn,
|
|
34
33
|
} from "../../config/kiroConstants.js";
|
|
34
|
+
import { resolveKiroThinkingBudget } from "../../services/thinkingBudget.js";
|
|
35
35
|
import { DEFAULT_IMAGE_MIME } from "../schema/index.js";
|
|
36
36
|
import { ROLE, CLAUDE_BLOCK } from "../schema/index.js";
|
|
37
37
|
|
|
@@ -8,11 +8,11 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
8
8
|
import { resolveSessionId } from "../../utils/sessionManager.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveKiroModel,
|
|
11
|
-
resolveKiroThinkingBudget,
|
|
12
11
|
buildThinkingSystemPrefix,
|
|
13
12
|
KIRO_AGENTIC_SYSTEM_PROMPT,
|
|
14
|
-
resolveDefaultProfileArn
|
|
13
|
+
resolveDefaultProfileArn,
|
|
15
14
|
} from "../../config/kiroConstants.js";
|
|
15
|
+
import { resolveKiroThinkingBudget } from "../../services/thinkingBudget.js";
|
|
16
16
|
import { parseDataUri } from "../concerns/image.js";
|
|
17
17
|
import { DEFAULT_IMAGE_MIME } from "../schema/index.js";
|
|
18
18
|
import { ROLE, OPENAI_BLOCK, CLAUDE_BLOCK } from "../schema/index.js";
|
|
@@ -221,13 +221,18 @@ function applyAdaptiveBudget(body, cfg) {
|
|
|
221
221
|
);
|
|
222
222
|
return setCustomBudget(body, budget);
|
|
223
223
|
}
|
|
224
|
-
function hasThinkingCapableModel(body) {
|
|
224
|
+
export function hasThinkingCapableModel(body) {
|
|
225
225
|
const model = getStringField(toRecord(body), "model");
|
|
226
226
|
const resolved = getResolvedModelCapabilities(model);
|
|
227
227
|
if (resolved.supportsThinking === true) return true;
|
|
228
228
|
if (resolved.supportsThinking === false) return false;
|
|
229
229
|
return model.includes("claude") || model.includes("o1") || model.includes("o3") || model.includes("o4") || model.includes("gemini") || model.endsWith("-thinking") || model.includes("thinking");
|
|
230
230
|
}
|
|
231
|
+
export function resolveKiroThinkingBudget(body, headers, model) {
|
|
232
|
+
return isThinkingEnabled(body, headers, model)
|
|
233
|
+
? KIRO_THINKING_BUDGET_DEFAULT
|
|
234
|
+
: 0;
|
|
235
|
+
}
|
|
231
236
|
export {
|
|
232
237
|
DEFAULT_THINKING_CONFIG,
|
|
233
238
|
EFFORT_BUDGETS,
|
|
@@ -236,7 +241,6 @@ export {
|
|
|
236
241
|
applyThinkingBudget,
|
|
237
242
|
ensureThinkingConfig,
|
|
238
243
|
getThinkingBudgetConfig,
|
|
239
|
-
hasThinkingCapableModel,
|
|
240
244
|
hydrateThinkingBudgetConfig,
|
|
241
245
|
normalizeThinkingLevel,
|
|
242
246
|
setThinkingBudgetConfig
|
|
@@ -27,11 +27,11 @@ import { FORMATS } from "../formats.js";
|
|
|
27
27
|
import { v4 as uuidv4 } from "uuid";
|
|
28
28
|
import {
|
|
29
29
|
resolveKiroModel,
|
|
30
|
-
resolveKiroThinkingBudget,
|
|
31
30
|
buildThinkingSystemPrefix,
|
|
32
31
|
KIRO_AGENTIC_SYSTEM_PROMPT,
|
|
33
32
|
resolveDefaultProfileArn,
|
|
34
33
|
} from "../../config/kiroConstants.js";
|
|
34
|
+
import { resolveKiroThinkingBudget } from "../../services/thinkingBudget.js";
|
|
35
35
|
import { DEFAULT_IMAGE_MIME } from "../schema/index.js";
|
|
36
36
|
import { ROLE, CLAUDE_BLOCK } from "../schema/index.js";
|
|
37
37
|
|
|
@@ -8,11 +8,11 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
8
8
|
import { resolveSessionId } from "../../utils/sessionManager.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveKiroModel,
|
|
11
|
-
resolveKiroThinkingBudget,
|
|
12
11
|
buildThinkingSystemPrefix,
|
|
13
12
|
KIRO_AGENTIC_SYSTEM_PROMPT,
|
|
14
|
-
resolveDefaultProfileArn
|
|
13
|
+
resolveDefaultProfileArn,
|
|
15
14
|
} from "../../config/kiroConstants.js";
|
|
15
|
+
import { resolveKiroThinkingBudget } from "../../services/thinkingBudget.js";
|
|
16
16
|
import { parseDataUri } from "../concerns/image.js";
|
|
17
17
|
import { DEFAULT_IMAGE_MIME } from "../schema/index.js";
|
|
18
18
|
import { ROLE, OPENAI_BLOCK, CLAUDE_BLOCK } from "../schema/index.js";
|