@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.
@@ -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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fudrouter/fsrouter",
3
- "version": "0.6.56",
3
+ "version": "0.6.57",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "9Router v2 \u2014 Express Backend (API, SSE, DB, Auth, MITM)",