@cognipeer/agent-sdk 0.10.6 → 0.13.0

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.
@@ -0,0 +1,756 @@
1
+ // src/models/model-rules.json
2
+ var model_rules_default = {
3
+ version: 1,
4
+ effortLadder: [
5
+ "none",
6
+ "minimal",
7
+ "low",
8
+ "medium",
9
+ "high",
10
+ "xhigh",
11
+ "max"
12
+ ],
13
+ budgets: {
14
+ minimal: 1024,
15
+ low: 2048,
16
+ medium: 8192,
17
+ high: 16384,
18
+ xhigh: 24576,
19
+ max: 32768
20
+ },
21
+ geminiBudgets: {
22
+ minimal: 512,
23
+ low: 1024,
24
+ medium: 4096,
25
+ high: 12e3,
26
+ xhigh: 24576,
27
+ max: 24576
28
+ },
29
+ rules: [
30
+ {
31
+ id: "openai-chat-models",
32
+ family: "openai",
33
+ match: "^(?:chatgpt|gpt-[\\d.]+[a-z0-9.-]*?-chat)",
34
+ reasoning: {
35
+ style: "none",
36
+ efforts: [],
37
+ off: null
38
+ },
39
+ sampling: {
40
+ temperature: "any",
41
+ topP: true,
42
+ topK: true,
43
+ penalties: true,
44
+ logprobs: true
45
+ },
46
+ maxTokensParam: "max_completion_tokens",
47
+ chatTools: {
48
+ reasoning: "any"
49
+ },
50
+ source: "docs",
51
+ note: "Chat-tuned *-chat variants are not reasoning models: ordinary sampling, no reasoning field."
52
+ },
53
+ {
54
+ id: "openai-gpt-6-plus",
55
+ family: "openai",
56
+ match: "^gpt-?(?:[6-9]|(?!35(?!\\d))[1-9]\\d+)(?:[.-]|$)",
57
+ reasoning: {
58
+ style: "effort",
59
+ efforts: [
60
+ "none",
61
+ "low",
62
+ "medium",
63
+ "high",
64
+ "xhigh"
65
+ ],
66
+ off: "none",
67
+ responsesEfforts: [
68
+ "none",
69
+ "low",
70
+ "medium",
71
+ "high",
72
+ "xhigh",
73
+ "max"
74
+ ]
75
+ },
76
+ sampling: {
77
+ temperature: "default-only",
78
+ topP: false,
79
+ topK: false,
80
+ penalties: false,
81
+ logprobs: false
82
+ },
83
+ maxTokensParam: "max_completion_tokens",
84
+ chatTools: {
85
+ reasoning: "force-none"
86
+ },
87
+ source: "verified-2026-10-14",
88
+ note: "gpt-N, N>=6. Chat Completions takes none/low/medium/high/xhigh (minimal and max are 400s); Responses also takes max. Function tools with an effort other than none are a 400 on Chat Completions and the default effort is not none, so none is sent explicitly. Rejects max_tokens, temperature != 1, top_p, penalties, logprobs."
89
+ },
90
+ {
91
+ id: "openai-gpt-5x",
92
+ family: "openai",
93
+ match: "^gpt-?5\\.[1-9]",
94
+ reasoning: {
95
+ style: "effort",
96
+ efforts: [
97
+ "none",
98
+ "low",
99
+ "medium",
100
+ "high",
101
+ "xhigh"
102
+ ],
103
+ off: "none",
104
+ responsesEfforts: [
105
+ "none",
106
+ "low",
107
+ "medium",
108
+ "high",
109
+ "xhigh",
110
+ "max"
111
+ ]
112
+ },
113
+ sampling: {
114
+ temperature: "default-only",
115
+ topP: false,
116
+ topK: false,
117
+ penalties: false,
118
+ logprobs: false
119
+ },
120
+ maxTokensParam: "max_completion_tokens",
121
+ chatTools: {
122
+ reasoning: "force-none"
123
+ },
124
+ source: "verified-2026-10-14",
125
+ note: "gpt-5.1 and newer 5.x. Same wire rules as gpt-6: no minimal/max on Chat Completions (Responses takes max), function tools need reasoning_effort none on Chat Completions."
126
+ },
127
+ {
128
+ id: "openai-gpt-5-base",
129
+ family: "openai",
130
+ match: "^gpt-?5(?![.\\d])",
131
+ reasoning: {
132
+ style: "effort",
133
+ efforts: [
134
+ "minimal",
135
+ "low",
136
+ "medium",
137
+ "high"
138
+ ],
139
+ off: null
140
+ },
141
+ sampling: {
142
+ temperature: "default-only",
143
+ topP: false,
144
+ topK: false,
145
+ penalties: false,
146
+ logprobs: false
147
+ },
148
+ maxTokensParam: "max_completion_tokens",
149
+ chatTools: {
150
+ reasoning: "any"
151
+ },
152
+ source: "docs",
153
+ note: "gpt-5, -mini, -nano, -codex: minimal/low/medium/high, reasoning cannot be turned off (none maps to minimal)."
154
+ },
155
+ {
156
+ id: "openai-o-series",
157
+ family: "openai",
158
+ match: "^o[1-9]\\d?(?![a-z0-9])",
159
+ reasoning: {
160
+ style: "effort",
161
+ efforts: [
162
+ "low",
163
+ "medium",
164
+ "high"
165
+ ],
166
+ off: null
167
+ },
168
+ sampling: {
169
+ temperature: "default-only",
170
+ topP: false,
171
+ topK: false,
172
+ penalties: false,
173
+ logprobs: false
174
+ },
175
+ maxTokensParam: "max_completion_tokens",
176
+ chatTools: {
177
+ reasoning: "any"
178
+ },
179
+ source: "docs",
180
+ note: "o1/o3/o4 family: low/medium/high, no sampling overrides."
181
+ },
182
+ {
183
+ id: "openai-gpt-oss",
184
+ family: "openai",
185
+ match: "^gpt-?oss",
186
+ reasoning: {
187
+ style: "effort",
188
+ efforts: [
189
+ "low",
190
+ "medium",
191
+ "high"
192
+ ],
193
+ off: null
194
+ },
195
+ sampling: {
196
+ temperature: "any",
197
+ topP: true,
198
+ topK: true,
199
+ penalties: true,
200
+ logprobs: true
201
+ },
202
+ maxTokensParam: "max_tokens",
203
+ chatTools: {
204
+ reasoning: "any"
205
+ },
206
+ source: "docs",
207
+ note: "Open-weight gpt-oss: low/medium/high; sampling and max_tokens behave like an ordinary chat model."
208
+ },
209
+ {
210
+ id: "openai-legacy-gpt",
211
+ family: "openai",
212
+ match: "^(?:gpt-?(?:[0-4]|35)(?![0-9])|text-|davinci|babbage)",
213
+ reasoning: {
214
+ style: "none",
215
+ efforts: [],
216
+ off: null
217
+ },
218
+ sampling: {
219
+ temperature: "any",
220
+ topP: true,
221
+ topK: true,
222
+ penalties: true,
223
+ logprobs: true
224
+ },
225
+ maxTokensParam: "max_tokens",
226
+ chatTools: {
227
+ reasoning: "any"
228
+ },
229
+ source: "docs",
230
+ note: "gpt-4o, gpt-4.1, gpt-3.5 and older: no reasoning, ordinary sampling."
231
+ },
232
+ {
233
+ id: "openai-compatible-toggle",
234
+ family: "openai",
235
+ match: "^(?:deepseek-(?:r\\d|reasoner)|qwq|qwen-?3)",
236
+ reasoning: {
237
+ style: "toggle",
238
+ efforts: [
239
+ "none",
240
+ "minimal",
241
+ "low",
242
+ "medium",
243
+ "high",
244
+ "xhigh",
245
+ "max"
246
+ ],
247
+ off: "none"
248
+ },
249
+ sampling: {
250
+ temperature: "any",
251
+ topP: true,
252
+ topK: true,
253
+ penalties: true,
254
+ logprobs: true
255
+ },
256
+ maxTokensParam: "max_tokens",
257
+ chatTools: {
258
+ reasoning: "any"
259
+ },
260
+ source: "docs",
261
+ note: "DeepSeek R/reasoner, QwQ, Qwen3: on/off style hosts. The effort is forwarded as-is (including none, which switches thinking off on thinking-by-default models)."
262
+ },
263
+ {
264
+ id: "openai-default",
265
+ family: "openai",
266
+ match: ".*",
267
+ reasoning: {
268
+ style: "effort",
269
+ efforts: [
270
+ "none",
271
+ "minimal",
272
+ "low",
273
+ "medium",
274
+ "high",
275
+ "xhigh",
276
+ "max"
277
+ ],
278
+ off: "none"
279
+ },
280
+ sampling: {
281
+ temperature: "any",
282
+ topP: true,
283
+ topK: true,
284
+ penalties: true,
285
+ logprobs: true
286
+ },
287
+ maxTokensParam: "max_tokens",
288
+ chatTools: {
289
+ reasoning: "any"
290
+ },
291
+ source: "docs",
292
+ note: "Permissive default for unknown OpenAI-wire models: pass what the caller asked; the provider learns from 400s."
293
+ },
294
+ {
295
+ id: "claude-haiku-5",
296
+ family: "anthropic",
297
+ match: "^claude-(?:haiku-5|5(?:-\\d+)?-haiku)(?!\\d)",
298
+ reasoning: {
299
+ style: "adaptive",
300
+ efforts: [
301
+ "low",
302
+ "medium",
303
+ "high",
304
+ "xhigh",
305
+ "max"
306
+ ],
307
+ off: "disabled"
308
+ },
309
+ sampling: {
310
+ temperature: "unsupported",
311
+ topP: false,
312
+ topK: false,
313
+ penalties: false,
314
+ logprobs: false
315
+ },
316
+ maxTokensParam: "max_tokens",
317
+ chatTools: {
318
+ reasoning: "any"
319
+ },
320
+ source: "verified-2026-10-14",
321
+ note: "Claude Haiku 5.x: thinking:{type:adaptive} + output_config.effort; thinking:{type:enabled,budget_tokens} is rejected. Off = thinking:{type:disabled}. Sampling params are rejected."
322
+ },
323
+ {
324
+ id: "claude-sonnet-5",
325
+ family: "anthropic",
326
+ match: "^claude-(?:sonnet-5|5(?:-\\d+)?-sonnet)(?!\\d)",
327
+ reasoning: {
328
+ style: "adaptive",
329
+ efforts: [
330
+ "low",
331
+ "medium",
332
+ "high",
333
+ "xhigh",
334
+ "max"
335
+ ],
336
+ off: "between_tools"
337
+ },
338
+ sampling: {
339
+ temperature: "unsupported",
340
+ topP: false,
341
+ topK: false,
342
+ penalties: false,
343
+ logprobs: false
344
+ },
345
+ maxTokensParam: "max_tokens",
346
+ chatTools: {
347
+ reasoning: "any"
348
+ },
349
+ source: "verified-2026-10-14",
350
+ note: "Claude Sonnet 5.x: adaptive + output_config.effort. thinking:{type:disabled} is rejected; off = thinking:{type:between_tools}. Sampling params are rejected."
351
+ },
352
+ {
353
+ id: "claude-opus-5",
354
+ family: "anthropic",
355
+ match: "^claude-(?:opus-5|5(?:-\\d+)?-opus)(?!\\d)",
356
+ reasoning: {
357
+ style: "adaptive",
358
+ efforts: [
359
+ "low",
360
+ "medium",
361
+ "high",
362
+ "xhigh",
363
+ "max"
364
+ ],
365
+ off: null
366
+ },
367
+ sampling: {
368
+ temperature: "unsupported",
369
+ topP: false,
370
+ topK: false,
371
+ penalties: false,
372
+ logprobs: false
373
+ },
374
+ maxTokensParam: "max_tokens",
375
+ chatTools: {
376
+ reasoning: "any"
377
+ },
378
+ source: "verified-2026-10-14",
379
+ note: "Claude Opus 5.x: adaptive + output_config.effort; thinking cannot be turned off (none maps to the lowest effort). Sampling params are rejected."
380
+ },
381
+ {
382
+ id: "claude-fable",
383
+ family: "anthropic",
384
+ match: "^claude-fable",
385
+ reasoning: {
386
+ style: "adaptive",
387
+ efforts: [
388
+ "low",
389
+ "medium",
390
+ "high",
391
+ "xhigh",
392
+ "max"
393
+ ],
394
+ off: null
395
+ },
396
+ sampling: {
397
+ temperature: "unsupported",
398
+ topP: false,
399
+ topK: false,
400
+ penalties: false,
401
+ logprobs: false
402
+ },
403
+ maxTokensParam: "max_tokens",
404
+ chatTools: {
405
+ reasoning: "any"
406
+ },
407
+ source: "docs",
408
+ note: "Claude Fable line: treated like the 5.x adaptive models."
409
+ },
410
+ {
411
+ id: "claude-4-7",
412
+ family: "anthropic",
413
+ match: "^claude-(?:(?:opus|sonnet|haiku)-4[-.]7|4[-.]7-(?:opus|sonnet|haiku))(?!\\d)",
414
+ reasoning: {
415
+ style: "adaptive",
416
+ efforts: [
417
+ "low",
418
+ "medium",
419
+ "high",
420
+ "xhigh",
421
+ "max"
422
+ ],
423
+ off: "disabled"
424
+ },
425
+ sampling: {
426
+ temperature: "thinking-requires-1",
427
+ topP: true,
428
+ topK: true,
429
+ penalties: true,
430
+ logprobs: true
431
+ },
432
+ maxTokensParam: "max_tokens",
433
+ chatTools: {
434
+ reasoning: "any"
435
+ },
436
+ source: "docs",
437
+ note: "Claude 4.7: adaptive thinking, low/medium/high/xhigh/max."
438
+ },
439
+ {
440
+ id: "claude-4-6",
441
+ family: "anthropic",
442
+ match: "^claude-(?:(?:opus|sonnet|haiku)-4[-.]6|4[-.]6-(?:opus|sonnet|haiku))(?!\\d)",
443
+ reasoning: {
444
+ style: "adaptive",
445
+ efforts: [
446
+ "low",
447
+ "medium",
448
+ "high",
449
+ "max"
450
+ ],
451
+ off: "disabled"
452
+ },
453
+ sampling: {
454
+ temperature: "thinking-requires-1",
455
+ topP: true,
456
+ topK: true,
457
+ penalties: true,
458
+ logprobs: true
459
+ },
460
+ maxTokensParam: "max_tokens",
461
+ chatTools: {
462
+ reasoning: "any"
463
+ },
464
+ source: "docs",
465
+ note: "Claude 4.6: adaptive thinking, low/medium/high/max (no xhigh)."
466
+ },
467
+ {
468
+ id: "claude-legacy-budget",
469
+ family: "anthropic",
470
+ match: "^claude-(?:3|4-|(?:opus|sonnet|haiku)-4)",
471
+ reasoning: {
472
+ style: "budget",
473
+ efforts: [
474
+ "none",
475
+ "minimal",
476
+ "low",
477
+ "medium",
478
+ "high",
479
+ "xhigh",
480
+ "max"
481
+ ],
482
+ off: null
483
+ },
484
+ sampling: {
485
+ temperature: "thinking-requires-1",
486
+ topP: true,
487
+ topK: true,
488
+ penalties: true,
489
+ logprobs: true
490
+ },
491
+ maxTokensParam: "max_tokens",
492
+ chatTools: {
493
+ reasoning: "any"
494
+ },
495
+ source: "docs",
496
+ note: "Claude 3.7 and 4.0-4.5: thinking:{type:enabled,budget_tokens}; every effort maps to a budget; sampling overrides are not allowed while thinking."
497
+ },
498
+ {
499
+ id: "anthropic-default",
500
+ family: "anthropic",
501
+ match: ".*",
502
+ reasoning: {
503
+ style: "budget",
504
+ efforts: [
505
+ "none",
506
+ "minimal",
507
+ "low",
508
+ "medium",
509
+ "high",
510
+ "xhigh",
511
+ "max"
512
+ ],
513
+ off: null
514
+ },
515
+ sampling: {
516
+ temperature: "thinking-requires-1",
517
+ topP: true,
518
+ topK: true,
519
+ penalties: true,
520
+ logprobs: true
521
+ },
522
+ maxTokensParam: "max_tokens",
523
+ chatTools: {
524
+ reasoning: "any"
525
+ },
526
+ source: "docs",
527
+ note: "Permissive default for unknown Anthropic-wire models: budget style (the long-standing form); the provider flips the thinking form when the API says so."
528
+ },
529
+ {
530
+ id: "gemini-budget",
531
+ family: "gemini",
532
+ match: "^gemini",
533
+ reasoning: {
534
+ style: "budget",
535
+ efforts: [
536
+ "none",
537
+ "minimal",
538
+ "low",
539
+ "medium",
540
+ "high",
541
+ "xhigh",
542
+ "max"
543
+ ],
544
+ off: "none"
545
+ },
546
+ sampling: {
547
+ temperature: "any",
548
+ topP: true,
549
+ topK: true,
550
+ penalties: true,
551
+ logprobs: true
552
+ },
553
+ maxTokensParam: "max_tokens",
554
+ chatTools: {
555
+ reasoning: "any"
556
+ },
557
+ source: "docs",
558
+ note: "Gemini 2.5-style thinkingBudget; effort maps to a token budget, none = budget 0."
559
+ },
560
+ {
561
+ id: "gemini-default",
562
+ family: "gemini",
563
+ match: ".*",
564
+ reasoning: {
565
+ style: "budget",
566
+ efforts: [
567
+ "none",
568
+ "minimal",
569
+ "low",
570
+ "medium",
571
+ "high",
572
+ "xhigh",
573
+ "max"
574
+ ],
575
+ off: "none"
576
+ },
577
+ sampling: {
578
+ temperature: "any",
579
+ topP: true,
580
+ topK: true,
581
+ penalties: true,
582
+ logprobs: true
583
+ },
584
+ maxTokensParam: "max_tokens",
585
+ chatTools: {
586
+ reasoning: "any"
587
+ },
588
+ source: "docs",
589
+ note: "Permissive default for unknown Gemini-wire models."
590
+ },
591
+ {
592
+ id: "other-default",
593
+ family: "other",
594
+ match: ".*",
595
+ reasoning: {
596
+ style: "effort",
597
+ efforts: [
598
+ "none",
599
+ "minimal",
600
+ "low",
601
+ "medium",
602
+ "high",
603
+ "xhigh",
604
+ "max"
605
+ ],
606
+ off: "none"
607
+ },
608
+ sampling: {
609
+ temperature: "any",
610
+ topP: true,
611
+ topK: true,
612
+ penalties: true,
613
+ logprobs: true
614
+ },
615
+ maxTokensParam: "max_tokens",
616
+ chatTools: {
617
+ reasoning: "any"
618
+ },
619
+ source: "docs",
620
+ note: "Permissive default for model families the SDK has no rules for."
621
+ }
622
+ ]
623
+ };
624
+
625
+ // src/models/rules.ts
626
+ var MODEL_RULES = model_rules_default;
627
+ var LADDER = MODEL_RULES.effortLadder;
628
+ var compiled = /* @__PURE__ */ new Map();
629
+ function regexFor(rule) {
630
+ let re = compiled.get(rule.id);
631
+ if (!re) {
632
+ re = new RegExp(rule.match, "i");
633
+ compiled.set(rule.id, re);
634
+ }
635
+ return re;
636
+ }
637
+ var GATEWAY_PREFIX = /^(?:(?:global|us|eu|apac|jp|au|ca|us-gov)\.)?(?:(?:openai|anthropic|google|meta|amazon|deepseek|qwen|mistral|cohere|ai21)\.)?/;
638
+ function modelIdCandidates(model) {
639
+ if (!model) return [];
640
+ const lower = String(model).trim().toLowerCase();
641
+ const last = lower.split("/").pop() ?? lower;
642
+ const out = [];
643
+ for (const id of [lower, last]) {
644
+ for (const c of [id, id.replace(GATEWAY_PREFIX, "")]) {
645
+ if (c && !out.includes(c)) out.push(c);
646
+ }
647
+ }
648
+ return out;
649
+ }
650
+ var OPENAI_WIRE = /* @__PURE__ */ new Set(["openai", "azure", "openai-compatible", "together", "openrouter", "groq", "fireworks", "ollama", "vllm", "litellm", "mistral", "deepseek", "xai", "jev"]);
651
+ function familiesFor(provider) {
652
+ const p = (provider ?? "").toLowerCase();
653
+ if (OPENAI_WIRE.has(p)) return ["openai"];
654
+ if (p === "anthropic") return ["anthropic"];
655
+ if (p === "bedrock") return ["anthropic", "openai", "other"];
656
+ if (p === "vertex" || p === "gemini" || p === "google") return ["gemini", "anthropic"];
657
+ return ["openai", "anthropic", "gemini", "other"];
658
+ }
659
+ function matchRule(family, ids, allowDefault) {
660
+ for (const rule of MODEL_RULES.rules) {
661
+ if (rule.family !== family) continue;
662
+ if (rule.match === ".*") {
663
+ if (allowDefault) return rule;
664
+ continue;
665
+ }
666
+ const re = regexFor(rule);
667
+ if (ids.some((id) => re.test(id))) return rule;
668
+ }
669
+ return void 0;
670
+ }
671
+ function mergeRulePatch(base, patch) {
672
+ if (!patch) return base;
673
+ const out = { ...base };
674
+ if (patch.reasoning) out.reasoning = { ...base.reasoning ?? {}, ...patch.reasoning };
675
+ if (patch.sampling) out.sampling = { ...base.sampling ?? {}, ...patch.sampling };
676
+ if (patch.chatTools) out.chatTools = { ...base.chatTools ?? {}, ...patch.chatTools };
677
+ if (patch.maxTokensParam) out.maxTokensParam = patch.maxTokensParam;
678
+ if (patch.dropParams) out.dropParams = [.../* @__PURE__ */ new Set([...base.dropParams ?? [], ...patch.dropParams])];
679
+ return out;
680
+ }
681
+ var learned = /* @__PURE__ */ new Map();
682
+ function learnedKey(provider, model, scope) {
683
+ return `${(provider ?? "").toLowerCase()}@${scope ?? ""}::${(model ?? "").trim().toLowerCase()}`;
684
+ }
685
+ function resolveModelRule(opts) {
686
+ const families = familiesFor(opts.provider);
687
+ const ids = modelIdCandidates(opts.model);
688
+ let rule;
689
+ for (const family of families) {
690
+ rule = matchRule(family, ids, false);
691
+ if (rule) break;
692
+ }
693
+ let isDefault = false;
694
+ if (!rule) {
695
+ isDefault = true;
696
+ rule = matchRule(families[0], ids, true) ?? MODEL_RULES.rules[MODEL_RULES.rules.length - 1];
697
+ }
698
+ let effective = rule;
699
+ const known = opts.model ? learned.get(learnedKey(opts.provider, opts.model, opts.scope))?.patch : void 0;
700
+ if (known) effective = mergeRulePatch(effective, known);
701
+ if (opts.patch) effective = mergeRulePatch(effective, opts.patch);
702
+ return { ...effective, matchedRuleId: rule.id, isDefault, learned: !!known };
703
+ }
704
+ function mapReasoningEffort(rule, effort, endpoint = "chat") {
705
+ const efforts = endpoint === "responses" && rule.reasoning.responsesEfforts || rule.reasoning.efforts;
706
+ if (rule.reasoning.style === "none" || efforts.length === 0) return { mapped: true };
707
+ const supported = LADDER.filter((e) => efforts.includes(e));
708
+ if (supported.includes(effort)) return { effort, mapped: false };
709
+ if (effort === "none") {
710
+ const off = rule.reasoning.off;
711
+ if (off && off !== "none") return { off, mapped: true };
712
+ const lowest = supported.find((e) => e !== "none");
713
+ return lowest ? { effort: lowest, mapped: true } : { mapped: true };
714
+ }
715
+ const at = LADDER.indexOf(effort);
716
+ if (at < 0) return { mapped: true };
717
+ for (let i = at - 1; i >= 1; i--) if (supported.includes(LADDER[i])) return { effort: LADDER[i], mapped: true };
718
+ for (let i = at + 1; i < LADDER.length; i++) if (supported.includes(LADDER[i])) return { effort: LADDER[i], mapped: true };
719
+ return supported.includes("none") ? { effort: "none", mapped: true } : { mapped: true };
720
+ }
721
+ function allowsSampling(rule, field, value, thinkingOn = false) {
722
+ const s = rule.sampling;
723
+ switch (field) {
724
+ case "temperature":
725
+ switch (s.temperature) {
726
+ case "any":
727
+ return true;
728
+ case "unsupported":
729
+ return false;
730
+ // The default is what the server applies anyway, so it is never sent.
731
+ case "default-only":
732
+ return false;
733
+ case "thinking-requires-1":
734
+ return !thinkingOn || value === 1;
735
+ }
736
+ return true;
737
+ // Anthropic's thinking restriction covers top_p / top_k as well as temperature.
738
+ case "topP":
739
+ return s.topP && !(thinkingOn && s.temperature === "thinking-requires-1");
740
+ case "topK":
741
+ return s.topK && !(thinkingOn && s.temperature === "thinking-requires-1");
742
+ case "presencePenalty":
743
+ case "frequencyPenalty":
744
+ return s.penalties;
745
+ case "logprobs":
746
+ return s.logprobs;
747
+ }
748
+ }
749
+ function effortBudget(effort, table = "anthropic") {
750
+ if (effort === "none") return 0;
751
+ return (table === "gemini" ? MODEL_RULES.geminiBudgets : MODEL_RULES.budgets)[effort] ?? 0;
752
+ }
753
+
754
+ export { MODEL_RULES, allowsSampling, effortBudget, mapReasoningEffort, modelIdCandidates, resolveModelRule };
755
+ //# sourceMappingURL=model-rules.mjs.map
756
+ //# sourceMappingURL=model-rules.mjs.map