@genesislcap/ai-assistant 15.15.2 → 15.16.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 +271 -2
- package/dist/ai-assistant.d.ts +90 -1
- package/dist/chat-driver.cjs +72 -0
- package/dist/chat-driver.cjs.map +2 -2
- package/dist/chat-driver.mjs +72 -0
- package/dist/chat-driver.mjs.map +2 -2
- package/dist/custom-elements.json +221 -97
- package/dist/dts/components/ai-driver/ai-driver.d.ts +11 -0
- package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/chat-driver.d.ts +31 -1
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/chat-interaction-wrapper/chat-interaction-wrapper.d.ts +10 -0
- package/dist/dts/components/chat-interaction-wrapper/chat-interaction-wrapper.d.ts.map +1 -1
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.cost.test.d.ts +2 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.cost.test.d.ts.map +1 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +3 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
- package/dist/dts/index.d.ts +1 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/main/file-attachments.test.d.ts +2 -0
- package/dist/dts/main/file-attachments.test.d.ts.map +1 -0
- package/dist/dts/main/interaction-cost.test.d.ts +2 -0
- package/dist/dts/main/interaction-cost.test.d.ts.map +1 -0
- package/dist/dts/main/main.d.ts +27 -0
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/dts/react.d.ts +2 -1
- package/dist/dts/state/debug-event-log.d.ts +1 -1
- package/dist/dts/state/debug-event-log.d.ts.map +1 -1
- package/dist/dts/types/ai-chat-widget.d.ts +8 -0
- package/dist/dts/types/ai-chat-widget.d.ts.map +1 -1
- package/dist/esm/components/chat-driver/chat-driver.js +75 -1
- package/dist/esm/components/chat-driver/chat-driver.test.js +90 -0
- package/dist/esm/components/chat-interaction-wrapper/chat-interaction-wrapper.js +22 -0
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.cost.test.js +76 -0
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +14 -0
- package/dist/esm/main/file-attachments.test.js +164 -0
- package/dist/esm/main/interaction-cost.test.js +107 -0
- package/dist/esm/main/main.js +193 -21
- package/dist/esm/main/main.template.js +1 -0
- package/dist/esm/state/debug-event-log.js +6 -0
- package/dist/react.cjs +6 -1
- package/dist/react.mjs +6 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/src/components/ai-driver/ai-driver.ts +11 -0
- package/src/components/chat-driver/chat-driver.test.ts +109 -0
- package/src/components/chat-driver/chat-driver.ts +78 -1
- package/src/components/chat-interaction-wrapper/chat-interaction-wrapper.ts +29 -0
- package/src/components/orchestrating-driver/orchestrating-driver.cost.test.ts +107 -0
- package/src/components/orchestrating-driver/orchestrating-driver.ts +17 -0
- package/src/index.ts +4 -1
- package/src/main/file-attachments.test.ts +215 -0
- package/src/main/interaction-cost.test.ts +140 -0
- package/src/main/main.template.ts +1 -0
- package/src/main/main.ts +204 -22
- package/src/state/debug-event-log.ts +8 -0
- package/src/types/ai-chat-widget.ts +8 -0
|
@@ -59,6 +59,8 @@ export type MetaEventType =
|
|
|
59
59
|
// Blocking interactions
|
|
60
60
|
| 'interaction.requested'
|
|
61
61
|
| 'interaction.resolved'
|
|
62
|
+
| 'interaction.external-cost'
|
|
63
|
+
| 'interaction.external-cost-dropped'
|
|
62
64
|
// External / unified diagnostics (GENC-1461) — an out-of-band engine's log folded into this session
|
|
63
65
|
| 'external-diagnostics.folded'
|
|
64
66
|
// Context / cost
|
|
@@ -131,6 +133,12 @@ export const META_EVENT_IMPORTANCE: Record<MetaEventType, MetaEventImportance> =
|
|
|
131
133
|
'provider.selected': 'normal',
|
|
132
134
|
'interaction.requested': 'normal',
|
|
133
135
|
'interaction.resolved': 'normal',
|
|
136
|
+
// Bookkeeping about an already-finished turn; interesting when reconciling a session total.
|
|
137
|
+
'interaction.external-cost': 'normal',
|
|
138
|
+
// Spend that was billed but could NOT be recorded (the message was trimmed/condensed away, or
|
|
139
|
+
// the value was not real spend). 'high': it is the one way the session total goes quietly
|
|
140
|
+
// wrong, so it must stand out when reconciling.
|
|
141
|
+
'interaction.external-cost-dropped': 'high',
|
|
134
142
|
'external-diagnostics.folded': 'normal',
|
|
135
143
|
'session.cleared': 'normal',
|
|
136
144
|
'session.switched': 'low',
|
|
@@ -48,6 +48,14 @@ export type AiChatInteraction<TData = unknown, TResult = unknown> =
|
|
|
48
48
|
* change on this `@beta` interface — widgets read `this.interaction` (narrowing on
|
|
49
49
|
* `status`) instead of the removed flat fields.
|
|
50
50
|
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* A widget talks back by dispatching two events, both caught by the wrapper:
|
|
53
|
+
* `interaction-completed` resolves the interaction (once — a second is ignored), and
|
|
54
|
+
* `interaction-cost` reports a positive USD delta for paid work done AFTER resolving,
|
|
55
|
+
* which repeated calls sum. The second exists for widgets that resolve early so the
|
|
56
|
+
* assistant stops waiting, then keep working for the user; without it that spend is
|
|
57
|
+
* billed but missing from the total the user sees.
|
|
58
|
+
*
|
|
51
59
|
* @beta
|
|
52
60
|
*/
|
|
53
61
|
export interface AiChatWidget<TData = unknown, TResult = unknown> {
|