@genesislcap/foundation-ai 15.91.0 → 15.92.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/README.md +26 -103
- package/dist/dts/ai-provider.d.ts +5 -3
- package/dist/dts/ai-provider.d.ts.map +1 -1
- package/dist/dts/index.d.ts +7 -4
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/providers/openai-provider.d.ts +8 -7
- package/dist/dts/providers/openai-provider.d.ts.map +1 -1
- package/dist/dts/transports/budget-exhausted-error.d.ts +5 -7
- package/dist/dts/transports/budget-exhausted-error.d.ts.map +1 -1
- package/dist/dts/transports/context-overflow-error.d.ts.map +1 -1
- package/dist/dts/transports/openai-transport.d.ts +119 -0
- package/dist/dts/transports/openai-transport.d.ts.map +1 -0
- package/dist/dts/types/chat.types.d.ts +12 -0
- package/dist/dts/types/chat.types.d.ts.map +1 -1
- package/dist/dts/types/config.types.d.ts +44 -16
- package/dist/dts/types/config.types.d.ts.map +1 -1
- package/dist/dts/utils/token-cost.d.ts +65 -1
- package/dist/dts/utils/token-cost.d.ts.map +1 -1
- package/dist/dts/utils/tool-schema.d.ts +38 -0
- package/dist/dts/utils/tool-schema.d.ts.map +1 -1
- package/dist/esm/ai-provider.js +21 -14
- package/dist/esm/index.js +4 -2
- package/dist/esm/providers/openai-provider.js +15 -9
- package/dist/esm/transports/budget-exhausted-error.js +6 -7
- package/dist/esm/transports/context-overflow-error.js +2 -0
- package/dist/esm/transports/openai-transport.js +752 -0
- package/dist/esm/types/config.types.js +12 -1
- package/dist/esm/utils/token-cost.js +89 -0
- package/dist/esm/utils/tool-schema.js +108 -0
- package/dist/foundation-ai.api.json +1745 -137
- package/dist/foundation-ai.d.ts +270 -28
- package/package.json +9 -9
- package/dist/dts/transports/server-openai-transport.d.ts +0 -23
- package/dist/dts/transports/server-openai-transport.d.ts.map +0 -1
- package/dist/esm/transports/server-openai-transport.js +0 -94
|
@@ -491,8 +491,8 @@
|
|
|
491
491
|
},
|
|
492
492
|
{
|
|
493
493
|
"kind": "Reference",
|
|
494
|
-
"text": "
|
|
495
|
-
"canonicalReference": "@genesislcap/foundation-ai!
|
|
494
|
+
"text": "ChromeAIConfig",
|
|
495
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChromeAIConfig:interface"
|
|
496
496
|
},
|
|
497
497
|
{
|
|
498
498
|
"kind": "Content",
|
|
@@ -500,8 +500,8 @@
|
|
|
500
500
|
},
|
|
501
501
|
{
|
|
502
502
|
"kind": "Reference",
|
|
503
|
-
"text": "
|
|
504
|
-
"canonicalReference": "@genesislcap/foundation-ai!
|
|
503
|
+
"text": "GeminiAIConfig",
|
|
504
|
+
"canonicalReference": "@genesislcap/foundation-ai!GeminiAIConfig:interface"
|
|
505
505
|
},
|
|
506
506
|
{
|
|
507
507
|
"kind": "Content",
|
|
@@ -509,8 +509,8 @@
|
|
|
509
509
|
},
|
|
510
510
|
{
|
|
511
511
|
"kind": "Reference",
|
|
512
|
-
"text": "
|
|
513
|
-
"canonicalReference": "@genesislcap/foundation-ai!
|
|
512
|
+
"text": "AnthropicAIConfig",
|
|
513
|
+
"canonicalReference": "@genesislcap/foundation-ai!AnthropicAIConfig:interface"
|
|
514
514
|
},
|
|
515
515
|
{
|
|
516
516
|
"kind": "Content",
|
|
@@ -518,8 +518,8 @@
|
|
|
518
518
|
},
|
|
519
519
|
{
|
|
520
520
|
"kind": "Reference",
|
|
521
|
-
"text": "
|
|
522
|
-
"canonicalReference": "@genesislcap/foundation-ai!
|
|
521
|
+
"text": "OpenAIAIConfig",
|
|
522
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIAIConfig:interface"
|
|
523
523
|
},
|
|
524
524
|
{
|
|
525
525
|
"kind": "Content",
|
|
@@ -3904,7 +3904,7 @@
|
|
|
3904
3904
|
{
|
|
3905
3905
|
"kind": "Variable",
|
|
3906
3906
|
"canonicalReference": "@genesislcap/foundation-ai!BUDGETED_VENDORS:var",
|
|
3907
|
-
"docComment": "/**\n * The vendors whose spend the ai-service proxy meters — i.e. the only vendors that can raise a {@link BudgetExhaustedError}, and therefore the only ones a 402's `otherVendorAvailable: false` is a statement about.\n *\n * Deliberately narrower than the keys of {@link VENDOR_LABELS}, and it must stay exactly the proxy's own list — `VENDORS` in ai-service's `utils/aiVendor.js`. A vendor listed here that the proxy does not meter gets walled by the `otherVendorAvailable: false` sweep on a verdict that says nothing about it, and if it is reachable, `blocked` then derives true and locks a composer with headroom left.\n *\n *
|
|
3907
|
+
"docComment": "/**\n * The vendors whose spend the ai-service proxy meters — i.e. the only vendors that can raise a {@link BudgetExhaustedError}, and therefore the only ones a 402's `otherVendorAvailable: false` is a statement about.\n *\n * Deliberately narrower than the keys of {@link VENDOR_LABELS}, and it must stay exactly the proxy's own list — `VENDORS` in ai-service's `utils/aiVendor.js`. A vendor listed here that the proxy does not meter gets walled by the `otherVendorAvailable: false` sweep on a verdict that says nothing about it, and if it is reachable, `blocked` then derives true and locks a composer with headroom left.\n *\n * `chrome` is excluded for that reason: it runs on-device — no pot to exhaust, and free.\n *\n * `openai` is metered (GENC-1829): ai-service budgets it on its own `SpentUsdOpenai` counter and proxies it on `/api/openai/chat`. The proxy computes `otherVendorAvailable` over the vendors it OFFERS, so with OpenAI switched off there a 402 still says nothing about it.\n *\n * @beta\n */\n",
|
|
3908
3908
|
"excerptTokens": [
|
|
3909
3909
|
{
|
|
3910
3910
|
"kind": "Content",
|
|
@@ -7009,6 +7009,38 @@
|
|
|
7009
7009
|
"endIndex": 2
|
|
7010
7010
|
}
|
|
7011
7011
|
},
|
|
7012
|
+
{
|
|
7013
|
+
"kind": "PropertySignature",
|
|
7014
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatMessage#providerMetadata:member",
|
|
7015
|
+
"docComment": "/**\n * Opaque, provider-specific state attached to this MESSAGE that must round-trip back to the originating provider on later requests — the message-level twin of `ChatToolCall.providerMetadata`, same contract: keyed by provider id, a transport reads only its own key, and the contents are not part of the stable public contract.\n *\n * Exists because some state belongs to a turn that made no tool call. OpenAI's Responses API marks each assistant message with a `phase` (`commentary` / `final_answer`) and attaches encrypted reasoning items to it; with no tool call to hang them on, a text-only turn would lose both, and a preamble replayed without its `phase` can be read back as the final answer.\n */\n",
|
|
7016
|
+
"excerptTokens": [
|
|
7017
|
+
{
|
|
7018
|
+
"kind": "Content",
|
|
7019
|
+
"text": "providerMetadata?: "
|
|
7020
|
+
},
|
|
7021
|
+
{
|
|
7022
|
+
"kind": "Reference",
|
|
7023
|
+
"text": "Record",
|
|
7024
|
+
"canonicalReference": "!Record:type"
|
|
7025
|
+
},
|
|
7026
|
+
{
|
|
7027
|
+
"kind": "Content",
|
|
7028
|
+
"text": "<string, unknown>"
|
|
7029
|
+
},
|
|
7030
|
+
{
|
|
7031
|
+
"kind": "Content",
|
|
7032
|
+
"text": ";"
|
|
7033
|
+
}
|
|
7034
|
+
],
|
|
7035
|
+
"isReadonly": false,
|
|
7036
|
+
"isOptional": true,
|
|
7037
|
+
"releaseTag": "Beta",
|
|
7038
|
+
"name": "providerMetadata",
|
|
7039
|
+
"propertyTypeTokenRange": {
|
|
7040
|
+
"startIndex": 1,
|
|
7041
|
+
"endIndex": 3
|
|
7042
|
+
}
|
|
7043
|
+
},
|
|
7012
7044
|
{
|
|
7013
7045
|
"kind": "PropertySignature",
|
|
7014
7046
|
"canonicalReference": "@genesislcap/foundation-ai!ChatMessage#providerName:member",
|
|
@@ -10559,7 +10591,7 @@
|
|
|
10559
10591
|
{
|
|
10560
10592
|
"kind": "Function",
|
|
10561
10593
|
"canonicalReference": "@genesislcap/foundation-ai!createAIProvider:function(1)",
|
|
10562
|
-
"docComment": "/**\n * Creates an AIProvider from config. Uses ChromeProvider when providerType is 'chrome'. Uses
|
|
10594
|
+
"docComment": "/**\n * Creates an AIProvider from config. Uses ChromeProvider when providerType is 'chrome'. Uses GeminiProvider, AnthropicProvider or OpenAIProvider for their `providerType`. Otherwise returns DefaultAIProvider. When the AI feature flag is disabled (?feature.ai), always returns DefaultAIProvider.\n *\n * @beta\n */\n",
|
|
10563
10595
|
"excerptTokens": [
|
|
10564
10596
|
{
|
|
10565
10597
|
"kind": "Content",
|
|
@@ -14465,90 +14497,171 @@
|
|
|
14465
14497
|
},
|
|
14466
14498
|
{
|
|
14467
14499
|
"kind": "Variable",
|
|
14468
|
-
"canonicalReference": "@genesislcap/foundation-ai!
|
|
14469
|
-
"docComment": "/**\n *
|
|
14500
|
+
"canonicalReference": "@genesislcap/foundation-ai!OPENAI_CACHE_WRITE_12H_MULTIPLIER:var",
|
|
14501
|
+
"docComment": "/**\n * @beta\n */\n",
|
|
14470
14502
|
"excerptTokens": [
|
|
14471
14503
|
{
|
|
14472
14504
|
"kind": "Content",
|
|
14473
|
-
"text": "
|
|
14505
|
+
"text": "OPENAI_CACHE_WRITE_12H_MULTIPLIER = "
|
|
14474
14506
|
},
|
|
14475
14507
|
{
|
|
14476
14508
|
"kind": "Content",
|
|
14477
|
-
"text": "
|
|
14509
|
+
"text": "2.5"
|
|
14478
14510
|
}
|
|
14479
14511
|
],
|
|
14480
|
-
"fileUrlPath": "src/
|
|
14512
|
+
"fileUrlPath": "src/utils/token-cost.ts",
|
|
14481
14513
|
"initializerTokenRange": {
|
|
14482
14514
|
"startIndex": 1,
|
|
14483
14515
|
"endIndex": 2
|
|
14484
14516
|
},
|
|
14485
14517
|
"isReadonly": true,
|
|
14486
14518
|
"releaseTag": "Beta",
|
|
14487
|
-
"name": "
|
|
14519
|
+
"name": "OPENAI_CACHE_WRITE_12H_MULTIPLIER",
|
|
14488
14520
|
"variableTypeTokenRange": {
|
|
14489
14521
|
"startIndex": 0,
|
|
14490
14522
|
"endIndex": 0
|
|
14491
14523
|
}
|
|
14492
14524
|
},
|
|
14493
14525
|
{
|
|
14494
|
-
"kind": "
|
|
14495
|
-
"canonicalReference": "@genesislcap/foundation-ai!
|
|
14496
|
-
"docComment": "/**\n *
|
|
14526
|
+
"kind": "Variable",
|
|
14527
|
+
"canonicalReference": "@genesislcap/foundation-ai!OPENAI_CACHE_WRITE_30M_MULTIPLIER:var",
|
|
14528
|
+
"docComment": "/**\n * Cache-write multipliers on the base input rate, by TTL — https://developers.openai.com/api/docs/guides/prompt-caching. These are the WHOLE rate for a written token, not a premium added to it, which is the same shape as Anthropic's.\n *\n * @beta\n */\n",
|
|
14497
14529
|
"excerptTokens": [
|
|
14498
14530
|
{
|
|
14499
14531
|
"kind": "Content",
|
|
14500
|
-
"text": "
|
|
14532
|
+
"text": "OPENAI_CACHE_WRITE_30M_MULTIPLIER = "
|
|
14501
14533
|
},
|
|
14502
14534
|
{
|
|
14503
14535
|
"kind": "Content",
|
|
14504
|
-
"text": "
|
|
14536
|
+
"text": "1.25"
|
|
14537
|
+
}
|
|
14538
|
+
],
|
|
14539
|
+
"fileUrlPath": "src/utils/token-cost.ts",
|
|
14540
|
+
"initializerTokenRange": {
|
|
14541
|
+
"startIndex": 1,
|
|
14542
|
+
"endIndex": 2
|
|
14543
|
+
},
|
|
14544
|
+
"isReadonly": true,
|
|
14545
|
+
"releaseTag": "Beta",
|
|
14546
|
+
"name": "OPENAI_CACHE_WRITE_30M_MULTIPLIER",
|
|
14547
|
+
"variableTypeTokenRange": {
|
|
14548
|
+
"startIndex": 0,
|
|
14549
|
+
"endIndex": 0
|
|
14550
|
+
}
|
|
14551
|
+
},
|
|
14552
|
+
{
|
|
14553
|
+
"kind": "Variable",
|
|
14554
|
+
"canonicalReference": "@genesislcap/foundation-ai!OPENAI_LONG_CONTEXT_INPUT_MULTIPLIER:var",
|
|
14555
|
+
"docComment": "/**\n * @beta\n */\n",
|
|
14556
|
+
"excerptTokens": [
|
|
14557
|
+
{
|
|
14558
|
+
"kind": "Content",
|
|
14559
|
+
"text": "OPENAI_LONG_CONTEXT_INPUT_MULTIPLIER = "
|
|
14505
14560
|
},
|
|
14506
14561
|
{
|
|
14507
14562
|
"kind": "Content",
|
|
14508
|
-
"text": "
|
|
14563
|
+
"text": "2"
|
|
14509
14564
|
}
|
|
14510
14565
|
],
|
|
14511
|
-
"fileUrlPath": "src/
|
|
14566
|
+
"fileUrlPath": "src/utils/token-cost.ts",
|
|
14567
|
+
"initializerTokenRange": {
|
|
14568
|
+
"startIndex": 1,
|
|
14569
|
+
"endIndex": 2
|
|
14570
|
+
},
|
|
14571
|
+
"isReadonly": true,
|
|
14512
14572
|
"releaseTag": "Beta",
|
|
14513
|
-
"name": "
|
|
14514
|
-
"
|
|
14573
|
+
"name": "OPENAI_LONG_CONTEXT_INPUT_MULTIPLIER",
|
|
14574
|
+
"variableTypeTokenRange": {
|
|
14575
|
+
"startIndex": 0,
|
|
14576
|
+
"endIndex": 0
|
|
14577
|
+
}
|
|
14578
|
+
},
|
|
14579
|
+
{
|
|
14580
|
+
"kind": "Variable",
|
|
14581
|
+
"canonicalReference": "@genesislcap/foundation-ai!OPENAI_LONG_CONTEXT_OUTPUT_MULTIPLIER:var",
|
|
14582
|
+
"docComment": "/**\n * @beta\n */\n",
|
|
14583
|
+
"excerptTokens": [
|
|
14584
|
+
{
|
|
14585
|
+
"kind": "Content",
|
|
14586
|
+
"text": "OPENAI_LONG_CONTEXT_OUTPUT_MULTIPLIER = "
|
|
14587
|
+
},
|
|
14588
|
+
{
|
|
14589
|
+
"kind": "Content",
|
|
14590
|
+
"text": "1.5"
|
|
14591
|
+
}
|
|
14592
|
+
],
|
|
14593
|
+
"fileUrlPath": "src/utils/token-cost.ts",
|
|
14594
|
+
"initializerTokenRange": {
|
|
14515
14595
|
"startIndex": 1,
|
|
14516
14596
|
"endIndex": 2
|
|
14597
|
+
},
|
|
14598
|
+
"isReadonly": true,
|
|
14599
|
+
"releaseTag": "Beta",
|
|
14600
|
+
"name": "OPENAI_LONG_CONTEXT_OUTPUT_MULTIPLIER",
|
|
14601
|
+
"variableTypeTokenRange": {
|
|
14602
|
+
"startIndex": 0,
|
|
14603
|
+
"endIndex": 0
|
|
14517
14604
|
}
|
|
14518
14605
|
},
|
|
14519
14606
|
{
|
|
14520
|
-
"kind": "
|
|
14521
|
-
"canonicalReference": "@genesislcap/foundation-ai!
|
|
14522
|
-
"docComment": "/**\n *
|
|
14607
|
+
"kind": "Variable",
|
|
14608
|
+
"canonicalReference": "@genesislcap/foundation-ai!OPENAI_LONG_CONTEXT_THRESHOLD:var",
|
|
14609
|
+
"docComment": "/**\n * Above this many input tokens the WHOLE request bills at the long-context tier — input and cached input at {@link OPENAI_LONG_CONTEXT_INPUT_MULTIPLIER}, output at {@link OPENAI_LONG_CONTEXT_OUTPUT_MULTIPLIER}. Like Gemini's tier it is a property of the request, not a marginal rate, and it is chosen on the whole prompt: uncached, cached and written tokens.\n *\n * @beta\n */\n",
|
|
14523
14610
|
"excerptTokens": [
|
|
14524
14611
|
{
|
|
14525
14612
|
"kind": "Content",
|
|
14526
|
-
"text": "
|
|
14613
|
+
"text": "OPENAI_LONG_CONTEXT_THRESHOLD = "
|
|
14614
|
+
},
|
|
14615
|
+
{
|
|
14616
|
+
"kind": "Content",
|
|
14617
|
+
"text": "272000"
|
|
14618
|
+
}
|
|
14619
|
+
],
|
|
14620
|
+
"fileUrlPath": "src/utils/token-cost.ts",
|
|
14621
|
+
"initializerTokenRange": {
|
|
14622
|
+
"startIndex": 1,
|
|
14623
|
+
"endIndex": 2
|
|
14624
|
+
},
|
|
14625
|
+
"isReadonly": true,
|
|
14626
|
+
"releaseTag": "Beta",
|
|
14627
|
+
"name": "OPENAI_LONG_CONTEXT_THRESHOLD",
|
|
14628
|
+
"variableTypeTokenRange": {
|
|
14629
|
+
"startIndex": 0,
|
|
14630
|
+
"endIndex": 0
|
|
14631
|
+
}
|
|
14632
|
+
},
|
|
14633
|
+
{
|
|
14634
|
+
"kind": "Interface",
|
|
14635
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIAIConfig:interface",
|
|
14636
|
+
"docComment": "/**\n * OpenAI server-proxy AI configuration (client calls your server; server calls OpenAI's Responses API).\n *\n * @remarks\n *\n * API key stays on the server: set `serverEndpoint` to the proxy route (Create's ai-service mounts it at `/api/openai/chat`, e.g. `/gwf/ai-service/api/openai/chat`). There is no default, and with neither `serverEndpoint` nor `apiKey` the transport throws. When `apiKey` is provided the transport calls `api.openai.com/v1/responses` directly — only use this in trusted contexts.\n *\n * @beta\n */\n",
|
|
14637
|
+
"excerptTokens": [
|
|
14638
|
+
{
|
|
14639
|
+
"kind": "Content",
|
|
14640
|
+
"text": "export interface OpenAIAIConfig extends "
|
|
14527
14641
|
},
|
|
14528
14642
|
{
|
|
14529
14643
|
"kind": "Reference",
|
|
14530
|
-
"text": "
|
|
14531
|
-
"canonicalReference": "
|
|
14644
|
+
"text": "AIProviderConfig",
|
|
14645
|
+
"canonicalReference": "@genesislcap/foundation-ai!~AIProviderConfig:interface"
|
|
14532
14646
|
},
|
|
14533
14647
|
{
|
|
14534
14648
|
"kind": "Content",
|
|
14535
14649
|
"text": " "
|
|
14536
14650
|
}
|
|
14537
14651
|
],
|
|
14538
|
-
"fileUrlPath": "src/
|
|
14652
|
+
"fileUrlPath": "src/types/config.types.ts",
|
|
14539
14653
|
"releaseTag": "Beta",
|
|
14540
|
-
"
|
|
14541
|
-
"name": "ProviderRefusedError",
|
|
14654
|
+
"name": "OpenAIAIConfig",
|
|
14542
14655
|
"preserveMemberOrder": false,
|
|
14543
14656
|
"members": [
|
|
14544
14657
|
{
|
|
14545
|
-
"kind": "
|
|
14546
|
-
"canonicalReference": "@genesislcap/foundation-ai!
|
|
14547
|
-
"docComment": "
|
|
14658
|
+
"kind": "PropertySignature",
|
|
14659
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIAIConfig#apiKey:member",
|
|
14660
|
+
"docComment": "",
|
|
14548
14661
|
"excerptTokens": [
|
|
14549
14662
|
{
|
|
14550
14663
|
"kind": "Content",
|
|
14551
|
-
"text": "
|
|
14664
|
+
"text": "apiKey?: "
|
|
14552
14665
|
},
|
|
14553
14666
|
{
|
|
14554
14667
|
"kind": "Content",
|
|
@@ -14556,16 +14669,26 @@
|
|
|
14556
14669
|
},
|
|
14557
14670
|
{
|
|
14558
14671
|
"kind": "Content",
|
|
14559
|
-
"text": "
|
|
14560
|
-
}
|
|
14561
|
-
|
|
14562
|
-
|
|
14563
|
-
|
|
14564
|
-
|
|
14565
|
-
|
|
14672
|
+
"text": ";"
|
|
14673
|
+
}
|
|
14674
|
+
],
|
|
14675
|
+
"isReadonly": false,
|
|
14676
|
+
"isOptional": true,
|
|
14677
|
+
"releaseTag": "Beta",
|
|
14678
|
+
"name": "apiKey",
|
|
14679
|
+
"propertyTypeTokenRange": {
|
|
14680
|
+
"startIndex": 1,
|
|
14681
|
+
"endIndex": 2
|
|
14682
|
+
}
|
|
14683
|
+
},
|
|
14684
|
+
{
|
|
14685
|
+
"kind": "PropertySignature",
|
|
14686
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIAIConfig#maxTokens:member",
|
|
14687
|
+
"docComment": "/**\n * Per-response output ceiling (`max_output_tokens`). Omitted when unset.\n */\n",
|
|
14688
|
+
"excerptTokens": [
|
|
14566
14689
|
{
|
|
14567
14690
|
"kind": "Content",
|
|
14568
|
-
"text": "
|
|
14691
|
+
"text": "maxTokens?: "
|
|
14569
14692
|
},
|
|
14570
14693
|
{
|
|
14571
14694
|
"kind": "Content",
|
|
@@ -14573,53 +14696,1566 @@
|
|
|
14573
14696
|
},
|
|
14574
14697
|
{
|
|
14575
14698
|
"kind": "Content",
|
|
14576
|
-
"text": "
|
|
14577
|
-
}
|
|
14699
|
+
"text": ";"
|
|
14700
|
+
}
|
|
14701
|
+
],
|
|
14702
|
+
"isReadonly": false,
|
|
14703
|
+
"isOptional": true,
|
|
14704
|
+
"releaseTag": "Beta",
|
|
14705
|
+
"name": "maxTokens",
|
|
14706
|
+
"propertyTypeTokenRange": {
|
|
14707
|
+
"startIndex": 1,
|
|
14708
|
+
"endIndex": 2
|
|
14709
|
+
}
|
|
14710
|
+
},
|
|
14711
|
+
{
|
|
14712
|
+
"kind": "PropertySignature",
|
|
14713
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIAIConfig#model:member",
|
|
14714
|
+
"docComment": "/**\n * Defaults to `gpt-6-luna`. Only {@link SUPPORTED_OPENAI_MODEL_IDS} are accepted at runtime.\n */\n",
|
|
14715
|
+
"excerptTokens": [
|
|
14578
14716
|
{
|
|
14579
14717
|
"kind": "Content",
|
|
14580
|
-
"text": "
|
|
14718
|
+
"text": "model?: "
|
|
14719
|
+
},
|
|
14720
|
+
{
|
|
14721
|
+
"kind": "Reference",
|
|
14722
|
+
"text": "OpenAIModelId",
|
|
14723
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIModelId:type"
|
|
14581
14724
|
},
|
|
14582
14725
|
{
|
|
14583
14726
|
"kind": "Content",
|
|
14584
|
-
"text": "
|
|
14727
|
+
"text": ";"
|
|
14728
|
+
}
|
|
14729
|
+
],
|
|
14730
|
+
"isReadonly": false,
|
|
14731
|
+
"isOptional": true,
|
|
14732
|
+
"releaseTag": "Beta",
|
|
14733
|
+
"name": "model",
|
|
14734
|
+
"propertyTypeTokenRange": {
|
|
14735
|
+
"startIndex": 1,
|
|
14736
|
+
"endIndex": 2
|
|
14737
|
+
}
|
|
14738
|
+
},
|
|
14739
|
+
{
|
|
14740
|
+
"kind": "PropertySignature",
|
|
14741
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIAIConfig#providerType:member",
|
|
14742
|
+
"docComment": "",
|
|
14743
|
+
"excerptTokens": [
|
|
14744
|
+
{
|
|
14745
|
+
"kind": "Content",
|
|
14746
|
+
"text": "providerType: "
|
|
14585
14747
|
},
|
|
14586
14748
|
{
|
|
14587
14749
|
"kind": "Content",
|
|
14588
|
-
"text": "
|
|
14750
|
+
"text": "'openai'"
|
|
14589
14751
|
},
|
|
14590
14752
|
{
|
|
14591
14753
|
"kind": "Content",
|
|
14592
|
-
"text": "
|
|
14754
|
+
"text": ";"
|
|
14593
14755
|
}
|
|
14594
14756
|
],
|
|
14757
|
+
"isReadonly": false,
|
|
14758
|
+
"isOptional": false,
|
|
14595
14759
|
"releaseTag": "Beta",
|
|
14596
|
-
"
|
|
14597
|
-
"
|
|
14598
|
-
|
|
14760
|
+
"name": "providerType",
|
|
14761
|
+
"propertyTypeTokenRange": {
|
|
14762
|
+
"startIndex": 1,
|
|
14763
|
+
"endIndex": 2
|
|
14764
|
+
}
|
|
14765
|
+
},
|
|
14766
|
+
{
|
|
14767
|
+
"kind": "PropertySignature",
|
|
14768
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIAIConfig#reasoningSummary:member",
|
|
14769
|
+
"docComment": "/**\n * Ask for reasoning summaries (`reasoning.summary`) so a thinking turn has something to show. Off by default: OpenAI may require organisation verification before it returns them, and an unverified organisation would otherwise see every reasoning turn rejected.\n */\n",
|
|
14770
|
+
"excerptTokens": [
|
|
14599
14771
|
{
|
|
14600
|
-
"
|
|
14601
|
-
"
|
|
14602
|
-
"startIndex": 1,
|
|
14603
|
-
"endIndex": 2
|
|
14604
|
-
},
|
|
14605
|
-
"isOptional": false
|
|
14772
|
+
"kind": "Content",
|
|
14773
|
+
"text": "reasoningSummary?: "
|
|
14606
14774
|
},
|
|
14607
14775
|
{
|
|
14608
|
-
"
|
|
14609
|
-
"
|
|
14610
|
-
"startIndex": 3,
|
|
14611
|
-
"endIndex": 4
|
|
14612
|
-
},
|
|
14613
|
-
"isOptional": false
|
|
14776
|
+
"kind": "Content",
|
|
14777
|
+
"text": "'auto' | 'concise' | 'detailed'"
|
|
14614
14778
|
},
|
|
14615
14779
|
{
|
|
14616
|
-
"
|
|
14617
|
-
"
|
|
14618
|
-
|
|
14619
|
-
|
|
14620
|
-
|
|
14621
|
-
|
|
14622
|
-
|
|
14780
|
+
"kind": "Content",
|
|
14781
|
+
"text": ";"
|
|
14782
|
+
}
|
|
14783
|
+
],
|
|
14784
|
+
"isReadonly": false,
|
|
14785
|
+
"isOptional": true,
|
|
14786
|
+
"releaseTag": "Beta",
|
|
14787
|
+
"name": "reasoningSummary",
|
|
14788
|
+
"propertyTypeTokenRange": {
|
|
14789
|
+
"startIndex": 1,
|
|
14790
|
+
"endIndex": 2
|
|
14791
|
+
}
|
|
14792
|
+
},
|
|
14793
|
+
{
|
|
14794
|
+
"kind": "PropertySignature",
|
|
14795
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIAIConfig#serverEndpoint:member",
|
|
14796
|
+
"docComment": "",
|
|
14797
|
+
"excerptTokens": [
|
|
14798
|
+
{
|
|
14799
|
+
"kind": "Content",
|
|
14800
|
+
"text": "serverEndpoint?: "
|
|
14801
|
+
},
|
|
14802
|
+
{
|
|
14803
|
+
"kind": "Content",
|
|
14804
|
+
"text": "string"
|
|
14805
|
+
},
|
|
14806
|
+
{
|
|
14807
|
+
"kind": "Content",
|
|
14808
|
+
"text": ";"
|
|
14809
|
+
}
|
|
14810
|
+
],
|
|
14811
|
+
"isReadonly": false,
|
|
14812
|
+
"isOptional": true,
|
|
14813
|
+
"releaseTag": "Beta",
|
|
14814
|
+
"name": "serverEndpoint",
|
|
14815
|
+
"propertyTypeTokenRange": {
|
|
14816
|
+
"startIndex": 1,
|
|
14817
|
+
"endIndex": 2
|
|
14818
|
+
}
|
|
14819
|
+
}
|
|
14820
|
+
],
|
|
14821
|
+
"extendsTokenRanges": [
|
|
14822
|
+
{
|
|
14823
|
+
"startIndex": 1,
|
|
14824
|
+
"endIndex": 2
|
|
14825
|
+
}
|
|
14826
|
+
]
|
|
14827
|
+
},
|
|
14828
|
+
{
|
|
14829
|
+
"kind": "TypeAlias",
|
|
14830
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIModelId:type",
|
|
14831
|
+
"docComment": "/**\n * OpenAI Responses API model ids supported by {@link OpenAITransport}.\n *\n * @remarks\n *\n * The GPT-6 family only: on gpt-6-astra, gpt-6.1-sol and gpt-6.1-terra, tool calling is available on the Responses API alone, and the transport is built on it. Older ids are not listed because nothing here prices or tests them — see {@link SUPPORTED_ANTHROPIC_MODEL_IDS} for why an unlisted model must be a decision rather than a fall-through.\n *\n * @beta\n */\n",
|
|
14832
|
+
"excerptTokens": [
|
|
14833
|
+
{
|
|
14834
|
+
"kind": "Content",
|
|
14835
|
+
"text": "export type OpenAIModelId = "
|
|
14836
|
+
},
|
|
14837
|
+
{
|
|
14838
|
+
"kind": "Content",
|
|
14839
|
+
"text": "'gpt-6-astra' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-sol' | 'gpt-6-luna'"
|
|
14840
|
+
},
|
|
14841
|
+
{
|
|
14842
|
+
"kind": "Content",
|
|
14843
|
+
"text": ";"
|
|
14844
|
+
}
|
|
14845
|
+
],
|
|
14846
|
+
"fileUrlPath": "src/types/config.types.ts",
|
|
14847
|
+
"releaseTag": "Beta",
|
|
14848
|
+
"name": "OpenAIModelId",
|
|
14849
|
+
"typeTokenRange": {
|
|
14850
|
+
"startIndex": 1,
|
|
14851
|
+
"endIndex": 2
|
|
14852
|
+
}
|
|
14853
|
+
},
|
|
14854
|
+
{
|
|
14855
|
+
"kind": "Class",
|
|
14856
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIProvider:class",
|
|
14857
|
+
"docComment": "/**\n * General OpenAI provider, on `OpenAITransport` (the Responses API, direct or via a server proxy): criteria, prompt and chat — the same shape as its Gemini and Anthropic twins.\n *\n * @beta\n */\n",
|
|
14858
|
+
"excerptTokens": [
|
|
14859
|
+
{
|
|
14860
|
+
"kind": "Content",
|
|
14861
|
+
"text": "export declare class OpenAIProvider implements "
|
|
14862
|
+
},
|
|
14863
|
+
{
|
|
14864
|
+
"kind": "Reference",
|
|
14865
|
+
"text": "AIProvider",
|
|
14866
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIProvider:interface"
|
|
14867
|
+
},
|
|
14868
|
+
{
|
|
14869
|
+
"kind": "Content",
|
|
14870
|
+
"text": " "
|
|
14871
|
+
}
|
|
14872
|
+
],
|
|
14873
|
+
"fileUrlPath": "src/providers/openai-provider.ts",
|
|
14874
|
+
"releaseTag": "Beta",
|
|
14875
|
+
"isAbstract": false,
|
|
14876
|
+
"name": "OpenAIProvider",
|
|
14877
|
+
"preserveMemberOrder": false,
|
|
14878
|
+
"members": [
|
|
14879
|
+
{
|
|
14880
|
+
"kind": "Constructor",
|
|
14881
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIProvider:constructor(1)",
|
|
14882
|
+
"docComment": "/**\n * Constructs a new instance of the `OpenAIProvider` class\n */\n",
|
|
14883
|
+
"excerptTokens": [
|
|
14884
|
+
{
|
|
14885
|
+
"kind": "Content",
|
|
14886
|
+
"text": "constructor(config: "
|
|
14887
|
+
},
|
|
14888
|
+
{
|
|
14889
|
+
"kind": "Reference",
|
|
14890
|
+
"text": "OpenAIProviderConfig",
|
|
14891
|
+
"canonicalReference": "@genesislcap/foundation-ai!~OpenAIProviderConfig:interface"
|
|
14892
|
+
},
|
|
14893
|
+
{
|
|
14894
|
+
"kind": "Content",
|
|
14895
|
+
"text": ", transport: "
|
|
14896
|
+
},
|
|
14897
|
+
{
|
|
14898
|
+
"kind": "Reference",
|
|
14899
|
+
"text": "OpenAITransport",
|
|
14900
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransport:class"
|
|
14901
|
+
},
|
|
14902
|
+
{
|
|
14903
|
+
"kind": "Content",
|
|
14904
|
+
"text": ");"
|
|
14905
|
+
}
|
|
14906
|
+
],
|
|
14907
|
+
"releaseTag": "Beta",
|
|
14908
|
+
"isProtected": false,
|
|
14909
|
+
"overloadIndex": 1,
|
|
14910
|
+
"parameters": [
|
|
14911
|
+
{
|
|
14912
|
+
"parameterName": "config",
|
|
14913
|
+
"parameterTypeTokenRange": {
|
|
14914
|
+
"startIndex": 1,
|
|
14915
|
+
"endIndex": 2
|
|
14916
|
+
},
|
|
14917
|
+
"isOptional": false
|
|
14918
|
+
},
|
|
14919
|
+
{
|
|
14920
|
+
"parameterName": "transport",
|
|
14921
|
+
"parameterTypeTokenRange": {
|
|
14922
|
+
"startIndex": 3,
|
|
14923
|
+
"endIndex": 4
|
|
14924
|
+
},
|
|
14925
|
+
"isOptional": false
|
|
14926
|
+
}
|
|
14927
|
+
]
|
|
14928
|
+
},
|
|
14929
|
+
{
|
|
14930
|
+
"kind": "Method",
|
|
14931
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIProvider#chat:member(1)",
|
|
14932
|
+
"docComment": "",
|
|
14933
|
+
"excerptTokens": [
|
|
14934
|
+
{
|
|
14935
|
+
"kind": "Content",
|
|
14936
|
+
"text": "chat(history: "
|
|
14937
|
+
},
|
|
14938
|
+
{
|
|
14939
|
+
"kind": "Reference",
|
|
14940
|
+
"text": "ChatMessage",
|
|
14941
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
|
|
14942
|
+
},
|
|
14943
|
+
{
|
|
14944
|
+
"kind": "Content",
|
|
14945
|
+
"text": "[]"
|
|
14946
|
+
},
|
|
14947
|
+
{
|
|
14948
|
+
"kind": "Content",
|
|
14949
|
+
"text": ", userMessage: "
|
|
14950
|
+
},
|
|
14951
|
+
{
|
|
14952
|
+
"kind": "Content",
|
|
14953
|
+
"text": "string"
|
|
14954
|
+
},
|
|
14955
|
+
{
|
|
14956
|
+
"kind": "Content",
|
|
14957
|
+
"text": ", options?: "
|
|
14958
|
+
},
|
|
14959
|
+
{
|
|
14960
|
+
"kind": "Reference",
|
|
14961
|
+
"text": "ChatRequestOptions",
|
|
14962
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatRequestOptions:interface"
|
|
14963
|
+
},
|
|
14964
|
+
{
|
|
14965
|
+
"kind": "Content",
|
|
14966
|
+
"text": "): "
|
|
14967
|
+
},
|
|
14968
|
+
{
|
|
14969
|
+
"kind": "Reference",
|
|
14970
|
+
"text": "Promise",
|
|
14971
|
+
"canonicalReference": "!Promise:interface"
|
|
14972
|
+
},
|
|
14973
|
+
{
|
|
14974
|
+
"kind": "Content",
|
|
14975
|
+
"text": "<"
|
|
14976
|
+
},
|
|
14977
|
+
{
|
|
14978
|
+
"kind": "Reference",
|
|
14979
|
+
"text": "ChatMessage",
|
|
14980
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
|
|
14981
|
+
},
|
|
14982
|
+
{
|
|
14983
|
+
"kind": "Content",
|
|
14984
|
+
"text": ">"
|
|
14985
|
+
},
|
|
14986
|
+
{
|
|
14987
|
+
"kind": "Content",
|
|
14988
|
+
"text": ";"
|
|
14989
|
+
}
|
|
14990
|
+
],
|
|
14991
|
+
"isStatic": false,
|
|
14992
|
+
"returnTypeTokenRange": {
|
|
14993
|
+
"startIndex": 8,
|
|
14994
|
+
"endIndex": 12
|
|
14995
|
+
},
|
|
14996
|
+
"releaseTag": "Beta",
|
|
14997
|
+
"isProtected": false,
|
|
14998
|
+
"overloadIndex": 1,
|
|
14999
|
+
"parameters": [
|
|
15000
|
+
{
|
|
15001
|
+
"parameterName": "history",
|
|
15002
|
+
"parameterTypeTokenRange": {
|
|
15003
|
+
"startIndex": 1,
|
|
15004
|
+
"endIndex": 3
|
|
15005
|
+
},
|
|
15006
|
+
"isOptional": false
|
|
15007
|
+
},
|
|
15008
|
+
{
|
|
15009
|
+
"parameterName": "userMessage",
|
|
15010
|
+
"parameterTypeTokenRange": {
|
|
15011
|
+
"startIndex": 4,
|
|
15012
|
+
"endIndex": 5
|
|
15013
|
+
},
|
|
15014
|
+
"isOptional": false
|
|
15015
|
+
},
|
|
15016
|
+
{
|
|
15017
|
+
"parameterName": "options",
|
|
15018
|
+
"parameterTypeTokenRange": {
|
|
15019
|
+
"startIndex": 6,
|
|
15020
|
+
"endIndex": 7
|
|
15021
|
+
},
|
|
15022
|
+
"isOptional": true
|
|
15023
|
+
}
|
|
15024
|
+
],
|
|
15025
|
+
"isOptional": false,
|
|
15026
|
+
"isAbstract": false,
|
|
15027
|
+
"name": "chat"
|
|
15028
|
+
},
|
|
15029
|
+
{
|
|
15030
|
+
"kind": "Method",
|
|
15031
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIProvider#getStatus:member(1)",
|
|
15032
|
+
"docComment": "",
|
|
15033
|
+
"excerptTokens": [
|
|
15034
|
+
{
|
|
15035
|
+
"kind": "Content",
|
|
15036
|
+
"text": "getStatus(): "
|
|
15037
|
+
},
|
|
15038
|
+
{
|
|
15039
|
+
"kind": "Reference",
|
|
15040
|
+
"text": "Promise",
|
|
15041
|
+
"canonicalReference": "!Promise:interface"
|
|
15042
|
+
},
|
|
15043
|
+
{
|
|
15044
|
+
"kind": "Content",
|
|
15045
|
+
"text": "<"
|
|
15046
|
+
},
|
|
15047
|
+
{
|
|
15048
|
+
"kind": "Reference",
|
|
15049
|
+
"text": "AIStatus",
|
|
15050
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIStatus:interface"
|
|
15051
|
+
},
|
|
15052
|
+
{
|
|
15053
|
+
"kind": "Content",
|
|
15054
|
+
"text": ">"
|
|
15055
|
+
},
|
|
15056
|
+
{
|
|
15057
|
+
"kind": "Content",
|
|
15058
|
+
"text": ";"
|
|
15059
|
+
}
|
|
15060
|
+
],
|
|
15061
|
+
"isStatic": false,
|
|
15062
|
+
"returnTypeTokenRange": {
|
|
15063
|
+
"startIndex": 1,
|
|
15064
|
+
"endIndex": 5
|
|
15065
|
+
},
|
|
15066
|
+
"releaseTag": "Beta",
|
|
15067
|
+
"isProtected": false,
|
|
15068
|
+
"overloadIndex": 1,
|
|
15069
|
+
"parameters": [],
|
|
15070
|
+
"isOptional": false,
|
|
15071
|
+
"isAbstract": false,
|
|
15072
|
+
"name": "getStatus"
|
|
15073
|
+
},
|
|
15074
|
+
{
|
|
15075
|
+
"kind": "Method",
|
|
15076
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIProvider#interpretCriteria:member(1)",
|
|
15077
|
+
"docComment": "",
|
|
15078
|
+
"excerptTokens": [
|
|
15079
|
+
{
|
|
15080
|
+
"kind": "Content",
|
|
15081
|
+
"text": "interpretCriteria(input: "
|
|
15082
|
+
},
|
|
15083
|
+
{
|
|
15084
|
+
"kind": "Content",
|
|
15085
|
+
"text": "string"
|
|
15086
|
+
},
|
|
15087
|
+
{
|
|
15088
|
+
"kind": "Content",
|
|
15089
|
+
"text": ", context: "
|
|
15090
|
+
},
|
|
15091
|
+
{
|
|
15092
|
+
"kind": "Reference",
|
|
15093
|
+
"text": "CriteriaInterpretContext",
|
|
15094
|
+
"canonicalReference": "@genesislcap/foundation-ai!CriteriaInterpretContext:interface"
|
|
15095
|
+
},
|
|
15096
|
+
{
|
|
15097
|
+
"kind": "Content",
|
|
15098
|
+
"text": "): "
|
|
15099
|
+
},
|
|
15100
|
+
{
|
|
15101
|
+
"kind": "Reference",
|
|
15102
|
+
"text": "Promise",
|
|
15103
|
+
"canonicalReference": "!Promise:interface"
|
|
15104
|
+
},
|
|
15105
|
+
{
|
|
15106
|
+
"kind": "Content",
|
|
15107
|
+
"text": "<"
|
|
15108
|
+
},
|
|
15109
|
+
{
|
|
15110
|
+
"kind": "Reference",
|
|
15111
|
+
"text": "CriteriaInterpretationResult",
|
|
15112
|
+
"canonicalReference": "@genesislcap/foundation-ai!CriteriaInterpretationResult:interface"
|
|
15113
|
+
},
|
|
15114
|
+
{
|
|
15115
|
+
"kind": "Content",
|
|
15116
|
+
"text": " | null>"
|
|
15117
|
+
},
|
|
15118
|
+
{
|
|
15119
|
+
"kind": "Content",
|
|
15120
|
+
"text": ";"
|
|
15121
|
+
}
|
|
15122
|
+
],
|
|
15123
|
+
"isStatic": false,
|
|
15124
|
+
"returnTypeTokenRange": {
|
|
15125
|
+
"startIndex": 5,
|
|
15126
|
+
"endIndex": 9
|
|
15127
|
+
},
|
|
15128
|
+
"releaseTag": "Beta",
|
|
15129
|
+
"isProtected": false,
|
|
15130
|
+
"overloadIndex": 1,
|
|
15131
|
+
"parameters": [
|
|
15132
|
+
{
|
|
15133
|
+
"parameterName": "input",
|
|
15134
|
+
"parameterTypeTokenRange": {
|
|
15135
|
+
"startIndex": 1,
|
|
15136
|
+
"endIndex": 2
|
|
15137
|
+
},
|
|
15138
|
+
"isOptional": false
|
|
15139
|
+
},
|
|
15140
|
+
{
|
|
15141
|
+
"parameterName": "context",
|
|
15142
|
+
"parameterTypeTokenRange": {
|
|
15143
|
+
"startIndex": 3,
|
|
15144
|
+
"endIndex": 4
|
|
15145
|
+
},
|
|
15146
|
+
"isOptional": false
|
|
15147
|
+
}
|
|
15148
|
+
],
|
|
15149
|
+
"isOptional": false,
|
|
15150
|
+
"isAbstract": false,
|
|
15151
|
+
"name": "interpretCriteria"
|
|
15152
|
+
},
|
|
15153
|
+
{
|
|
15154
|
+
"kind": "Method",
|
|
15155
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIProvider#prompt:member(1)",
|
|
15156
|
+
"docComment": "",
|
|
15157
|
+
"excerptTokens": [
|
|
15158
|
+
{
|
|
15159
|
+
"kind": "Content",
|
|
15160
|
+
"text": "prompt(message: "
|
|
15161
|
+
},
|
|
15162
|
+
{
|
|
15163
|
+
"kind": "Content",
|
|
15164
|
+
"text": "string"
|
|
15165
|
+
},
|
|
15166
|
+
{
|
|
15167
|
+
"kind": "Content",
|
|
15168
|
+
"text": ", options?: "
|
|
15169
|
+
},
|
|
15170
|
+
{
|
|
15171
|
+
"kind": "Reference",
|
|
15172
|
+
"text": "ChatRequestOptions",
|
|
15173
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatRequestOptions:interface"
|
|
15174
|
+
},
|
|
15175
|
+
{
|
|
15176
|
+
"kind": "Content",
|
|
15177
|
+
"text": "): "
|
|
15178
|
+
},
|
|
15179
|
+
{
|
|
15180
|
+
"kind": "Reference",
|
|
15181
|
+
"text": "Promise",
|
|
15182
|
+
"canonicalReference": "!Promise:interface"
|
|
15183
|
+
},
|
|
15184
|
+
{
|
|
15185
|
+
"kind": "Content",
|
|
15186
|
+
"text": "<string>"
|
|
15187
|
+
},
|
|
15188
|
+
{
|
|
15189
|
+
"kind": "Content",
|
|
15190
|
+
"text": ";"
|
|
15191
|
+
}
|
|
15192
|
+
],
|
|
15193
|
+
"isStatic": false,
|
|
15194
|
+
"returnTypeTokenRange": {
|
|
15195
|
+
"startIndex": 5,
|
|
15196
|
+
"endIndex": 7
|
|
15197
|
+
},
|
|
15198
|
+
"releaseTag": "Beta",
|
|
15199
|
+
"isProtected": false,
|
|
15200
|
+
"overloadIndex": 1,
|
|
15201
|
+
"parameters": [
|
|
15202
|
+
{
|
|
15203
|
+
"parameterName": "message",
|
|
15204
|
+
"parameterTypeTokenRange": {
|
|
15205
|
+
"startIndex": 1,
|
|
15206
|
+
"endIndex": 2
|
|
15207
|
+
},
|
|
15208
|
+
"isOptional": false
|
|
15209
|
+
},
|
|
15210
|
+
{
|
|
15211
|
+
"parameterName": "options",
|
|
15212
|
+
"parameterTypeTokenRange": {
|
|
15213
|
+
"startIndex": 3,
|
|
15214
|
+
"endIndex": 4
|
|
15215
|
+
},
|
|
15216
|
+
"isOptional": true
|
|
15217
|
+
}
|
|
15218
|
+
],
|
|
15219
|
+
"isOptional": false,
|
|
15220
|
+
"isAbstract": false,
|
|
15221
|
+
"name": "prompt"
|
|
15222
|
+
}
|
|
15223
|
+
],
|
|
15224
|
+
"implementsTokenRanges": [
|
|
15225
|
+
{
|
|
15226
|
+
"startIndex": 1,
|
|
15227
|
+
"endIndex": 2
|
|
15228
|
+
}
|
|
15229
|
+
]
|
|
15230
|
+
},
|
|
15231
|
+
{
|
|
15232
|
+
"kind": "Function",
|
|
15233
|
+
"canonicalReference": "@genesislcap/foundation-ai!openaiRatesFor:function(1)",
|
|
15234
|
+
"docComment": "/**\n * The rates a request on `model` with `promptTokens` of input is billed at. `promptTokens` is the whole prompt; pass 0 when only the standard tier is wanted.\n *\n * @beta\n */\n",
|
|
15235
|
+
"excerptTokens": [
|
|
15236
|
+
{
|
|
15237
|
+
"kind": "Content",
|
|
15238
|
+
"text": "export declare function openaiRatesFor(model: "
|
|
15239
|
+
},
|
|
15240
|
+
{
|
|
15241
|
+
"kind": "Reference",
|
|
15242
|
+
"text": "OpenAIModelId",
|
|
15243
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIModelId:type"
|
|
15244
|
+
},
|
|
15245
|
+
{
|
|
15246
|
+
"kind": "Content",
|
|
15247
|
+
"text": ", promptTokens: "
|
|
15248
|
+
},
|
|
15249
|
+
{
|
|
15250
|
+
"kind": "Content",
|
|
15251
|
+
"text": "number"
|
|
15252
|
+
},
|
|
15253
|
+
{
|
|
15254
|
+
"kind": "Content",
|
|
15255
|
+
"text": "): "
|
|
15256
|
+
},
|
|
15257
|
+
{
|
|
15258
|
+
"kind": "Reference",
|
|
15259
|
+
"text": "TokenRates",
|
|
15260
|
+
"canonicalReference": "@genesislcap/foundation-ai!TokenRates:interface"
|
|
15261
|
+
},
|
|
15262
|
+
{
|
|
15263
|
+
"kind": "Content",
|
|
15264
|
+
"text": " & {\n cachedPerMillion: number;\n}"
|
|
15265
|
+
},
|
|
15266
|
+
{
|
|
15267
|
+
"kind": "Content",
|
|
15268
|
+
"text": ";"
|
|
15269
|
+
}
|
|
15270
|
+
],
|
|
15271
|
+
"fileUrlPath": "src/utils/token-cost.ts",
|
|
15272
|
+
"returnTypeTokenRange": {
|
|
15273
|
+
"startIndex": 5,
|
|
15274
|
+
"endIndex": 7
|
|
15275
|
+
},
|
|
15276
|
+
"releaseTag": "Beta",
|
|
15277
|
+
"overloadIndex": 1,
|
|
15278
|
+
"parameters": [
|
|
15279
|
+
{
|
|
15280
|
+
"parameterName": "model",
|
|
15281
|
+
"parameterTypeTokenRange": {
|
|
15282
|
+
"startIndex": 1,
|
|
15283
|
+
"endIndex": 2
|
|
15284
|
+
},
|
|
15285
|
+
"isOptional": false
|
|
15286
|
+
},
|
|
15287
|
+
{
|
|
15288
|
+
"parameterName": "promptTokens",
|
|
15289
|
+
"parameterTypeTokenRange": {
|
|
15290
|
+
"startIndex": 3,
|
|
15291
|
+
"endIndex": 4
|
|
15292
|
+
},
|
|
15293
|
+
"isOptional": false
|
|
15294
|
+
}
|
|
15295
|
+
],
|
|
15296
|
+
"name": "openaiRatesFor"
|
|
15297
|
+
},
|
|
15298
|
+
{
|
|
15299
|
+
"kind": "Function",
|
|
15300
|
+
"canonicalReference": "@genesislcap/foundation-ai!openaiTokenCost:function(1)",
|
|
15301
|
+
"docComment": "/**\n * Cost one OpenAI request.\n *\n * @beta\n */\n",
|
|
15302
|
+
"excerptTokens": [
|
|
15303
|
+
{
|
|
15304
|
+
"kind": "Content",
|
|
15305
|
+
"text": "export declare function openaiTokenCost(model: "
|
|
15306
|
+
},
|
|
15307
|
+
{
|
|
15308
|
+
"kind": "Reference",
|
|
15309
|
+
"text": "OpenAIModelId",
|
|
15310
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIModelId:type"
|
|
15311
|
+
},
|
|
15312
|
+
{
|
|
15313
|
+
"kind": "Content",
|
|
15314
|
+
"text": ", usage: "
|
|
15315
|
+
},
|
|
15316
|
+
{
|
|
15317
|
+
"kind": "Reference",
|
|
15318
|
+
"text": "OpenAIUsageRecord",
|
|
15319
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIUsageRecord:interface"
|
|
15320
|
+
},
|
|
15321
|
+
{
|
|
15322
|
+
"kind": "Content",
|
|
15323
|
+
"text": "): "
|
|
15324
|
+
},
|
|
15325
|
+
{
|
|
15326
|
+
"kind": "Reference",
|
|
15327
|
+
"text": "TokenCost",
|
|
15328
|
+
"canonicalReference": "@genesislcap/foundation-ai!TokenCost:interface"
|
|
15329
|
+
},
|
|
15330
|
+
{
|
|
15331
|
+
"kind": "Content",
|
|
15332
|
+
"text": ";"
|
|
15333
|
+
}
|
|
15334
|
+
],
|
|
15335
|
+
"fileUrlPath": "src/utils/token-cost.ts",
|
|
15336
|
+
"returnTypeTokenRange": {
|
|
15337
|
+
"startIndex": 5,
|
|
15338
|
+
"endIndex": 6
|
|
15339
|
+
},
|
|
15340
|
+
"releaseTag": "Beta",
|
|
15341
|
+
"overloadIndex": 1,
|
|
15342
|
+
"parameters": [
|
|
15343
|
+
{
|
|
15344
|
+
"parameterName": "model",
|
|
15345
|
+
"parameterTypeTokenRange": {
|
|
15346
|
+
"startIndex": 1,
|
|
15347
|
+
"endIndex": 2
|
|
15348
|
+
},
|
|
15349
|
+
"isOptional": false
|
|
15350
|
+
},
|
|
15351
|
+
{
|
|
15352
|
+
"parameterName": "usage",
|
|
15353
|
+
"parameterTypeTokenRange": {
|
|
15354
|
+
"startIndex": 3,
|
|
15355
|
+
"endIndex": 4
|
|
15356
|
+
},
|
|
15357
|
+
"isOptional": false
|
|
15358
|
+
}
|
|
15359
|
+
],
|
|
15360
|
+
"name": "openaiTokenCost"
|
|
15361
|
+
},
|
|
15362
|
+
{
|
|
15363
|
+
"kind": "Class",
|
|
15364
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransport:class",
|
|
15365
|
+
"docComment": "/**\n * Transport for OpenAI's Responses API. Calls it directly when `apiKey` is provided, otherwise posts to a server-proxy endpoint (ai-service `/api/openai/chat`) that adds the key, meters spend and frames the stream.\n *\n * Stateless by design: `store: false`, no `previous_response_id`. Everything a later turn needs (encrypted reasoning, `phase`) rides on the persisted `ChatMessage`s, so sessions survive restore and vendor switches the same way they do on the other transports.\n *\n * Implements `AITransport` (structured prompt) and `ChatTransport` (multi-turn chat).\n *\n * @beta\n */\n",
|
|
15366
|
+
"excerptTokens": [
|
|
15367
|
+
{
|
|
15368
|
+
"kind": "Content",
|
|
15369
|
+
"text": "export declare class OpenAITransport implements "
|
|
15370
|
+
},
|
|
15371
|
+
{
|
|
15372
|
+
"kind": "Reference",
|
|
15373
|
+
"text": "AITransport",
|
|
15374
|
+
"canonicalReference": "@genesislcap/foundation-ai!~AITransport:interface"
|
|
15375
|
+
},
|
|
15376
|
+
{
|
|
15377
|
+
"kind": "Content",
|
|
15378
|
+
"text": ", "
|
|
15379
|
+
},
|
|
15380
|
+
{
|
|
15381
|
+
"kind": "Reference",
|
|
15382
|
+
"text": "ChatTransport",
|
|
15383
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatTransport:interface"
|
|
15384
|
+
},
|
|
15385
|
+
{
|
|
15386
|
+
"kind": "Content",
|
|
15387
|
+
"text": ", "
|
|
15388
|
+
},
|
|
15389
|
+
{
|
|
15390
|
+
"kind": "Reference",
|
|
15391
|
+
"text": "CostReportingTransport",
|
|
15392
|
+
"canonicalReference": "@genesislcap/foundation-ai!CostReportingTransport:interface"
|
|
15393
|
+
},
|
|
15394
|
+
{
|
|
15395
|
+
"kind": "Content",
|
|
15396
|
+
"text": " "
|
|
15397
|
+
}
|
|
15398
|
+
],
|
|
15399
|
+
"fileUrlPath": "src/transports/openai-transport.ts",
|
|
15400
|
+
"releaseTag": "Beta",
|
|
15401
|
+
"isAbstract": false,
|
|
15402
|
+
"name": "OpenAITransport",
|
|
15403
|
+
"preserveMemberOrder": false,
|
|
15404
|
+
"members": [
|
|
15405
|
+
{
|
|
15406
|
+
"kind": "Constructor",
|
|
15407
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransport:constructor(1)",
|
|
15408
|
+
"docComment": "/**\n * Constructs a new instance of the `OpenAITransport` class\n */\n",
|
|
15409
|
+
"excerptTokens": [
|
|
15410
|
+
{
|
|
15411
|
+
"kind": "Content",
|
|
15412
|
+
"text": "constructor(config?: "
|
|
15413
|
+
},
|
|
15414
|
+
{
|
|
15415
|
+
"kind": "Reference",
|
|
15416
|
+
"text": "OpenAITransportConfig",
|
|
15417
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransportConfig:interface"
|
|
15418
|
+
},
|
|
15419
|
+
{
|
|
15420
|
+
"kind": "Content",
|
|
15421
|
+
"text": ");"
|
|
15422
|
+
}
|
|
15423
|
+
],
|
|
15424
|
+
"releaseTag": "Beta",
|
|
15425
|
+
"isProtected": false,
|
|
15426
|
+
"overloadIndex": 1,
|
|
15427
|
+
"parameters": [
|
|
15428
|
+
{
|
|
15429
|
+
"parameterName": "config",
|
|
15430
|
+
"parameterTypeTokenRange": {
|
|
15431
|
+
"startIndex": 1,
|
|
15432
|
+
"endIndex": 2
|
|
15433
|
+
},
|
|
15434
|
+
"isOptional": true
|
|
15435
|
+
}
|
|
15436
|
+
]
|
|
15437
|
+
},
|
|
15438
|
+
{
|
|
15439
|
+
"kind": "Method",
|
|
15440
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransport#getConfig:member(1)",
|
|
15441
|
+
"docComment": "",
|
|
15442
|
+
"excerptTokens": [
|
|
15443
|
+
{
|
|
15444
|
+
"kind": "Content",
|
|
15445
|
+
"text": "getConfig(): "
|
|
15446
|
+
},
|
|
15447
|
+
{
|
|
15448
|
+
"kind": "Content",
|
|
15449
|
+
"text": "{\n provider: 'openai';\n model: "
|
|
15450
|
+
},
|
|
15451
|
+
{
|
|
15452
|
+
"kind": "Reference",
|
|
15453
|
+
"text": "OpenAIModelId",
|
|
15454
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIModelId:type"
|
|
15455
|
+
},
|
|
15456
|
+
{
|
|
15457
|
+
"kind": "Content",
|
|
15458
|
+
"text": ";\n contextLimit: number;\n }"
|
|
15459
|
+
},
|
|
15460
|
+
{
|
|
15461
|
+
"kind": "Content",
|
|
15462
|
+
"text": ";"
|
|
15463
|
+
}
|
|
15464
|
+
],
|
|
15465
|
+
"isStatic": false,
|
|
15466
|
+
"returnTypeTokenRange": {
|
|
15467
|
+
"startIndex": 1,
|
|
15468
|
+
"endIndex": 4
|
|
15469
|
+
},
|
|
15470
|
+
"releaseTag": "Beta",
|
|
15471
|
+
"isProtected": false,
|
|
15472
|
+
"overloadIndex": 1,
|
|
15473
|
+
"parameters": [],
|
|
15474
|
+
"isOptional": false,
|
|
15475
|
+
"isAbstract": false,
|
|
15476
|
+
"name": "getConfig"
|
|
15477
|
+
},
|
|
15478
|
+
{
|
|
15479
|
+
"kind": "Method",
|
|
15480
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransport#getLifetimeCost:member(1)",
|
|
15481
|
+
"docComment": "",
|
|
15482
|
+
"excerptTokens": [
|
|
15483
|
+
{
|
|
15484
|
+
"kind": "Content",
|
|
15485
|
+
"text": "getLifetimeCost(): "
|
|
15486
|
+
},
|
|
15487
|
+
{
|
|
15488
|
+
"kind": "Content",
|
|
15489
|
+
"text": "number"
|
|
15490
|
+
},
|
|
15491
|
+
{
|
|
15492
|
+
"kind": "Content",
|
|
15493
|
+
"text": ";"
|
|
15494
|
+
}
|
|
15495
|
+
],
|
|
15496
|
+
"isStatic": false,
|
|
15497
|
+
"returnTypeTokenRange": {
|
|
15498
|
+
"startIndex": 1,
|
|
15499
|
+
"endIndex": 2
|
|
15500
|
+
},
|
|
15501
|
+
"releaseTag": "Beta",
|
|
15502
|
+
"isProtected": false,
|
|
15503
|
+
"overloadIndex": 1,
|
|
15504
|
+
"parameters": [],
|
|
15505
|
+
"isOptional": false,
|
|
15506
|
+
"isAbstract": false,
|
|
15507
|
+
"name": "getLifetimeCost"
|
|
15508
|
+
},
|
|
15509
|
+
{
|
|
15510
|
+
"kind": "Method",
|
|
15511
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransport#getLifetimeSavings:member(1)",
|
|
15512
|
+
"docComment": "",
|
|
15513
|
+
"excerptTokens": [
|
|
15514
|
+
{
|
|
15515
|
+
"kind": "Content",
|
|
15516
|
+
"text": "getLifetimeSavings(): "
|
|
15517
|
+
},
|
|
15518
|
+
{
|
|
15519
|
+
"kind": "Content",
|
|
15520
|
+
"text": "number"
|
|
15521
|
+
},
|
|
15522
|
+
{
|
|
15523
|
+
"kind": "Content",
|
|
15524
|
+
"text": ";"
|
|
15525
|
+
}
|
|
15526
|
+
],
|
|
15527
|
+
"isStatic": false,
|
|
15528
|
+
"returnTypeTokenRange": {
|
|
15529
|
+
"startIndex": 1,
|
|
15530
|
+
"endIndex": 2
|
|
15531
|
+
},
|
|
15532
|
+
"releaseTag": "Beta",
|
|
15533
|
+
"isProtected": false,
|
|
15534
|
+
"overloadIndex": 1,
|
|
15535
|
+
"parameters": [],
|
|
15536
|
+
"isOptional": false,
|
|
15537
|
+
"isAbstract": false,
|
|
15538
|
+
"name": "getLifetimeSavings"
|
|
15539
|
+
},
|
|
15540
|
+
{
|
|
15541
|
+
"kind": "Method",
|
|
15542
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransport#resetLifetimeCost:member(1)",
|
|
15543
|
+
"docComment": "",
|
|
15544
|
+
"excerptTokens": [
|
|
15545
|
+
{
|
|
15546
|
+
"kind": "Content",
|
|
15547
|
+
"text": "resetLifetimeCost(): "
|
|
15548
|
+
},
|
|
15549
|
+
{
|
|
15550
|
+
"kind": "Content",
|
|
15551
|
+
"text": "void"
|
|
15552
|
+
},
|
|
15553
|
+
{
|
|
15554
|
+
"kind": "Content",
|
|
15555
|
+
"text": ";"
|
|
15556
|
+
}
|
|
15557
|
+
],
|
|
15558
|
+
"isStatic": false,
|
|
15559
|
+
"returnTypeTokenRange": {
|
|
15560
|
+
"startIndex": 1,
|
|
15561
|
+
"endIndex": 2
|
|
15562
|
+
},
|
|
15563
|
+
"releaseTag": "Beta",
|
|
15564
|
+
"isProtected": false,
|
|
15565
|
+
"overloadIndex": 1,
|
|
15566
|
+
"parameters": [],
|
|
15567
|
+
"isOptional": false,
|
|
15568
|
+
"isAbstract": false,
|
|
15569
|
+
"name": "resetLifetimeCost"
|
|
15570
|
+
},
|
|
15571
|
+
{
|
|
15572
|
+
"kind": "Method",
|
|
15573
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransport#sendChatMessage:member(1)",
|
|
15574
|
+
"docComment": "",
|
|
15575
|
+
"excerptTokens": [
|
|
15576
|
+
{
|
|
15577
|
+
"kind": "Content",
|
|
15578
|
+
"text": "sendChatMessage(history: "
|
|
15579
|
+
},
|
|
15580
|
+
{
|
|
15581
|
+
"kind": "Reference",
|
|
15582
|
+
"text": "ChatMessage",
|
|
15583
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
|
|
15584
|
+
},
|
|
15585
|
+
{
|
|
15586
|
+
"kind": "Content",
|
|
15587
|
+
"text": "[]"
|
|
15588
|
+
},
|
|
15589
|
+
{
|
|
15590
|
+
"kind": "Content",
|
|
15591
|
+
"text": ", userMessage: "
|
|
15592
|
+
},
|
|
15593
|
+
{
|
|
15594
|
+
"kind": "Content",
|
|
15595
|
+
"text": "string"
|
|
15596
|
+
},
|
|
15597
|
+
{
|
|
15598
|
+
"kind": "Content",
|
|
15599
|
+
"text": ", options?: "
|
|
15600
|
+
},
|
|
15601
|
+
{
|
|
15602
|
+
"kind": "Reference",
|
|
15603
|
+
"text": "ChatRequestOptions",
|
|
15604
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatRequestOptions:interface"
|
|
15605
|
+
},
|
|
15606
|
+
{
|
|
15607
|
+
"kind": "Content",
|
|
15608
|
+
"text": "): "
|
|
15609
|
+
},
|
|
15610
|
+
{
|
|
15611
|
+
"kind": "Reference",
|
|
15612
|
+
"text": "Promise",
|
|
15613
|
+
"canonicalReference": "!Promise:interface"
|
|
15614
|
+
},
|
|
15615
|
+
{
|
|
15616
|
+
"kind": "Content",
|
|
15617
|
+
"text": "<"
|
|
15618
|
+
},
|
|
15619
|
+
{
|
|
15620
|
+
"kind": "Reference",
|
|
15621
|
+
"text": "ChatMessage",
|
|
15622
|
+
"canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
|
|
15623
|
+
},
|
|
15624
|
+
{
|
|
15625
|
+
"kind": "Content",
|
|
15626
|
+
"text": ">"
|
|
15627
|
+
},
|
|
15628
|
+
{
|
|
15629
|
+
"kind": "Content",
|
|
15630
|
+
"text": ";"
|
|
15631
|
+
}
|
|
15632
|
+
],
|
|
15633
|
+
"isStatic": false,
|
|
15634
|
+
"returnTypeTokenRange": {
|
|
15635
|
+
"startIndex": 8,
|
|
15636
|
+
"endIndex": 12
|
|
15637
|
+
},
|
|
15638
|
+
"releaseTag": "Beta",
|
|
15639
|
+
"isProtected": false,
|
|
15640
|
+
"overloadIndex": 1,
|
|
15641
|
+
"parameters": [
|
|
15642
|
+
{
|
|
15643
|
+
"parameterName": "history",
|
|
15644
|
+
"parameterTypeTokenRange": {
|
|
15645
|
+
"startIndex": 1,
|
|
15646
|
+
"endIndex": 3
|
|
15647
|
+
},
|
|
15648
|
+
"isOptional": false
|
|
15649
|
+
},
|
|
15650
|
+
{
|
|
15651
|
+
"parameterName": "userMessage",
|
|
15652
|
+
"parameterTypeTokenRange": {
|
|
15653
|
+
"startIndex": 4,
|
|
15654
|
+
"endIndex": 5
|
|
15655
|
+
},
|
|
15656
|
+
"isOptional": false
|
|
15657
|
+
},
|
|
15658
|
+
{
|
|
15659
|
+
"parameterName": "options",
|
|
15660
|
+
"parameterTypeTokenRange": {
|
|
15661
|
+
"startIndex": 6,
|
|
15662
|
+
"endIndex": 7
|
|
15663
|
+
},
|
|
15664
|
+
"isOptional": true
|
|
15665
|
+
}
|
|
15666
|
+
],
|
|
15667
|
+
"isOptional": false,
|
|
15668
|
+
"isAbstract": false,
|
|
15669
|
+
"name": "sendChatMessage"
|
|
15670
|
+
},
|
|
15671
|
+
{
|
|
15672
|
+
"kind": "Method",
|
|
15673
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransport#sendStructuredPrompt:member(1)",
|
|
15674
|
+
"docComment": "",
|
|
15675
|
+
"excerptTokens": [
|
|
15676
|
+
{
|
|
15677
|
+
"kind": "Content",
|
|
15678
|
+
"text": "sendStructuredPrompt(options: "
|
|
15679
|
+
},
|
|
15680
|
+
{
|
|
15681
|
+
"kind": "Reference",
|
|
15682
|
+
"text": "StructuredPromptOptions",
|
|
15683
|
+
"canonicalReference": "@genesislcap/foundation-ai!~StructuredPromptOptions:interface"
|
|
15684
|
+
},
|
|
15685
|
+
{
|
|
15686
|
+
"kind": "Content",
|
|
15687
|
+
"text": "): "
|
|
15688
|
+
},
|
|
15689
|
+
{
|
|
15690
|
+
"kind": "Reference",
|
|
15691
|
+
"text": "Promise",
|
|
15692
|
+
"canonicalReference": "!Promise:interface"
|
|
15693
|
+
},
|
|
15694
|
+
{
|
|
15695
|
+
"kind": "Content",
|
|
15696
|
+
"text": "<string>"
|
|
15697
|
+
},
|
|
15698
|
+
{
|
|
15699
|
+
"kind": "Content",
|
|
15700
|
+
"text": ";"
|
|
15701
|
+
}
|
|
15702
|
+
],
|
|
15703
|
+
"isStatic": false,
|
|
15704
|
+
"returnTypeTokenRange": {
|
|
15705
|
+
"startIndex": 3,
|
|
15706
|
+
"endIndex": 5
|
|
15707
|
+
},
|
|
15708
|
+
"releaseTag": "Beta",
|
|
15709
|
+
"isProtected": false,
|
|
15710
|
+
"overloadIndex": 1,
|
|
15711
|
+
"parameters": [
|
|
15712
|
+
{
|
|
15713
|
+
"parameterName": "options",
|
|
15714
|
+
"parameterTypeTokenRange": {
|
|
15715
|
+
"startIndex": 1,
|
|
15716
|
+
"endIndex": 2
|
|
15717
|
+
},
|
|
15718
|
+
"isOptional": false
|
|
15719
|
+
}
|
|
15720
|
+
],
|
|
15721
|
+
"isOptional": false,
|
|
15722
|
+
"isAbstract": false,
|
|
15723
|
+
"name": "sendStructuredPrompt"
|
|
15724
|
+
}
|
|
15725
|
+
],
|
|
15726
|
+
"implementsTokenRanges": [
|
|
15727
|
+
{
|
|
15728
|
+
"startIndex": 1,
|
|
15729
|
+
"endIndex": 2
|
|
15730
|
+
},
|
|
15731
|
+
{
|
|
15732
|
+
"startIndex": 3,
|
|
15733
|
+
"endIndex": 4
|
|
15734
|
+
},
|
|
15735
|
+
{
|
|
15736
|
+
"startIndex": 5,
|
|
15737
|
+
"endIndex": 6
|
|
15738
|
+
}
|
|
15739
|
+
]
|
|
15740
|
+
},
|
|
15741
|
+
{
|
|
15742
|
+
"kind": "Interface",
|
|
15743
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransportConfig:interface",
|
|
15744
|
+
"docComment": "/**\n * @beta\n */\n",
|
|
15745
|
+
"excerptTokens": [
|
|
15746
|
+
{
|
|
15747
|
+
"kind": "Content",
|
|
15748
|
+
"text": "export interface OpenAITransportConfig "
|
|
15749
|
+
}
|
|
15750
|
+
],
|
|
15751
|
+
"fileUrlPath": "src/transports/openai-transport.ts",
|
|
15752
|
+
"releaseTag": "Beta",
|
|
15753
|
+
"name": "OpenAITransportConfig",
|
|
15754
|
+
"preserveMemberOrder": false,
|
|
15755
|
+
"members": [
|
|
15756
|
+
{
|
|
15757
|
+
"kind": "PropertySignature",
|
|
15758
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransportConfig#apiKey:member",
|
|
15759
|
+
"docComment": "/**\n * API key for direct calls to the OpenAI API. Must be provided explicitly.\n */\n",
|
|
15760
|
+
"excerptTokens": [
|
|
15761
|
+
{
|
|
15762
|
+
"kind": "Content",
|
|
15763
|
+
"text": "apiKey?: "
|
|
15764
|
+
},
|
|
15765
|
+
{
|
|
15766
|
+
"kind": "Content",
|
|
15767
|
+
"text": "string"
|
|
15768
|
+
},
|
|
15769
|
+
{
|
|
15770
|
+
"kind": "Content",
|
|
15771
|
+
"text": ";"
|
|
15772
|
+
}
|
|
15773
|
+
],
|
|
15774
|
+
"isReadonly": false,
|
|
15775
|
+
"isOptional": true,
|
|
15776
|
+
"releaseTag": "Beta",
|
|
15777
|
+
"name": "apiKey",
|
|
15778
|
+
"propertyTypeTokenRange": {
|
|
15779
|
+
"startIndex": 1,
|
|
15780
|
+
"endIndex": 2
|
|
15781
|
+
}
|
|
15782
|
+
},
|
|
15783
|
+
{
|
|
15784
|
+
"kind": "PropertySignature",
|
|
15785
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransportConfig#maxTokens:member",
|
|
15786
|
+
"docComment": "/**\n * Per-request `max_output_tokens` default. Omitted (model ceiling) when unset.\n */\n",
|
|
15787
|
+
"excerptTokens": [
|
|
15788
|
+
{
|
|
15789
|
+
"kind": "Content",
|
|
15790
|
+
"text": "maxTokens?: "
|
|
15791
|
+
},
|
|
15792
|
+
{
|
|
15793
|
+
"kind": "Content",
|
|
15794
|
+
"text": "number"
|
|
15795
|
+
},
|
|
15796
|
+
{
|
|
15797
|
+
"kind": "Content",
|
|
15798
|
+
"text": ";"
|
|
15799
|
+
}
|
|
15800
|
+
],
|
|
15801
|
+
"isReadonly": false,
|
|
15802
|
+
"isOptional": true,
|
|
15803
|
+
"releaseTag": "Beta",
|
|
15804
|
+
"name": "maxTokens",
|
|
15805
|
+
"propertyTypeTokenRange": {
|
|
15806
|
+
"startIndex": 1,
|
|
15807
|
+
"endIndex": 2
|
|
15808
|
+
}
|
|
15809
|
+
},
|
|
15810
|
+
{
|
|
15811
|
+
"kind": "PropertySignature",
|
|
15812
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransportConfig#model:member",
|
|
15813
|
+
"docComment": "/**\n * Defaults to `gpt-6-luna`. Only {@link SUPPORTED_OPENAI_MODEL_IDS} are accepted.\n */\n",
|
|
15814
|
+
"excerptTokens": [
|
|
15815
|
+
{
|
|
15816
|
+
"kind": "Content",
|
|
15817
|
+
"text": "model?: "
|
|
15818
|
+
},
|
|
15819
|
+
{
|
|
15820
|
+
"kind": "Reference",
|
|
15821
|
+
"text": "OpenAIModelId",
|
|
15822
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIModelId:type"
|
|
15823
|
+
},
|
|
15824
|
+
{
|
|
15825
|
+
"kind": "Content",
|
|
15826
|
+
"text": ";"
|
|
15827
|
+
}
|
|
15828
|
+
],
|
|
15829
|
+
"isReadonly": false,
|
|
15830
|
+
"isOptional": true,
|
|
15831
|
+
"releaseTag": "Beta",
|
|
15832
|
+
"name": "model",
|
|
15833
|
+
"propertyTypeTokenRange": {
|
|
15834
|
+
"startIndex": 1,
|
|
15835
|
+
"endIndex": 2
|
|
15836
|
+
}
|
|
15837
|
+
},
|
|
15838
|
+
{
|
|
15839
|
+
"kind": "PropertySignature",
|
|
15840
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransportConfig#reasoningSummary:member",
|
|
15841
|
+
"docComment": "/**\n * `reasoning.summary` to request when the turn reasons. Defaults to `'none'` (no summary requested): OpenAI may require organisation verification before it returns summaries, and an unverified organisation would otherwise see every reasoning turn rejected.\n */\n",
|
|
15842
|
+
"excerptTokens": [
|
|
15843
|
+
{
|
|
15844
|
+
"kind": "Content",
|
|
15845
|
+
"text": "reasoningSummary?: "
|
|
15846
|
+
},
|
|
15847
|
+
{
|
|
15848
|
+
"kind": "Content",
|
|
15849
|
+
"text": "'auto' | 'concise' | 'detailed' | 'none'"
|
|
15850
|
+
},
|
|
15851
|
+
{
|
|
15852
|
+
"kind": "Content",
|
|
15853
|
+
"text": ";"
|
|
15854
|
+
}
|
|
15855
|
+
],
|
|
15856
|
+
"isReadonly": false,
|
|
15857
|
+
"isOptional": true,
|
|
15858
|
+
"releaseTag": "Beta",
|
|
15859
|
+
"name": "reasoningSummary",
|
|
15860
|
+
"propertyTypeTokenRange": {
|
|
15861
|
+
"startIndex": 1,
|
|
15862
|
+
"endIndex": 2
|
|
15863
|
+
}
|
|
15864
|
+
},
|
|
15865
|
+
{
|
|
15866
|
+
"kind": "PropertySignature",
|
|
15867
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransportConfig#serverEndpoint:member",
|
|
15868
|
+
"docComment": "/**\n * Server-proxy endpoint (e.g. `/gwf/ai-service/api/openai/chat`). Used when no API key is set.\n */\n",
|
|
15869
|
+
"excerptTokens": [
|
|
15870
|
+
{
|
|
15871
|
+
"kind": "Content",
|
|
15872
|
+
"text": "serverEndpoint?: "
|
|
15873
|
+
},
|
|
15874
|
+
{
|
|
15875
|
+
"kind": "Content",
|
|
15876
|
+
"text": "string"
|
|
15877
|
+
},
|
|
15878
|
+
{
|
|
15879
|
+
"kind": "Content",
|
|
15880
|
+
"text": ";"
|
|
15881
|
+
}
|
|
15882
|
+
],
|
|
15883
|
+
"isReadonly": false,
|
|
15884
|
+
"isOptional": true,
|
|
15885
|
+
"releaseTag": "Beta",
|
|
15886
|
+
"name": "serverEndpoint",
|
|
15887
|
+
"propertyTypeTokenRange": {
|
|
15888
|
+
"startIndex": 1,
|
|
15889
|
+
"endIndex": 2
|
|
15890
|
+
}
|
|
15891
|
+
},
|
|
15892
|
+
{
|
|
15893
|
+
"kind": "PropertySignature",
|
|
15894
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransportConfig#stallTimeout:member",
|
|
15895
|
+
"docComment": "/**\n * Inactivity window (ms) on the server-proxied heartbeat path. Ignored on direct API calls. Defaults to 30_000.\n */\n",
|
|
15896
|
+
"excerptTokens": [
|
|
15897
|
+
{
|
|
15898
|
+
"kind": "Content",
|
|
15899
|
+
"text": "stallTimeout?: "
|
|
15900
|
+
},
|
|
15901
|
+
{
|
|
15902
|
+
"kind": "Content",
|
|
15903
|
+
"text": "number"
|
|
15904
|
+
},
|
|
15905
|
+
{
|
|
15906
|
+
"kind": "Content",
|
|
15907
|
+
"text": ";"
|
|
15908
|
+
}
|
|
15909
|
+
],
|
|
15910
|
+
"isReadonly": false,
|
|
15911
|
+
"isOptional": true,
|
|
15912
|
+
"releaseTag": "Beta",
|
|
15913
|
+
"name": "stallTimeout",
|
|
15914
|
+
"propertyTypeTokenRange": {
|
|
15915
|
+
"startIndex": 1,
|
|
15916
|
+
"endIndex": 2
|
|
15917
|
+
}
|
|
15918
|
+
},
|
|
15919
|
+
{
|
|
15920
|
+
"kind": "PropertySignature",
|
|
15921
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAITransportConfig#timeout:member",
|
|
15922
|
+
"docComment": "",
|
|
15923
|
+
"excerptTokens": [
|
|
15924
|
+
{
|
|
15925
|
+
"kind": "Content",
|
|
15926
|
+
"text": "timeout?: "
|
|
15927
|
+
},
|
|
15928
|
+
{
|
|
15929
|
+
"kind": "Content",
|
|
15930
|
+
"text": "number"
|
|
15931
|
+
},
|
|
15932
|
+
{
|
|
15933
|
+
"kind": "Content",
|
|
15934
|
+
"text": ";"
|
|
15935
|
+
}
|
|
15936
|
+
],
|
|
15937
|
+
"isReadonly": false,
|
|
15938
|
+
"isOptional": true,
|
|
15939
|
+
"releaseTag": "Beta",
|
|
15940
|
+
"name": "timeout",
|
|
15941
|
+
"propertyTypeTokenRange": {
|
|
15942
|
+
"startIndex": 1,
|
|
15943
|
+
"endIndex": 2
|
|
15944
|
+
}
|
|
15945
|
+
}
|
|
15946
|
+
],
|
|
15947
|
+
"extendsTokenRanges": []
|
|
15948
|
+
},
|
|
15949
|
+
{
|
|
15950
|
+
"kind": "Interface",
|
|
15951
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIUsageRecord:interface",
|
|
15952
|
+
"docComment": "/**\n * Token counts from an OpenAI Responses `usage` block.\n *\n * @remarks\n *\n * Gemini's input semantics, not Anthropic's: `input_tokens` is the **whole** prompt and both cache buckets sit inside it, so the uncached remainder is a subtraction. Reasoning tokens need no field of their own — `output_tokens` already includes `output_tokens_details.reasoning_tokens`.\n *\n * @beta\n */\n",
|
|
15953
|
+
"excerptTokens": [
|
|
15954
|
+
{
|
|
15955
|
+
"kind": "Content",
|
|
15956
|
+
"text": "export interface OpenAIUsageRecord "
|
|
15957
|
+
}
|
|
15958
|
+
],
|
|
15959
|
+
"fileUrlPath": "src/utils/token-cost.ts",
|
|
15960
|
+
"releaseTag": "Beta",
|
|
15961
|
+
"name": "OpenAIUsageRecord",
|
|
15962
|
+
"preserveMemberOrder": false,
|
|
15963
|
+
"members": [
|
|
15964
|
+
{
|
|
15965
|
+
"kind": "PropertySignature",
|
|
15966
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIUsageRecord#cacheReadTokens:member",
|
|
15967
|
+
"docComment": "/**\n * `usage.input_tokens_details.cached_tokens` — cache reads.\n */\n",
|
|
15968
|
+
"excerptTokens": [
|
|
15969
|
+
{
|
|
15970
|
+
"kind": "Content",
|
|
15971
|
+
"text": "cacheReadTokens: "
|
|
15972
|
+
},
|
|
15973
|
+
{
|
|
15974
|
+
"kind": "Content",
|
|
15975
|
+
"text": "number"
|
|
15976
|
+
},
|
|
15977
|
+
{
|
|
15978
|
+
"kind": "Content",
|
|
15979
|
+
"text": ";"
|
|
15980
|
+
}
|
|
15981
|
+
],
|
|
15982
|
+
"isReadonly": false,
|
|
15983
|
+
"isOptional": false,
|
|
15984
|
+
"releaseTag": "Beta",
|
|
15985
|
+
"name": "cacheReadTokens",
|
|
15986
|
+
"propertyTypeTokenRange": {
|
|
15987
|
+
"startIndex": 1,
|
|
15988
|
+
"endIndex": 2
|
|
15989
|
+
}
|
|
15990
|
+
},
|
|
15991
|
+
{
|
|
15992
|
+
"kind": "PropertySignature",
|
|
15993
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIUsageRecord#cacheWrite12hTokens:member",
|
|
15994
|
+
"docComment": "/**\n * `usage.input_tokens_details.cache_write_tokens_details.ttl_12h_tokens` — the 12-hour portion of {@link OpenAIUsageRecord.cacheWriteTokens}; the remainder is costed at the 30-minute rate.\n */\n",
|
|
15995
|
+
"excerptTokens": [
|
|
15996
|
+
{
|
|
15997
|
+
"kind": "Content",
|
|
15998
|
+
"text": "cacheWrite12hTokens: "
|
|
15999
|
+
},
|
|
16000
|
+
{
|
|
16001
|
+
"kind": "Content",
|
|
16002
|
+
"text": "number"
|
|
16003
|
+
},
|
|
16004
|
+
{
|
|
16005
|
+
"kind": "Content",
|
|
16006
|
+
"text": ";"
|
|
16007
|
+
}
|
|
16008
|
+
],
|
|
16009
|
+
"isReadonly": false,
|
|
16010
|
+
"isOptional": false,
|
|
16011
|
+
"releaseTag": "Beta",
|
|
16012
|
+
"name": "cacheWrite12hTokens",
|
|
16013
|
+
"propertyTypeTokenRange": {
|
|
16014
|
+
"startIndex": 1,
|
|
16015
|
+
"endIndex": 2
|
|
16016
|
+
}
|
|
16017
|
+
},
|
|
16018
|
+
{
|
|
16019
|
+
"kind": "PropertySignature",
|
|
16020
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIUsageRecord#cacheWriteTokens:member",
|
|
16021
|
+
"docComment": "/**\n * `usage.input_tokens_details.cache_write_tokens` — the total across both TTLs.\n */\n",
|
|
16022
|
+
"excerptTokens": [
|
|
16023
|
+
{
|
|
16024
|
+
"kind": "Content",
|
|
16025
|
+
"text": "cacheWriteTokens: "
|
|
16026
|
+
},
|
|
16027
|
+
{
|
|
16028
|
+
"kind": "Content",
|
|
16029
|
+
"text": "number"
|
|
16030
|
+
},
|
|
16031
|
+
{
|
|
16032
|
+
"kind": "Content",
|
|
16033
|
+
"text": ";"
|
|
16034
|
+
}
|
|
16035
|
+
],
|
|
16036
|
+
"isReadonly": false,
|
|
16037
|
+
"isOptional": false,
|
|
16038
|
+
"releaseTag": "Beta",
|
|
16039
|
+
"name": "cacheWriteTokens",
|
|
16040
|
+
"propertyTypeTokenRange": {
|
|
16041
|
+
"startIndex": 1,
|
|
16042
|
+
"endIndex": 2
|
|
16043
|
+
}
|
|
16044
|
+
},
|
|
16045
|
+
{
|
|
16046
|
+
"kind": "PropertySignature",
|
|
16047
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIUsageRecord#inputTokens:member",
|
|
16048
|
+
"docComment": "/**\n * `usage.input_tokens` — the whole prompt, cached reads AND writes included.\n */\n",
|
|
16049
|
+
"excerptTokens": [
|
|
16050
|
+
{
|
|
16051
|
+
"kind": "Content",
|
|
16052
|
+
"text": "inputTokens: "
|
|
16053
|
+
},
|
|
16054
|
+
{
|
|
16055
|
+
"kind": "Content",
|
|
16056
|
+
"text": "number"
|
|
16057
|
+
},
|
|
16058
|
+
{
|
|
16059
|
+
"kind": "Content",
|
|
16060
|
+
"text": ";"
|
|
16061
|
+
}
|
|
16062
|
+
],
|
|
16063
|
+
"isReadonly": false,
|
|
16064
|
+
"isOptional": false,
|
|
16065
|
+
"releaseTag": "Beta",
|
|
16066
|
+
"name": "inputTokens",
|
|
16067
|
+
"propertyTypeTokenRange": {
|
|
16068
|
+
"startIndex": 1,
|
|
16069
|
+
"endIndex": 2
|
|
16070
|
+
}
|
|
16071
|
+
},
|
|
16072
|
+
{
|
|
16073
|
+
"kind": "PropertySignature",
|
|
16074
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIUsageRecord#outputTokens:member",
|
|
16075
|
+
"docComment": "/**\n * `usage.output_tokens`. Includes reasoning tokens, which bill as output.\n */\n",
|
|
16076
|
+
"excerptTokens": [
|
|
16077
|
+
{
|
|
16078
|
+
"kind": "Content",
|
|
16079
|
+
"text": "outputTokens: "
|
|
16080
|
+
},
|
|
16081
|
+
{
|
|
16082
|
+
"kind": "Content",
|
|
16083
|
+
"text": "number"
|
|
16084
|
+
},
|
|
16085
|
+
{
|
|
16086
|
+
"kind": "Content",
|
|
16087
|
+
"text": ";"
|
|
16088
|
+
}
|
|
16089
|
+
],
|
|
16090
|
+
"isReadonly": false,
|
|
16091
|
+
"isOptional": false,
|
|
16092
|
+
"releaseTag": "Beta",
|
|
16093
|
+
"name": "outputTokens",
|
|
16094
|
+
"propertyTypeTokenRange": {
|
|
16095
|
+
"startIndex": 1,
|
|
16096
|
+
"endIndex": 2
|
|
16097
|
+
}
|
|
16098
|
+
}
|
|
16099
|
+
],
|
|
16100
|
+
"extendsTokenRanges": []
|
|
16101
|
+
},
|
|
16102
|
+
{
|
|
16103
|
+
"kind": "Variable",
|
|
16104
|
+
"canonicalReference": "@genesislcap/foundation-ai!PROVIDER_REFUSED_CODE:var",
|
|
16105
|
+
"docComment": "/**\n * The proxy's machine-readable code for \"the upstream vendor refused this account\".\n *\n * Deliberately distinct from `BUDGET_EXCEEDED`: the ai-service proxy stamps this when it relays a provider refusal, so the client can tell a relayed upstream fault from the proxy's own budget verdict without inspecting the body at all.\n *\n * Exported from the package index — unlike its `BUDGET_EXCEEDED_CODE` sibling, which is internal — because the SERVER side of the contract lives in another repo (genesis-create's ai-service stamps this code onto its proxy responses). A hand-copied string literal there would drift on the first rename, and the drift would be silent: the client would simply stop classifying.\n *\n * @beta\n */\n",
|
|
16106
|
+
"excerptTokens": [
|
|
16107
|
+
{
|
|
16108
|
+
"kind": "Content",
|
|
16109
|
+
"text": "PROVIDER_REFUSED_CODE = "
|
|
16110
|
+
},
|
|
16111
|
+
{
|
|
16112
|
+
"kind": "Content",
|
|
16113
|
+
"text": "\"PROVIDER_REFUSED\""
|
|
16114
|
+
}
|
|
16115
|
+
],
|
|
16116
|
+
"fileUrlPath": "src/transports/provider-refused.ts",
|
|
16117
|
+
"initializerTokenRange": {
|
|
16118
|
+
"startIndex": 1,
|
|
16119
|
+
"endIndex": 2
|
|
16120
|
+
},
|
|
16121
|
+
"isReadonly": true,
|
|
16122
|
+
"releaseTag": "Beta",
|
|
16123
|
+
"name": "PROVIDER_REFUSED_CODE",
|
|
16124
|
+
"variableTypeTokenRange": {
|
|
16125
|
+
"startIndex": 0,
|
|
16126
|
+
"endIndex": 0
|
|
16127
|
+
}
|
|
16128
|
+
},
|
|
16129
|
+
{
|
|
16130
|
+
"kind": "TypeAlias",
|
|
16131
|
+
"canonicalReference": "@genesislcap/foundation-ai!ProviderRefusalKind:type",
|
|
16132
|
+
"docComment": "/**\n * Which kind of refusal it was. **One error type, two kinds** — because the user-facing outcome is identical (one sentence, see {@link DEFAULT_PROVIDER_REFUSED_MESSAGE}) while the operator's fix is completely different.\n *\n * - `spend` — the account cannot spend: credit balance at zero, a workspace/organisation usage cap reached, or a billing/payment-information problem. Someone has to pay or raise a cap. - `auth` — the credential cannot be used: revoked, expired or malformed key (`401`), or a key without access to the requested model (`403`). Someone has to rotate a key or grant access.\n *\n * The alternative designs were both worse. A single type named for spend would *lie* about an expired key, and a debug timeline reading `provider-spend-refused` for an auth fault misleads the next engineer — which is precisely the trap the first draft of this feature fell into by naming itself `ProviderCreditExhaustedError` before a usage cap turned out to be in the same family. Two separate error types would duplicate a branch, a message and a wire code to express one outcome.\n *\n * @beta\n */\n",
|
|
16133
|
+
"excerptTokens": [
|
|
16134
|
+
{
|
|
16135
|
+
"kind": "Content",
|
|
16136
|
+
"text": "export type ProviderRefusalKind = "
|
|
16137
|
+
},
|
|
16138
|
+
{
|
|
16139
|
+
"kind": "Content",
|
|
16140
|
+
"text": "'spend' | 'auth'"
|
|
16141
|
+
},
|
|
16142
|
+
{
|
|
16143
|
+
"kind": "Content",
|
|
16144
|
+
"text": ";"
|
|
16145
|
+
}
|
|
16146
|
+
],
|
|
16147
|
+
"fileUrlPath": "src/transports/provider-refused.ts",
|
|
16148
|
+
"releaseTag": "Beta",
|
|
16149
|
+
"name": "ProviderRefusalKind",
|
|
16150
|
+
"typeTokenRange": {
|
|
16151
|
+
"startIndex": 1,
|
|
16152
|
+
"endIndex": 2
|
|
16153
|
+
}
|
|
16154
|
+
},
|
|
16155
|
+
{
|
|
16156
|
+
"kind": "Class",
|
|
16157
|
+
"canonicalReference": "@genesislcap/foundation-ai!ProviderRefusedError:class",
|
|
16158
|
+
"docComment": "/**\n * Thrown when the upstream provider refuses the request because of the state of the **account** rather than anything about the request — see {@link ProviderRefusalKind}.\n *\n * Terminal and non-transient, in the same family as `ResponseTruncatedError` and `BudgetExhaustedError`: retrying cannot clear it, because nothing about the request is wrong. So both the transport retry ladder and the driver's transient-retry catch step aside for it and the failure surfaces immediately as the `'provider-refused'` `TurnFailureReason`.\n *\n * @beta\n */\n",
|
|
16159
|
+
"excerptTokens": [
|
|
16160
|
+
{
|
|
16161
|
+
"kind": "Content",
|
|
16162
|
+
"text": "export declare class ProviderRefusedError extends "
|
|
16163
|
+
},
|
|
16164
|
+
{
|
|
16165
|
+
"kind": "Reference",
|
|
16166
|
+
"text": "Error",
|
|
16167
|
+
"canonicalReference": "!Error:interface"
|
|
16168
|
+
},
|
|
16169
|
+
{
|
|
16170
|
+
"kind": "Content",
|
|
16171
|
+
"text": " "
|
|
16172
|
+
}
|
|
16173
|
+
],
|
|
16174
|
+
"fileUrlPath": "src/transports/provider-refused.ts",
|
|
16175
|
+
"releaseTag": "Beta",
|
|
16176
|
+
"isAbstract": false,
|
|
16177
|
+
"name": "ProviderRefusedError",
|
|
16178
|
+
"preserveMemberOrder": false,
|
|
16179
|
+
"members": [
|
|
16180
|
+
{
|
|
16181
|
+
"kind": "Constructor",
|
|
16182
|
+
"canonicalReference": "@genesislcap/foundation-ai!ProviderRefusedError:constructor(1)",
|
|
16183
|
+
"docComment": "/**\n * Constructs a new instance of the `ProviderRefusedError` class\n */\n",
|
|
16184
|
+
"excerptTokens": [
|
|
16185
|
+
{
|
|
16186
|
+
"kind": "Content",
|
|
16187
|
+
"text": "constructor(\n vendorLabel: "
|
|
16188
|
+
},
|
|
16189
|
+
{
|
|
16190
|
+
"kind": "Content",
|
|
16191
|
+
"text": "string"
|
|
16192
|
+
},
|
|
16193
|
+
{
|
|
16194
|
+
"kind": "Content",
|
|
16195
|
+
"text": ", \n kind: "
|
|
16196
|
+
},
|
|
16197
|
+
{
|
|
16198
|
+
"kind": "Reference",
|
|
16199
|
+
"text": "ProviderRefusalKind",
|
|
16200
|
+
"canonicalReference": "@genesislcap/foundation-ai!ProviderRefusalKind:type"
|
|
16201
|
+
},
|
|
16202
|
+
{
|
|
16203
|
+
"kind": "Content",
|
|
16204
|
+
"text": ", \n upstreamStatus?: "
|
|
16205
|
+
},
|
|
16206
|
+
{
|
|
16207
|
+
"kind": "Content",
|
|
16208
|
+
"text": "number"
|
|
16209
|
+
},
|
|
16210
|
+
{
|
|
16211
|
+
"kind": "Content",
|
|
16212
|
+
"text": ", \n upstreamType?: "
|
|
16213
|
+
},
|
|
16214
|
+
{
|
|
16215
|
+
"kind": "Content",
|
|
16216
|
+
"text": "string"
|
|
16217
|
+
},
|
|
16218
|
+
{
|
|
16219
|
+
"kind": "Content",
|
|
16220
|
+
"text": ", \n detail?: "
|
|
16221
|
+
},
|
|
16222
|
+
{
|
|
16223
|
+
"kind": "Content",
|
|
16224
|
+
"text": "string"
|
|
16225
|
+
},
|
|
16226
|
+
{
|
|
16227
|
+
"kind": "Content",
|
|
16228
|
+
"text": ");"
|
|
16229
|
+
}
|
|
16230
|
+
],
|
|
16231
|
+
"releaseTag": "Beta",
|
|
16232
|
+
"isProtected": false,
|
|
16233
|
+
"overloadIndex": 1,
|
|
16234
|
+
"parameters": [
|
|
16235
|
+
{
|
|
16236
|
+
"parameterName": "vendorLabel",
|
|
16237
|
+
"parameterTypeTokenRange": {
|
|
16238
|
+
"startIndex": 1,
|
|
16239
|
+
"endIndex": 2
|
|
16240
|
+
},
|
|
16241
|
+
"isOptional": false
|
|
16242
|
+
},
|
|
16243
|
+
{
|
|
16244
|
+
"parameterName": "kind",
|
|
16245
|
+
"parameterTypeTokenRange": {
|
|
16246
|
+
"startIndex": 3,
|
|
16247
|
+
"endIndex": 4
|
|
16248
|
+
},
|
|
16249
|
+
"isOptional": false
|
|
16250
|
+
},
|
|
16251
|
+
{
|
|
16252
|
+
"parameterName": "upstreamStatus",
|
|
16253
|
+
"parameterTypeTokenRange": {
|
|
16254
|
+
"startIndex": 5,
|
|
16255
|
+
"endIndex": 6
|
|
16256
|
+
},
|
|
16257
|
+
"isOptional": true
|
|
16258
|
+
},
|
|
14623
16259
|
{
|
|
14624
16260
|
"parameterName": "upstreamType",
|
|
14625
16261
|
"parameterTypeTokenRange": {
|
|
@@ -15001,7 +16637,7 @@
|
|
|
15001
16637
|
{
|
|
15002
16638
|
"kind": "Function",
|
|
15003
16639
|
"canonicalReference": "@genesislcap/foundation-ai!resolveAIConfig:function(1)",
|
|
15004
|
-
"docComment": "/**\n * Resolves AI config, optionally preferring Chrome when available. Use before registering AIProvider.
|
|
16640
|
+
"docComment": "/**\n * Resolves AI config, optionally preferring Chrome when available. Use before registering AIProvider. The cloud configs it returns carry no endpoint: add `serverEndpoint` (a server proxy) or `apiKey` (direct, trusted contexts only) before `createAIProvider`. Returns null when the AI feature flag is disabled (?feature.ai).\n *\n * @beta\n */\n",
|
|
15005
16641
|
"excerptTokens": [
|
|
15006
16642
|
{
|
|
15007
16643
|
"kind": "Content",
|
|
@@ -15076,7 +16712,7 @@
|
|
|
15076
16712
|
{
|
|
15077
16713
|
"kind": "PropertySignature",
|
|
15078
16714
|
"canonicalReference": "@genesislcap/foundation-ai!ResolveAIConfigOptions#model:member",
|
|
15079
|
-
"docComment": "/**\n * Model name.\n *\n * - OpenAI default
|
|
16715
|
+
"docComment": "/**\n * Model name.\n *\n * - OpenAI: only {@link SUPPORTED_OPENAI_MODEL_IDS} (default `gpt-6-luna`). - Gemini: only {@link SUPPORTED_GEMINI_MODEL_IDS} (default `gemini-2.5-flash-lite`). - Anthropic: only {@link SUPPORTED_ANTHROPIC_MODEL_IDS} (default `claude-haiku-4-5-20251001`).\n */\n",
|
|
15080
16716
|
"excerptTokens": [
|
|
15081
16717
|
{
|
|
15082
16718
|
"kind": "Content",
|
|
@@ -15436,66 +17072,6 @@
|
|
|
15436
17072
|
},
|
|
15437
17073
|
"implementsTokenRanges": []
|
|
15438
17074
|
},
|
|
15439
|
-
{
|
|
15440
|
-
"kind": "Interface",
|
|
15441
|
-
"canonicalReference": "@genesislcap/foundation-ai!ServerAIConfig:interface",
|
|
15442
|
-
"docComment": "/**\n * Server-proxy AI configuration (client calls your server; server calls the provider).\n *\n * @remarks\n *\n * API key stays on the server. URL is derived from API_HOST at /ai-service/chat-completions. Use provider to select backend (openai, anthropic, etc.).\n *\n * @beta\n */\n",
|
|
15443
|
-
"excerptTokens": [
|
|
15444
|
-
{
|
|
15445
|
-
"kind": "Content",
|
|
15446
|
-
"text": "export interface ServerAIConfig extends "
|
|
15447
|
-
},
|
|
15448
|
-
{
|
|
15449
|
-
"kind": "Reference",
|
|
15450
|
-
"text": "AIProviderConfig",
|
|
15451
|
-
"canonicalReference": "@genesislcap/foundation-ai!~AIProviderConfig:interface"
|
|
15452
|
-
},
|
|
15453
|
-
{
|
|
15454
|
-
"kind": "Content",
|
|
15455
|
-
"text": " "
|
|
15456
|
-
}
|
|
15457
|
-
],
|
|
15458
|
-
"fileUrlPath": "src/types/config.types.ts",
|
|
15459
|
-
"releaseTag": "Beta",
|
|
15460
|
-
"name": "ServerAIConfig",
|
|
15461
|
-
"preserveMemberOrder": false,
|
|
15462
|
-
"members": [
|
|
15463
|
-
{
|
|
15464
|
-
"kind": "PropertySignature",
|
|
15465
|
-
"canonicalReference": "@genesislcap/foundation-ai!ServerAIConfig#provider:member",
|
|
15466
|
-
"docComment": "",
|
|
15467
|
-
"excerptTokens": [
|
|
15468
|
-
{
|
|
15469
|
-
"kind": "Content",
|
|
15470
|
-
"text": "provider: "
|
|
15471
|
-
},
|
|
15472
|
-
{
|
|
15473
|
-
"kind": "Reference",
|
|
15474
|
-
"text": "ServerAIProviderType",
|
|
15475
|
-
"canonicalReference": "@genesislcap/foundation-ai!~ServerAIProviderType:type"
|
|
15476
|
-
},
|
|
15477
|
-
{
|
|
15478
|
-
"kind": "Content",
|
|
15479
|
-
"text": ";"
|
|
15480
|
-
}
|
|
15481
|
-
],
|
|
15482
|
-
"isReadonly": false,
|
|
15483
|
-
"isOptional": false,
|
|
15484
|
-
"releaseTag": "Beta",
|
|
15485
|
-
"name": "provider",
|
|
15486
|
-
"propertyTypeTokenRange": {
|
|
15487
|
-
"startIndex": 1,
|
|
15488
|
-
"endIndex": 2
|
|
15489
|
-
}
|
|
15490
|
-
}
|
|
15491
|
-
],
|
|
15492
|
-
"extendsTokenRanges": [
|
|
15493
|
-
{
|
|
15494
|
-
"startIndex": 1,
|
|
15495
|
-
"endIndex": 2
|
|
15496
|
-
}
|
|
15497
|
-
]
|
|
15498
|
-
},
|
|
15499
17075
|
{
|
|
15500
17076
|
"kind": "Function",
|
|
15501
17077
|
"canonicalReference": "@genesislcap/foundation-ai!startSpeechRecognition:function(1)",
|
|
@@ -15808,6 +17384,38 @@
|
|
|
15808
17384
|
"endIndex": 4
|
|
15809
17385
|
}
|
|
15810
17386
|
},
|
|
17387
|
+
{
|
|
17388
|
+
"kind": "Variable",
|
|
17389
|
+
"canonicalReference": "@genesislcap/foundation-ai!SUPPORTED_OPENAI_MODEL_IDS:var",
|
|
17390
|
+
"docComment": "/**\n * @beta\n */\n",
|
|
17391
|
+
"excerptTokens": [
|
|
17392
|
+
{
|
|
17393
|
+
"kind": "Content",
|
|
17394
|
+
"text": "SUPPORTED_OPENAI_MODEL_IDS: "
|
|
17395
|
+
},
|
|
17396
|
+
{
|
|
17397
|
+
"kind": "Content",
|
|
17398
|
+
"text": "readonly "
|
|
17399
|
+
},
|
|
17400
|
+
{
|
|
17401
|
+
"kind": "Reference",
|
|
17402
|
+
"text": "OpenAIModelId",
|
|
17403
|
+
"canonicalReference": "@genesislcap/foundation-ai!OpenAIModelId:type"
|
|
17404
|
+
},
|
|
17405
|
+
{
|
|
17406
|
+
"kind": "Content",
|
|
17407
|
+
"text": "[]"
|
|
17408
|
+
}
|
|
17409
|
+
],
|
|
17410
|
+
"fileUrlPath": "src/types/config.types.ts",
|
|
17411
|
+
"isReadonly": true,
|
|
17412
|
+
"releaseTag": "Beta",
|
|
17413
|
+
"name": "SUPPORTED_OPENAI_MODEL_IDS",
|
|
17414
|
+
"variableTypeTokenRange": {
|
|
17415
|
+
"startIndex": 1,
|
|
17416
|
+
"endIndex": 4
|
|
17417
|
+
}
|
|
17418
|
+
},
|
|
15811
17419
|
{
|
|
15812
17420
|
"kind": "TypeAlias",
|
|
15813
17421
|
"canonicalReference": "@genesislcap/foundation-ai!TimestampDisplay:type",
|
|
@@ -16216,7 +17824,7 @@
|
|
|
16216
17824
|
{
|
|
16217
17825
|
"kind": "Function",
|
|
16218
17826
|
"canonicalReference": "@genesislcap/foundation-ai!vendorOfModel:function(1)",
|
|
16219
|
-
"docComment": "/**\n * Which vendor a model id belongs to, or `undefined` when no supported provider claims it.\n *\n * @remarks\n *\n * Derived from {@link SUPPORTED_ANTHROPIC_MODEL_IDS} and {@link
|
|
17827
|
+
"docComment": "/**\n * Which vendor a model id belongs to, or `undefined` when no supported provider claims it.\n *\n * @remarks\n *\n * Derived from {@link SUPPORTED_ANTHROPIC_MODEL_IDS}, {@link SUPPORTED_GEMINI_MODEL_IDS} and {@link SUPPORTED_OPENAI_MODEL_IDS}, so it cannot drift from them the way a hand-maintained map does — adding a model to an allowlist is enough to teach this too.\n *\n * Exists because callers hold a **model id**, not a vendor. A usage ledger reads a message's `model` and then has to pick the matching pricing function — `anthropicTokenCost` vs `geminiTokenCost` — whose usage records are deliberately not interchangeable, because the two providers disagree about whether the prompt figure includes the cached part. Without this, every such caller writes its own model→vendor map, which is the same duplication that exporting the pricing removes.\n *\n * Returns `undefined` rather than falling back to a default vendor so an unrecognised model is a decision the caller has to make out loud. Silently defaulting is precisely how an unlisted model gets priced at some other tier's rates — a consumer has already had Haiku billed at Sonnet rates that way.\n *\n * Takes a plain `string`, not a union: the interesting callers are reading a model id back off a stored message or a config file, where it is untrusted text.\n *\n * @beta\n */\n",
|
|
16220
17828
|
"excerptTokens": [
|
|
16221
17829
|
{
|
|
16222
17830
|
"kind": "Content",
|