@genesislcap/foundation-ai 15.14.2 → 15.15.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/dist/dts/index.d.ts +1 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/transports/anthropic-transport.d.ts +9 -0
- package/dist/dts/transports/anthropic-transport.d.ts.map +1 -1
- package/dist/dts/transports/gemini-transport.d.ts +11 -7
- package/dist/dts/transports/gemini-transport.d.ts.map +1 -1
- package/dist/dts/types/chat.types.d.ts +103 -5
- package/dist/dts/types/chat.types.d.ts.map +1 -1
- package/dist/dts/utils/image-mime.d.ts +34 -0
- package/dist/dts/utils/image-mime.d.ts.map +1 -0
- package/dist/esm/transports/anthropic-transport.js +178 -32
- package/dist/esm/transports/gemini-transport.js +178 -35
- package/dist/esm/utils/image-mime.js +37 -0
- package/dist/foundation-ai.api.json +405 -90
- package/dist/foundation-ai.d.ts +129 -15
- package/package.json +11 -11
|
@@ -3529,103 +3529,40 @@
|
|
|
3529
3529
|
"extendsTokenRanges": []
|
|
3530
3530
|
},
|
|
3531
3531
|
{
|
|
3532
|
-
"kind": "
|
|
3533
|
-
"canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:
|
|
3532
|
+
"kind": "TypeAlias",
|
|
3533
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:type",
|
|
3534
3534
|
"docComment": "/**\n * A file attachment included with a user message.\n *\n * @beta\n */\n",
|
|
3535
3535
|
"excerptTokens": [
|
|
3536
3536
|
{
|
|
3537
3537
|
"kind": "Content",
|
|
3538
|
-
"text": "export
|
|
3539
|
-
}
|
|
3540
|
-
],
|
|
3541
|
-
"fileUrlPath": "src/types/chat.types.ts",
|
|
3542
|
-
"releaseTag": "Beta",
|
|
3543
|
-
"name": "ChatAttachment",
|
|
3544
|
-
"preserveMemberOrder": false,
|
|
3545
|
-
"members": [
|
|
3538
|
+
"text": "export type ChatAttachment = "
|
|
3539
|
+
},
|
|
3546
3540
|
{
|
|
3547
|
-
"kind": "
|
|
3548
|
-
"
|
|
3549
|
-
"
|
|
3550
|
-
"excerptTokens": [
|
|
3551
|
-
{
|
|
3552
|
-
"kind": "Content",
|
|
3553
|
-
"text": "content: "
|
|
3554
|
-
},
|
|
3555
|
-
{
|
|
3556
|
-
"kind": "Content",
|
|
3557
|
-
"text": "string"
|
|
3558
|
-
},
|
|
3559
|
-
{
|
|
3560
|
-
"kind": "Content",
|
|
3561
|
-
"text": ";"
|
|
3562
|
-
}
|
|
3563
|
-
],
|
|
3564
|
-
"isReadonly": false,
|
|
3565
|
-
"isOptional": false,
|
|
3566
|
-
"releaseTag": "Beta",
|
|
3567
|
-
"name": "content",
|
|
3568
|
-
"propertyTypeTokenRange": {
|
|
3569
|
-
"startIndex": 1,
|
|
3570
|
-
"endIndex": 2
|
|
3571
|
-
}
|
|
3541
|
+
"kind": "Reference",
|
|
3542
|
+
"text": "ChatTextAttachment",
|
|
3543
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatTextAttachment:interface"
|
|
3572
3544
|
},
|
|
3573
3545
|
{
|
|
3574
|
-
"kind": "
|
|
3575
|
-
"
|
|
3576
|
-
"docComment": "",
|
|
3577
|
-
"excerptTokens": [
|
|
3578
|
-
{
|
|
3579
|
-
"kind": "Content",
|
|
3580
|
-
"text": "mimeType: "
|
|
3581
|
-
},
|
|
3582
|
-
{
|
|
3583
|
-
"kind": "Content",
|
|
3584
|
-
"text": "string"
|
|
3585
|
-
},
|
|
3586
|
-
{
|
|
3587
|
-
"kind": "Content",
|
|
3588
|
-
"text": ";"
|
|
3589
|
-
}
|
|
3590
|
-
],
|
|
3591
|
-
"isReadonly": false,
|
|
3592
|
-
"isOptional": false,
|
|
3593
|
-
"releaseTag": "Beta",
|
|
3594
|
-
"name": "mimeType",
|
|
3595
|
-
"propertyTypeTokenRange": {
|
|
3596
|
-
"startIndex": 1,
|
|
3597
|
-
"endIndex": 2
|
|
3598
|
-
}
|
|
3546
|
+
"kind": "Content",
|
|
3547
|
+
"text": " | "
|
|
3599
3548
|
},
|
|
3600
3549
|
{
|
|
3601
|
-
"kind": "
|
|
3602
|
-
"
|
|
3603
|
-
"
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
},
|
|
3609
|
-
{
|
|
3610
|
-
"kind": "Content",
|
|
3611
|
-
"text": "string"
|
|
3612
|
-
},
|
|
3613
|
-
{
|
|
3614
|
-
"kind": "Content",
|
|
3615
|
-
"text": ";"
|
|
3616
|
-
}
|
|
3617
|
-
],
|
|
3618
|
-
"isReadonly": false,
|
|
3619
|
-
"isOptional": false,
|
|
3620
|
-
"releaseTag": "Beta",
|
|
3621
|
-
"name": "name",
|
|
3622
|
-
"propertyTypeTokenRange": {
|
|
3623
|
-
"startIndex": 1,
|
|
3624
|
-
"endIndex": 2
|
|
3625
|
-
}
|
|
3550
|
+
"kind": "Reference",
|
|
3551
|
+
"text": "ChatImageAttachment",
|
|
3552
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatImageAttachment:interface"
|
|
3553
|
+
},
|
|
3554
|
+
{
|
|
3555
|
+
"kind": "Content",
|
|
3556
|
+
"text": ";"
|
|
3626
3557
|
}
|
|
3627
3558
|
],
|
|
3628
|
-
"
|
|
3559
|
+
"fileUrlPath": "src/types/chat.types.ts",
|
|
3560
|
+
"releaseTag": "Beta",
|
|
3561
|
+
"name": "ChatAttachment",
|
|
3562
|
+
"typeTokenRange": {
|
|
3563
|
+
"startIndex": 1,
|
|
3564
|
+
"endIndex": 4
|
|
3565
|
+
}
|
|
3629
3566
|
},
|
|
3630
3567
|
{
|
|
3631
3568
|
"kind": "Interface",
|
|
@@ -4108,6 +4045,159 @@
|
|
|
4108
4045
|
],
|
|
4109
4046
|
"extendsTokenRanges": []
|
|
4110
4047
|
},
|
|
4048
|
+
{
|
|
4049
|
+
"kind": "Interface",
|
|
4050
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatImageAttachment:interface",
|
|
4051
|
+
"docComment": "/**\n * An image attachment included with a user message or a tool result. Sent as a real image content block — an Anthropic `type: 'image'` block or a Gemini `inlineData` part — not flattened to text.\n *\n * @beta\n */\n",
|
|
4052
|
+
"excerptTokens": [
|
|
4053
|
+
{
|
|
4054
|
+
"kind": "Content",
|
|
4055
|
+
"text": "export interface ChatImageAttachment "
|
|
4056
|
+
}
|
|
4057
|
+
],
|
|
4058
|
+
"fileUrlPath": "src/types/chat.types.ts",
|
|
4059
|
+
"releaseTag": "Beta",
|
|
4060
|
+
"name": "ChatImageAttachment",
|
|
4061
|
+
"preserveMemberOrder": false,
|
|
4062
|
+
"members": [
|
|
4063
|
+
{
|
|
4064
|
+
"kind": "PropertySignature",
|
|
4065
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatImageAttachment#data:member",
|
|
4066
|
+
"docComment": "/**\n * Base64 payload — the bare bytes both APIs expect, ideally with NO `data:` URL prefix. A leading `data:<mime>;base64,` preamble (what `FileReader.readAsDataURL` produces, the easy mistake) is tolerated: the transports strip it before sending via `stripImageDataUrl`.\n */\n",
|
|
4067
|
+
"excerptTokens": [
|
|
4068
|
+
{
|
|
4069
|
+
"kind": "Content",
|
|
4070
|
+
"text": "data: "
|
|
4071
|
+
},
|
|
4072
|
+
{
|
|
4073
|
+
"kind": "Content",
|
|
4074
|
+
"text": "string"
|
|
4075
|
+
},
|
|
4076
|
+
{
|
|
4077
|
+
"kind": "Content",
|
|
4078
|
+
"text": ";"
|
|
4079
|
+
}
|
|
4080
|
+
],
|
|
4081
|
+
"isReadonly": false,
|
|
4082
|
+
"isOptional": false,
|
|
4083
|
+
"releaseTag": "Beta",
|
|
4084
|
+
"name": "data",
|
|
4085
|
+
"propertyTypeTokenRange": {
|
|
4086
|
+
"startIndex": 1,
|
|
4087
|
+
"endIndex": 2
|
|
4088
|
+
}
|
|
4089
|
+
},
|
|
4090
|
+
{
|
|
4091
|
+
"kind": "PropertySignature",
|
|
4092
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatImageAttachment#detail:member",
|
|
4093
|
+
"docComment": "/**\n * Advisory resolution hint. Honoured on Gemini (`mediaResolution`); a documented no-op on Anthropic, where the only lever is the pixels you send — resize before attaching. Named as advisory rather than mapped to a fake Anthropic equivalent, following the precedent of {@link CachePolicy}'s `ttl` being Anthropic-only and ignored on Gemini.\n */\n",
|
|
4094
|
+
"excerptTokens": [
|
|
4095
|
+
{
|
|
4096
|
+
"kind": "Content",
|
|
4097
|
+
"text": "detail?: "
|
|
4098
|
+
},
|
|
4099
|
+
{
|
|
4100
|
+
"kind": "Content",
|
|
4101
|
+
"text": "'low' | 'medium' | 'high'"
|
|
4102
|
+
},
|
|
4103
|
+
{
|
|
4104
|
+
"kind": "Content",
|
|
4105
|
+
"text": ";"
|
|
4106
|
+
}
|
|
4107
|
+
],
|
|
4108
|
+
"isReadonly": false,
|
|
4109
|
+
"isOptional": true,
|
|
4110
|
+
"releaseTag": "Beta",
|
|
4111
|
+
"name": "detail",
|
|
4112
|
+
"propertyTypeTokenRange": {
|
|
4113
|
+
"startIndex": 1,
|
|
4114
|
+
"endIndex": 2
|
|
4115
|
+
}
|
|
4116
|
+
},
|
|
4117
|
+
{
|
|
4118
|
+
"kind": "PropertySignature",
|
|
4119
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatImageAttachment#kind:member",
|
|
4120
|
+
"docComment": "/**\n * REQUIRED, and the only thing either transport branches on. Deliberately not inferred from `mimeType`: the composer's `readAsText` path can produce `mimeType: 'image/png'` with text content, so a mime-based branch would send mojibake as base64 image data.\n */\n",
|
|
4121
|
+
"excerptTokens": [
|
|
4122
|
+
{
|
|
4123
|
+
"kind": "Content",
|
|
4124
|
+
"text": "kind: "
|
|
4125
|
+
},
|
|
4126
|
+
{
|
|
4127
|
+
"kind": "Content",
|
|
4128
|
+
"text": "'image'"
|
|
4129
|
+
},
|
|
4130
|
+
{
|
|
4131
|
+
"kind": "Content",
|
|
4132
|
+
"text": ";"
|
|
4133
|
+
}
|
|
4134
|
+
],
|
|
4135
|
+
"isReadonly": false,
|
|
4136
|
+
"isOptional": false,
|
|
4137
|
+
"releaseTag": "Beta",
|
|
4138
|
+
"name": "kind",
|
|
4139
|
+
"propertyTypeTokenRange": {
|
|
4140
|
+
"startIndex": 1,
|
|
4141
|
+
"endIndex": 2
|
|
4142
|
+
}
|
|
4143
|
+
},
|
|
4144
|
+
{
|
|
4145
|
+
"kind": "PropertySignature",
|
|
4146
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatImageAttachment#mimeType:member",
|
|
4147
|
+
"docComment": "/**\n * One of the four both vendors accept: `image/png`, `image/jpeg`, `image/gif`, `image/webp`.\n */\n",
|
|
4148
|
+
"excerptTokens": [
|
|
4149
|
+
{
|
|
4150
|
+
"kind": "Content",
|
|
4151
|
+
"text": "mimeType: "
|
|
4152
|
+
},
|
|
4153
|
+
{
|
|
4154
|
+
"kind": "Content",
|
|
4155
|
+
"text": "string"
|
|
4156
|
+
},
|
|
4157
|
+
{
|
|
4158
|
+
"kind": "Content",
|
|
4159
|
+
"text": ";"
|
|
4160
|
+
}
|
|
4161
|
+
],
|
|
4162
|
+
"isReadonly": false,
|
|
4163
|
+
"isOptional": false,
|
|
4164
|
+
"releaseTag": "Beta",
|
|
4165
|
+
"name": "mimeType",
|
|
4166
|
+
"propertyTypeTokenRange": {
|
|
4167
|
+
"startIndex": 1,
|
|
4168
|
+
"endIndex": 2
|
|
4169
|
+
}
|
|
4170
|
+
},
|
|
4171
|
+
{
|
|
4172
|
+
"kind": "PropertySignature",
|
|
4173
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatImageAttachment#name:member",
|
|
4174
|
+
"docComment": "",
|
|
4175
|
+
"excerptTokens": [
|
|
4176
|
+
{
|
|
4177
|
+
"kind": "Content",
|
|
4178
|
+
"text": "name: "
|
|
4179
|
+
},
|
|
4180
|
+
{
|
|
4181
|
+
"kind": "Content",
|
|
4182
|
+
"text": "string"
|
|
4183
|
+
},
|
|
4184
|
+
{
|
|
4185
|
+
"kind": "Content",
|
|
4186
|
+
"text": ";"
|
|
4187
|
+
}
|
|
4188
|
+
],
|
|
4189
|
+
"isReadonly": false,
|
|
4190
|
+
"isOptional": false,
|
|
4191
|
+
"releaseTag": "Beta",
|
|
4192
|
+
"name": "name",
|
|
4193
|
+
"propertyTypeTokenRange": {
|
|
4194
|
+
"startIndex": 1,
|
|
4195
|
+
"endIndex": 2
|
|
4196
|
+
}
|
|
4197
|
+
}
|
|
4198
|
+
],
|
|
4199
|
+
"extendsTokenRanges": []
|
|
4200
|
+
},
|
|
4111
4201
|
{
|
|
4112
4202
|
"kind": "TypeAlias",
|
|
4113
4203
|
"canonicalReference": "@genesislcap/foundation-ai!ChatInputDuringExecutionMode:type",
|
|
@@ -4374,7 +4464,7 @@
|
|
|
4374
4464
|
{
|
|
4375
4465
|
"kind": "Reference",
|
|
4376
4466
|
"text": "ChatAttachment",
|
|
4377
|
-
"canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:
|
|
4467
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:type"
|
|
4378
4468
|
},
|
|
4379
4469
|
{
|
|
4380
4470
|
"kind": "Content",
|
|
@@ -4975,7 +5065,7 @@
|
|
|
4975
5065
|
{
|
|
4976
5066
|
"kind": "Reference",
|
|
4977
5067
|
"text": "ChatAttachment",
|
|
4978
|
-
"canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:
|
|
5068
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:type"
|
|
4979
5069
|
},
|
|
4980
5070
|
{
|
|
4981
5071
|
"kind": "Content",
|
|
@@ -5055,6 +5145,33 @@
|
|
|
5055
5145
|
"endIndex": 3
|
|
5056
5146
|
}
|
|
5057
5147
|
},
|
|
5148
|
+
{
|
|
5149
|
+
"kind": "PropertySignature",
|
|
5150
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatRequestOptions#maxTokens:member",
|
|
5151
|
+
"docComment": "/**\n * Output-token ceiling for THIS turn, overriding the transport's configured `maxTokens`.\n *\n * Needed because the configured value is per-transport-INSTANCE, so a caller that wants two ceilings has to register two providers — which is why ai-service carries separate `anthropic` and `anthropicFast` slots. That does not scale to a pipeline whose stages legitimately want very different budgets (a full mockup versus a one-line critique).\n *\n * Reaches `max_tokens` on Anthropic and `generationConfig.maxOutputTokens` on Gemini, and is also what a `ResponseTruncatedError` reports as the cap it hit — otherwise the truncation message names the instance default and sends you looking at the wrong number.\n *\n * @beta\n */\n",
|
|
5152
|
+
"excerptTokens": [
|
|
5153
|
+
{
|
|
5154
|
+
"kind": "Content",
|
|
5155
|
+
"text": "maxTokens?: "
|
|
5156
|
+
},
|
|
5157
|
+
{
|
|
5158
|
+
"kind": "Content",
|
|
5159
|
+
"text": "number"
|
|
5160
|
+
},
|
|
5161
|
+
{
|
|
5162
|
+
"kind": "Content",
|
|
5163
|
+
"text": ";"
|
|
5164
|
+
}
|
|
5165
|
+
],
|
|
5166
|
+
"isReadonly": false,
|
|
5167
|
+
"isOptional": true,
|
|
5168
|
+
"releaseTag": "Beta",
|
|
5169
|
+
"name": "maxTokens",
|
|
5170
|
+
"propertyTypeTokenRange": {
|
|
5171
|
+
"startIndex": 1,
|
|
5172
|
+
"endIndex": 2
|
|
5173
|
+
}
|
|
5174
|
+
},
|
|
5058
5175
|
{
|
|
5059
5176
|
"kind": "PropertySignature",
|
|
5060
5177
|
"canonicalReference": "@genesislcap/foundation-ai!ChatRequestOptions#responseSchema:member",
|
|
@@ -5587,10 +5704,176 @@
|
|
|
5587
5704
|
"endIndex": 2
|
|
5588
5705
|
}
|
|
5589
5706
|
},
|
|
5707
|
+
{
|
|
5708
|
+
"kind": "Interface",
|
|
5709
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatTextAttachment:interface",
|
|
5710
|
+
"docComment": "/**\n * A text file attachment included with a user message. Serialised to the model as `[File: <name>]\\n<content>` — a plain text block on both vendors.\n *\n * @beta\n */\n",
|
|
5711
|
+
"excerptTokens": [
|
|
5712
|
+
{
|
|
5713
|
+
"kind": "Content",
|
|
5714
|
+
"text": "export interface ChatTextAttachment "
|
|
5715
|
+
}
|
|
5716
|
+
],
|
|
5717
|
+
"fileUrlPath": "src/types/chat.types.ts",
|
|
5718
|
+
"releaseTag": "Beta",
|
|
5719
|
+
"name": "ChatTextAttachment",
|
|
5720
|
+
"preserveMemberOrder": false,
|
|
5721
|
+
"members": [
|
|
5722
|
+
{
|
|
5723
|
+
"kind": "PropertySignature",
|
|
5724
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatTextAttachment#content:member",
|
|
5725
|
+
"docComment": "",
|
|
5726
|
+
"excerptTokens": [
|
|
5727
|
+
{
|
|
5728
|
+
"kind": "Content",
|
|
5729
|
+
"text": "content: "
|
|
5730
|
+
},
|
|
5731
|
+
{
|
|
5732
|
+
"kind": "Content",
|
|
5733
|
+
"text": "string"
|
|
5734
|
+
},
|
|
5735
|
+
{
|
|
5736
|
+
"kind": "Content",
|
|
5737
|
+
"text": ";"
|
|
5738
|
+
}
|
|
5739
|
+
],
|
|
5740
|
+
"isReadonly": false,
|
|
5741
|
+
"isOptional": false,
|
|
5742
|
+
"releaseTag": "Beta",
|
|
5743
|
+
"name": "content",
|
|
5744
|
+
"propertyTypeTokenRange": {
|
|
5745
|
+
"startIndex": 1,
|
|
5746
|
+
"endIndex": 2
|
|
5747
|
+
}
|
|
5748
|
+
},
|
|
5749
|
+
{
|
|
5750
|
+
"kind": "PropertySignature",
|
|
5751
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatTextAttachment#kind:member",
|
|
5752
|
+
"docComment": "/**\n * Optional on this arm so an attachment authored before images existed — `{ name, content, mimeType }` — is still a valid `ChatAttachment` with no edit. The image arm requires it.\n */\n",
|
|
5753
|
+
"excerptTokens": [
|
|
5754
|
+
{
|
|
5755
|
+
"kind": "Content",
|
|
5756
|
+
"text": "kind?: "
|
|
5757
|
+
},
|
|
5758
|
+
{
|
|
5759
|
+
"kind": "Content",
|
|
5760
|
+
"text": "'text'"
|
|
5761
|
+
},
|
|
5762
|
+
{
|
|
5763
|
+
"kind": "Content",
|
|
5764
|
+
"text": ";"
|
|
5765
|
+
}
|
|
5766
|
+
],
|
|
5767
|
+
"isReadonly": false,
|
|
5768
|
+
"isOptional": true,
|
|
5769
|
+
"releaseTag": "Beta",
|
|
5770
|
+
"name": "kind",
|
|
5771
|
+
"propertyTypeTokenRange": {
|
|
5772
|
+
"startIndex": 1,
|
|
5773
|
+
"endIndex": 2
|
|
5774
|
+
}
|
|
5775
|
+
},
|
|
5776
|
+
{
|
|
5777
|
+
"kind": "PropertySignature",
|
|
5778
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatTextAttachment#mimeType:member",
|
|
5779
|
+
"docComment": "/**\n * Advisory only on this arm. Note the composer reads files with `readAsText`, so a binary file dropped there arrives with a truthy image mime and mojibake `content` — which is why the transports branch on `kind`, never on `mimeType`. See {@link ChatImageAttachment}.\n */\n",
|
|
5780
|
+
"excerptTokens": [
|
|
5781
|
+
{
|
|
5782
|
+
"kind": "Content",
|
|
5783
|
+
"text": "mimeType: "
|
|
5784
|
+
},
|
|
5785
|
+
{
|
|
5786
|
+
"kind": "Content",
|
|
5787
|
+
"text": "string"
|
|
5788
|
+
},
|
|
5789
|
+
{
|
|
5790
|
+
"kind": "Content",
|
|
5791
|
+
"text": ";"
|
|
5792
|
+
}
|
|
5793
|
+
],
|
|
5794
|
+
"isReadonly": false,
|
|
5795
|
+
"isOptional": false,
|
|
5796
|
+
"releaseTag": "Beta",
|
|
5797
|
+
"name": "mimeType",
|
|
5798
|
+
"propertyTypeTokenRange": {
|
|
5799
|
+
"startIndex": 1,
|
|
5800
|
+
"endIndex": 2
|
|
5801
|
+
}
|
|
5802
|
+
},
|
|
5803
|
+
{
|
|
5804
|
+
"kind": "PropertySignature",
|
|
5805
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatTextAttachment#name:member",
|
|
5806
|
+
"docComment": "",
|
|
5807
|
+
"excerptTokens": [
|
|
5808
|
+
{
|
|
5809
|
+
"kind": "Content",
|
|
5810
|
+
"text": "name: "
|
|
5811
|
+
},
|
|
5812
|
+
{
|
|
5813
|
+
"kind": "Content",
|
|
5814
|
+
"text": "string"
|
|
5815
|
+
},
|
|
5816
|
+
{
|
|
5817
|
+
"kind": "Content",
|
|
5818
|
+
"text": ";"
|
|
5819
|
+
}
|
|
5820
|
+
],
|
|
5821
|
+
"isReadonly": false,
|
|
5822
|
+
"isOptional": false,
|
|
5823
|
+
"releaseTag": "Beta",
|
|
5824
|
+
"name": "name",
|
|
5825
|
+
"propertyTypeTokenRange": {
|
|
5826
|
+
"startIndex": 1,
|
|
5827
|
+
"endIndex": 2
|
|
5828
|
+
}
|
|
5829
|
+
}
|
|
5830
|
+
],
|
|
5831
|
+
"extendsTokenRanges": []
|
|
5832
|
+
},
|
|
5833
|
+
{
|
|
5834
|
+
"kind": "TypeAlias",
|
|
5835
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatThinkingLevel:type",
|
|
5836
|
+
"docComment": "/**\n * The graded members of {@link ChatThinkingPolicy} — the ones that carry a depth rather than merely switching reasoning on or off. Split out so each transport's clamp table can be an exhaustive `Record` and adding a level to the union becomes a compile error at every mapping site, rather than a value that silently falls through to \"model default\".\n */\n",
|
|
5837
|
+
"excerptTokens": [
|
|
5838
|
+
{
|
|
5839
|
+
"kind": "Content",
|
|
5840
|
+
"text": "export type ChatThinkingLevel = "
|
|
5841
|
+
},
|
|
5842
|
+
{
|
|
5843
|
+
"kind": "Reference",
|
|
5844
|
+
"text": "Extract",
|
|
5845
|
+
"canonicalReference": "!Extract:type"
|
|
5846
|
+
},
|
|
5847
|
+
{
|
|
5848
|
+
"kind": "Content",
|
|
5849
|
+
"text": "<"
|
|
5850
|
+
},
|
|
5851
|
+
{
|
|
5852
|
+
"kind": "Reference",
|
|
5853
|
+
"text": "ChatThinkingPolicy",
|
|
5854
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatThinkingPolicy:type"
|
|
5855
|
+
},
|
|
5856
|
+
{
|
|
5857
|
+
"kind": "Content",
|
|
5858
|
+
"text": ", 'minimal' | 'low' | 'medium' | 'high' | 'max'>"
|
|
5859
|
+
},
|
|
5860
|
+
{
|
|
5861
|
+
"kind": "Content",
|
|
5862
|
+
"text": ";"
|
|
5863
|
+
}
|
|
5864
|
+
],
|
|
5865
|
+
"fileUrlPath": "src/types/chat.types.ts",
|
|
5866
|
+
"releaseTag": "Public",
|
|
5867
|
+
"name": "ChatThinkingLevel",
|
|
5868
|
+
"typeTokenRange": {
|
|
5869
|
+
"startIndex": 1,
|
|
5870
|
+
"endIndex": 5
|
|
5871
|
+
}
|
|
5872
|
+
},
|
|
5590
5873
|
{
|
|
5591
5874
|
"kind": "TypeAlias",
|
|
5592
5875
|
"canonicalReference": "@genesislcap/foundation-ai!ChatThinkingPolicy:type",
|
|
5593
|
-
"docComment": "/**\n * Whether the model should reason before answering, resolved per turn. **Provider-neutral intent, provider-specific effect**, and — like `tool_choice` — a *request*, not a guarantee: a model that cannot honour it keeps its default.\n *\n * - `'auto'` — the model decides how much to think (Anthropic `thinking: {type:'adaptive'}`, Gemini `thinkingConfig.thinkingBudget: -1`). On a model whose default is thinking-*off* this turns it **on**, which is the point: it is the opt-in for models where adaptive thinking is available but not default. - `'off'` — no reasoning tokens (Anthropic `thinking: {type:'disabled'}`, Gemini `thinkingBudget: 0`). The lever for turns that only step a known sequence, where reasoning is billed as output at the full candidate rate to decide something already determined.\n *\n * **Choose it per turn, not per model call.** A tool-use loop is one assistant turn, and Anthropic requires a single thinking mode for its duration; toggling part-way through does not error but silently disables thinking for that request, strips blocks that would leave the turn structure invalid, and invalidates the prompt cache. The driver pins whatever it resolves on a turn's first model call for the rest of that turn.\n *\n * Deliberately has **no token-budget member**. Gemini accepts a numeric `thinkingBudget`, but Anthropic *removed* `budget_tokens` and returns a 400 for it on Sonnet 5 and every Opus 5-era model — so a budget field would be unimplementable on half the supported fleet and would exist only to be ignored. `'
|
|
5876
|
+
"docComment": "/**\n * Whether the model should reason before answering, resolved per turn. **Provider-neutral intent, provider-specific effect**, and — like `tool_choice` — a *request*, not a guarantee: a model that cannot honour it keeps its default.\n *\n * - `'auto'` — the model decides how much to think (Anthropic `thinking: {type:'adaptive'}`, Gemini `thinkingConfig.thinkingBudget: -1`). On a model whose default is thinking-*off* this turns it **on**, which is the point: it is the opt-in for models where adaptive thinking is available but not default. - `'off'` — no reasoning tokens (Anthropic `thinking: {type:'disabled'}`, Gemini `thinkingBudget: 0`). The lever for turns that only step a known sequence, where reasoning is billed as output at the full candidate rate to decide something already determined.\n *\n * **Choose it per turn, not per model call.** A tool-use loop is one assistant turn, and Anthropic requires a single thinking mode for its duration; toggling part-way through does not error but silently disables thinking for that request, strips blocks that would leave the turn structure invalid, and invalidates the prompt cache. The driver pins whatever it resolves on a turn's first model call for the rest of that turn.\n *\n * Deliberately has **no token-budget member**. Gemini accepts a numeric `thinkingBudget`, but Anthropic *removed* `budget_tokens` and returns a 400 for it on Sonnet 5 and every Opus 5-era model — so a budget field would be unimplementable on half the supported fleet and would exist only to be ignored. The graded levels below are that idea done vendor-neutrally: Anthropic `output_config.effort` and Gemini `thinkingConfig.thinkingLevel` line up, as anticipated here.\n *\n * **The graded levels** (`'minimal'` … `'max'`) ask for a DEPTH of reasoning rather than merely on/off. On Anthropic they set `output_config.effort` alongside adaptive thinking; on Gemini they set `thinkingLevel`. Two honest edges:\n *\n * - Anthropic has no `'minimal'`, so it clamps to `low`; Gemini has no `'max'`, so it clamps to `high`. Each clamp is toward the nearer neighbour, never toward a value that would 400. - Anthropic's `xhigh` (between `high` and `max`, and its recommended setting for agentic coding) is **not exposed**, because Gemini has no equivalent and a value only one vendor can express is how a \"vendor-neutral\" option quietly stops being one. Ask for `'max'` if you want the ceiling.\n *\n * Models that predate the effort parameter (Sonnet 4.5, Haiku 4.5) reject it, so a graded level there falls back to that model's adaptive-or-default posture with a one-time warning — the same clamp discipline the on/off values already follow.\n *\n * **Omitting this is a distinct third state** — each model keeps its own default posture (see `anthropicThinking`), which is *not* uniformly `'auto'` or `'off'`. So a resolver returning `undefined` on some turns leaves those turns exactly as they were before this option existed, rather than silently re-pricing them.\n *\n * Not every model can honour every value, and the two providers hit the same wall at the top of their ranges: Anthropic Fable 5 and Gemini 2.5 Pro both think unconditionally and reject (or ignore) a request to stop. Transports **clamp** rather than forward a request that would 400 — the turn runs at the model's default and a one-time warning is logged. Never assume `'off'` means zero reasoning tokens were billed; read the usage back.\n *\n * @beta\n */\n",
|
|
5594
5877
|
"excerptTokens": [
|
|
5595
5878
|
{
|
|
5596
5879
|
"kind": "Content",
|
|
@@ -5598,7 +5881,7 @@
|
|
|
5598
5881
|
},
|
|
5599
5882
|
{
|
|
5600
5883
|
"kind": "Content",
|
|
5601
|
-
"text": "'auto' | 'off'"
|
|
5884
|
+
"text": "'auto' | 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'max'"
|
|
5602
5885
|
},
|
|
5603
5886
|
{
|
|
5604
5887
|
"kind": "Content",
|
|
@@ -5984,6 +6267,38 @@
|
|
|
5984
6267
|
"name": "ChatToolResult",
|
|
5985
6268
|
"preserveMemberOrder": false,
|
|
5986
6269
|
"members": [
|
|
6270
|
+
{
|
|
6271
|
+
"kind": "PropertySignature",
|
|
6272
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatToolResult#attachments:member",
|
|
6273
|
+
"docComment": "/**\n * Images the tool produced, sent alongside `content` as real image blocks.\n *\n * This is the half that makes a vision AGENT possible rather than a one-shot vision call: a tool that renders something can hand the render back for the model to LOOK at, instead of describing it in prose. Only `kind: 'image'` attachments are carried — a text attachment here would be indistinguishable from `content` and is dropped by the transports rather than double-sent.\n *\n * Absent on every existing tool result, and the transports emit the historical string-content shape whenever it is absent, so nothing already on the wire moves.\n */\n",
|
|
6274
|
+
"excerptTokens": [
|
|
6275
|
+
{
|
|
6276
|
+
"kind": "Content",
|
|
6277
|
+
"text": "attachments?: "
|
|
6278
|
+
},
|
|
6279
|
+
{
|
|
6280
|
+
"kind": "Reference",
|
|
6281
|
+
"text": "ChatImageAttachment",
|
|
6282
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatImageAttachment:interface"
|
|
6283
|
+
},
|
|
6284
|
+
{
|
|
6285
|
+
"kind": "Content",
|
|
6286
|
+
"text": "[]"
|
|
6287
|
+
},
|
|
6288
|
+
{
|
|
6289
|
+
"kind": "Content",
|
|
6290
|
+
"text": ";"
|
|
6291
|
+
}
|
|
6292
|
+
],
|
|
6293
|
+
"isReadonly": false,
|
|
6294
|
+
"isOptional": true,
|
|
6295
|
+
"releaseTag": "Beta",
|
|
6296
|
+
"name": "attachments",
|
|
6297
|
+
"propertyTypeTokenRange": {
|
|
6298
|
+
"startIndex": 1,
|
|
6299
|
+
"endIndex": 3
|
|
6300
|
+
}
|
|
6301
|
+
},
|
|
5987
6302
|
{
|
|
5988
6303
|
"kind": "PropertySignature",
|
|
5989
6304
|
"canonicalReference": "@genesislcap/foundation-ai!ChatToolResult#content:member",
|