@genesislcap/ai-assistant 15.105.0-GENC-2037.2 → 15.106.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/ai-assistant.api.json +2 -66
- package/dist/ai-assistant.d.ts +1 -31
- package/dist/chat-driver.cjs +19 -66
- package/dist/chat-driver.cjs.map +2 -2
- package/dist/chat-driver.mjs +19 -66
- package/dist/chat-driver.mjs.map +2 -2
- package/dist/custom-elements.json +2 -60
- package/dist/dts/chat-driver-node.d.ts +1 -1
- package/dist/dts/chat-driver-node.d.ts.map +1 -1
- package/dist/dts/genesis/config.d.ts.map +1 -1
- package/dist/dts/genesis/register-genesis-assistant.d.ts +0 -16
- package/dist/dts/genesis/register-genesis-assistant.d.ts.map +1 -1
- package/dist/dts/genesis/types.d.ts +2 -8
- package/dist/dts/genesis/types.d.ts.map +1 -1
- package/dist/dts/main/budget-controller.d.ts.map +1 -1
- package/dist/dts/provider/tiered-provider-switcher.d.ts +1 -31
- package/dist/dts/provider/tiered-provider-switcher.d.ts.map +1 -1
- package/dist/esm/chat-driver-node.js +1 -1
- package/dist/esm/genesis/config.js +1 -1
- package/dist/esm/genesis/consumes.js +1 -1
- package/dist/esm/genesis/register-genesis-assistant.js +7 -46
- package/dist/esm/main/budget-controller.js +5 -6
- package/dist/esm/provider/tiered-provider-switcher.js +1 -53
- package/dist/genesis-consumes.cjs +1 -1
- package/dist/genesis-consumes.cjs.map +2 -2
- package/dist/genesis-consumes.mjs +1 -1
- package/dist/genesis-consumes.mjs.map +2 -2
- package/docs/genesis.md +3 -27
- package/package.json +17 -17
- package/scripts/smoke-genesis-consumes-node.mjs +1 -1
- package/dist/dts/genesis/vendor-follower.d.ts +0 -75
- package/dist/dts/genesis/vendor-follower.d.ts.map +0 -1
- package/dist/esm/genesis/vendor-follower.js +0 -137
|
@@ -44801,70 +44801,6 @@
|
|
|
44801
44801
|
"isAbstract": false,
|
|
44802
44802
|
"name": "adoptPersistedVendor"
|
|
44803
44803
|
},
|
|
44804
|
-
{
|
|
44805
|
-
"kind": "Method",
|
|
44806
|
-
"canonicalReference": "@genesislcap/ai-assistant!TieredAIProviderSwitcher#setAvailableVendors:member(1)",
|
|
44807
|
-
"docComment": "/**\n * Change which vendors are available, within the ones it was constructed with, and optionally which one is active — in one registry rebuild.\n *\n * @remarks\n *\n * For a host that learns at runtime which vendors its proxy can serve. Genesis Create's preview is the one today: the app is built before the user picks a vendor there, so it registers every vendor and narrows to the ones Create offers once it has asked. The standby entries follow the list, so the assistant's budget-wall banner offers a switch only to a vendor that can answer.\n *\n * `active` is adopted the way {@link TieredAIProviderSwitcher.adoptPersistedVendor} adopts a vendor: subscribers hear of a change, `onSwitch` does not fire. Left out, the active vendor stays when the new list keeps it and becomes the list's first when it does not.\n *\n * Ignored as a whole — nothing changes — when no listed vendor is one it was constructed with, or when `active` is not in the list. A call that changes neither the list nor the vendor leaves the registry alone, so a host may repeat it as often as it asks.\n */\n",
|
|
44808
|
-
"excerptTokens": [
|
|
44809
|
-
{
|
|
44810
|
-
"kind": "Content",
|
|
44811
|
-
"text": "setAvailableVendors(vendors: "
|
|
44812
|
-
},
|
|
44813
|
-
{
|
|
44814
|
-
"kind": "Content",
|
|
44815
|
-
"text": "readonly string[]"
|
|
44816
|
-
},
|
|
44817
|
-
{
|
|
44818
|
-
"kind": "Content",
|
|
44819
|
-
"text": ", active?: "
|
|
44820
|
-
},
|
|
44821
|
-
{
|
|
44822
|
-
"kind": "Content",
|
|
44823
|
-
"text": "string"
|
|
44824
|
-
},
|
|
44825
|
-
{
|
|
44826
|
-
"kind": "Content",
|
|
44827
|
-
"text": "): "
|
|
44828
|
-
},
|
|
44829
|
-
{
|
|
44830
|
-
"kind": "Content",
|
|
44831
|
-
"text": "void"
|
|
44832
|
-
},
|
|
44833
|
-
{
|
|
44834
|
-
"kind": "Content",
|
|
44835
|
-
"text": ";"
|
|
44836
|
-
}
|
|
44837
|
-
],
|
|
44838
|
-
"isStatic": false,
|
|
44839
|
-
"returnTypeTokenRange": {
|
|
44840
|
-
"startIndex": 5,
|
|
44841
|
-
"endIndex": 6
|
|
44842
|
-
},
|
|
44843
|
-
"releaseTag": "Beta",
|
|
44844
|
-
"isProtected": false,
|
|
44845
|
-
"overloadIndex": 1,
|
|
44846
|
-
"parameters": [
|
|
44847
|
-
{
|
|
44848
|
-
"parameterName": "vendors",
|
|
44849
|
-
"parameterTypeTokenRange": {
|
|
44850
|
-
"startIndex": 1,
|
|
44851
|
-
"endIndex": 2
|
|
44852
|
-
},
|
|
44853
|
-
"isOptional": false
|
|
44854
|
-
},
|
|
44855
|
-
{
|
|
44856
|
-
"parameterName": "active",
|
|
44857
|
-
"parameterTypeTokenRange": {
|
|
44858
|
-
"startIndex": 3,
|
|
44859
|
-
"endIndex": 4
|
|
44860
|
-
},
|
|
44861
|
-
"isOptional": true
|
|
44862
|
-
}
|
|
44863
|
-
],
|
|
44864
|
-
"isOptional": false,
|
|
44865
|
-
"isAbstract": false,
|
|
44866
|
-
"name": "setAvailableVendors"
|
|
44867
|
-
},
|
|
44868
44804
|
{
|
|
44869
44805
|
"kind": "Method",
|
|
44870
44806
|
"canonicalReference": "@genesislcap/ai-assistant!TieredAIProviderSwitcher#subscribe:member(1)",
|
|
@@ -44995,11 +44931,11 @@
|
|
|
44995
44931
|
{
|
|
44996
44932
|
"kind": "Property",
|
|
44997
44933
|
"canonicalReference": "@genesislcap/ai-assistant!TieredAIProviderSwitcher#vendors:member",
|
|
44998
|
-
"docComment": "
|
|
44934
|
+
"docComment": "",
|
|
44999
44935
|
"excerptTokens": [
|
|
45000
44936
|
{
|
|
45001
44937
|
"kind": "Content",
|
|
45002
|
-
"text": "
|
|
44938
|
+
"text": "readonly vendors: "
|
|
45003
44939
|
},
|
|
45004
44940
|
{
|
|
45005
44941
|
"kind": "Content",
|
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -10785,12 +10785,7 @@ export declare type ThinkingPolicyInput = ChatThinkingPolicy | ((ctx: SystemProm
|
|
|
10785
10785
|
* @beta
|
|
10786
10786
|
*/
|
|
10787
10787
|
export declare class TieredAIProviderSwitcher implements AIProviderSwitcher {
|
|
10788
|
-
|
|
10789
|
-
* The vendors it was constructed with: {@link TieredAIProviderSwitcher.setAvailableVendors}
|
|
10790
|
-
* chooses among these and never adds one.
|
|
10791
|
-
*/
|
|
10792
|
-
private readonly builtVendors;
|
|
10793
|
-
private _vendors;
|
|
10788
|
+
readonly vendors: readonly AITierVendor[];
|
|
10794
10789
|
private readonly options;
|
|
10795
10790
|
private readonly defaultTier;
|
|
10796
10791
|
private readonly registry;
|
|
@@ -10798,31 +10793,6 @@ export declare class TieredAIProviderSwitcher implements AIProviderSwitcher {
|
|
|
10798
10793
|
private _vendor;
|
|
10799
10794
|
constructor(options: TieredAIProviderSwitcherOptions);
|
|
10800
10795
|
get vendor(): AITierVendor;
|
|
10801
|
-
/**
|
|
10802
|
-
* The vendors it can switch between now: `vendors` as constructed, unless
|
|
10803
|
-
* {@link TieredAIProviderSwitcher.setAvailableVendors} has narrowed them since.
|
|
10804
|
-
*/
|
|
10805
|
-
get vendors(): readonly AITierVendor[];
|
|
10806
|
-
/**
|
|
10807
|
-
* Change which vendors are available, within the ones it was constructed with, and optionally
|
|
10808
|
-
* which one is active — in one registry rebuild.
|
|
10809
|
-
*
|
|
10810
|
-
* @remarks
|
|
10811
|
-
* For a host that learns at runtime which vendors its proxy can serve. Genesis Create's preview
|
|
10812
|
-
* is the one today: the app is built before the user picks a vendor there, so it registers every
|
|
10813
|
-
* vendor and narrows to the ones Create offers once it has asked. The standby entries follow
|
|
10814
|
-
* the list, so the assistant's budget-wall banner offers a switch only to a vendor that can
|
|
10815
|
-
* answer.
|
|
10816
|
-
*
|
|
10817
|
-
* `active` is adopted the way {@link TieredAIProviderSwitcher.adoptPersistedVendor} adopts a
|
|
10818
|
-
* vendor: subscribers hear of a change, `onSwitch` does not fire. Left out, the active vendor
|
|
10819
|
-
* stays when the new list keeps it and becomes the list's first when it does not.
|
|
10820
|
-
*
|
|
10821
|
-
* Ignored as a whole — nothing changes — when no listed vendor is one it was constructed with,
|
|
10822
|
-
* or when `active` is not in the list. A call that changes neither the list nor the vendor
|
|
10823
|
-
* leaves the registry alone, so a host may repeat it as often as it asks.
|
|
10824
|
-
*/
|
|
10825
|
-
setAvailableVendors(vendors: readonly string[], active?: string): void;
|
|
10826
10796
|
/**
|
|
10827
10797
|
* A user-driven switch: move the registry, then tell the app so it can persist the choice.
|
|
10828
10798
|
* An unknown vendor is ignored.
|
package/dist/chat-driver.cjs
CHANGED
|
@@ -1827,7 +1827,8 @@ var VENDOR_LABELS = Object.freeze({
|
|
|
1827
1827
|
anthropic: "Anthropic",
|
|
1828
1828
|
gemini: "Gemini",
|
|
1829
1829
|
openai: "OpenAI",
|
|
1830
|
-
chrome: "Chrome"
|
|
1830
|
+
chrome: "Chrome",
|
|
1831
|
+
bedrock: "Bedrock"
|
|
1831
1832
|
});
|
|
1832
1833
|
var BUDGETED_VENDORS = Object.freeze([
|
|
1833
1834
|
"anthropic",
|
|
@@ -4920,50 +4921,35 @@ var MutableAIProviderRegistry = class _MutableAIProviderRegistry {
|
|
|
4920
4921
|
|
|
4921
4922
|
// ../../foundation-ai/dist/esm/tiers/ai-tiers.js
|
|
4922
4923
|
var AI_TIER_IDS = ["low", "high", "reasoning"];
|
|
4923
|
-
var AI_TIER_VENDORS = ["anthropic", "gemini"
|
|
4924
|
+
var AI_TIER_VENDORS = ["anthropic", "gemini"];
|
|
4924
4925
|
var AI_STALL_TIMEOUT_MS = 6e4;
|
|
4925
4926
|
var AI_NO_RESPONSE_TIMEOUT_MS = 3e5;
|
|
4926
4927
|
var DEFAULT_AI_TIERS = Object.freeze({
|
|
4927
|
-
// The Claude 5.5 family, as Genesis Create runs it (GENC-1665). All three think by default and
|
|
4928
|
-
// replay that thinking under preserved thinking, so the transport sends `thinking.block_binding`
|
|
4929
|
-
// and its `anthropic-beta: thinking-binding-controls-2026-08-01` header on every adaptive turn,
|
|
4930
|
-
// through a `serverEndpoint` too: a proxy in front of these tiers has to forward that header,
|
|
4931
|
-
// or each such turn is a 400. Every model here has a documented 128K output ceiling.
|
|
4932
4928
|
anthropic: Object.freeze({
|
|
4933
|
-
// A lighter-loop tier that never emits a whole file. 32K rather than Haiku 4.5's 16K because
|
|
4934
|
-
// Haiku 5.5 thinks by default (effort `medium`) and bills that thinking out of `max_tokens`,
|
|
4935
|
-
// where 4.5 did not think and 16K was all answer. $0.10 / $0.50 per MTok up to 100K prompt
|
|
4936
|
-
// tokens ($0.50 / $2.50 above), against Haiku 4.5's $1 / $5.
|
|
4937
4929
|
low: Object.freeze({
|
|
4938
|
-
model: "claude-haiku-5-
|
|
4939
|
-
maxTokens:
|
|
4930
|
+
model: "claude-haiku-4-5-20251001",
|
|
4931
|
+
maxTokens: 16e3,
|
|
4940
4932
|
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4941
4933
|
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4942
4934
|
}),
|
|
4943
|
-
// The heavy tier: whole-file writes, and adaptive thinking out of the same budget
|
|
4944
|
-
// caller leaves thinking on — hence
|
|
4945
|
-
//
|
|
4946
|
-
// rejects `disabled`, so the transport turns thinking off with `between_tools` (short progress
|
|
4947
|
-
// notes between tool calls, no extended thinking, and no `block_binding`, which it rejects).
|
|
4948
|
-
// Same $2 / $10 as Sonnet 5, cache reads at $0.10. It rejects a forced `tool_choice`; the
|
|
4949
|
-
// transport downgrades one to `auto` plus an instruction.
|
|
4935
|
+
// The heavy tier: whole-file writes, and adaptive thinking out of the same budget
|
|
4936
|
+
// wherever a caller leaves thinking on — hence Sonnet 5's full 128K ceiling rather
|
|
4937
|
+
// than a figure that only fits one of the two.
|
|
4950
4938
|
high: Object.freeze({
|
|
4951
|
-
model: "claude-sonnet-5
|
|
4939
|
+
model: "claude-sonnet-5",
|
|
4952
4940
|
maxTokens: 128e3,
|
|
4953
4941
|
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4954
4942
|
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4955
4943
|
}),
|
|
4956
|
-
//
|
|
4957
|
-
//
|
|
4958
|
-
//
|
|
4959
|
-
//
|
|
4960
|
-
//
|
|
4961
|
-
//
|
|
4962
|
-
// against $5 / $25), with native structured output, and like Sonnet 5.5 it rejects a forced
|
|
4963
|
-
// `tool_choice`.
|
|
4944
|
+
// One-shot judgement calls rather than tool loops, so a smaller ceiling is ample:
|
|
4945
|
+
// `max_tokens` is only a cap, and this tier never emits a whole file.
|
|
4946
|
+
//
|
|
4947
|
+
// Opus 4.8 rather than the 4.7 Create benched: the same price ($5 / $25) and the same 1M
|
|
4948
|
+
// window, but 4.8 supports native structured output where 4.7 takes the forced-tool
|
|
4949
|
+
// fallback — and structured judgement is what this tier is asked for most (review of #2540).
|
|
4964
4950
|
reasoning: Object.freeze({
|
|
4965
|
-
model: "claude-opus-
|
|
4966
|
-
maxTokens:
|
|
4951
|
+
model: "claude-opus-4-8",
|
|
4952
|
+
maxTokens: 32e3,
|
|
4967
4953
|
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4968
4954
|
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4969
4955
|
})
|
|
@@ -4991,47 +4977,14 @@ var DEFAULT_AI_TIERS = Object.freeze({
|
|
|
4991
4977
|
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4992
4978
|
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4993
4979
|
})
|
|
4994
|
-
}),
|
|
4995
|
-
// NOT BENCHED. Proposed defaults picked by price and capability tier alone, so that a
|
|
4996
|
-
// generated app can name `vendor: 'openai'` at all; they have not been through the ui-builder
|
|
4997
|
-
// bench the Anthropic and Gemini rows came out of. Run that bench before treating these as a
|
|
4998
|
-
// platform decision, and move any row it disagrees with.
|
|
4999
|
-
//
|
|
5000
|
-
// No `maxTokens` on any row: `max_output_tokens` is optional on the Responses API and the
|
|
5001
|
-
// transport omits it when unset, so the model's own ceiling applies and a whole-file write is
|
|
5002
|
-
// not truncated the way Anthropic's 4096 default would truncate it.
|
|
5003
|
-
openai: Object.freeze({
|
|
5004
|
-
// The cheapest GPT-6 tier ($0.10 / $0.50), and one of the two that accepts reasoning
|
|
5005
|
-
// effort `none`, so a caller that turns thinking off gets no reasoning at all.
|
|
5006
|
-
low: Object.freeze({
|
|
5007
|
-
model: "gpt-6-luna",
|
|
5008
|
-
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
5009
|
-
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
5010
|
-
}),
|
|
5011
|
-
// $1 / $5, and it also accepts effort `none`, so tool loops that turn thinking off are not
|
|
5012
|
-
// forced to pay for it.
|
|
5013
|
-
high: Object.freeze({
|
|
5014
|
-
model: "gpt-6.1-terra",
|
|
5015
|
-
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
5016
|
-
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
5017
|
-
}),
|
|
5018
|
-
// $2 / $10 rather than gpt-6-astra's $10 / $50. It cannot turn reasoning off (`off` runs at
|
|
5019
|
-
// effort `low`), which suits a tier asked for judgement calls. Its transport warns on every
|
|
5020
|
-
// construction that it is the dearer model; that warning is expected here.
|
|
5021
|
-
reasoning: Object.freeze({
|
|
5022
|
-
model: "gpt-6.1-sol",
|
|
5023
|
-
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
5024
|
-
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
5025
|
-
})
|
|
5026
4980
|
})
|
|
5027
4981
|
});
|
|
5028
4982
|
function resolveAITiers(overrides) {
|
|
5029
|
-
if (!(overrides === null || overrides === void 0 ? void 0 : overrides.anthropic) && !(overrides === null || overrides === void 0 ? void 0 : overrides.gemini)
|
|
4983
|
+
if (!(overrides === null || overrides === void 0 ? void 0 : overrides.anthropic) && !(overrides === null || overrides === void 0 ? void 0 : overrides.gemini))
|
|
5030
4984
|
return DEFAULT_AI_TIERS;
|
|
5031
4985
|
return Object.freeze({
|
|
5032
4986
|
anthropic: mergeVendor(DEFAULT_AI_TIERS.anthropic, overrides.anthropic),
|
|
5033
|
-
gemini: mergeVendor(DEFAULT_AI_TIERS.gemini, overrides.gemini)
|
|
5034
|
-
openai: mergeVendor(DEFAULT_AI_TIERS.openai, overrides.openai)
|
|
4987
|
+
gemini: mergeVendor(DEFAULT_AI_TIERS.gemini, overrides.gemini)
|
|
5035
4988
|
});
|
|
5036
4989
|
}
|
|
5037
4990
|
function mergeVendor(defaults, overrides) {
|