@cognipeer/agent-sdk 0.20.0 → 0.22.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.
- package/LICENSE +21 -0
- package/README.md +23 -2
- package/dist/index.cjs +17276 -15538
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +336 -22
- package/dist/index.d.ts +336 -22
- package/dist/index.mjs +17276 -15538
- package/dist/index.mjs.map +1 -1
- package/dist/{model-rules--welxWDw.d.cts → model-rules-D6teB4rU.d.cts} +136 -16
- package/dist/{model-rules--welxWDw.d.ts → model-rules-D6teB4rU.d.ts} +136 -16
- package/dist/model-rules.cjs +283 -10
- package/dist/model-rules.cjs.map +1 -1
- package/dist/model-rules.d.cts +1 -1
- package/dist/model-rules.d.ts +1 -1
- package/dist/model-rules.json +268 -9
- package/dist/model-rules.mjs +283 -10
- package/dist/model-rules.mjs.map +1 -1
- package/package.json +8 -3
package/dist/model-rules.mjs
CHANGED
|
@@ -18,6 +18,14 @@ var model_rules_default = {
|
|
|
18
18
|
xhigh: 24576,
|
|
19
19
|
max: 32768
|
|
20
20
|
},
|
|
21
|
+
adaptiveMaxTokens: {
|
|
22
|
+
minimal: 4096,
|
|
23
|
+
low: 8192,
|
|
24
|
+
medium: 16384,
|
|
25
|
+
high: 32768,
|
|
26
|
+
xhigh: 64e3,
|
|
27
|
+
max: 64e3
|
|
28
|
+
},
|
|
21
29
|
geminiBudgets: {
|
|
22
30
|
minimal: 512,
|
|
23
31
|
low: 1024,
|
|
@@ -304,7 +312,8 @@ var model_rules_default = {
|
|
|
304
312
|
"xhigh",
|
|
305
313
|
"max"
|
|
306
314
|
],
|
|
307
|
-
off: "disabled"
|
|
315
|
+
off: "disabled",
|
|
316
|
+
defaultOn: true
|
|
308
317
|
},
|
|
309
318
|
sampling: {
|
|
310
319
|
temperature: "unsupported",
|
|
@@ -318,7 +327,7 @@ var model_rules_default = {
|
|
|
318
327
|
reasoning: "any"
|
|
319
328
|
},
|
|
320
329
|
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."
|
|
330
|
+
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. Thinks by default with display omitted (empty text): includeThoughts alone sends adaptive + display summarized."
|
|
322
331
|
},
|
|
323
332
|
{
|
|
324
333
|
id: "claude-sonnet-5",
|
|
@@ -333,7 +342,8 @@ var model_rules_default = {
|
|
|
333
342
|
"xhigh",
|
|
334
343
|
"max"
|
|
335
344
|
],
|
|
336
|
-
off: "between_tools"
|
|
345
|
+
off: "between_tools",
|
|
346
|
+
defaultOn: true
|
|
337
347
|
},
|
|
338
348
|
sampling: {
|
|
339
349
|
temperature: "unsupported",
|
|
@@ -347,7 +357,7 @@ var model_rules_default = {
|
|
|
347
357
|
reasoning: "any"
|
|
348
358
|
},
|
|
349
359
|
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."
|
|
360
|
+
note: "Claude Sonnet 5.x: adaptive + output_config.effort. thinking:{type:disabled} is rejected; off = thinking:{type:between_tools}. Sampling params are rejected. Thinks by default with display omitted (empty text): includeThoughts alone sends adaptive + display summarized."
|
|
351
361
|
},
|
|
352
362
|
{
|
|
353
363
|
id: "claude-opus-5",
|
|
@@ -362,7 +372,8 @@ var model_rules_default = {
|
|
|
362
372
|
"xhigh",
|
|
363
373
|
"max"
|
|
364
374
|
],
|
|
365
|
-
off: null
|
|
375
|
+
off: null,
|
|
376
|
+
defaultOn: true
|
|
366
377
|
},
|
|
367
378
|
sampling: {
|
|
368
379
|
temperature: "unsupported",
|
|
@@ -376,12 +387,12 @@ var model_rules_default = {
|
|
|
376
387
|
reasoning: "any"
|
|
377
388
|
},
|
|
378
389
|
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."
|
|
390
|
+
note: "Claude Opus 5.x: adaptive + output_config.effort; thinking cannot be turned off (none maps to the lowest effort). Sampling params are rejected. Thinks by default with display omitted (empty text): includeThoughts alone sends adaptive + display summarized."
|
|
380
391
|
},
|
|
381
392
|
{
|
|
382
393
|
id: "claude-fable",
|
|
383
394
|
family: "anthropic",
|
|
384
|
-
match: "^claude-fable",
|
|
395
|
+
match: "^claude-(?:fable|mythos-5)",
|
|
385
396
|
reasoning: {
|
|
386
397
|
style: "adaptive",
|
|
387
398
|
efforts: [
|
|
@@ -391,7 +402,8 @@ var model_rules_default = {
|
|
|
391
402
|
"xhigh",
|
|
392
403
|
"max"
|
|
393
404
|
],
|
|
394
|
-
off: null
|
|
405
|
+
off: null,
|
|
406
|
+
defaultOn: true
|
|
395
407
|
},
|
|
396
408
|
sampling: {
|
|
397
409
|
temperature: "unsupported",
|
|
@@ -405,7 +417,37 @@ var model_rules_default = {
|
|
|
405
417
|
reasoning: "any"
|
|
406
418
|
},
|
|
407
419
|
source: "docs",
|
|
408
|
-
note: "Claude Fable
|
|
420
|
+
note: "Claude Fable and Mythos 5 lines (5, 5.1): thinking is always on (disabled and budget_tokens are 400s), so treated like the 5.x adaptive models: effort low..max, sampling params rejected, display omitted by default (includeThoughts alone sends adaptive + display summarized)."
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
id: "claude-mythos-preview",
|
|
424
|
+
family: "anthropic",
|
|
425
|
+
match: "^claude-mythos-preview",
|
|
426
|
+
reasoning: {
|
|
427
|
+
style: "budget",
|
|
428
|
+
efforts: [
|
|
429
|
+
"minimal",
|
|
430
|
+
"low",
|
|
431
|
+
"medium",
|
|
432
|
+
"high",
|
|
433
|
+
"xhigh",
|
|
434
|
+
"max"
|
|
435
|
+
],
|
|
436
|
+
off: null
|
|
437
|
+
},
|
|
438
|
+
sampling: {
|
|
439
|
+
temperature: "thinking-requires-1",
|
|
440
|
+
topP: true,
|
|
441
|
+
topK: true,
|
|
442
|
+
penalties: true,
|
|
443
|
+
logprobs: true
|
|
444
|
+
},
|
|
445
|
+
maxTokensParam: "max_tokens",
|
|
446
|
+
chatTools: {
|
|
447
|
+
reasoning: "any"
|
|
448
|
+
},
|
|
449
|
+
source: "docs",
|
|
450
|
+
note: "Claude Mythos Preview: the one 4.7+ model that still takes extended thinking (budget_tokens). Thinking cannot be disabled (type disabled is a 400) and defaults to adaptive when a request says nothing, so effort none sends no thinking field at all."
|
|
409
451
|
},
|
|
410
452
|
{
|
|
411
453
|
id: "claude-4-7",
|
|
@@ -526,6 +568,223 @@ var model_rules_default = {
|
|
|
526
568
|
source: "docs",
|
|
527
569
|
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
570
|
},
|
|
571
|
+
{
|
|
572
|
+
id: "gemini-3-pro-image",
|
|
573
|
+
family: "gemini",
|
|
574
|
+
match: "^gemini-3(?:\\.\\d+)?-pro-image",
|
|
575
|
+
reasoning: {
|
|
576
|
+
style: "level",
|
|
577
|
+
efforts: [
|
|
578
|
+
"high"
|
|
579
|
+
],
|
|
580
|
+
off: null
|
|
581
|
+
},
|
|
582
|
+
sampling: {
|
|
583
|
+
temperature: "any",
|
|
584
|
+
topP: true,
|
|
585
|
+
topK: true,
|
|
586
|
+
penalties: true,
|
|
587
|
+
logprobs: true
|
|
588
|
+
},
|
|
589
|
+
maxTokensParam: "max_tokens",
|
|
590
|
+
chatTools: {
|
|
591
|
+
reasoning: "any"
|
|
592
|
+
},
|
|
593
|
+
source: "docs",
|
|
594
|
+
note: "Gemini 3 Pro Image accepts only thinkingLevel high. thinkingLevel replaces thinkingBudget (a request with both is a 400); thinking cannot be switched off, so effort none maps to the lowest level the model accepts."
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
id: "gemini-3-image",
|
|
598
|
+
family: "gemini",
|
|
599
|
+
match: "^gemini-3(?:\\.\\d+)?-.*image",
|
|
600
|
+
reasoning: {
|
|
601
|
+
style: "level",
|
|
602
|
+
efforts: [
|
|
603
|
+
"minimal",
|
|
604
|
+
"high"
|
|
605
|
+
],
|
|
606
|
+
off: null
|
|
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: "Gemini 3.x Flash / Flash-Lite image models accept thinkingLevel minimal or high. thinkingLevel replaces thinkingBudget (a request with both is a 400); thinking cannot be switched off, so effort none maps to the lowest level the model accepts."
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
id: "gemini-3-pro",
|
|
624
|
+
family: "gemini",
|
|
625
|
+
match: "^gemini-3(?:\\.0)?-pro",
|
|
626
|
+
reasoning: {
|
|
627
|
+
style: "level",
|
|
628
|
+
efforts: [
|
|
629
|
+
"low",
|
|
630
|
+
"high"
|
|
631
|
+
],
|
|
632
|
+
off: null
|
|
633
|
+
},
|
|
634
|
+
sampling: {
|
|
635
|
+
temperature: "any",
|
|
636
|
+
topP: true,
|
|
637
|
+
topK: true,
|
|
638
|
+
penalties: true,
|
|
639
|
+
logprobs: true
|
|
640
|
+
},
|
|
641
|
+
maxTokensParam: "max_tokens",
|
|
642
|
+
chatTools: {
|
|
643
|
+
reasoning: "any"
|
|
644
|
+
},
|
|
645
|
+
source: "docs",
|
|
646
|
+
note: "Gemini 3 Pro accepts thinkingLevel low or high (no minimal, no medium; default high). thinkingLevel replaces thinkingBudget (a request with both is a 400); thinking cannot be switched off, so effort none maps to the lowest level the model accepts."
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
id: "gemini-3x-pro",
|
|
650
|
+
family: "gemini",
|
|
651
|
+
match: "^gemini-3\\.\\d+-pro",
|
|
652
|
+
reasoning: {
|
|
653
|
+
style: "level",
|
|
654
|
+
efforts: [
|
|
655
|
+
"low",
|
|
656
|
+
"medium",
|
|
657
|
+
"high"
|
|
658
|
+
],
|
|
659
|
+
off: null
|
|
660
|
+
},
|
|
661
|
+
sampling: {
|
|
662
|
+
temperature: "any",
|
|
663
|
+
topP: true,
|
|
664
|
+
topK: true,
|
|
665
|
+
penalties: true,
|
|
666
|
+
logprobs: true
|
|
667
|
+
},
|
|
668
|
+
maxTokensParam: "max_tokens",
|
|
669
|
+
chatTools: {
|
|
670
|
+
reasoning: "any"
|
|
671
|
+
},
|
|
672
|
+
source: "docs",
|
|
673
|
+
note: "Gemini 3.x Pro (3.1 and later) accepts thinkingLevel low, medium or high (no minimal; default high). thinkingLevel replaces thinkingBudget (a request with both is a 400); thinking cannot be switched off, so effort none maps to the lowest level the model accepts."
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
id: "gemini-3x-flash-no-minimal",
|
|
677
|
+
family: "gemini",
|
|
678
|
+
match: "^gemini-3\\.[78]-flash",
|
|
679
|
+
reasoning: {
|
|
680
|
+
style: "level",
|
|
681
|
+
efforts: [
|
|
682
|
+
"low",
|
|
683
|
+
"medium",
|
|
684
|
+
"high"
|
|
685
|
+
],
|
|
686
|
+
off: null
|
|
687
|
+
},
|
|
688
|
+
sampling: {
|
|
689
|
+
temperature: "any",
|
|
690
|
+
topP: true,
|
|
691
|
+
topK: true,
|
|
692
|
+
penalties: true,
|
|
693
|
+
logprobs: true
|
|
694
|
+
},
|
|
695
|
+
maxTokensParam: "max_tokens",
|
|
696
|
+
chatTools: {
|
|
697
|
+
reasoning: "any"
|
|
698
|
+
},
|
|
699
|
+
source: "docs",
|
|
700
|
+
note: "Gemini 3.7 / 3.8 Flash accept thinkingLevel low, medium or high (no minimal). thinkingLevel replaces thinkingBudget (a request with both is a 400); thinking cannot be switched off, so effort none maps to the lowest level the model accepts."
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
id: "gemini-3-level",
|
|
704
|
+
family: "gemini",
|
|
705
|
+
match: "^gemini-3",
|
|
706
|
+
reasoning: {
|
|
707
|
+
style: "level",
|
|
708
|
+
efforts: [
|
|
709
|
+
"minimal",
|
|
710
|
+
"low",
|
|
711
|
+
"medium",
|
|
712
|
+
"high"
|
|
713
|
+
],
|
|
714
|
+
off: null
|
|
715
|
+
},
|
|
716
|
+
sampling: {
|
|
717
|
+
temperature: "any",
|
|
718
|
+
topP: true,
|
|
719
|
+
topK: true,
|
|
720
|
+
penalties: true,
|
|
721
|
+
logprobs: true
|
|
722
|
+
},
|
|
723
|
+
maxTokensParam: "max_tokens",
|
|
724
|
+
chatTools: {
|
|
725
|
+
reasoning: "any"
|
|
726
|
+
},
|
|
727
|
+
source: "docs",
|
|
728
|
+
note: "Gemini 3 Flash / Flash-Lite and other gemini-3 models accept thinkingLevel minimal, low, medium or high. thinkingLevel replaces thinkingBudget (a request with both is a 400); thinking cannot be switched off, so effort none maps to the lowest level the model accepts."
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
id: "gemini-4-level",
|
|
732
|
+
family: "gemini",
|
|
733
|
+
match: "^gemini-[4-9]",
|
|
734
|
+
reasoning: {
|
|
735
|
+
style: "level",
|
|
736
|
+
efforts: [
|
|
737
|
+
"low",
|
|
738
|
+
"medium",
|
|
739
|
+
"high"
|
|
740
|
+
],
|
|
741
|
+
off: null
|
|
742
|
+
},
|
|
743
|
+
sampling: {
|
|
744
|
+
temperature: "any",
|
|
745
|
+
topP: true,
|
|
746
|
+
topK: true,
|
|
747
|
+
penalties: true,
|
|
748
|
+
logprobs: true
|
|
749
|
+
},
|
|
750
|
+
maxTokensParam: "max_tokens",
|
|
751
|
+
chatTools: {
|
|
752
|
+
reasoning: "any"
|
|
753
|
+
},
|
|
754
|
+
source: "docs",
|
|
755
|
+
note: "Gemini 4 and later accept thinkingLevel low, medium or high; MINIMAL is not supported on Gemini 4 models. Setting thinkingBudget on Gemini 4 returns a 400 INVALID_ARGUMENT, so no budget is ever derived (a numeric budgetTokens picks the nearest level; only an explicit providerExtras.thinkingBudget sends one); thinking cannot be switched off, so effort none maps to the lowest level."
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
id: "gemini-2.5-pro",
|
|
759
|
+
family: "gemini",
|
|
760
|
+
match: "^gemini-2\\.5-pro",
|
|
761
|
+
reasoning: {
|
|
762
|
+
style: "budget",
|
|
763
|
+
efforts: [
|
|
764
|
+
"minimal",
|
|
765
|
+
"low",
|
|
766
|
+
"medium",
|
|
767
|
+
"high",
|
|
768
|
+
"xhigh",
|
|
769
|
+
"max"
|
|
770
|
+
],
|
|
771
|
+
off: null,
|
|
772
|
+
minBudget: 128
|
|
773
|
+
},
|
|
774
|
+
sampling: {
|
|
775
|
+
temperature: "any",
|
|
776
|
+
topP: true,
|
|
777
|
+
topK: true,
|
|
778
|
+
penalties: true,
|
|
779
|
+
logprobs: true
|
|
780
|
+
},
|
|
781
|
+
maxTokensParam: "max_tokens",
|
|
782
|
+
chatTools: {
|
|
783
|
+
reasoning: "any"
|
|
784
|
+
},
|
|
785
|
+
source: "docs",
|
|
786
|
+
note: "Gemini 2.5 Pro: thinkingBudget 128-32768 and thinking cannot be turned off, so effort none maps to minBudget (128) instead of 0."
|
|
787
|
+
},
|
|
529
788
|
{
|
|
530
789
|
id: "gemini-budget",
|
|
531
790
|
family: "gemini",
|
|
@@ -682,6 +941,19 @@ var learned = /* @__PURE__ */ new Map();
|
|
|
682
941
|
function learnedKey(provider, model, scope) {
|
|
683
942
|
return `${(provider ?? "").toLowerCase()}@${scope ?? ""}::${(model ?? "").trim().toLowerCase()}`;
|
|
684
943
|
}
|
|
944
|
+
var BEDROCK_CLAUDE = /(?:^|[./])anthropic\.claude/;
|
|
945
|
+
function isClaudeModelId(model) {
|
|
946
|
+
const id = String(model ?? "").trim().toLowerCase();
|
|
947
|
+
if (!id) return false;
|
|
948
|
+
return BEDROCK_CLAUDE.test(id) || modelIdCandidates(id).some((c) => c.startsWith("claude"));
|
|
949
|
+
}
|
|
950
|
+
function bedrockModelFamily(model) {
|
|
951
|
+
const id = String(model ?? "").trim().toLowerCase();
|
|
952
|
+
if (!id) return "unknown";
|
|
953
|
+
if (isClaudeModelId(id)) return "claude";
|
|
954
|
+
if (id.startsWith("arn:") && !(id.split("/").pop() ?? "").includes(".")) return "unknown";
|
|
955
|
+
return "other";
|
|
956
|
+
}
|
|
685
957
|
function resolveModelRule(opts) {
|
|
686
958
|
const families = familiesFor(opts.provider);
|
|
687
959
|
const ids = modelIdCandidates(opts.model);
|
|
@@ -693,7 +965,8 @@ function resolveModelRule(opts) {
|
|
|
693
965
|
let isDefault = false;
|
|
694
966
|
if (!rule) {
|
|
695
967
|
isDefault = true;
|
|
696
|
-
|
|
968
|
+
const notClaude = (opts.provider ?? "").toLowerCase() === "bedrock" && bedrockModelFamily(opts.model) === "other";
|
|
969
|
+
rule = matchRule(notClaude ? "other" : families[0], ids, true) ?? MODEL_RULES.rules[MODEL_RULES.rules.length - 1];
|
|
697
970
|
}
|
|
698
971
|
let effective = rule;
|
|
699
972
|
const known = opts.model ? learned.get(learnedKey(opts.provider, opts.model, opts.scope))?.patch : void 0;
|