@genesislcap/ai-assistant 15.14.0 → 15.14.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.
- package/dist/ai-assistant.api.json +37 -1
- package/dist/ai-assistant.d.ts +55 -0
- package/dist/chat-driver.cjs +285 -9
- package/dist/chat-driver.cjs.map +3 -3
- package/dist/chat-driver.mjs +282 -9
- package/dist/chat-driver.mjs.map +3 -3
- package/dist/custom-elements.json +101 -3
- 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 +54 -0
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/chat-driver.test.d.ts.map +1 -1
- package/dist/esm/chat-driver-node.js +9 -1
- package/dist/esm/components/chat-driver/chat-driver.js +154 -22
- package/dist/esm/components/chat-driver/chat-driver.test.js +210 -1
- package/dist/esm/state/debug-event-log.js +1 -1
- package/dist/esm/state/debug-event-log.test.js +2 -0
- package/docs/migration-GENC-1506.md +209 -0
- package/package.json +17 -17
- package/src/chat-driver-node.ts +10 -0
- package/src/components/chat-driver/chat-driver.test.ts +294 -0
- package/src/components/chat-driver/chat-driver.ts +215 -9
- package/src/state/debug-event-log.test.ts +2 -0
- package/src/state/debug-event-log.ts +1 -1
|
@@ -119,6 +119,30 @@
|
|
|
119
119
|
"package": "@genesislcap/foundation-ai"
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
|
+
{
|
|
123
|
+
"kind": "js",
|
|
124
|
+
"name": "DEFAULT_PROVIDER_REFUSED_MESSAGE",
|
|
125
|
+
"declaration": {
|
|
126
|
+
"name": "DEFAULT_PROVIDER_REFUSED_MESSAGE",
|
|
127
|
+
"package": "@genesislcap/foundation-ai"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"kind": "js",
|
|
132
|
+
"name": "PROVIDER_REFUSED_CODE",
|
|
133
|
+
"declaration": {
|
|
134
|
+
"name": "PROVIDER_REFUSED_CODE",
|
|
135
|
+
"package": "@genesislcap/foundation-ai"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"kind": "js",
|
|
140
|
+
"name": "ProviderRefusedError",
|
|
141
|
+
"declaration": {
|
|
142
|
+
"name": "ProviderRefusedError",
|
|
143
|
+
"package": "@genesislcap/foundation-ai"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
122
146
|
{
|
|
123
147
|
"kind": "js",
|
|
124
148
|
"name": "isObservableAIProviderRegistry",
|
|
@@ -4943,7 +4967,7 @@
|
|
|
4943
4967
|
"type": {
|
|
4944
4968
|
"text": "readonly string[]"
|
|
4945
4969
|
},
|
|
4946
|
-
"default": "[\n 'This is an exported debug log for the Genesis AI assistant. Read it top-to-bottom.',\n \"`sessionUsage` is what this session spent: `costUsd` (USD, provider-reported per request and summed, cache discounts already applied) plus the four TOKEN BUCKETS — `uncachedInputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `outputTokens`. Those four are disjoint and safe to add up for a total-tokens figure; the per-message fields further down are NOT (see kind:'message'). Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a big token count against a small cost means the prompt was mostly cache hits, not a missing charge. It covers sub-agent turns and spend a compaction banked, so for the CONVERSATION it is the authoritative total: prefer it over re-summing the timeline, which can be short by whatever the ring buffers evicted. The same figures appear under `meta.context`. It is as current as the snapshot it came from: the assistant's own download stamps a fresh one, but a log stitched by another tool can carry an older one — compare `meta.timestamp` with the last timeline entry, and if it is well behind, read these totals as historical and fall back to summing the timeline. One scope caveat: it is derived from the transcript, so it excludes billed calls that produced no message (a blank or refused attempt that was retried — see kind:'turn'.`usage`). Summing the turns can therefore come out HIGHER than this, and the difference is exactly that discarded spend, not a double-count.\",\n \"What 'session' means for those figures: the CURRENT conversation under this session key (a host-supplied per-project id, or the element id + header title when the host supplies none) — which is not necessarily everything in `timeline`. It is re-derived from the live transcript, so it spans page loads only when the chat is being remembered, and a Clear resets it to zero. `timeline` is append-only regardless: it keeps every page load and the pre-Clear conversation, with the session.cleared event as the boundary. So on a long-lived log, read these totals as the latest conversation's and the earlier sections as history — not as a total of the whole file.\",\n '`timeline` is the entire session as one array, already sorted chronologically by `timestamp` (ISO 8601). Every entry has a `kind`.',\n 'Timestamps are millisecond-resolution; entries that share the same millisecond are ordered by a fixed kind rank (event, then turn, then message), which is a heuristic and may not reflect exact causal order within that millisecond — e.g. a user message and the turn it triggered, or a final assistant message and its turn.end event, can appear in either order depending on whether they landed in the same millisecond. Read the logical structure of a turn rather than over-interpreting the micro-ordering of co-timestamped entries of different kinds.',\n \"kind:'message' — the conversation. `role` is user/assistant/tool/system-event/synthetic-user; `agentName` says which agent produced it; `toolCalls`/`toolResult`/`interaction` carry tool and widget activity; `inputTokens`/`outputTokens`/`cost` are per-message LLM usage, where `inputTokens` is the WHOLE prompt for that request and `cacheReadTokens`/`cacheWriteTokens` BREAK IT DOWN rather than add to it — uncached input is `inputTokens` minus those two, and adding the cache fields to `inputTokens` counts the prompt twice. The cache fields are absent on providers that report no cache split (Gemini reports reads only, since implicit caching bills no write) and on messages persisted before they existed, so read them as 0 when missing. Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a large token count at a small cost means the prompt was mostly cache hits. `externalCostUsd` is any non-LLM cost a widget reported for its own external service calls (folded into the session cost total alongside `cost`). On model-produced assistant messages, `model` is the concrete model id that generated it (e.g. 'gemini-2.5-flash-lite') and `providerName` is the registry slot it resolved under (e.g. a tier name like 'high'/'low', or the default); together they attribute the message — and any tool calls it carries — to an exact model even across a mid-session vendor/tier switch, where one slot name can map to different models before and after the switch. Both are undefined on any entry that is NOT an LLM response: non-assistant roles (user/tool/system-event) and 'synthetic-user' echoes; assistant interaction/widget entries (empty content carrying an `interaction` — a rendered widget, not a model turn); driver-authored assistant fallbacks (the timeout, repeated-malformed-call, and empty-response apology messages); and messages restored from a session persisted before these fields existed. One partial case: on a genuine model turn whose provider exposes no `getStatus` (or reports no model), `providerName` is still set but `model` alone is undefined. A 'synthetic-user' message is a display-only echo of an interaction outcome (e.g. the answer a widget reported): it renders on the user's side of the chat and `agentName` is the agent that created it, but it is never sent to the LLM — so it has no matching 'turn' and the model learns the outcome only from the corresponding tool result.\",\n \"Sub-agent messages appear inline. When a tool delegates to a sub-agent (via `requestSubAgent`), the sub-agent's whole conversation — its own assistant/tool messages, each with their own `content`/`thinking`/`toolCalls`/`toolResult` and per-message `model`/`providerName`/`inputTokens`/`outputTokens`/`cacheReadTokens`/`cacheWriteTokens`/`cost` — is hoisted into the timeline as ordinary kind:'message' entries, interleaved by timestamp right after the tool call that spawned them (so you read the delegation top-to-bottom). A hoisted entry is marked: `subAgentDepth` is its delegation depth (1 for a sub-agent, 2 for a sub-agent's sub-agent, …), `subAgentOf` is the id of the parent tool call that spawned it (correlates it back even when two sub-agents run in one parent turn), `subAgentName` is the sub-agent's own name, and `agentName` is rewritten to a `\\\"<parent> › <sub-agent>\\\"` breadcrumb (composing when nested, e.g. `\\\"UI Builder › Planner › Grounding\\\"`). The sub-agent's per-LLM-call snapshots also surface as kind:'turn' entries with an N-M `turnIndex`, and subagent.started/completed (or subagent.failed) events bracket the run. Per-message `cost` on hoisted entries is already part of the session total (it is summed from the un-flattened history), so summing the top-level timeline does NOT double-count.\",\n \"kind:'turn' — one LLM call. `turnIndex` is a string: a top-level turn is the bare counter ('0', '1', …); a sub-agent's turns are numbered under the parent turn that activated them ('3-1', '3-2', …, and a nested sub-agent contributes '3-2-1', …), and `agentName` names the agent that ran the turn. `systemPrompt` and `toolNames` are what the model saw. A systemPrompt of '<repeated — identical to turn N>' was byte-identical to turn N and de-duplicated; the full prompt is shown whenever it changes (often because a stateful agent advanced), so prompt evolution is visible.\",\n \"kind:'turn'.`model`/`providerName`/`provider` — which model ran that call: the concrete model id, the registry slot it resolved under (a tier name like 'high'/'low', or the default), and the vendor. Recorded per CALL, so an agent whose `provider` selector varies by state — a flow that plans on a high tier and executes on a low one — has every step attributed, including calls that produced no message. `model` is the SERVING model where the provider reports one, so a turn answered by a server-side fallback names the model that answered rather than the one requested; it always matches the `model` on the message that call produced. Absent when the provider exposes no `getStatus` and the transport stamped nothing.\",\n \"kind:'turn'.`usage` — what that ONE call cost, in the same four-bucket + `costUsd` shape as `sessionUsage`. Absent while a call is in flight and on providers that report no usage. This is the SAME money as the message the call produced, not extra money: never add turn usage to message usage, and read a turn plus its message as one charge. Its distinct value is the calls that produced NO message — a blank or refused response is billed and then discarded before the retry, so the turn entry is the only record of that spend, and a turn with `usage` but no message after it is exactly that. `costUsd: 0` alongside a nonzero token count means the provider reported no price, not that the call was free.\",\n \"kind:'turn'.`agentSnapshot` — the active agent's own view of its internal state, captured at that turn. An agent opts into this by exposing a `getDebugSnapshot()` that returns JSON-serializable per-state info; stateful/flow agents wire it automatically, so you can watch a flow advance turn-by-turn (e.g. current step, cursor, collected fields, pending changes). Absent for agents that don't expose one.\",\n \"kind:'event' — a meta/lifecycle event. `type` names it (see below); `detail` carries structured data. `detail.placement` is the emitting UI instance: 'bubble' (collapsed), 'panel' (popped-out), or 'standalone'.\",\n \"Each 'event' also has an `importance`: 'high' (failures/limits — turn.error, tool.failed, subagent.failed, file.read-failed, suggestions.failed, context.threshold-crossed), 'normal' (session flow — connects, turns, retries, handoffs, agent/provider changes, interactions, sub-agent start/complete), or 'low' (skippable UI/bookkeeping noise — panel.toggled, attachment.added, driver.wired/unwired, context.updated, context.condensed). To skim, ignore importance:'low'; to triage a failure, filter to importance:'high' then read the nearby messages and turns. A 'high' turn.error is often preceded by one or more 'normal' turn.retry events for the same reason — read them together to see how many attempts were made before bailing. 'message' and 'turn' entries carry no importance — they are the substance, always read them.\",\n 'Event types: assistant.connected/disconnected (mount + placement + whether the session was created or restored), assistant.popout/popin (window placement), driver.created/wired/unwired (which driver is live and why it stops/starts responding across a popout), state.changed (idle↔loading), turn.start/turn.end (turn boundary; turn.end carries durationMs), turn.retry (a recoverable in-turn retry — detail.reason plus attempt/maxAttempts; for malformed calls also finishMessage; for empty responses also the provider finishReason + thoughtsTokens + parts breakdown), turn.error (a turn failed or hit a guardrail — detail.reason is one of exception/malformed-function-call/empty-response/unknown-tool-limit/max-iterations/response-truncated/refusal/budget-exhausted, plus reason-specific diagnostics: attempts (for empty-response also finishReason + thoughtsTokens + a parts breakdown, distinguishing a thinking-only STOP from a truly empty turn), finishMessage, for response-truncated the model + maxTokens + outputTokens + tools, unknownTools (split into staleTools — real earlier this activation but retired by the current state or hidden behind an open exclusive fold — and hallucinatedTools — never advertised) + availableTools, iterations + limit, for budget-exhausted the budgetUsd + spentUsd figures reported by the proxy plus the resolved vendor, or name + message for exceptions), tool.failed (a tool threw), tool.unresolved (the model called a tool that could not be dispatched — detail.kind is folded/fold-hidden/stale/unknown, plus tool + agent and, for the counted kinds, the consecutive streak; the recurring lead-up to an unknown-tool-limit turn.error), subagent.started/completed/failed (the lifecycle of a `requestSubAgent` delegation — detail.agent names the sub-agent; these bracket the sub-agent turns that appear as kind:turn entries with an N-M `turnIndex`; subagent.failed also carries detail.reason, one of max_iterations/malformed_tool_call/empty_response/unknown_tool_limit/timeout/response_truncated/refusal/budget_exhausted; budget_exhausted is terminal for the PARENT turn too — the parent stops rather than calling the model again into the same wall), agent.handoff (routing; from=null is the initial activation), agent.pinned/unpinned (forced routing), provider.selected (the resolved provider for the upcoming turns — detail.provider is the registry SLOT/tier name, detail.model the concrete model behind it and detail.vendor its vendor; emitted only when the slot CHANGES, so read the per-turn `model` for the model of any given call rather than assuming the nearest event still applies), interaction.requested/resolved (blocking user widgets — explain quiet gaps; note that when a sub-agent opens a widget, detail.agent — and the agentName on the interaction message — is the HOST agent that owns the widget, NOT the sub-agent that asked, because widgets render and resolve on the host driver), context.updated/threshold-crossed (token + cost), context.condensed (a stale tool payload was collapsed out of the model-bound history by a `condenseWhen` declaration on the tool — detail.tool + toolCallId, target args|response, trigger (superseded:<key> or age:<n>), stubLen, and an estimated tokensSaved; stored history and this log keep the FULL payload, so the model-visible slice at any point is the full history minus the condensations recorded up to then), panel.toggled, attachment.added, file.read-failed, suggestions.failed.',\n 'Sub-agent meta events: a sub-agent\\'s own turn.retry/turn.error/tool.failed/tool.unresolved events are merged into this same timeline, tagged with `detail.subAgent` — a `\"<parent> › <sub-agent>\"` breadcrumb that composes when nested (e.g. `\"UI Builder › Planner › Grounding\"`) — and interleaved by their original timestamps within the subagent.started→completed/failed bracket. These are the per-attempt/per-failure signals that do NOT appear among the sub-agent\\'s (hoisted) messages: a malformed/empty attempt that gets retried produces no message, and the stale-vs-hallucinated split and streak counts live only on the event. A sub-agent\\'s high-volume, message-derivable events (turn.start/turn.end, provider.selected, context.updated) are intentionally NOT merged — read its hoisted messages for model/tokens/cost and turn-by-turn activity, and the bracketing subagent.* events for the run\\'s span.',\n \"`meta` holds context captured at export time: agentSummary (full agent configs), context (active model, contextTokens/contextLimit/contextUsagePercent for the last call, and the session totals — sessionCostUsd, sessionTokensConsumed, and the four-bucket sessionUsage lifted to the top of this log), activeDebugSnapshot (the active agent's `getDebugSnapshot()` taken fresh at export — reflects state NOW, which may have advanced beyond the last turn's agentSnapshot), debug (optional host-supplied debug state), host, and the export timestamp.\",\n 'Note the two different scopes in `meta.context`: `contextTokens` is the prompt size of the LAST call (against `contextLimit`, the model context window), while `sessionUsage`/`sessionTokensConsumed` are cumulative BILLED throughput. Every turn resends the conversation, so the cumulative figure counts each turn’s prompt again in the next turn’s and is expected to dwarf the context size — that is not double-counting.',\n 'To debug a failure: find the last turn.error or tool.failed, then read upward for the user message, the turn(s), and the agent/provider/state events that led into it.',\n]",
|
|
4970
|
+
"default": "[\n 'This is an exported debug log for the Genesis AI assistant. Read it top-to-bottom.',\n \"`sessionUsage` is what this session spent: `costUsd` (USD, provider-reported per request and summed, cache discounts already applied) plus the four TOKEN BUCKETS — `uncachedInputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `outputTokens`. Those four are disjoint and safe to add up for a total-tokens figure; the per-message fields further down are NOT (see kind:'message'). Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a big token count against a small cost means the prompt was mostly cache hits, not a missing charge. It covers sub-agent turns and spend a compaction banked, so for the CONVERSATION it is the authoritative total: prefer it over re-summing the timeline, which can be short by whatever the ring buffers evicted. The same figures appear under `meta.context`. It is as current as the snapshot it came from: the assistant's own download stamps a fresh one, but a log stitched by another tool can carry an older one — compare `meta.timestamp` with the last timeline entry, and if it is well behind, read these totals as historical and fall back to summing the timeline. One scope caveat: it is derived from the transcript, so it excludes billed calls that produced no message (a blank or refused attempt that was retried — see kind:'turn'.`usage`). Summing the turns can therefore come out HIGHER than this, and the difference is exactly that discarded spend, not a double-count.\",\n \"What 'session' means for those figures: the CURRENT conversation under this session key (a host-supplied per-project id, or the element id + header title when the host supplies none) — which is not necessarily everything in `timeline`. It is re-derived from the live transcript, so it spans page loads only when the chat is being remembered, and a Clear resets it to zero. `timeline` is append-only regardless: it keeps every page load and the pre-Clear conversation, with the session.cleared event as the boundary. So on a long-lived log, read these totals as the latest conversation's and the earlier sections as history — not as a total of the whole file.\",\n '`timeline` is the entire session as one array, already sorted chronologically by `timestamp` (ISO 8601). Every entry has a `kind`.',\n 'Timestamps are millisecond-resolution; entries that share the same millisecond are ordered by a fixed kind rank (event, then turn, then message), which is a heuristic and may not reflect exact causal order within that millisecond — e.g. a user message and the turn it triggered, or a final assistant message and its turn.end event, can appear in either order depending on whether they landed in the same millisecond. Read the logical structure of a turn rather than over-interpreting the micro-ordering of co-timestamped entries of different kinds.',\n \"kind:'message' — the conversation. `role` is user/assistant/tool/system-event/synthetic-user; `agentName` says which agent produced it; `toolCalls`/`toolResult`/`interaction` carry tool and widget activity; `inputTokens`/`outputTokens`/`cost` are per-message LLM usage, where `inputTokens` is the WHOLE prompt for that request and `cacheReadTokens`/`cacheWriteTokens` BREAK IT DOWN rather than add to it — uncached input is `inputTokens` minus those two, and adding the cache fields to `inputTokens` counts the prompt twice. The cache fields are absent on providers that report no cache split (Gemini reports reads only, since implicit caching bills no write) and on messages persisted before they existed, so read them as 0 when missing. Each bucket bills at a different rate — cache reads a fraction of uncached input, cache writes a premium, output highest — so a large token count at a small cost means the prompt was mostly cache hits. `externalCostUsd` is any non-LLM cost a widget reported for its own external service calls (folded into the session cost total alongside `cost`). On model-produced assistant messages, `model` is the concrete model id that generated it (e.g. 'gemini-2.5-flash-lite') and `providerName` is the registry slot it resolved under (e.g. a tier name like 'high'/'low', or the default); together they attribute the message — and any tool calls it carries — to an exact model even across a mid-session vendor/tier switch, where one slot name can map to different models before and after the switch. Both are undefined on any entry that is NOT an LLM response: non-assistant roles (user/tool/system-event) and 'synthetic-user' echoes; assistant interaction/widget entries (empty content carrying an `interaction` — a rendered widget, not a model turn); driver-authored assistant fallbacks (the timeout, repeated-malformed-call, and empty-response apology messages); and messages restored from a session persisted before these fields existed. One partial case: on a genuine model turn whose provider exposes no `getStatus` (or reports no model), `providerName` is still set but `model` alone is undefined. A 'synthetic-user' message is a display-only echo of an interaction outcome (e.g. the answer a widget reported): it renders on the user's side of the chat and `agentName` is the agent that created it, but it is never sent to the LLM — so it has no matching 'turn' and the model learns the outcome only from the corresponding tool result.\",\n \"Sub-agent messages appear inline. When a tool delegates to a sub-agent (via `requestSubAgent`), the sub-agent's whole conversation — its own assistant/tool messages, each with their own `content`/`thinking`/`toolCalls`/`toolResult` and per-message `model`/`providerName`/`inputTokens`/`outputTokens`/`cacheReadTokens`/`cacheWriteTokens`/`cost` — is hoisted into the timeline as ordinary kind:'message' entries, interleaved by timestamp right after the tool call that spawned them (so you read the delegation top-to-bottom). A hoisted entry is marked: `subAgentDepth` is its delegation depth (1 for a sub-agent, 2 for a sub-agent's sub-agent, …), `subAgentOf` is the id of the parent tool call that spawned it (correlates it back even when two sub-agents run in one parent turn), `subAgentName` is the sub-agent's own name, and `agentName` is rewritten to a `\\\"<parent> › <sub-agent>\\\"` breadcrumb (composing when nested, e.g. `\\\"UI Builder › Planner › Grounding\\\"`). The sub-agent's per-LLM-call snapshots also surface as kind:'turn' entries with an N-M `turnIndex`, and subagent.started/completed (or subagent.failed) events bracket the run. Per-message `cost` on hoisted entries is already part of the session total (it is summed from the un-flattened history), so summing the top-level timeline does NOT double-count.\",\n \"kind:'turn' — one LLM call. `turnIndex` is a string: a top-level turn is the bare counter ('0', '1', …); a sub-agent's turns are numbered under the parent turn that activated them ('3-1', '3-2', …, and a nested sub-agent contributes '3-2-1', …), and `agentName` names the agent that ran the turn. `systemPrompt` and `toolNames` are what the model saw. A systemPrompt of '<repeated — identical to turn N>' was byte-identical to turn N and de-duplicated; the full prompt is shown whenever it changes (often because a stateful agent advanced), so prompt evolution is visible.\",\n \"kind:'turn'.`model`/`providerName`/`provider` — which model ran that call: the concrete model id, the registry slot it resolved under (a tier name like 'high'/'low', or the default), and the vendor. Recorded per CALL, so an agent whose `provider` selector varies by state — a flow that plans on a high tier and executes on a low one — has every step attributed, including calls that produced no message. `model` is the SERVING model where the provider reports one, so a turn answered by a server-side fallback names the model that answered rather than the one requested; it always matches the `model` on the message that call produced. Absent when the provider exposes no `getStatus` and the transport stamped nothing.\",\n \"kind:'turn'.`usage` — what that ONE call cost, in the same four-bucket + `costUsd` shape as `sessionUsage`. Absent while a call is in flight and on providers that report no usage. This is the SAME money as the message the call produced, not extra money: never add turn usage to message usage, and read a turn plus its message as one charge. Its distinct value is the calls that produced NO message — a blank or refused response is billed and then discarded before the retry, so the turn entry is the only record of that spend, and a turn with `usage` but no message after it is exactly that. `costUsd: 0` alongside a nonzero token count means the provider reported no price, not that the call was free.\",\n \"kind:'turn'.`agentSnapshot` — the active agent's own view of its internal state, captured at that turn. An agent opts into this by exposing a `getDebugSnapshot()` that returns JSON-serializable per-state info; stateful/flow agents wire it automatically, so you can watch a flow advance turn-by-turn (e.g. current step, cursor, collected fields, pending changes). Absent for agents that don't expose one.\",\n \"kind:'event' — a meta/lifecycle event. `type` names it (see below); `detail` carries structured data. `detail.placement` is the emitting UI instance: 'bubble' (collapsed), 'panel' (popped-out), or 'standalone'.\",\n \"Each 'event' also has an `importance`: 'high' (failures/limits — turn.error, tool.failed, subagent.failed, file.read-failed, suggestions.failed, context.threshold-crossed), 'normal' (session flow — connects, turns, retries, handoffs, agent/provider changes, interactions, sub-agent start/complete), or 'low' (skippable UI/bookkeeping noise — panel.toggled, attachment.added, driver.wired/unwired, context.updated, context.condensed). To skim, ignore importance:'low'; to triage a failure, filter to importance:'high' then read the nearby messages and turns. A 'high' turn.error is often preceded by one or more 'normal' turn.retry events for the same reason — read them together to see how many attempts were made before bailing. 'message' and 'turn' entries carry no importance — they are the substance, always read them.\",\n 'Event types: assistant.connected/disconnected (mount + placement + whether the session was created or restored), assistant.popout/popin (window placement), driver.created/wired/unwired (which driver is live and why it stops/starts responding across a popout), state.changed (idle↔loading), turn.start/turn.end (turn boundary; turn.end carries durationMs), turn.retry (a recoverable in-turn retry — detail.reason plus attempt/maxAttempts; for malformed calls also finishMessage; for empty responses also the provider finishReason + thoughtsTokens + parts breakdown), turn.error (a turn failed or hit a guardrail — detail.reason is one of exception/malformed-function-call/empty-response/unknown-tool-limit/max-iterations/response-truncated/refusal/budget-exhausted/provider-refused, plus reason-specific diagnostics: attempts (for empty-response also finishReason + thoughtsTokens + a parts breakdown, distinguishing a thinking-only STOP from a truly empty turn), finishMessage, for response-truncated the model + maxTokens + outputTokens + tools, unknownTools (split into staleTools — real earlier this activation but retired by the current state or hidden behind an open exclusive fold — and hallucinatedTools — never advertised) + availableTools, iterations + limit, for budget-exhausted the budgetUsd + spentUsd figures reported by the proxy plus the resolved vendor, for provider-refused the kind (spend|auth) plus the upstream status and error type — the vendor refusing the ACCOUNT rather than us refusing to spend, so the remedy is a top-up or a key rotation rather than a raised cap, and the kind is the only place that distinction survives because the user-facing copy is deliberately cause-free, or name + message for exceptions), tool.failed (a tool threw), tool.unresolved (the model called a tool that could not be dispatched — detail.kind is folded/fold-hidden/stale/unknown, plus tool + agent and, for the counted kinds, the consecutive streak; the recurring lead-up to an unknown-tool-limit turn.error), subagent.started/completed/failed (the lifecycle of a `requestSubAgent` delegation — detail.agent names the sub-agent; these bracket the sub-agent turns that appear as kind:turn entries with an N-M `turnIndex`; subagent.failed also carries detail.reason, one of max_iterations/malformed_tool_call/empty_response/unknown_tool_limit/timeout/response_truncated/refusal/budget_exhausted/provider_refused; budget_exhausted and provider_refused are both terminal for the PARENT turn too — the parent stops rather than calling the model again into the same wall), agent.handoff (routing; from=null is the initial activation), agent.pinned/unpinned (forced routing), provider.selected (the resolved provider for the upcoming turns — detail.provider is the registry SLOT/tier name, detail.model the concrete model behind it and detail.vendor its vendor; emitted only when the slot CHANGES, so read the per-turn `model` for the model of any given call rather than assuming the nearest event still applies), interaction.requested/resolved (blocking user widgets — explain quiet gaps; note that when a sub-agent opens a widget, detail.agent — and the agentName on the interaction message — is the HOST agent that owns the widget, NOT the sub-agent that asked, because widgets render and resolve on the host driver), context.updated/threshold-crossed (token + cost), context.condensed (a stale tool payload was collapsed out of the model-bound history by a `condenseWhen` declaration on the tool — detail.tool + toolCallId, target args|response, trigger (superseded:<key> or age:<n>), stubLen, and an estimated tokensSaved; stored history and this log keep the FULL payload, so the model-visible slice at any point is the full history minus the condensations recorded up to then), panel.toggled, attachment.added, file.read-failed, suggestions.failed.',\n 'Sub-agent meta events: a sub-agent\\'s own turn.retry/turn.error/tool.failed/tool.unresolved events are merged into this same timeline, tagged with `detail.subAgent` — a `\"<parent> › <sub-agent>\"` breadcrumb that composes when nested (e.g. `\"UI Builder › Planner › Grounding\"`) — and interleaved by their original timestamps within the subagent.started→completed/failed bracket. These are the per-attempt/per-failure signals that do NOT appear among the sub-agent\\'s (hoisted) messages: a malformed/empty attempt that gets retried produces no message, and the stale-vs-hallucinated split and streak counts live only on the event. A sub-agent\\'s high-volume, message-derivable events (turn.start/turn.end, provider.selected, context.updated) are intentionally NOT merged — read its hoisted messages for model/tokens/cost and turn-by-turn activity, and the bracketing subagent.* events for the run\\'s span.',\n \"`meta` holds context captured at export time: agentSummary (full agent configs), context (active model, contextTokens/contextLimit/contextUsagePercent for the last call, and the session totals — sessionCostUsd, sessionTokensConsumed, and the four-bucket sessionUsage lifted to the top of this log), activeDebugSnapshot (the active agent's `getDebugSnapshot()` taken fresh at export — reflects state NOW, which may have advanced beyond the last turn's agentSnapshot), debug (optional host-supplied debug state), host, and the export timestamp.\",\n 'Note the two different scopes in `meta.context`: `contextTokens` is the prompt size of the LAST call (against `contextLimit`, the model context window), while `sessionUsage`/`sessionTokensConsumed` are cumulative BILLED throughput. Every turn resends the conversation, so the cumulative figure counts each turn’s prompt again in the next turn’s and is expected to dwarf the context size — that is not double-counting.',\n 'To debug a failure: find the last turn.error or tool.failed, then read upward for the user message, the turn(s), and the agent/provider/state events that led into it.',\n]",
|
|
4947
4971
|
"description": "Human/agent-facing guide emitted as the first key of the exported debug log,\nso whoever opens the JSON (often an AI agent) knows how to read it without\nreverse-engineering the shape. Kept here next to the event catalogue it\ndescribes — but proximity alone demonstrably did NOT keep the two in sync\n(`refusal` was missing from both reason lists for a whole release), so\n`debug-event-log.test.ts` now asserts that every `TurnFailureReason` and every\n`SubAgentFailureReason` is named here, and fails the build when one is added\nwithout a matching sentence. Enumerations below read as exhaustive and WILL be\ntrusted by an agent reading the JSON — keep them so."
|
|
4948
4972
|
}
|
|
4949
4973
|
],
|
|
@@ -7952,7 +7976,7 @@
|
|
|
7952
7976
|
"kind": "field",
|
|
7953
7977
|
"name": "subAgentFailure",
|
|
7954
7978
|
"type": {
|
|
7955
|
-
"text": "{
|
|
7979
|
+
"text": "| {\n reason: SubAgentFailureReason;\n budget?: BudgetDetail;\n /**\n * The refusing vendor and kind, when a child hit the PROVIDER wall (GENC-1506).\n *\n * Carried for the same reason `budget` is: the child is a **separate driver instance**, so\n * nothing it sets on itself is visible to the parent. Without this the parent could report\n * `provider-refused` but not say which vendor or which kind — losing the only signal that\n * distinguishes \"top up the account\" from \"rotate the key\", since the user copy is cause-free.\n */\n providerRefused?: ProviderRefusedDetail;\n }\n | undefined"
|
|
7956
7980
|
},
|
|
7957
7981
|
"privacy": "private",
|
|
7958
7982
|
"description": "Set when a sub-agent's tool loop ends without `completeSubAgent` being\ncalled. Read by the parent's `invokeSubAgent` to build the `{ ok: false }`\nbranch of `requestSubAgent`. Only ever set when `isSubAgent` is true.\n\n`budget` rides along on a `'budget_exhausted'` failure so the parent inherits\nthe child's ATTRIBUTION, not just the fact of a wall — see\n`budgetWallDetail`."
|
|
@@ -8256,6 +8280,36 @@
|
|
|
8256
8280
|
"description": "Host override for the budget-wall transcript copy, used verbatim — see\n`ChatDriverConfig.budgetExhaustedMessage`. `undefined` means no override,\nand the bubble is composed per wall by ChatDriver.budgetExhaustedBubble.",
|
|
8257
8281
|
"default": "budgetExhaustedMessage"
|
|
8258
8282
|
},
|
|
8283
|
+
{
|
|
8284
|
+
"kind": "field",
|
|
8285
|
+
"name": "providerRefusedMessageOverride",
|
|
8286
|
+
"type": {
|
|
8287
|
+
"text": "string | undefined"
|
|
8288
|
+
},
|
|
8289
|
+
"privacy": "private",
|
|
8290
|
+
"readonly": true,
|
|
8291
|
+
"description": "Host override for the provider-refusal sentence, from\n`ChatDriverConfig.providerRefusedMessage`. `undefined` means no override, so the shipped default\nis used verbatim.",
|
|
8292
|
+
"default": "providerRefusedMessage"
|
|
8293
|
+
},
|
|
8294
|
+
{
|
|
8295
|
+
"kind": "field",
|
|
8296
|
+
"name": "providerRefusedThisTurn",
|
|
8297
|
+
"type": {
|
|
8298
|
+
"text": "boolean"
|
|
8299
|
+
},
|
|
8300
|
+
"privacy": "private",
|
|
8301
|
+
"default": "false",
|
|
8302
|
+
"description": "A provider refusal was observed this turn, so the tool loop must not call the model again\n(GENC-1506).\n\nExists for the SUB-AGENT path only, exactly like `budgetExhaustedThisTurn`: this driver's own\nrefusal returns straight out of the catch, whereas a child's refusal reaches the parent as a tool\nresult, and without this flag the loop would issue another call into the same wall — N batched\nchildren costing N doomed calls plus a doomed parent one."
|
|
8303
|
+
},
|
|
8304
|
+
{
|
|
8305
|
+
"kind": "field",
|
|
8306
|
+
"name": "providerRefusedDetail",
|
|
8307
|
+
"type": {
|
|
8308
|
+
"text": "ProviderRefusedDetail | undefined"
|
|
8309
|
+
},
|
|
8310
|
+
"privacy": "private",
|
|
8311
|
+
"description": "The refusal detail latched off a sub-agent's failure, for the parent's own result."
|
|
8312
|
+
},
|
|
8259
8313
|
{
|
|
8260
8314
|
"kind": "field",
|
|
8261
8315
|
"name": "budgetExhaustedThisTurn",
|
|
@@ -8361,6 +8415,13 @@
|
|
|
8361
8415
|
"type": {
|
|
8362
8416
|
"text": "BudgetDetail"
|
|
8363
8417
|
}
|
|
8418
|
+
},
|
|
8419
|
+
{
|
|
8420
|
+
"name": "providerRefused",
|
|
8421
|
+
"optional": true,
|
|
8422
|
+
"type": {
|
|
8423
|
+
"text": "ProviderRefusedDetail"
|
|
8424
|
+
}
|
|
8364
8425
|
}
|
|
8365
8426
|
],
|
|
8366
8427
|
"description": "Build the `done` loop result, carrying the typed failure reason when the turn\nbailed (PTC-0). The discriminant stays `'done'` either way — the same value a\nclean turn returns — so consumers matching on `reason === 'done'` are unchanged;\n`failureReason` is simply present on a failure and absent on success. Omitted\n(rather than set to `undefined`) so a happy-path result stays byte-identical to\nthe historical `{ reason: 'done' }`."
|
|
@@ -8389,6 +8450,36 @@
|
|
|
8389
8450
|
}
|
|
8390
8451
|
]
|
|
8391
8452
|
},
|
|
8453
|
+
{
|
|
8454
|
+
"kind": "method",
|
|
8455
|
+
"name": "providerRefusedBubble",
|
|
8456
|
+
"privacy": "private",
|
|
8457
|
+
"return": {
|
|
8458
|
+
"type": {
|
|
8459
|
+
"text": "string"
|
|
8460
|
+
}
|
|
8461
|
+
},
|
|
8462
|
+
"description": "The sentence shown when the upstream provider refuses (GENC-1506).\n\nDeliberately far simpler than `budgetExhaustedBubble`: no vendor name, no figures, no\nswitch-provider advice, and no branching on `kind`. The copy is cause-free by design — a user who\ncan see their own remaining spend must not be told about a limit, and we must not imply the bill\nhas gone unpaid — so there is nothing here to compose. A host override wins verbatim."
|
|
8463
|
+
},
|
|
8464
|
+
{
|
|
8465
|
+
"kind": "method",
|
|
8466
|
+
"name": "reportProviderRefused",
|
|
8467
|
+
"privacy": "private",
|
|
8468
|
+
"return": {
|
|
8469
|
+
"type": {
|
|
8470
|
+
"text": "ChatDriverResult"
|
|
8471
|
+
}
|
|
8472
|
+
},
|
|
8473
|
+
"parameters": [
|
|
8474
|
+
{
|
|
8475
|
+
"name": "e",
|
|
8476
|
+
"type": {
|
|
8477
|
+
"text": "ProviderRefusedError"
|
|
8478
|
+
}
|
|
8479
|
+
}
|
|
8480
|
+
],
|
|
8481
|
+
"description": "Terminal provider-refusal outcome. Mirrors `reportBudgetExhausted` so the two walls behave\nidentically from the caller's side, while keeping their diagnostics distinct.\n\n`kind` reaches the debug log and the result but never the transcript: it is what lets an operator\ntell \"top up the account\" from \"rotate the key\", and with cause-free user copy this is the only\nplace that distinction survives."
|
|
8482
|
+
},
|
|
8392
8483
|
{
|
|
8393
8484
|
"kind": "method",
|
|
8394
8485
|
"name": "failureReasonOf",
|
|
@@ -8606,7 +8697,7 @@
|
|
|
8606
8697
|
"name": "getSubAgentFailure",
|
|
8607
8698
|
"return": {
|
|
8608
8699
|
"type": {
|
|
8609
|
-
"text": "{
|
|
8700
|
+
"text": "| {\n reason: SubAgentFailureReason;\n budget?: BudgetDetail;\n providerRefused?: ProviderRefusedDetail;\n }\n | undefined"
|
|
8610
8701
|
}
|
|
8611
8702
|
},
|
|
8612
8703
|
"description": "Returns the typed failure recorded when a sub-agent run ended without\n`completeSubAgent`, if any. Called by a parent `ChatDriver` after running\nthis instance as a sub-agent."
|
|
@@ -8633,6 +8724,13 @@
|
|
|
8633
8724
|
"type": {
|
|
8634
8725
|
"text": "BudgetDetail"
|
|
8635
8726
|
}
|
|
8727
|
+
},
|
|
8728
|
+
{
|
|
8729
|
+
"name": "providerRefused",
|
|
8730
|
+
"optional": true,
|
|
8731
|
+
"type": {
|
|
8732
|
+
"text": "ProviderRefusedDetail"
|
|
8733
|
+
}
|
|
8636
8734
|
}
|
|
8637
8735
|
],
|
|
8638
8736
|
"description": "Record a sub-agent failure reason (first one wins). No-op for top-level\nagents, so loop-exit sites can call it unconditionally. The parent reads\nthis via `getSubAgentFailure()` and emits the `subagent.failed` meta event\nunder its *own* session — see `invokeSubAgent`. (A child sub-agent runs\nunder a separate session key, so recording here would orphan the event off\nthe user-visible debug-log timeline.)"
|
|
@@ -23,7 +23,7 @@ export * from './channel/ai-activity-bus';
|
|
|
23
23
|
export * from './config/config';
|
|
24
24
|
export * from './config/define-stateful-agent';
|
|
25
25
|
export * from './config/fallback-agents';
|
|
26
|
-
export { AnthropicProvider, AnthropicTransport, GeminiProvider, GeminiTransport, MutableAIProviderRegistry, SUPPORTED_ANTHROPIC_MODEL_IDS, SUPPORTED_GEMINI_MODEL_IDS, isObservableAIProviderRegistry, ANTHROPIC_CACHE_READ_MULTIPLIER, ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_5M_MULTIPLIER, anthropicRatesFor, anthropicTokenCost, GEMINI_CACHED_INPUT_MULTIPLIER, GEMINI_LONG_CONTEXT_THRESHOLD, geminiRatesFor, geminiTokenCost, vendorOfModel, } from '@genesislcap/foundation-ai';
|
|
26
|
+
export { AnthropicProvider, AnthropicTransport, GeminiProvider, GeminiTransport, MutableAIProviderRegistry, SUPPORTED_ANTHROPIC_MODEL_IDS, SUPPORTED_GEMINI_MODEL_IDS, DEFAULT_PROVIDER_REFUSED_MESSAGE, PROVIDER_REFUSED_CODE, ProviderRefusedError, isObservableAIProviderRegistry, ANTHROPIC_CACHE_READ_MULTIPLIER, ANTHROPIC_CACHE_WRITE_1H_MULTIPLIER, ANTHROPIC_CACHE_WRITE_5M_MULTIPLIER, anthropicRatesFor, anthropicTokenCost, GEMINI_CACHED_INPUT_MULTIPLIER, GEMINI_LONG_CONTEXT_THRESHOLD, geminiRatesFor, geminiTokenCost, vendorOfModel, } from '@genesislcap/foundation-ai';
|
|
27
27
|
export type { AggregateUsage, AIProvider, AIProviderRegistry, AnthropicModelId, CachePolicy, ChatFallback, ChatMessage, ChatRequestOptions, ChatThinkingPolicy, ChatToolChoice, ChatToolDefinition, ChatToolHandlers, GeminiModelId, AnthropicUsageRecord, GeminiUsageRecord, TokenCost, TokenCostBreakdown, TokenRates, } from '@genesislcap/foundation-ai';
|
|
28
28
|
export { addUsage, emptyUsage, messageUsage, sumUsage, totalTokens } from './utils/sum-usage';
|
|
29
29
|
export { usageRows } from './utils/usage-rows';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-driver-node.d.ts","sourceRoot":"","sources":["../../src/chat-driver-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AASzC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,yBAAyB,EAKzB,6BAA6B,EAC7B,0BAA0B,
|
|
1
|
+
{"version":3,"file":"chat-driver-node.d.ts","sourceRoot":"","sources":["../../src/chat-driver-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AASzC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,yBAAyB,EAKzB,6BAA6B,EAC7B,0BAA0B,EAQ1B,gCAAgC,EAChC,qBAAqB,EACrB,oBAAoB,EACpB,8BAA8B,EAW9B,+BAA+B,EAC/B,mCAAmC,EACnC,mCAAmC,EACnC,iBAAiB,EACjB,kBAAkB,EAClB,8BAA8B,EAC9B,6BAA6B,EAC7B,cAAc,EACd,eAAe,EAGf,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAGV,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EAIb,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,UAAU,GACX,MAAM,4BAA4B,CAAC;AAoBpC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAS9F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AASnD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACtE,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,YAAY,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAKnF,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC1F,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -12,6 +12,10 @@ import type { AiDriver, AllAgentSummary } from '../ai-driver/ai-driver';
|
|
|
12
12
|
type BudgetDetail = NonNullable<Extract<ChatDriverResult, {
|
|
13
13
|
reason: 'done';
|
|
14
14
|
}>['budget']>;
|
|
15
|
+
/** The `providerRefused` payload on a `'provider-refused'` {@link ChatDriverResult} (GENC-1506). */
|
|
16
|
+
type ProviderRefusedDetail = NonNullable<Extract<ChatDriverResult, {
|
|
17
|
+
reason: 'done';
|
|
18
|
+
}>['providerRefused']>;
|
|
15
19
|
/** Name reserved for the cross-agent handoff tool — injected by OrchestratingDriver. */
|
|
16
20
|
export declare const REQUEST_CONTINUATION_TOOL = "request_continuation";
|
|
17
21
|
/**
|
|
@@ -185,6 +189,19 @@ export interface ChatDriverConfig {
|
|
|
185
189
|
* reversible change.
|
|
186
190
|
*/
|
|
187
191
|
budgetExhaustedMessage?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Overrides the transcript sentence shown when the upstream PROVIDER refuses the account
|
|
194
|
+
* (GENC-1506) — see `DEFAULT_PROVIDER_REFUSED_MESSAGE`.
|
|
195
|
+
*
|
|
196
|
+
* Separate from `budgetExhaustedMessage` because the two conditions are separate: ours is a spend
|
|
197
|
+
* cap a host administrator can raise, this is the vendor declining to serve us at all. A host that
|
|
198
|
+
* white-labels one will usually want to white-label both, but conflating them into one field would
|
|
199
|
+
* force identical copy on two situations with different remedies.
|
|
200
|
+
*
|
|
201
|
+
* Rarely needed: unlike the budget default, the shipped sentence names no vendor and no Genesis, so
|
|
202
|
+
* it is already safe for a white-labelled deployment.
|
|
203
|
+
*/
|
|
204
|
+
providerRefusedMessage?: string;
|
|
188
205
|
}
|
|
189
206
|
/**
|
|
190
207
|
* Plain TS class that drives a multi-turn chat conversation, including the tool-call loop.
|
|
@@ -520,6 +537,24 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
520
537
|
* and the bubble is composed per wall by {@link ChatDriver.budgetExhaustedBubble}.
|
|
521
538
|
*/
|
|
522
539
|
private readonly budgetExhaustedMessageOverride?;
|
|
540
|
+
/**
|
|
541
|
+
* Host override for the provider-refusal sentence, from
|
|
542
|
+
* `ChatDriverConfig.providerRefusedMessage`. `undefined` means no override, so the shipped default
|
|
543
|
+
* is used verbatim.
|
|
544
|
+
*/
|
|
545
|
+
private readonly providerRefusedMessageOverride?;
|
|
546
|
+
/**
|
|
547
|
+
* A provider refusal was observed this turn, so the tool loop must not call the model again
|
|
548
|
+
* (GENC-1506).
|
|
549
|
+
*
|
|
550
|
+
* Exists for the SUB-AGENT path only, exactly like `budgetExhaustedThisTurn`: this driver's own
|
|
551
|
+
* refusal returns straight out of the catch, whereas a child's refusal reaches the parent as a tool
|
|
552
|
+
* result, and without this flag the loop would issue another call into the same wall — N batched
|
|
553
|
+
* children costing N doomed calls plus a doomed parent one.
|
|
554
|
+
*/
|
|
555
|
+
private providerRefusedThisTurn;
|
|
556
|
+
/** The refusal detail latched off a sub-agent's failure, for the parent's own result. */
|
|
557
|
+
private providerRefusedDetail?;
|
|
523
558
|
/**
|
|
524
559
|
* Set the moment a budget wall is observed anywhere in this turn — this
|
|
525
560
|
* driver's own 402, or a sub-agent's (which surfaces here only as a
|
|
@@ -625,6 +660,24 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
625
660
|
*/
|
|
626
661
|
private budgetExhaustedBubble;
|
|
627
662
|
reportBudgetExhausted(e: BudgetExhaustedError, pendingUserMessage?: ChatMessage): ChatDriverResult;
|
|
663
|
+
/**
|
|
664
|
+
* The sentence shown when the upstream provider refuses (GENC-1506).
|
|
665
|
+
*
|
|
666
|
+
* Deliberately far simpler than `budgetExhaustedBubble`: no vendor name, no figures, no
|
|
667
|
+
* switch-provider advice, and no branching on `kind`. The copy is cause-free by design — a user who
|
|
668
|
+
* can see their own remaining spend must not be told about a limit, and we must not imply the bill
|
|
669
|
+
* has gone unpaid — so there is nothing here to compose. A host override wins verbatim.
|
|
670
|
+
*/
|
|
671
|
+
private providerRefusedBubble;
|
|
672
|
+
/**
|
|
673
|
+
* Terminal provider-refusal outcome. Mirrors `reportBudgetExhausted` so the two walls behave
|
|
674
|
+
* identically from the caller's side, while keeping their diagnostics distinct.
|
|
675
|
+
*
|
|
676
|
+
* `kind` reaches the debug log and the result but never the transcript: it is what lets an operator
|
|
677
|
+
* tell "top up the account" from "rotate the key", and with cause-free user copy this is the only
|
|
678
|
+
* place that distinction survives.
|
|
679
|
+
*/
|
|
680
|
+
private reportProviderRefused;
|
|
628
681
|
/** The typed failure reason on a loop result, or `undefined` for a clean turn / handoff. */
|
|
629
682
|
private static failureReasonOf;
|
|
630
683
|
/**
|
|
@@ -708,6 +761,7 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
708
761
|
getSubAgentFailure(): {
|
|
709
762
|
reason: SubAgentFailureReason;
|
|
710
763
|
budget?: BudgetDetail;
|
|
764
|
+
providerRefused?: ProviderRefusedDetail;
|
|
711
765
|
} | undefined;
|
|
712
766
|
/**
|
|
713
767
|
* Record a sub-agent failure reason (first one wins). No-op for top-level
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,kBAAkB,EAClB,cAAc,EAEd,cAAc,EACd,gBAAgB,EAEhB,WAAW,EAIX,cAAc,EAKd,yBAAyB,EAEzB,qBAAqB,EAGtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,
|
|
1
|
+
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,kBAAkB,EAClB,cAAc,EAEd,cAAc,EACd,gBAAgB,EAEhB,WAAW,EAIX,cAAc,EAKd,yBAAyB,EAEzB,qBAAqB,EAGtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EAQrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EACV,WAAW,EAKX,iBAAiB,EAKjB,oBAAoB,EACpB,iBAAiB,EAElB,MAAM,qBAAq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AS3C,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAwD/F;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,mBAAmB;IAoG3B;;;;;OAKG;YACW,cAAc;IAoP5B;;;OAGG;IACG,mBAAmB,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAsDrF,wFAAwF;IACxF,OAAO,CAAC,OAAO;IAKf;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAc1B;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IAMtB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IA+BxB,uFAAuF;IACvF,OAAO,CAAC,QAAQ;IAsChB,OAAO,CAAC,aAAa;IAQrB,8EAA8E;IAC9E,OAAO,CAAC,SAAS;IAWjB,mFAAmF;IACnF,OAAO,CAAC,2BAA2B;YAkCrB,WAAW;IAwjCzB,OAAO,CAAC,eAAe;CAoBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-driver.test.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-driver.test.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.test.ts"],"names":[],"mappings":"AAgCA,OAAO,uBAAuB,CAAC"}
|
|
@@ -35,7 +35,15 @@ export { AnthropicProvider, AnthropicTransport, GeminiProvider, GeminiTransport,
|
|
|
35
35
|
// foundation-ai's REAL list instead of maintaining a parallel hardcoded copy that silently drifts
|
|
36
36
|
// as the platform adds models (a valid new model would otherwise look like a misconfiguration).
|
|
37
37
|
// GENC-1461, create PR #1644 review.
|
|
38
|
-
SUPPORTED_ANTHROPIC_MODEL_IDS, SUPPORTED_GEMINI_MODEL_IDS,
|
|
38
|
+
SUPPORTED_ANTHROPIC_MODEL_IDS, SUPPORTED_GEMINI_MODEL_IDS,
|
|
39
|
+
// The provider wall (GENC-1506). Re-exported for the same anti-drift reason as the model lists
|
|
40
|
+
// above, and it matters more here because the other end of this contract is in ANOTHER REPO:
|
|
41
|
+
// genesis-create's ai-service stamps `PROVIDER_REFUSED_CODE` onto its proxy responses and shows
|
|
42
|
+
// `DEFAULT_PROVIDER_REFUSED_MESSAGE` on its own generation surfaces. Hand-copying either would
|
|
43
|
+
// drift silently — a renamed code stops classifying, and a second copy of the sentence survives
|
|
44
|
+
// the first reword. `ProviderRefusedError` is here so a headless caller can `instanceof` it
|
|
45
|
+
// against the same bundled instance the driver throws from.
|
|
46
|
+
DEFAULT_PROVIDER_REFUSED_MESSAGE, PROVIDER_REFUSED_CODE, ProviderRefusedError, isObservableAIProviderRegistry,
|
|
39
47
|
// Request pricing. Re-exported HERE, not left to a direct `@genesislcap/foundation-ai`
|
|
40
48
|
// import, for the same reason as everything above it: a headless host that adds its own
|
|
41
49
|
// foundation-ai dependency gets a second copy, and the driver's malformed/truncated
|