@genesislcap/ai-assistant 15.3.3 → 15.3.4-GENC-1475.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 +333 -43
- package/dist/ai-assistant.d.ts +185 -19
- package/dist/chat-driver.cjs +94 -22
- package/dist/chat-driver.cjs.map +3 -3
- package/dist/chat-driver.mjs +94 -22
- package/dist/chat-driver.mjs.map +3 -3
- package/dist/custom-elements.json +139 -23
- package/dist/dts/components/chat-driver/chat-driver.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.map +1 -1
- package/dist/dts/main/cost-session-banking.test.d.ts +2 -0
- package/dist/dts/main/cost-session-banking.test.d.ts.map +1 -0
- package/dist/dts/main/main.d.ts +114 -14
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/state/ai-assistant-slice.d.ts +11 -8
- package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
- package/dist/dts/state/persistence/session-persistence-provider.d.ts +23 -0
- package/dist/dts/state/persistence/session-persistence-provider.d.ts.map +1 -1
- package/dist/dts/state/persistence/session-snapshot.d.ts.map +1 -1
- package/dist/dts/state/session-store.d.ts +1 -2
- package/dist/dts/state/session-store.d.ts.map +1 -1
- package/dist/dts/utils/cost-session-history.d.ts +76 -11
- package/dist/dts/utils/cost-session-history.d.ts.map +1 -1
- package/dist/dts/utils/resolve-cost-history-config.d.ts +6 -0
- package/dist/dts/utils/resolve-cost-history-config.d.ts.map +1 -1
- package/dist/dts/utils/sum-costs.d.ts.map +1 -1
- package/dist/dts/utils/sum-tokens.d.ts +8 -8
- package/dist/dts/utils/sum-tokens.d.ts.map +1 -1
- package/dist/dts/utils/sum-usage.d.ts +59 -0
- package/dist/dts/utils/sum-usage.d.ts.map +1 -0
- package/dist/dts/utils/sum-usage.test.d.ts +2 -0
- package/dist/dts/utils/sum-usage.test.d.ts.map +1 -0
- package/dist/esm/components/chat-driver/chat-driver.js +6 -0
- package/dist/esm/components/settings-modal/settings-modal.styles.js +84 -2
- package/dist/esm/components/settings-modal/settings-modal.template.js +130 -32
- package/dist/esm/main/cost-session-banking.test.js +216 -0
- package/dist/esm/main/main.js +271 -57
- package/dist/esm/state/ai-assistant-slice.js +11 -8
- package/dist/esm/state/ai-assistant-slice.test.js +12 -5
- package/dist/esm/state/debug-event-log.js +2 -2
- package/dist/esm/state/persistence/session-persistence.integration.test.js +5 -1
- package/dist/esm/state/persistence/session-persister.js +2 -2
- package/dist/esm/state/persistence/session-persister.test.js +10 -1
- package/dist/esm/state/persistence/session-snapshot.js +6 -2
- package/dist/esm/state/persistence/session-snapshot.test.js +4 -1
- package/dist/esm/state/persistence/stateful-restore.e2e.test.js +10 -1
- package/dist/esm/utils/cost-session-history.js +63 -13
- package/dist/esm/utils/cost-session-history.test.js +132 -13
- package/dist/esm/utils/resolve-cost-history-config.js +2 -1
- package/dist/esm/utils/sum-costs.js +2 -13
- package/dist/esm/utils/sum-tokens.js +10 -27
- package/dist/esm/utils/sum-tokens.test.js +1 -5
- package/dist/esm/utils/sum-usage.js +123 -0
- package/dist/esm/utils/sum-usage.test.js +120 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/src/components/chat-driver/chat-driver.ts +6 -0
- package/src/components/settings-modal/settings-modal.styles.ts +84 -2
- package/src/components/settings-modal/settings-modal.template.ts +144 -33
- package/src/main/cost-session-banking.test.ts +270 -0
- package/src/main/main.ts +279 -56
- package/src/state/ai-assistant-slice.test.ts +12 -5
- package/src/state/ai-assistant-slice.ts +21 -13
- package/src/state/debug-event-log.ts +2 -2
- package/src/state/persistence/session-persistence-provider.ts +24 -0
- package/src/state/persistence/session-persistence.integration.test.ts +8 -1
- package/src/state/persistence/session-persister.test.ts +10 -1
- package/src/state/persistence/session-persister.ts +2 -2
- package/src/state/persistence/session-snapshot.test.ts +4 -1
- package/src/state/persistence/session-snapshot.ts +5 -1
- package/src/state/persistence/stateful-restore.e2e.test.ts +9 -1
- package/src/utils/cost-session-history.test.ts +146 -16
- package/src/utils/cost-session-history.ts +112 -21
- package/src/utils/resolve-cost-history-config.ts +7 -0
- package/src/utils/sum-costs.ts +2 -9
- package/src/utils/sum-tokens.test.ts +1 -11
- package/src/utils/sum-tokens.ts +10 -26
- package/src/utils/sum-usage.test.ts +140 -0
- package/src/utils/sum-usage.ts +130 -0
|
@@ -5916,7 +5916,7 @@
|
|
|
5916
5916
|
{
|
|
5917
5917
|
"kind": "Interface",
|
|
5918
5918
|
"canonicalReference": "@genesislcap/ai-assistant!CostSessionModelEntry:interface",
|
|
5919
|
-
"docComment": "/**\n * A model used during a
|
|
5919
|
+
"docComment": "/**\n * A model used during a recorded cost session.\n */\n",
|
|
5920
5920
|
"excerptTokens": [
|
|
5921
5921
|
{
|
|
5922
5922
|
"kind": "Content",
|
|
@@ -5989,7 +5989,7 @@
|
|
|
5989
5989
|
{
|
|
5990
5990
|
"kind": "Interface",
|
|
5991
5991
|
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord:interface",
|
|
5992
|
-
"docComment": "/**\n * Persisted
|
|
5992
|
+
"docComment": "/**\n * Persisted usage record for one project's assistant work.\n */\n",
|
|
5993
5993
|
"excerptTokens": [
|
|
5994
5994
|
{
|
|
5995
5995
|
"kind": "Content",
|
|
@@ -6003,16 +6003,17 @@
|
|
|
6003
6003
|
"members": [
|
|
6004
6004
|
{
|
|
6005
6005
|
"kind": "PropertySignature",
|
|
6006
|
-
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#
|
|
6007
|
-
"docComment": "",
|
|
6006
|
+
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#banked:member",
|
|
6007
|
+
"docComment": "/**\n * Spend that predates the current transcript, and so cannot be re-derived from it.\n *\n * Without this a row could only ever report what the open transcript proves. That is fine when the transcript is restored on load (it *is* the project's history), but where it starts empty every refresh the row would be rewritten downwards on the next turn and the project's earlier spend lost. Banking it keeps `usage` a lifetime figure in both cases.\n *\n * Deliberately part of the row rather than element state: two assistant instances (a docked bubble and a popped-out panel) share one session, and both write this row. A value derived from the row keeps every write idempotent, whereas an element-held accumulator would be applied once per instance.\n *\n * Optional: rows written before this existed have none, which reads as \"nothing banked\".\n */\n",
|
|
6008
6008
|
"excerptTokens": [
|
|
6009
6009
|
{
|
|
6010
6010
|
"kind": "Content",
|
|
6011
|
-
"text": "
|
|
6011
|
+
"text": "banked?: "
|
|
6012
6012
|
},
|
|
6013
6013
|
{
|
|
6014
|
-
"kind": "
|
|
6015
|
-
"text": "
|
|
6014
|
+
"kind": "Reference",
|
|
6015
|
+
"text": "AggregateUsage",
|
|
6016
|
+
"canonicalReference": "@genesislcap/foundation-ai!AggregateUsage:interface"
|
|
6016
6017
|
},
|
|
6017
6018
|
{
|
|
6018
6019
|
"kind": "Content",
|
|
@@ -6020,9 +6021,9 @@
|
|
|
6020
6021
|
}
|
|
6021
6022
|
],
|
|
6022
6023
|
"isReadonly": false,
|
|
6023
|
-
"isOptional":
|
|
6024
|
+
"isOptional": true,
|
|
6024
6025
|
"releaseTag": "Public",
|
|
6025
|
-
"name": "
|
|
6026
|
+
"name": "banked",
|
|
6026
6027
|
"propertyTypeTokenRange": {
|
|
6027
6028
|
"startIndex": 1,
|
|
6028
6029
|
"endIndex": 2
|
|
@@ -6030,12 +6031,12 @@
|
|
|
6030
6031
|
},
|
|
6031
6032
|
{
|
|
6032
6033
|
"kind": "PropertySignature",
|
|
6033
|
-
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#
|
|
6034
|
-
"docComment": "
|
|
6034
|
+
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#id:member",
|
|
6035
|
+
"docComment": "",
|
|
6035
6036
|
"excerptTokens": [
|
|
6036
6037
|
{
|
|
6037
6038
|
"kind": "Content",
|
|
6038
|
-
"text": "
|
|
6039
|
+
"text": "id: "
|
|
6039
6040
|
},
|
|
6040
6041
|
{
|
|
6041
6042
|
"kind": "Content",
|
|
@@ -6049,7 +6050,7 @@
|
|
|
6049
6050
|
"isReadonly": false,
|
|
6050
6051
|
"isOptional": false,
|
|
6051
6052
|
"releaseTag": "Public",
|
|
6052
|
-
"name": "
|
|
6053
|
+
"name": "id",
|
|
6053
6054
|
"propertyTypeTokenRange": {
|
|
6054
6055
|
"startIndex": 1,
|
|
6055
6056
|
"endIndex": 2
|
|
@@ -6057,16 +6058,21 @@
|
|
|
6057
6058
|
},
|
|
6058
6059
|
{
|
|
6059
6060
|
"kind": "PropertySignature",
|
|
6060
|
-
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#
|
|
6061
|
+
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#models:member",
|
|
6061
6062
|
"docComment": "",
|
|
6062
6063
|
"excerptTokens": [
|
|
6063
6064
|
{
|
|
6064
6065
|
"kind": "Content",
|
|
6065
|
-
"text": "
|
|
6066
|
+
"text": "models: "
|
|
6067
|
+
},
|
|
6068
|
+
{
|
|
6069
|
+
"kind": "Reference",
|
|
6070
|
+
"text": "CostSessionModelEntry",
|
|
6071
|
+
"canonicalReference": "@genesislcap/ai-assistant!CostSessionModelEntry:interface"
|
|
6066
6072
|
},
|
|
6067
6073
|
{
|
|
6068
6074
|
"kind": "Content",
|
|
6069
|
-
"text": "
|
|
6075
|
+
"text": "[]"
|
|
6070
6076
|
},
|
|
6071
6077
|
{
|
|
6072
6078
|
"kind": "Content",
|
|
@@ -6076,29 +6082,24 @@
|
|
|
6076
6082
|
"isReadonly": false,
|
|
6077
6083
|
"isOptional": false,
|
|
6078
6084
|
"releaseTag": "Public",
|
|
6079
|
-
"name": "
|
|
6085
|
+
"name": "models",
|
|
6080
6086
|
"propertyTypeTokenRange": {
|
|
6081
6087
|
"startIndex": 1,
|
|
6082
|
-
"endIndex":
|
|
6088
|
+
"endIndex": 3
|
|
6083
6089
|
}
|
|
6084
6090
|
},
|
|
6085
6091
|
{
|
|
6086
6092
|
"kind": "PropertySignature",
|
|
6087
|
-
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#
|
|
6088
|
-
"docComment": "",
|
|
6093
|
+
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#projectKey:member",
|
|
6094
|
+
"docComment": "/**\n * Stable identity of the work this row stands for — the assistant's session key (a project id, for hosts that key sessions per project). The upsert key: a row is one project's lifetime usage, so re-reporting the same key REPLACES the row rather than adding another.\n */\n",
|
|
6089
6095
|
"excerptTokens": [
|
|
6090
6096
|
{
|
|
6091
6097
|
"kind": "Content",
|
|
6092
|
-
"text": "
|
|
6093
|
-
},
|
|
6094
|
-
{
|
|
6095
|
-
"kind": "Reference",
|
|
6096
|
-
"text": "CostSessionModelEntry",
|
|
6097
|
-
"canonicalReference": "@genesislcap/ai-assistant!CostSessionModelEntry:interface"
|
|
6098
|
+
"text": "projectKey: "
|
|
6098
6099
|
},
|
|
6099
6100
|
{
|
|
6100
6101
|
"kind": "Content",
|
|
6101
|
-
"text": "
|
|
6102
|
+
"text": "string"
|
|
6102
6103
|
},
|
|
6103
6104
|
{
|
|
6104
6105
|
"kind": "Content",
|
|
@@ -6108,10 +6109,10 @@
|
|
|
6108
6109
|
"isReadonly": false,
|
|
6109
6110
|
"isOptional": false,
|
|
6110
6111
|
"releaseTag": "Public",
|
|
6111
|
-
"name": "
|
|
6112
|
+
"name": "projectKey",
|
|
6112
6113
|
"propertyTypeTokenRange": {
|
|
6113
6114
|
"startIndex": 1,
|
|
6114
|
-
"endIndex":
|
|
6115
|
+
"endIndex": 2
|
|
6115
6116
|
}
|
|
6116
6117
|
},
|
|
6117
6118
|
{
|
|
@@ -6143,16 +6144,16 @@
|
|
|
6143
6144
|
},
|
|
6144
6145
|
{
|
|
6145
6146
|
"kind": "PropertySignature",
|
|
6146
|
-
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#
|
|
6147
|
-
"docComment": "",
|
|
6147
|
+
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#updatedAt:member",
|
|
6148
|
+
"docComment": "/**\n * ISO-8601 timestamp of the most recent usage recorded for this row.\n *\n * Named for what it is: the row is upserted as spend accrues, so this moves. It is NOT an end time — a row has no terminal state, because a project can always be worked on again.\n */\n",
|
|
6148
6149
|
"excerptTokens": [
|
|
6149
6150
|
{
|
|
6150
6151
|
"kind": "Content",
|
|
6151
|
-
"text": "
|
|
6152
|
+
"text": "updatedAt: "
|
|
6152
6153
|
},
|
|
6153
6154
|
{
|
|
6154
6155
|
"kind": "Content",
|
|
6155
|
-
"text": "
|
|
6156
|
+
"text": "string"
|
|
6156
6157
|
},
|
|
6157
6158
|
{
|
|
6158
6159
|
"kind": "Content",
|
|
@@ -6162,7 +6163,35 @@
|
|
|
6162
6163
|
"isReadonly": false,
|
|
6163
6164
|
"isOptional": false,
|
|
6164
6165
|
"releaseTag": "Public",
|
|
6165
|
-
"name": "
|
|
6166
|
+
"name": "updatedAt",
|
|
6167
|
+
"propertyTypeTokenRange": {
|
|
6168
|
+
"startIndex": 1,
|
|
6169
|
+
"endIndex": 2
|
|
6170
|
+
}
|
|
6171
|
+
},
|
|
6172
|
+
{
|
|
6173
|
+
"kind": "PropertySignature",
|
|
6174
|
+
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord#usage:member",
|
|
6175
|
+
"docComment": "/**\n * Cost plus the four token buckets — the same shape the live session tile renders, so a history row can show the identical breakdown instead of a lone merged total that cannot explain a large token count at a small cost.\n *\n * This is the project's **lifetime** usage: `banked` plus whatever the live transcript currently proves.\n */\n",
|
|
6176
|
+
"excerptTokens": [
|
|
6177
|
+
{
|
|
6178
|
+
"kind": "Content",
|
|
6179
|
+
"text": "usage: "
|
|
6180
|
+
},
|
|
6181
|
+
{
|
|
6182
|
+
"kind": "Reference",
|
|
6183
|
+
"text": "AggregateUsage",
|
|
6184
|
+
"canonicalReference": "@genesislcap/foundation-ai!AggregateUsage:interface"
|
|
6185
|
+
},
|
|
6186
|
+
{
|
|
6187
|
+
"kind": "Content",
|
|
6188
|
+
"text": ";"
|
|
6189
|
+
}
|
|
6190
|
+
],
|
|
6191
|
+
"isReadonly": false,
|
|
6192
|
+
"isOptional": false,
|
|
6193
|
+
"releaseTag": "Public",
|
|
6194
|
+
"name": "usage",
|
|
6166
6195
|
"propertyTypeTokenRange": {
|
|
6167
6196
|
"startIndex": 1,
|
|
6168
6197
|
"endIndex": 2
|
|
@@ -6801,7 +6830,7 @@
|
|
|
6801
6830
|
{
|
|
6802
6831
|
"kind": "Class",
|
|
6803
6832
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant:class",
|
|
6804
|
-
"docComment": "/**\n * Foundation AI Assistant component.\n *\n * @remarks\n *\n * Register one or more AI providers via `registerAIProviders` from `@genesislcap/foundation-ai`; this element resolves the `AIProviderRegistry` through the DI container. Pass agent configuration via the `agents` property — each agent can override which registered provider it uses via `provider:`. The component creates a `ChatDriver` (single agent) or `OrchestratingDriver` (multiple agents) to manage the conversation loop.\n *\n * Popout/collapse coordination uses `agenticActivityBus` topics `chat-popout` and `chat-popin` — not DOM `CustomEvent`s on this element.\n *\n * **Cost build history:** opt-in via `chatConfig.costHistory.enabled`. When enabled,
|
|
6833
|
+
"docComment": "/**\n * Foundation AI Assistant component.\n *\n * @remarks\n *\n * Register one or more AI providers via `registerAIProviders` from `@genesislcap/foundation-ai`; this element resolves the `AIProviderRegistry` through the DI container. Pass agent configuration via the `agents` property — each agent can override which registered provider it uses via `provider:`. The component creates a `ChatDriver` (single agent) or `OrchestratingDriver` (multiple agents) to manage the conversation loop.\n *\n * Popout/collapse coordination uses `agenticActivityBus` topics `chat-popout` and `chat-popin` — not DOM `CustomEvent`s on this element.\n *\n * **Cost build history:** opt-in via `chatConfig.costHistory.enabled`. When enabled, each session's usage is kept as exactly ONE row per session key in `localStorage` (scoped by `costHistory.scope`, the element `id`, or `'default'`), upserted as spend accrues. So a row is a project's lifetime usage rather than a visit to it, and the Cost tab's total is the sum of the rows alone — the live session is never added on top, because the active project's own row already reflects it. Hosts may call {@link FoundationAiAssistant.finalizeCostSession} to flush early; it is idempotent.\n *\n * @fires\n *\n * chat-header-mousedown - Fired when the user presses the chat header in `popout-mode=\"expand\"` (for drag-to-popout hosts). Bubbles and composed. detail: `ChatHeaderMouseDownDetail`\n *\n * @fires\n *\n * session-cleared - Fired after the session is wiped (the lifecycle menu's Clear). The payload is captured before teardown so the host can clean up any external state the active agent was working on. Bubbles and composed. detail: `SessionClearedDetail`\n *\n * @beta\n */\n",
|
|
6805
6834
|
"excerptTokens": [
|
|
6806
6835
|
{
|
|
6807
6836
|
"kind": "Content",
|
|
@@ -7971,7 +8000,7 @@
|
|
|
7971
8000
|
{
|
|
7972
8001
|
"kind": "Property",
|
|
7973
8002
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#cumulativeCostUsd:member",
|
|
7974
|
-
"docComment": "/**\n *
|
|
8003
|
+
"docComment": "/**\n * Lifetime USD across every project in the history scope.\n */\n",
|
|
7975
8004
|
"excerptTokens": [
|
|
7976
8005
|
{
|
|
7977
8006
|
"kind": "Content",
|
|
@@ -7998,6 +8027,37 @@
|
|
|
7998
8027
|
"isProtected": false,
|
|
7999
8028
|
"isAbstract": false
|
|
8000
8029
|
},
|
|
8030
|
+
{
|
|
8031
|
+
"kind": "Property",
|
|
8032
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#cumulativeUsage:member",
|
|
8033
|
+
"docComment": "/**\n * Lifetime usage across every project in the history scope — cost and all four token buckets. What the Cost tab's lifetime section renders.\n *\n * Rows ONLY — deliberately not rows + live session. Each row holds a project's lifetime usage and the active project's row is kept current on every transcript change, so adding the live total would count this project's spend twice. That double-count is what made the figure grow on every refresh: a page-hide banked a row while the restored session still carried the same spend.\n */\n",
|
|
8034
|
+
"excerptTokens": [
|
|
8035
|
+
{
|
|
8036
|
+
"kind": "Content",
|
|
8037
|
+
"text": "get cumulativeUsage(): "
|
|
8038
|
+
},
|
|
8039
|
+
{
|
|
8040
|
+
"kind": "Reference",
|
|
8041
|
+
"text": "AggregateUsage",
|
|
8042
|
+
"canonicalReference": "@genesislcap/foundation-ai!AggregateUsage:interface"
|
|
8043
|
+
},
|
|
8044
|
+
{
|
|
8045
|
+
"kind": "Content",
|
|
8046
|
+
"text": ";"
|
|
8047
|
+
}
|
|
8048
|
+
],
|
|
8049
|
+
"isReadonly": true,
|
|
8050
|
+
"isOptional": false,
|
|
8051
|
+
"releaseTag": "Beta",
|
|
8052
|
+
"name": "cumulativeUsage",
|
|
8053
|
+
"propertyTypeTokenRange": {
|
|
8054
|
+
"startIndex": 1,
|
|
8055
|
+
"endIndex": 2
|
|
8056
|
+
},
|
|
8057
|
+
"isStatic": false,
|
|
8058
|
+
"isProtected": false,
|
|
8059
|
+
"isAbstract": false
|
|
8060
|
+
},
|
|
8001
8061
|
{
|
|
8002
8062
|
"kind": "Property",
|
|
8003
8063
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#debugRedux:member",
|
|
@@ -8293,7 +8353,7 @@
|
|
|
8293
8353
|
{
|
|
8294
8354
|
"kind": "Method",
|
|
8295
8355
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#finalizeCostSession:member(1)",
|
|
8296
|
-
"docComment": "/**\n *
|
|
8356
|
+
"docComment": "/**\n * Write this session's usage into persisted build history (`localStorage`) as a single row keyed by the session key, replacing any existing row for that key.\n *\n * **Idempotent** — safe to call per turn, on tab close, and on a title change alike. The name is historical: it does NOT end the session or reset the running totals. Resetting them is what used to double-count spend, since the row was banked while the persisted transcript still carried the same usage, so a reload restored it and the Cost tab counted both.\n *\n * No-op unless `chatConfig.costHistory.enabled` is `true`, when the live session has no usage yet, or when the session has no key to upsert against. Gating on the *live* figures (not the banked total) means a reload that restores nothing rewrites nothing.\n */\n",
|
|
8297
8357
|
"excerptTokens": [
|
|
8298
8358
|
{
|
|
8299
8359
|
"kind": "Content",
|
|
@@ -9010,6 +9070,36 @@
|
|
|
9010
9070
|
"isProtected": false,
|
|
9011
9071
|
"isAbstract": false
|
|
9012
9072
|
},
|
|
9073
|
+
{
|
|
9074
|
+
"kind": "Property",
|
|
9075
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#liveUsageIsProjectLifetime:member",
|
|
9076
|
+
"docComment": "/**\n * Whether the live session figures amount to this project's whole history, which is true exactly when the transcript is restored on load. Drives the Cost tab's live labels (\"Project cost\" vs \"Session cost\") so they state the scope rather than imply one.\n *\n * Note this is NOT what makes the *rows* lifetime — those bank their pre-transcript spend (see `CostSessionRecord.banked`) and are lifetime either way.\n */\n",
|
|
9077
|
+
"excerptTokens": [
|
|
9078
|
+
{
|
|
9079
|
+
"kind": "Content",
|
|
9080
|
+
"text": "get liveUsageIsProjectLifetime(): "
|
|
9081
|
+
},
|
|
9082
|
+
{
|
|
9083
|
+
"kind": "Content",
|
|
9084
|
+
"text": "boolean"
|
|
9085
|
+
},
|
|
9086
|
+
{
|
|
9087
|
+
"kind": "Content",
|
|
9088
|
+
"text": ";"
|
|
9089
|
+
}
|
|
9090
|
+
],
|
|
9091
|
+
"isReadonly": true,
|
|
9092
|
+
"isOptional": false,
|
|
9093
|
+
"releaseTag": "Beta",
|
|
9094
|
+
"name": "liveUsageIsProjectLifetime",
|
|
9095
|
+
"propertyTypeTokenRange": {
|
|
9096
|
+
"startIndex": 1,
|
|
9097
|
+
"endIndex": 2
|
|
9098
|
+
},
|
|
9099
|
+
"isStatic": false,
|
|
9100
|
+
"isProtected": false,
|
|
9101
|
+
"isAbstract": false
|
|
9102
|
+
},
|
|
9013
9103
|
{
|
|
9014
9104
|
"kind": "Property",
|
|
9015
9105
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#messages:member",
|
|
@@ -10022,7 +10112,7 @@
|
|
|
10022
10112
|
{
|
|
10023
10113
|
"kind": "Property",
|
|
10024
10114
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#sessionCostUsd:member",
|
|
10025
|
-
"docComment": "/**\n * Aggregated USD cost across every chat turn in this session.\n */\n",
|
|
10115
|
+
"docComment": "/**\n * Aggregated USD cost across every chat turn in this session.\n *\n * Read-only (unlike previously): it is a projection of `sessionUsage`, and a host assigning it would have set a figure the next transcript change overwrites.\n */\n",
|
|
10026
10116
|
"excerptTokens": [
|
|
10027
10117
|
{
|
|
10028
10118
|
"kind": "Content",
|
|
@@ -10034,10 +10124,10 @@
|
|
|
10034
10124
|
},
|
|
10035
10125
|
{
|
|
10036
10126
|
"kind": "Content",
|
|
10037
|
-
"text": "
|
|
10127
|
+
"text": ";"
|
|
10038
10128
|
}
|
|
10039
10129
|
],
|
|
10040
|
-
"isReadonly":
|
|
10130
|
+
"isReadonly": true,
|
|
10041
10131
|
"isOptional": false,
|
|
10042
10132
|
"releaseTag": "Beta",
|
|
10043
10133
|
"name": "sessionCostUsd",
|
|
@@ -10206,7 +10296,7 @@
|
|
|
10206
10296
|
{
|
|
10207
10297
|
"kind": "Property",
|
|
10208
10298
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#sessionTokensConsumed:member",
|
|
10209
|
-
"docComment": "/**\n *
|
|
10299
|
+
"docComment": "/**\n * Total tokens across every chat turn in this session — all four buckets added up. Read-only; the per-bucket split is on `sessionUsage`.\n */\n",
|
|
10210
10300
|
"excerptTokens": [
|
|
10211
10301
|
{
|
|
10212
10302
|
"kind": "Content",
|
|
@@ -10218,10 +10308,10 @@
|
|
|
10218
10308
|
},
|
|
10219
10309
|
{
|
|
10220
10310
|
"kind": "Content",
|
|
10221
|
-
"text": "
|
|
10311
|
+
"text": ";"
|
|
10222
10312
|
}
|
|
10223
10313
|
],
|
|
10224
|
-
"isReadonly":
|
|
10314
|
+
"isReadonly": true,
|
|
10225
10315
|
"isOptional": false,
|
|
10226
10316
|
"releaseTag": "Beta",
|
|
10227
10317
|
"name": "sessionTokensConsumed",
|
|
@@ -10233,6 +10323,46 @@
|
|
|
10233
10323
|
"isProtected": false,
|
|
10234
10324
|
"isAbstract": false
|
|
10235
10325
|
},
|
|
10326
|
+
{
|
|
10327
|
+
"kind": "Property",
|
|
10328
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#sessionUsage:member",
|
|
10329
|
+
"docComment": "/**\n * Cost plus the four token buckets for this session — derived from the transcript on every change, so it includes sub-agent turns and spend banked by a compaction.\n */\n",
|
|
10330
|
+
"excerptTokens": [
|
|
10331
|
+
{
|
|
10332
|
+
"kind": "Content",
|
|
10333
|
+
"text": "get sessionUsage(): "
|
|
10334
|
+
},
|
|
10335
|
+
{
|
|
10336
|
+
"kind": "Reference",
|
|
10337
|
+
"text": "AggregateUsage",
|
|
10338
|
+
"canonicalReference": "@genesislcap/foundation-ai!AggregateUsage:interface"
|
|
10339
|
+
},
|
|
10340
|
+
{
|
|
10341
|
+
"kind": "Content",
|
|
10342
|
+
"text": ";\n\nset sessionUsage(value: "
|
|
10343
|
+
},
|
|
10344
|
+
{
|
|
10345
|
+
"kind": "Reference",
|
|
10346
|
+
"text": "AggregateUsage",
|
|
10347
|
+
"canonicalReference": "@genesislcap/foundation-ai!AggregateUsage:interface"
|
|
10348
|
+
},
|
|
10349
|
+
{
|
|
10350
|
+
"kind": "Content",
|
|
10351
|
+
"text": ");"
|
|
10352
|
+
}
|
|
10353
|
+
],
|
|
10354
|
+
"isReadonly": false,
|
|
10355
|
+
"isOptional": false,
|
|
10356
|
+
"releaseTag": "Beta",
|
|
10357
|
+
"name": "sessionUsage",
|
|
10358
|
+
"propertyTypeTokenRange": {
|
|
10359
|
+
"startIndex": 1,
|
|
10360
|
+
"endIndex": 2
|
|
10361
|
+
},
|
|
10362
|
+
"isStatic": false,
|
|
10363
|
+
"isProtected": false,
|
|
10364
|
+
"isAbstract": false
|
|
10365
|
+
},
|
|
10236
10366
|
{
|
|
10237
10367
|
"kind": "Method",
|
|
10238
10368
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#setAgent:member(1)",
|
|
@@ -10766,6 +10896,36 @@
|
|
|
10766
10896
|
"isProtected": false,
|
|
10767
10897
|
"isAbstract": false
|
|
10768
10898
|
},
|
|
10899
|
+
{
|
|
10900
|
+
"kind": "Property",
|
|
10901
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#settingsCostLifetimeVisible:member",
|
|
10902
|
+
"docComment": "/**\n * Whether the lifetime-usage section has anything to say.\n *\n * Requires build history: with it off there are no rows, so `cumulativeUsage` falls back to the live session and the section would restate the block directly below it under a \"lifetime\" heading it hasn't earned.\n */\n",
|
|
10903
|
+
"excerptTokens": [
|
|
10904
|
+
{
|
|
10905
|
+
"kind": "Content",
|
|
10906
|
+
"text": "get settingsCostLifetimeVisible(): "
|
|
10907
|
+
},
|
|
10908
|
+
{
|
|
10909
|
+
"kind": "Content",
|
|
10910
|
+
"text": "boolean"
|
|
10911
|
+
},
|
|
10912
|
+
{
|
|
10913
|
+
"kind": "Content",
|
|
10914
|
+
"text": ";"
|
|
10915
|
+
}
|
|
10916
|
+
],
|
|
10917
|
+
"isReadonly": true,
|
|
10918
|
+
"isOptional": false,
|
|
10919
|
+
"releaseTag": "Beta",
|
|
10920
|
+
"name": "settingsCostLifetimeVisible",
|
|
10921
|
+
"propertyTypeTokenRange": {
|
|
10922
|
+
"startIndex": 1,
|
|
10923
|
+
"endIndex": 2
|
|
10924
|
+
},
|
|
10925
|
+
"isStatic": false,
|
|
10926
|
+
"isProtected": false,
|
|
10927
|
+
"isAbstract": false
|
|
10928
|
+
},
|
|
10769
10929
|
{
|
|
10770
10930
|
"kind": "Property",
|
|
10771
10931
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#settingsCostSummaryVisible:member",
|
|
@@ -15177,6 +15337,65 @@
|
|
|
15177
15337
|
],
|
|
15178
15338
|
"name": "load"
|
|
15179
15339
|
},
|
|
15340
|
+
{
|
|
15341
|
+
"kind": "MethodSignature",
|
|
15342
|
+
"canonicalReference": "@genesislcap/ai-assistant!SessionPersistenceProvider#loadCostHistory:member(1)",
|
|
15343
|
+
"docComment": "/**\n * Scoped cost/build history — the per-project usage rows behind the Cost tab.\n *\n * ‼️ **Keyed by SCOPE, not `sessionKey`**, unlike every other method on this interface. A row holds one project's lifetime usage and the list spans projects, so keying it per session would defeat the model. The scope comes from `chatConfig.costHistory.scope`, falling back to the element `id`, then `'default'`.\n *\n * Optional: when a provider omits these, the assistant falls back to `localStorage`, so hosts that don't implement them are unaffected. Implementing them moves the ledger to the host's own backend, which is what stops it being stranded in one browser.\n *\n * Read/written **independently of the `enabled` toggle** (as with preferences and diagnostics): usage accounting is not conversation content, so a user turning off chat retention should not lose their cost ledger. Best-effort — a failed write must never affect the chat.\n *\n * `undefined` from `loadCostHistory` means \"nothing stored\", the same as `[]`.\n */\n",
|
|
15344
|
+
"excerptTokens": [
|
|
15345
|
+
{
|
|
15346
|
+
"kind": "Content",
|
|
15347
|
+
"text": "loadCostHistory?(scope: "
|
|
15348
|
+
},
|
|
15349
|
+
{
|
|
15350
|
+
"kind": "Content",
|
|
15351
|
+
"text": "string"
|
|
15352
|
+
},
|
|
15353
|
+
{
|
|
15354
|
+
"kind": "Content",
|
|
15355
|
+
"text": "): "
|
|
15356
|
+
},
|
|
15357
|
+
{
|
|
15358
|
+
"kind": "Reference",
|
|
15359
|
+
"text": "Promise",
|
|
15360
|
+
"canonicalReference": "!Promise:interface"
|
|
15361
|
+
},
|
|
15362
|
+
{
|
|
15363
|
+
"kind": "Content",
|
|
15364
|
+
"text": "<"
|
|
15365
|
+
},
|
|
15366
|
+
{
|
|
15367
|
+
"kind": "Reference",
|
|
15368
|
+
"text": "CostSessionRecord",
|
|
15369
|
+
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord:interface"
|
|
15370
|
+
},
|
|
15371
|
+
{
|
|
15372
|
+
"kind": "Content",
|
|
15373
|
+
"text": "[] | undefined>"
|
|
15374
|
+
},
|
|
15375
|
+
{
|
|
15376
|
+
"kind": "Content",
|
|
15377
|
+
"text": ";"
|
|
15378
|
+
}
|
|
15379
|
+
],
|
|
15380
|
+
"isOptional": true,
|
|
15381
|
+
"returnTypeTokenRange": {
|
|
15382
|
+
"startIndex": 3,
|
|
15383
|
+
"endIndex": 7
|
|
15384
|
+
},
|
|
15385
|
+
"releaseTag": "Public",
|
|
15386
|
+
"overloadIndex": 1,
|
|
15387
|
+
"parameters": [
|
|
15388
|
+
{
|
|
15389
|
+
"parameterName": "scope",
|
|
15390
|
+
"parameterTypeTokenRange": {
|
|
15391
|
+
"startIndex": 1,
|
|
15392
|
+
"endIndex": 2
|
|
15393
|
+
},
|
|
15394
|
+
"isOptional": false
|
|
15395
|
+
}
|
|
15396
|
+
],
|
|
15397
|
+
"name": "loadCostHistory"
|
|
15398
|
+
},
|
|
15180
15399
|
{
|
|
15181
15400
|
"kind": "MethodSignature",
|
|
15182
15401
|
"canonicalReference": "@genesislcap/ai-assistant!SessionPersistenceProvider#loadDiagnostics:member(1)",
|
|
@@ -15362,6 +15581,77 @@
|
|
|
15362
15581
|
],
|
|
15363
15582
|
"name": "save"
|
|
15364
15583
|
},
|
|
15584
|
+
{
|
|
15585
|
+
"kind": "MethodSignature",
|
|
15586
|
+
"canonicalReference": "@genesislcap/ai-assistant!SessionPersistenceProvider#saveCostHistory:member(1)",
|
|
15587
|
+
"docComment": "/**\n * Replace the stored row list for `scope`. See {@link SessionPersistenceProvider.loadCostHistory}.\n */\n",
|
|
15588
|
+
"excerptTokens": [
|
|
15589
|
+
{
|
|
15590
|
+
"kind": "Content",
|
|
15591
|
+
"text": "saveCostHistory?(scope: "
|
|
15592
|
+
},
|
|
15593
|
+
{
|
|
15594
|
+
"kind": "Content",
|
|
15595
|
+
"text": "string"
|
|
15596
|
+
},
|
|
15597
|
+
{
|
|
15598
|
+
"kind": "Content",
|
|
15599
|
+
"text": ", records: "
|
|
15600
|
+
},
|
|
15601
|
+
{
|
|
15602
|
+
"kind": "Reference",
|
|
15603
|
+
"text": "CostSessionRecord",
|
|
15604
|
+
"canonicalReference": "@genesislcap/ai-assistant!CostSessionRecord:interface"
|
|
15605
|
+
},
|
|
15606
|
+
{
|
|
15607
|
+
"kind": "Content",
|
|
15608
|
+
"text": "[]"
|
|
15609
|
+
},
|
|
15610
|
+
{
|
|
15611
|
+
"kind": "Content",
|
|
15612
|
+
"text": "): "
|
|
15613
|
+
},
|
|
15614
|
+
{
|
|
15615
|
+
"kind": "Reference",
|
|
15616
|
+
"text": "Promise",
|
|
15617
|
+
"canonicalReference": "!Promise:interface"
|
|
15618
|
+
},
|
|
15619
|
+
{
|
|
15620
|
+
"kind": "Content",
|
|
15621
|
+
"text": "<void>"
|
|
15622
|
+
},
|
|
15623
|
+
{
|
|
15624
|
+
"kind": "Content",
|
|
15625
|
+
"text": ";"
|
|
15626
|
+
}
|
|
15627
|
+
],
|
|
15628
|
+
"isOptional": true,
|
|
15629
|
+
"returnTypeTokenRange": {
|
|
15630
|
+
"startIndex": 6,
|
|
15631
|
+
"endIndex": 8
|
|
15632
|
+
},
|
|
15633
|
+
"releaseTag": "Public",
|
|
15634
|
+
"overloadIndex": 1,
|
|
15635
|
+
"parameters": [
|
|
15636
|
+
{
|
|
15637
|
+
"parameterName": "scope",
|
|
15638
|
+
"parameterTypeTokenRange": {
|
|
15639
|
+
"startIndex": 1,
|
|
15640
|
+
"endIndex": 2
|
|
15641
|
+
},
|
|
15642
|
+
"isOptional": false
|
|
15643
|
+
},
|
|
15644
|
+
{
|
|
15645
|
+
"parameterName": "records",
|
|
15646
|
+
"parameterTypeTokenRange": {
|
|
15647
|
+
"startIndex": 3,
|
|
15648
|
+
"endIndex": 5
|
|
15649
|
+
},
|
|
15650
|
+
"isOptional": false
|
|
15651
|
+
}
|
|
15652
|
+
],
|
|
15653
|
+
"name": "saveCostHistory"
|
|
15654
|
+
},
|
|
15365
15655
|
{
|
|
15366
15656
|
"kind": "PropertySignature",
|
|
15367
15657
|
"canonicalReference": "@genesislcap/ai-assistant!SessionPersistenceProvider#saveDebounceMs:member",
|