@cognipeer/agent-sdk 0.20.0 → 0.22.1
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 +17305 -15542
- 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 +17305 -15542
- 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.cjs
CHANGED
|
@@ -20,6 +20,14 @@ var model_rules_default = {
|
|
|
20
20
|
xhigh: 24576,
|
|
21
21
|
max: 32768
|
|
22
22
|
},
|
|
23
|
+
adaptiveMaxTokens: {
|
|
24
|
+
minimal: 4096,
|
|
25
|
+
low: 8192,
|
|
26
|
+
medium: 16384,
|
|
27
|
+
high: 32768,
|
|
28
|
+
xhigh: 64e3,
|
|
29
|
+
max: 64e3
|
|
30
|
+
},
|
|
23
31
|
geminiBudgets: {
|
|
24
32
|
minimal: 512,
|
|
25
33
|
low: 1024,
|
|
@@ -306,7 +314,8 @@ var model_rules_default = {
|
|
|
306
314
|
"xhigh",
|
|
307
315
|
"max"
|
|
308
316
|
],
|
|
309
|
-
off: "disabled"
|
|
317
|
+
off: "disabled",
|
|
318
|
+
defaultOn: true
|
|
310
319
|
},
|
|
311
320
|
sampling: {
|
|
312
321
|
temperature: "unsupported",
|
|
@@ -320,7 +329,7 @@ var model_rules_default = {
|
|
|
320
329
|
reasoning: "any"
|
|
321
330
|
},
|
|
322
331
|
source: "verified-2026-10-14",
|
|
323
|
-
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."
|
|
332
|
+
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."
|
|
324
333
|
},
|
|
325
334
|
{
|
|
326
335
|
id: "claude-sonnet-5",
|
|
@@ -335,7 +344,8 @@ var model_rules_default = {
|
|
|
335
344
|
"xhigh",
|
|
336
345
|
"max"
|
|
337
346
|
],
|
|
338
|
-
off: "between_tools"
|
|
347
|
+
off: "between_tools",
|
|
348
|
+
defaultOn: true
|
|
339
349
|
},
|
|
340
350
|
sampling: {
|
|
341
351
|
temperature: "unsupported",
|
|
@@ -349,7 +359,7 @@ var model_rules_default = {
|
|
|
349
359
|
reasoning: "any"
|
|
350
360
|
},
|
|
351
361
|
source: "verified-2026-10-14",
|
|
352
|
-
note: "Claude Sonnet 5.x: adaptive + output_config.effort. thinking:{type:disabled} is rejected; off = thinking:{type:between_tools}. Sampling params are rejected."
|
|
362
|
+
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."
|
|
353
363
|
},
|
|
354
364
|
{
|
|
355
365
|
id: "claude-opus-5",
|
|
@@ -364,7 +374,8 @@ var model_rules_default = {
|
|
|
364
374
|
"xhigh",
|
|
365
375
|
"max"
|
|
366
376
|
],
|
|
367
|
-
off: null
|
|
377
|
+
off: null,
|
|
378
|
+
defaultOn: true
|
|
368
379
|
},
|
|
369
380
|
sampling: {
|
|
370
381
|
temperature: "unsupported",
|
|
@@ -378,12 +389,12 @@ var model_rules_default = {
|
|
|
378
389
|
reasoning: "any"
|
|
379
390
|
},
|
|
380
391
|
source: "verified-2026-10-14",
|
|
381
|
-
note: "Claude Opus 5.x: adaptive + output_config.effort; thinking cannot be turned off (none maps to the lowest effort). Sampling params are rejected."
|
|
392
|
+
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."
|
|
382
393
|
},
|
|
383
394
|
{
|
|
384
395
|
id: "claude-fable",
|
|
385
396
|
family: "anthropic",
|
|
386
|
-
match: "^claude-fable",
|
|
397
|
+
match: "^claude-(?:fable|mythos-5)",
|
|
387
398
|
reasoning: {
|
|
388
399
|
style: "adaptive",
|
|
389
400
|
efforts: [
|
|
@@ -393,7 +404,8 @@ var model_rules_default = {
|
|
|
393
404
|
"xhigh",
|
|
394
405
|
"max"
|
|
395
406
|
],
|
|
396
|
-
off: null
|
|
407
|
+
off: null,
|
|
408
|
+
defaultOn: true
|
|
397
409
|
},
|
|
398
410
|
sampling: {
|
|
399
411
|
temperature: "unsupported",
|
|
@@ -407,7 +419,37 @@ var model_rules_default = {
|
|
|
407
419
|
reasoning: "any"
|
|
408
420
|
},
|
|
409
421
|
source: "docs",
|
|
410
|
-
note: "Claude Fable
|
|
422
|
+
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)."
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
id: "claude-mythos-preview",
|
|
426
|
+
family: "anthropic",
|
|
427
|
+
match: "^claude-mythos-preview",
|
|
428
|
+
reasoning: {
|
|
429
|
+
style: "budget",
|
|
430
|
+
efforts: [
|
|
431
|
+
"minimal",
|
|
432
|
+
"low",
|
|
433
|
+
"medium",
|
|
434
|
+
"high",
|
|
435
|
+
"xhigh",
|
|
436
|
+
"max"
|
|
437
|
+
],
|
|
438
|
+
off: null
|
|
439
|
+
},
|
|
440
|
+
sampling: {
|
|
441
|
+
temperature: "thinking-requires-1",
|
|
442
|
+
topP: true,
|
|
443
|
+
topK: true,
|
|
444
|
+
penalties: true,
|
|
445
|
+
logprobs: true
|
|
446
|
+
},
|
|
447
|
+
maxTokensParam: "max_tokens",
|
|
448
|
+
chatTools: {
|
|
449
|
+
reasoning: "any"
|
|
450
|
+
},
|
|
451
|
+
source: "docs",
|
|
452
|
+
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."
|
|
411
453
|
},
|
|
412
454
|
{
|
|
413
455
|
id: "claude-4-7",
|
|
@@ -528,6 +570,223 @@ var model_rules_default = {
|
|
|
528
570
|
source: "docs",
|
|
529
571
|
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."
|
|
530
572
|
},
|
|
573
|
+
{
|
|
574
|
+
id: "gemini-3-pro-image",
|
|
575
|
+
family: "gemini",
|
|
576
|
+
match: "^gemini-3(?:\\.\\d+)?-pro-image",
|
|
577
|
+
reasoning: {
|
|
578
|
+
style: "level",
|
|
579
|
+
efforts: [
|
|
580
|
+
"high"
|
|
581
|
+
],
|
|
582
|
+
off: null
|
|
583
|
+
},
|
|
584
|
+
sampling: {
|
|
585
|
+
temperature: "any",
|
|
586
|
+
topP: true,
|
|
587
|
+
topK: true,
|
|
588
|
+
penalties: true,
|
|
589
|
+
logprobs: true
|
|
590
|
+
},
|
|
591
|
+
maxTokensParam: "max_tokens",
|
|
592
|
+
chatTools: {
|
|
593
|
+
reasoning: "any"
|
|
594
|
+
},
|
|
595
|
+
source: "docs",
|
|
596
|
+
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."
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
id: "gemini-3-image",
|
|
600
|
+
family: "gemini",
|
|
601
|
+
match: "^gemini-3(?:\\.\\d+)?-.*image",
|
|
602
|
+
reasoning: {
|
|
603
|
+
style: "level",
|
|
604
|
+
efforts: [
|
|
605
|
+
"minimal",
|
|
606
|
+
"high"
|
|
607
|
+
],
|
|
608
|
+
off: null
|
|
609
|
+
},
|
|
610
|
+
sampling: {
|
|
611
|
+
temperature: "any",
|
|
612
|
+
topP: true,
|
|
613
|
+
topK: true,
|
|
614
|
+
penalties: true,
|
|
615
|
+
logprobs: true
|
|
616
|
+
},
|
|
617
|
+
maxTokensParam: "max_tokens",
|
|
618
|
+
chatTools: {
|
|
619
|
+
reasoning: "any"
|
|
620
|
+
},
|
|
621
|
+
source: "docs",
|
|
622
|
+
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."
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
id: "gemini-3-pro",
|
|
626
|
+
family: "gemini",
|
|
627
|
+
match: "^gemini-3(?:\\.0)?-pro",
|
|
628
|
+
reasoning: {
|
|
629
|
+
style: "level",
|
|
630
|
+
efforts: [
|
|
631
|
+
"low",
|
|
632
|
+
"high"
|
|
633
|
+
],
|
|
634
|
+
off: null
|
|
635
|
+
},
|
|
636
|
+
sampling: {
|
|
637
|
+
temperature: "any",
|
|
638
|
+
topP: true,
|
|
639
|
+
topK: true,
|
|
640
|
+
penalties: true,
|
|
641
|
+
logprobs: true
|
|
642
|
+
},
|
|
643
|
+
maxTokensParam: "max_tokens",
|
|
644
|
+
chatTools: {
|
|
645
|
+
reasoning: "any"
|
|
646
|
+
},
|
|
647
|
+
source: "docs",
|
|
648
|
+
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."
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
id: "gemini-3x-pro",
|
|
652
|
+
family: "gemini",
|
|
653
|
+
match: "^gemini-3\\.\\d+-pro",
|
|
654
|
+
reasoning: {
|
|
655
|
+
style: "level",
|
|
656
|
+
efforts: [
|
|
657
|
+
"low",
|
|
658
|
+
"medium",
|
|
659
|
+
"high"
|
|
660
|
+
],
|
|
661
|
+
off: null
|
|
662
|
+
},
|
|
663
|
+
sampling: {
|
|
664
|
+
temperature: "any",
|
|
665
|
+
topP: true,
|
|
666
|
+
topK: true,
|
|
667
|
+
penalties: true,
|
|
668
|
+
logprobs: true
|
|
669
|
+
},
|
|
670
|
+
maxTokensParam: "max_tokens",
|
|
671
|
+
chatTools: {
|
|
672
|
+
reasoning: "any"
|
|
673
|
+
},
|
|
674
|
+
source: "docs",
|
|
675
|
+
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."
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
id: "gemini-3x-flash-no-minimal",
|
|
679
|
+
family: "gemini",
|
|
680
|
+
match: "^gemini-3\\.[78]-flash",
|
|
681
|
+
reasoning: {
|
|
682
|
+
style: "level",
|
|
683
|
+
efforts: [
|
|
684
|
+
"low",
|
|
685
|
+
"medium",
|
|
686
|
+
"high"
|
|
687
|
+
],
|
|
688
|
+
off: null
|
|
689
|
+
},
|
|
690
|
+
sampling: {
|
|
691
|
+
temperature: "any",
|
|
692
|
+
topP: true,
|
|
693
|
+
topK: true,
|
|
694
|
+
penalties: true,
|
|
695
|
+
logprobs: true
|
|
696
|
+
},
|
|
697
|
+
maxTokensParam: "max_tokens",
|
|
698
|
+
chatTools: {
|
|
699
|
+
reasoning: "any"
|
|
700
|
+
},
|
|
701
|
+
source: "docs",
|
|
702
|
+
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."
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
id: "gemini-3-level",
|
|
706
|
+
family: "gemini",
|
|
707
|
+
match: "^gemini-3",
|
|
708
|
+
reasoning: {
|
|
709
|
+
style: "level",
|
|
710
|
+
efforts: [
|
|
711
|
+
"minimal",
|
|
712
|
+
"low",
|
|
713
|
+
"medium",
|
|
714
|
+
"high"
|
|
715
|
+
],
|
|
716
|
+
off: null
|
|
717
|
+
},
|
|
718
|
+
sampling: {
|
|
719
|
+
temperature: "any",
|
|
720
|
+
topP: true,
|
|
721
|
+
topK: true,
|
|
722
|
+
penalties: true,
|
|
723
|
+
logprobs: true
|
|
724
|
+
},
|
|
725
|
+
maxTokensParam: "max_tokens",
|
|
726
|
+
chatTools: {
|
|
727
|
+
reasoning: "any"
|
|
728
|
+
},
|
|
729
|
+
source: "docs",
|
|
730
|
+
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."
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
id: "gemini-4-level",
|
|
734
|
+
family: "gemini",
|
|
735
|
+
match: "^gemini-[4-9]",
|
|
736
|
+
reasoning: {
|
|
737
|
+
style: "level",
|
|
738
|
+
efforts: [
|
|
739
|
+
"low",
|
|
740
|
+
"medium",
|
|
741
|
+
"high"
|
|
742
|
+
],
|
|
743
|
+
off: null
|
|
744
|
+
},
|
|
745
|
+
sampling: {
|
|
746
|
+
temperature: "any",
|
|
747
|
+
topP: true,
|
|
748
|
+
topK: true,
|
|
749
|
+
penalties: true,
|
|
750
|
+
logprobs: true
|
|
751
|
+
},
|
|
752
|
+
maxTokensParam: "max_tokens",
|
|
753
|
+
chatTools: {
|
|
754
|
+
reasoning: "any"
|
|
755
|
+
},
|
|
756
|
+
source: "docs",
|
|
757
|
+
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."
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
id: "gemini-2.5-pro",
|
|
761
|
+
family: "gemini",
|
|
762
|
+
match: "^gemini-2\\.5-pro",
|
|
763
|
+
reasoning: {
|
|
764
|
+
style: "budget",
|
|
765
|
+
efforts: [
|
|
766
|
+
"minimal",
|
|
767
|
+
"low",
|
|
768
|
+
"medium",
|
|
769
|
+
"high",
|
|
770
|
+
"xhigh",
|
|
771
|
+
"max"
|
|
772
|
+
],
|
|
773
|
+
off: null,
|
|
774
|
+
minBudget: 128
|
|
775
|
+
},
|
|
776
|
+
sampling: {
|
|
777
|
+
temperature: "any",
|
|
778
|
+
topP: true,
|
|
779
|
+
topK: true,
|
|
780
|
+
penalties: true,
|
|
781
|
+
logprobs: true
|
|
782
|
+
},
|
|
783
|
+
maxTokensParam: "max_tokens",
|
|
784
|
+
chatTools: {
|
|
785
|
+
reasoning: "any"
|
|
786
|
+
},
|
|
787
|
+
source: "docs",
|
|
788
|
+
note: "Gemini 2.5 Pro: thinkingBudget 128-32768 and thinking cannot be turned off, so effort none maps to minBudget (128) instead of 0."
|
|
789
|
+
},
|
|
531
790
|
{
|
|
532
791
|
id: "gemini-budget",
|
|
533
792
|
family: "gemini",
|
|
@@ -684,6 +943,19 @@ var learned = /* @__PURE__ */ new Map();
|
|
|
684
943
|
function learnedKey(provider, model, scope) {
|
|
685
944
|
return `${(provider ?? "").toLowerCase()}@${scope ?? ""}::${(model ?? "").trim().toLowerCase()}`;
|
|
686
945
|
}
|
|
946
|
+
var BEDROCK_CLAUDE = /(?:^|[./])anthropic\.claude/;
|
|
947
|
+
function isClaudeModelId(model) {
|
|
948
|
+
const id = String(model ?? "").trim().toLowerCase();
|
|
949
|
+
if (!id) return false;
|
|
950
|
+
return BEDROCK_CLAUDE.test(id) || modelIdCandidates(id).some((c) => c.startsWith("claude"));
|
|
951
|
+
}
|
|
952
|
+
function bedrockModelFamily(model) {
|
|
953
|
+
const id = String(model ?? "").trim().toLowerCase();
|
|
954
|
+
if (!id) return "unknown";
|
|
955
|
+
if (isClaudeModelId(id)) return "claude";
|
|
956
|
+
if (id.startsWith("arn:") && !(id.split("/").pop() ?? "").includes(".")) return "unknown";
|
|
957
|
+
return "other";
|
|
958
|
+
}
|
|
687
959
|
function resolveModelRule(opts) {
|
|
688
960
|
const families = familiesFor(opts.provider);
|
|
689
961
|
const ids = modelIdCandidates(opts.model);
|
|
@@ -695,7 +967,8 @@ function resolveModelRule(opts) {
|
|
|
695
967
|
let isDefault = false;
|
|
696
968
|
if (!rule) {
|
|
697
969
|
isDefault = true;
|
|
698
|
-
|
|
970
|
+
const notClaude = (opts.provider ?? "").toLowerCase() === "bedrock" && bedrockModelFamily(opts.model) === "other";
|
|
971
|
+
rule = matchRule(notClaude ? "other" : families[0], ids, true) ?? MODEL_RULES.rules[MODEL_RULES.rules.length - 1];
|
|
699
972
|
}
|
|
700
973
|
let effective = rule;
|
|
701
974
|
const known = opts.model ? learned.get(learnedKey(opts.provider, opts.model, opts.scope))?.patch : void 0;
|