@genesislcap/ai-assistant 15.107.0 → 15.109.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 +410 -4
- package/dist/ai-assistant.d.ts +121 -2
- package/dist/chat-driver.cjs +69 -18
- package/dist/chat-driver.cjs.map +2 -2
- package/dist/chat-driver.mjs +69 -18
- package/dist/chat-driver.mjs.map +2 -2
- package/dist/custom-elements.json +787 -578
- package/dist/dts/chat-driver-node.d.ts +1 -1
- package/dist/dts/chat-driver-node.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/chat-driver.d.ts +9 -0
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +2 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
- package/dist/dts/components/settings-modal/settings-modal.d.ts +2 -0
- package/dist/dts/components/settings-modal/settings-modal.d.ts.map +1 -1
- package/dist/dts/components/settings-modal/settings-modal.styles.d.ts.map +1 -1
- package/dist/dts/components/settings-modal/settings-modal.template.d.ts +1 -0
- package/dist/dts/components/settings-modal/settings-modal.template.d.ts.map +1 -1
- package/dist/dts/genesis/config.d.ts.map +1 -1
- package/dist/dts/genesis/register-genesis-assistant.d.ts +24 -0
- package/dist/dts/genesis/register-genesis-assistant.d.ts.map +1 -1
- package/dist/dts/genesis/types.d.ts +8 -2
- package/dist/dts/genesis/types.d.ts.map +1 -1
- package/dist/dts/genesis/vendor-follower.d.ts +86 -0
- package/dist/dts/genesis/vendor-follower.d.ts.map +1 -0
- package/dist/dts/genesis/vendor-pick.d.ts +36 -0
- package/dist/dts/genesis/vendor-pick.d.ts.map +1 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/main/budget-controller.d.ts +6 -0
- package/dist/dts/main/budget-controller.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +30 -0
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/vendor-picker-controller.d.ts +89 -0
- package/dist/dts/main/vendor-picker-controller.d.ts.map +1 -0
- package/dist/dts/provider/ai-provider-switcher.d.ts +22 -1
- package/dist/dts/provider/ai-provider-switcher.d.ts.map +1 -1
- package/dist/dts/provider/tiered-provider-switcher.d.ts +39 -2
- package/dist/dts/provider/tiered-provider-switcher.d.ts.map +1 -1
- package/dist/esm/chat-driver-node.js +1 -1
- package/dist/esm/components/chat-driver/chat-driver.js +3 -2
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +1 -0
- package/dist/esm/components/settings-modal/settings-modal.js +4 -1
- package/dist/esm/components/settings-modal/settings-modal.styles.js +59 -0
- package/dist/esm/components/settings-modal/settings-modal.template.js +54 -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 +72 -7
- package/dist/esm/genesis/vendor-follower.js +149 -0
- package/dist/esm/genesis/vendor-pick.js +67 -0
- package/dist/esm/main/budget-controller.js +11 -9
- package/dist/esm/main/main.js +57 -0
- package/dist/esm/main/vendor-picker-controller.js +141 -0
- package/dist/esm/provider/tiered-provider-switcher.js +54 -1
- 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 +37 -3
- package/package.json +17 -17
- package/scripts/smoke-genesis-consumes-node.mjs +1 -1
package/dist/chat-driver.mjs
CHANGED
|
@@ -4822,35 +4822,50 @@ var MutableAIProviderRegistry = class _MutableAIProviderRegistry {
|
|
|
4822
4822
|
|
|
4823
4823
|
// ../../foundation-ai/dist/esm/tiers/ai-tiers.js
|
|
4824
4824
|
var AI_TIER_IDS = ["low", "high", "reasoning"];
|
|
4825
|
-
var AI_TIER_VENDORS = ["anthropic", "gemini"];
|
|
4825
|
+
var AI_TIER_VENDORS = ["anthropic", "gemini", "openai"];
|
|
4826
4826
|
var AI_STALL_TIMEOUT_MS = 6e4;
|
|
4827
4827
|
var AI_NO_RESPONSE_TIMEOUT_MS = 3e5;
|
|
4828
4828
|
var DEFAULT_AI_TIERS = Object.freeze({
|
|
4829
|
+
// The Claude 5.5 family, as Genesis Create runs it (GENC-1665). All three think by default and
|
|
4830
|
+
// replay that thinking under preserved thinking, so the transport sends `thinking.block_binding`
|
|
4831
|
+
// and its `anthropic-beta: thinking-binding-controls-2026-08-01` header on every adaptive turn,
|
|
4832
|
+
// through a `serverEndpoint` too: a proxy in front of these tiers has to forward that header,
|
|
4833
|
+
// or each such turn is a 400. Every model here has a documented 128K output ceiling.
|
|
4829
4834
|
anthropic: Object.freeze({
|
|
4835
|
+
// A lighter-loop tier that never emits a whole file. 32K rather than Haiku 4.5's 16K because
|
|
4836
|
+
// Haiku 5.5 thinks by default (effort `medium`) and bills that thinking out of `max_tokens`,
|
|
4837
|
+
// where 4.5 did not think and 16K was all answer. $0.10 / $0.50 per MTok up to 100K prompt
|
|
4838
|
+
// tokens ($0.50 / $2.50 above), against Haiku 4.5's $1 / $5.
|
|
4830
4839
|
low: Object.freeze({
|
|
4831
|
-
model: "claude-haiku-
|
|
4832
|
-
maxTokens:
|
|
4840
|
+
model: "claude-haiku-5-5",
|
|
4841
|
+
maxTokens: 32e3,
|
|
4833
4842
|
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4834
4843
|
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4835
4844
|
}),
|
|
4836
|
-
// The heavy tier: whole-file writes, and adaptive thinking out of the same budget
|
|
4837
|
-
//
|
|
4838
|
-
//
|
|
4845
|
+
// The heavy tier: whole-file writes, and adaptive thinking out of the same budget wherever a
|
|
4846
|
+
// caller leaves thinking on — hence the full 128K ceiling rather than a figure that only fits
|
|
4847
|
+
// one of the two. A `thinkingPolicy: 'off'` turn spends all of it on output: Sonnet 5.5
|
|
4848
|
+
// rejects `disabled`, so the transport turns thinking off with `between_tools` (short progress
|
|
4849
|
+
// notes between tool calls, no extended thinking, and no `block_binding`, which it rejects).
|
|
4850
|
+
// Same $2 / $10 as Sonnet 5, cache reads at $0.10. It rejects a forced `tool_choice`; the
|
|
4851
|
+
// transport downgrades one to `auto` plus an instruction.
|
|
4839
4852
|
high: Object.freeze({
|
|
4840
|
-
model: "claude-sonnet-5",
|
|
4853
|
+
model: "claude-sonnet-5-5",
|
|
4841
4854
|
maxTokens: 128e3,
|
|
4842
4855
|
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4843
4856
|
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4844
4857
|
}),
|
|
4845
|
-
//
|
|
4846
|
-
// `
|
|
4847
|
-
//
|
|
4848
|
-
//
|
|
4849
|
-
//
|
|
4850
|
-
//
|
|
4858
|
+
// Judgement calls rather than whole-file writes, but Opus 5.5 ALWAYS thinks (`disabled` is a
|
|
4859
|
+
// 400 at every effort; `'off'` drops it to effort `low` instead) and the thinking comes out of
|
|
4860
|
+
// this same budget before the answer is written. Opus 4.8's 32K was sized for a model that did
|
|
4861
|
+
// not think unless asked; Create saw a thinking reasoning tier spend all of 32K and end at
|
|
4862
|
+
// `max_tokens` with no tool call (GENC-1789), so this gets the full 128K. `max_tokens` is only
|
|
4863
|
+
// a cap: a turn that stops short of it bills nothing extra. Cheaper than Opus 4.8 ($4 / $20
|
|
4864
|
+
// against $5 / $25), with native structured output, and like Sonnet 5.5 it rejects a forced
|
|
4865
|
+
// `tool_choice`.
|
|
4851
4866
|
reasoning: Object.freeze({
|
|
4852
|
-
model: "claude-opus-
|
|
4853
|
-
maxTokens:
|
|
4867
|
+
model: "claude-opus-5-5",
|
|
4868
|
+
maxTokens: 128e3,
|
|
4854
4869
|
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4855
4870
|
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4856
4871
|
})
|
|
@@ -4878,14 +4893,47 @@ var DEFAULT_AI_TIERS = Object.freeze({
|
|
|
4878
4893
|
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4879
4894
|
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4880
4895
|
})
|
|
4896
|
+
}),
|
|
4897
|
+
// NOT BENCHED. Proposed defaults picked by price and capability tier alone, so that a
|
|
4898
|
+
// generated app can name `vendor: 'openai'` at all; they have not been through the ui-builder
|
|
4899
|
+
// bench the Anthropic and Gemini rows came out of. Run that bench before treating these as a
|
|
4900
|
+
// platform decision, and move any row it disagrees with.
|
|
4901
|
+
//
|
|
4902
|
+
// No `maxTokens` on any row: `max_output_tokens` is optional on the Responses API and the
|
|
4903
|
+
// transport omits it when unset, so the model's own ceiling applies and a whole-file write is
|
|
4904
|
+
// not truncated the way Anthropic's 4096 default would truncate it.
|
|
4905
|
+
openai: Object.freeze({
|
|
4906
|
+
// The cheapest GPT-6 tier ($0.10 / $0.50), and one of the two that accepts reasoning
|
|
4907
|
+
// effort `none`, so a caller that turns thinking off gets no reasoning at all.
|
|
4908
|
+
low: Object.freeze({
|
|
4909
|
+
model: "gpt-6-luna",
|
|
4910
|
+
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4911
|
+
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4912
|
+
}),
|
|
4913
|
+
// $1 / $5, and it also accepts effort `none`, so tool loops that turn thinking off are not
|
|
4914
|
+
// forced to pay for it.
|
|
4915
|
+
high: Object.freeze({
|
|
4916
|
+
model: "gpt-6.1-terra",
|
|
4917
|
+
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4918
|
+
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4919
|
+
}),
|
|
4920
|
+
// $2 / $10 rather than gpt-6-astra's $10 / $50. It cannot turn reasoning off (`off` runs at
|
|
4921
|
+
// effort `low`), which suits a tier asked for judgement calls. Its transport warns on every
|
|
4922
|
+
// construction that it is the dearer model; that warning is expected here.
|
|
4923
|
+
reasoning: Object.freeze({
|
|
4924
|
+
model: "gpt-6.1-sol",
|
|
4925
|
+
stallTimeoutMs: AI_STALL_TIMEOUT_MS,
|
|
4926
|
+
timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
|
|
4927
|
+
})
|
|
4881
4928
|
})
|
|
4882
4929
|
});
|
|
4883
4930
|
function resolveAITiers(overrides) {
|
|
4884
|
-
if (!(overrides === null || overrides === void 0 ? void 0 : overrides.anthropic) && !(overrides === null || overrides === void 0 ? void 0 : overrides.gemini))
|
|
4931
|
+
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))
|
|
4885
4932
|
return DEFAULT_AI_TIERS;
|
|
4886
4933
|
return Object.freeze({
|
|
4887
4934
|
anthropic: mergeVendor(DEFAULT_AI_TIERS.anthropic, overrides.anthropic),
|
|
4888
|
-
gemini: mergeVendor(DEFAULT_AI_TIERS.gemini, overrides.gemini)
|
|
4935
|
+
gemini: mergeVendor(DEFAULT_AI_TIERS.gemini, overrides.gemini),
|
|
4936
|
+
openai: mergeVendor(DEFAULT_AI_TIERS.openai, overrides.openai)
|
|
4889
4937
|
});
|
|
4890
4938
|
}
|
|
4891
4939
|
function mergeVendor(defaults, overrides) {
|
|
@@ -8481,6 +8529,7 @@ var ChatDriver = class _ChatDriver extends EventTarget {
|
|
|
8481
8529
|
deferAgentRelease = false,
|
|
8482
8530
|
activityBus = NOOP_ACTIVITY_BUS,
|
|
8483
8531
|
budgetExhaustedMessage,
|
|
8532
|
+
vendorSwitchPlace = "in Settings",
|
|
8484
8533
|
providerRefusedMessage,
|
|
8485
8534
|
aiServiceErrorMessages
|
|
8486
8535
|
} = config;
|
|
@@ -8490,6 +8539,7 @@ var ChatDriver = class _ChatDriver extends EventTarget {
|
|
|
8490
8539
|
this.deferAgentRelease = deferAgentRelease;
|
|
8491
8540
|
this.activityBus = activityBus;
|
|
8492
8541
|
this.budgetExhaustedMessageOverride = budgetExhaustedMessage;
|
|
8542
|
+
this.vendorSwitchPlace = vendorSwitchPlace;
|
|
8493
8543
|
this.providerRefusedMessageOverride = providerRefusedMessage;
|
|
8494
8544
|
this.aiServiceErrorMessagesOverride = aiServiceErrorMessages;
|
|
8495
8545
|
if (typeof toolHandlers === "function") {
|
|
@@ -8691,7 +8741,7 @@ var ChatDriver = class _ChatDriver extends EventTarget {
|
|
|
8691
8741
|
if (this.budgetExhaustedMessageOverride != null) return this.budgetExhaustedMessageOverride;
|
|
8692
8742
|
if (wall?.otherVendorAvailable !== true) return TURN_FAILURE_EXITS.budgetExhausted.copy;
|
|
8693
8743
|
const subject = wall?.vendorLabel ? `${wall.vendorLabel}'s AI usage limit` : "your AI usage limit";
|
|
8694
|
-
return `You've reached ${subject}. Switch to another AI provider
|
|
8744
|
+
return `You've reached ${subject}. Switch to another AI provider ${this.vendorSwitchPlace} to keep going, or contact your administrator to raise it.`;
|
|
8695
8745
|
}
|
|
8696
8746
|
/**
|
|
8697
8747
|
* Record a message the user sent and then stopped before any turn took it: during an
|
|
@@ -11678,6 +11728,7 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
|
|
|
11678
11728
|
sessionKey: options.sessionKey ?? "",
|
|
11679
11729
|
activityBus: options.activityBus,
|
|
11680
11730
|
budgetExhaustedMessage: options.budgetExhaustedMessage,
|
|
11731
|
+
vendorSwitchPlace: options.vendorSwitchPlace,
|
|
11681
11732
|
aiServiceErrorMessages: options.aiServiceErrorMessages,
|
|
11682
11733
|
// A release can hand back to a waiting caller, so this driver acts on the flag itself.
|
|
11683
11734
|
deferAgentRelease: true
|