@genesislcap/ai-assistant 15.104.0 → 15.105.0-GENC-2037.2

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.
Files changed (33) hide show
  1. package/dist/ai-assistant.api.json +66 -2
  2. package/dist/ai-assistant.d.ts +31 -1
  3. package/dist/chat-driver.cjs +65 -17
  4. package/dist/chat-driver.cjs.map +2 -2
  5. package/dist/chat-driver.mjs +65 -17
  6. package/dist/chat-driver.mjs.map +2 -2
  7. package/dist/custom-elements.json +60 -2
  8. package/dist/dts/chat-driver-node.d.ts +1 -1
  9. package/dist/dts/chat-driver-node.d.ts.map +1 -1
  10. package/dist/dts/genesis/config.d.ts.map +1 -1
  11. package/dist/dts/genesis/register-genesis-assistant.d.ts +16 -0
  12. package/dist/dts/genesis/register-genesis-assistant.d.ts.map +1 -1
  13. package/dist/dts/genesis/types.d.ts +8 -2
  14. package/dist/dts/genesis/types.d.ts.map +1 -1
  15. package/dist/dts/genesis/vendor-follower.d.ts +75 -0
  16. package/dist/dts/genesis/vendor-follower.d.ts.map +1 -0
  17. package/dist/dts/main/budget-controller.d.ts.map +1 -1
  18. package/dist/dts/provider/tiered-provider-switcher.d.ts +31 -1
  19. package/dist/dts/provider/tiered-provider-switcher.d.ts.map +1 -1
  20. package/dist/esm/chat-driver-node.js +1 -1
  21. package/dist/esm/genesis/config.js +1 -1
  22. package/dist/esm/genesis/consumes.js +1 -1
  23. package/dist/esm/genesis/register-genesis-assistant.js +46 -7
  24. package/dist/esm/genesis/vendor-follower.js +137 -0
  25. package/dist/esm/main/budget-controller.js +6 -5
  26. package/dist/esm/provider/tiered-provider-switcher.js +53 -1
  27. package/dist/genesis-consumes.cjs +1 -1
  28. package/dist/genesis-consumes.cjs.map +2 -2
  29. package/dist/genesis-consumes.mjs +1 -1
  30. package/dist/genesis-consumes.mjs.map +2 -2
  31. package/docs/genesis.md +27 -3
  32. package/package.json +17 -17
  33. package/scripts/smoke-genesis-consumes-node.mjs +1 -1
@@ -44801,6 +44801,70 @@
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
+ },
44804
44868
  {
44805
44869
  "kind": "Method",
44806
44870
  "canonicalReference": "@genesislcap/ai-assistant!TieredAIProviderSwitcher#subscribe:member(1)",
@@ -44931,11 +44995,11 @@
44931
44995
  {
44932
44996
  "kind": "Property",
44933
44997
  "canonicalReference": "@genesislcap/ai-assistant!TieredAIProviderSwitcher#vendors:member",
44934
- "docComment": "",
44998
+ "docComment": "/**\n * The vendors it can switch between now: `vendors` as constructed, unless {@link TieredAIProviderSwitcher.setAvailableVendors} has narrowed them since.\n */\n",
44935
44999
  "excerptTokens": [
44936
45000
  {
44937
45001
  "kind": "Content",
44938
- "text": "readonly vendors: "
45002
+ "text": "get vendors(): "
44939
45003
  },
44940
45004
  {
44941
45005
  "kind": "Content",
@@ -10785,7 +10785,12 @@ export declare type ThinkingPolicyInput = ChatThinkingPolicy | ((ctx: SystemProm
10785
10785
  * @beta
10786
10786
  */
10787
10787
  export declare class TieredAIProviderSwitcher implements AIProviderSwitcher {
10788
- readonly vendors: readonly AITierVendor[];
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;
10789
10794
  private readonly options;
10790
10795
  private readonly defaultTier;
10791
10796
  private readonly registry;
@@ -10793,6 +10798,31 @@ export declare class TieredAIProviderSwitcher implements AIProviderSwitcher {
10793
10798
  private _vendor;
10794
10799
  constructor(options: TieredAIProviderSwitcherOptions);
10795
10800
  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;
10796
10826
  /**
10797
10827
  * A user-driven switch: move the registry, then tell the app so it can persist the choice.
10798
10828
  * An unknown vendor is ignored.
@@ -4920,35 +4920,50 @@ var MutableAIProviderRegistry = class _MutableAIProviderRegistry {
4920
4920
 
4921
4921
  // ../../foundation-ai/dist/esm/tiers/ai-tiers.js
4922
4922
  var AI_TIER_IDS = ["low", "high", "reasoning"];
4923
- var AI_TIER_VENDORS = ["anthropic", "gemini"];
4923
+ var AI_TIER_VENDORS = ["anthropic", "gemini", "openai"];
4924
4924
  var AI_STALL_TIMEOUT_MS = 6e4;
4925
4925
  var AI_NO_RESPONSE_TIMEOUT_MS = 3e5;
4926
4926
  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.
4927
4932
  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.
4928
4937
  low: Object.freeze({
4929
- model: "claude-haiku-4-5-20251001",
4930
- maxTokens: 16e3,
4938
+ model: "claude-haiku-5-5",
4939
+ maxTokens: 32e3,
4931
4940
  stallTimeoutMs: AI_STALL_TIMEOUT_MS,
4932
4941
  timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
4933
4942
  }),
4934
- // The heavy tier: whole-file writes, and adaptive thinking out of the same budget
4935
- // wherever a caller leaves thinking on — hence Sonnet 5's full 128K ceiling rather
4936
- // than a figure that only fits one of the two.
4943
+ // The heavy tier: whole-file writes, and adaptive thinking out of the same budget wherever a
4944
+ // caller leaves thinking on — hence the full 128K ceiling rather than a figure that only fits
4945
+ // one of the two. A `thinkingPolicy: 'off'` turn spends all of it on output: Sonnet 5.5
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.
4937
4950
  high: Object.freeze({
4938
- model: "claude-sonnet-5",
4951
+ model: "claude-sonnet-5-5",
4939
4952
  maxTokens: 128e3,
4940
4953
  stallTimeoutMs: AI_STALL_TIMEOUT_MS,
4941
4954
  timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
4942
4955
  }),
4943
- // One-shot judgement calls rather than tool loops, so a smaller ceiling is ample:
4944
- // `max_tokens` is only a cap, and this tier never emits a whole file.
4945
- //
4946
- // Opus 4.8 rather than the 4.7 Create benched: the same price ($5 / $25) and the same 1M
4947
- // window, but 4.8 supports native structured output where 4.7 takes the forced-tool
4948
- // fallback — and structured judgement is what this tier is asked for most (review of #2540).
4956
+ // Judgement calls rather than whole-file writes, but Opus 5.5 ALWAYS thinks (`disabled` is a
4957
+ // 400 at every effort; `'off'` drops it to effort `low` instead) and the thinking comes out of
4958
+ // this same budget before the answer is written. Opus 4.8's 32K was sized for a model that did
4959
+ // not think unless asked; Create saw a thinking reasoning tier spend all of 32K and end at
4960
+ // `max_tokens` with no tool call (GENC-1789), so this gets the full 128K. `max_tokens` is only
4961
+ // a cap: a turn that stops short of it bills nothing extra. Cheaper than Opus 4.8 ($4 / $20
4962
+ // against $5 / $25), with native structured output, and like Sonnet 5.5 it rejects a forced
4963
+ // `tool_choice`.
4949
4964
  reasoning: Object.freeze({
4950
- model: "claude-opus-4-8",
4951
- maxTokens: 32e3,
4965
+ model: "claude-opus-5-5",
4966
+ maxTokens: 128e3,
4952
4967
  stallTimeoutMs: AI_STALL_TIMEOUT_MS,
4953
4968
  timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
4954
4969
  })
@@ -4976,14 +4991,47 @@ var DEFAULT_AI_TIERS = Object.freeze({
4976
4991
  stallTimeoutMs: AI_STALL_TIMEOUT_MS,
4977
4992
  timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
4978
4993
  })
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
+ })
4979
5026
  })
4980
5027
  });
4981
5028
  function resolveAITiers(overrides) {
4982
- if (!(overrides === null || overrides === void 0 ? void 0 : overrides.anthropic) && !(overrides === null || overrides === void 0 ? void 0 : overrides.gemini))
5029
+ if (!(overrides === null || overrides === void 0 ? void 0 : overrides.anthropic) && !(overrides === null || overrides === void 0 ? void 0 : overrides.gemini) && !(overrides === null || overrides === void 0 ? void 0 : overrides.openai))
4983
5030
  return DEFAULT_AI_TIERS;
4984
5031
  return Object.freeze({
4985
5032
  anthropic: mergeVendor(DEFAULT_AI_TIERS.anthropic, overrides.anthropic),
4986
- gemini: mergeVendor(DEFAULT_AI_TIERS.gemini, overrides.gemini)
5033
+ gemini: mergeVendor(DEFAULT_AI_TIERS.gemini, overrides.gemini),
5034
+ openai: mergeVendor(DEFAULT_AI_TIERS.openai, overrides.openai)
4987
5035
  });
4988
5036
  }
4989
5037
  function mergeVendor(defaults, overrides) {