@genesislcap/ai-assistant 14.456.3-alpha-d42d86c.0 → 14.457.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 +239 -2
- package/dist/ai-assistant.d.ts +53 -1
- package/dist/dts/components/chat-driver/chat-driver.d.ts +18 -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/dts/main/main.d.ts +34 -0
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.styles.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts.map +1 -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/utils/sum-costs.d.ts +5 -3
- package/dist/dts/utils/sum-costs.d.ts.map +1 -1
- package/dist/esm/components/chat-driver/chat-driver.js +125 -4
- package/dist/esm/components/chat-driver/chat-driver.test.js +240 -1
- package/dist/esm/main/main.js +76 -0
- package/dist/esm/main/main.styles.js +42 -1
- package/dist/esm/main/main.template.js +22 -1
- package/dist/esm/state/debug-event-log.js +6 -3
- package/dist/esm/utils/sum-costs.js +7 -3
- package/dist/esm/utils/sum-costs.test.js +26 -0
- package/package.json +16 -16
- package/src/components/chat-driver/chat-driver.test.ts +317 -1
- package/src/components/chat-driver/chat-driver.ts +128 -3
- package/src/main/main.styles.ts +42 -1
- package/src/main/main.template.ts +24 -1
- package/src/main/main.ts +78 -0
- package/src/state/debug-event-log.ts +8 -3
- package/src/utils/sum-costs.test.ts +28 -0
- package/src/utils/sum-costs.ts +6 -3
|
@@ -2876,7 +2876,7 @@
|
|
|
2876
2876
|
{
|
|
2877
2877
|
"kind": "Method",
|
|
2878
2878
|
"canonicalReference": "@genesislcap/ai-assistant!ChatDriver#dispose:member(1)",
|
|
2879
|
-
"docComment": "/**\n * Tear down the driver: aborts the lifecycle signal so any in-flight provider request (and prompt/tool factories awaiting it) cancels instead of running on to completion or the transport timeout. Called by the host on driver swap and by `OrchestratingDriver.dispose()`. Idempotent.\n */\n",
|
|
2879
|
+
"docComment": "/**\n * Tear down the driver: aborts the lifecycle signal so any in-flight provider request (and prompt/tool factories awaiting it) cancels instead of running on to completion or the transport timeout. Called by the host on driver swap and by `OrchestratingDriver.dispose()`. Idempotent.\n *\n * Deliberately does NOT settle `pendingInteractions` here: dispose is never reached while one is pending. The only host-level dispose is the agent-swap rebuild, which is guarded by `isBusy()` — a pending interaction keeps the tool loop suspended (`busy === true`), so the swap is deferred until the widget resolves. Sub-agent child disposes always have an empty pending map (widgets park on the parent via `setHostInteractionRequester`). A pending interaction is instead settled by `resolveInteraction` (user response or timeout), which also stamps history and reverts the chat-input override.\n */\n",
|
|
2880
2880
|
"excerptTokens": [
|
|
2881
2881
|
{
|
|
2882
2882
|
"kind": "Content",
|
|
@@ -4764,6 +4764,66 @@
|
|
|
4764
4764
|
"isProtected": false,
|
|
4765
4765
|
"isAbstract": false
|
|
4766
4766
|
},
|
|
4767
|
+
{
|
|
4768
|
+
"kind": "Property",
|
|
4769
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#composerHeightPx:member",
|
|
4770
|
+
"docComment": "/**\n * Explicit composer height (px) once the user has dragged the resize handle; `null` keeps the default auto-grow behaviour. Written into the `--composer-height` custom property via the `composerHeightStyle` getter.\n */\n",
|
|
4771
|
+
"excerptTokens": [
|
|
4772
|
+
{
|
|
4773
|
+
"kind": "Content",
|
|
4774
|
+
"text": "composerHeightPx: "
|
|
4775
|
+
},
|
|
4776
|
+
{
|
|
4777
|
+
"kind": "Content",
|
|
4778
|
+
"text": "number | null"
|
|
4779
|
+
},
|
|
4780
|
+
{
|
|
4781
|
+
"kind": "Content",
|
|
4782
|
+
"text": ";"
|
|
4783
|
+
}
|
|
4784
|
+
],
|
|
4785
|
+
"isReadonly": false,
|
|
4786
|
+
"isOptional": false,
|
|
4787
|
+
"releaseTag": "Beta",
|
|
4788
|
+
"name": "composerHeightPx",
|
|
4789
|
+
"propertyTypeTokenRange": {
|
|
4790
|
+
"startIndex": 1,
|
|
4791
|
+
"endIndex": 2
|
|
4792
|
+
},
|
|
4793
|
+
"isStatic": false,
|
|
4794
|
+
"isProtected": false,
|
|
4795
|
+
"isAbstract": false
|
|
4796
|
+
},
|
|
4797
|
+
{
|
|
4798
|
+
"kind": "Property",
|
|
4799
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#composerHeightStyle:member",
|
|
4800
|
+
"docComment": "/**\n * Inline style for the chat input: writes the chosen height into the `--composer-height` custom property (read by `.chat-input` + its control in `main.styles.ts`). Empty until the user drags (or when resizing is disabled), so the default applies.\n */\n",
|
|
4801
|
+
"excerptTokens": [
|
|
4802
|
+
{
|
|
4803
|
+
"kind": "Content",
|
|
4804
|
+
"text": "get composerHeightStyle(): "
|
|
4805
|
+
},
|
|
4806
|
+
{
|
|
4807
|
+
"kind": "Content",
|
|
4808
|
+
"text": "string"
|
|
4809
|
+
},
|
|
4810
|
+
{
|
|
4811
|
+
"kind": "Content",
|
|
4812
|
+
"text": ";"
|
|
4813
|
+
}
|
|
4814
|
+
],
|
|
4815
|
+
"isReadonly": true,
|
|
4816
|
+
"isOptional": false,
|
|
4817
|
+
"releaseTag": "Beta",
|
|
4818
|
+
"name": "composerHeightStyle",
|
|
4819
|
+
"propertyTypeTokenRange": {
|
|
4820
|
+
"startIndex": 1,
|
|
4821
|
+
"endIndex": 2
|
|
4822
|
+
},
|
|
4823
|
+
"isStatic": false,
|
|
4824
|
+
"isProtected": false,
|
|
4825
|
+
"isAbstract": false
|
|
4826
|
+
},
|
|
4767
4827
|
{
|
|
4768
4828
|
"kind": "Property",
|
|
4769
4829
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#composerHiddenByConfig:member",
|
|
@@ -5237,7 +5297,7 @@
|
|
|
5237
5297
|
},
|
|
5238
5298
|
{
|
|
5239
5299
|
"kind": "Content",
|
|
5240
|
-
"text": ";\n thinking?: boolean;\n agentName?: string;\n agentLabel?: string;\n inputTokens?: number;\n outputTokens?: number;\n cost?: number;\n responseMeta?: import(\"@genesislcap/foundation-ai\")."
|
|
5300
|
+
"text": ";\n thinking?: boolean;\n agentName?: string;\n agentLabel?: string;\n inputTokens?: number;\n outputTokens?: number;\n cost?: number;\n externalCostUsd?: number;\n responseMeta?: import(\"@genesislcap/foundation-ai\")."
|
|
5241
5301
|
},
|
|
5242
5302
|
{
|
|
5243
5303
|
"kind": "Reference",
|
|
@@ -5880,6 +5940,36 @@
|
|
|
5880
5940
|
"isProtected": false,
|
|
5881
5941
|
"isAbstract": false
|
|
5882
5942
|
},
|
|
5943
|
+
{
|
|
5944
|
+
"kind": "Property",
|
|
5945
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#isComposerResizable:member",
|
|
5946
|
+
"docComment": "/**\n * Whether the message input shows a drag handle to resize its height. On by default; hosts opt out via `chatConfig.ui.resizableInput: false`.\n */\n",
|
|
5947
|
+
"excerptTokens": [
|
|
5948
|
+
{
|
|
5949
|
+
"kind": "Content",
|
|
5950
|
+
"text": "get isComposerResizable(): "
|
|
5951
|
+
},
|
|
5952
|
+
{
|
|
5953
|
+
"kind": "Content",
|
|
5954
|
+
"text": "boolean"
|
|
5955
|
+
},
|
|
5956
|
+
{
|
|
5957
|
+
"kind": "Content",
|
|
5958
|
+
"text": ";"
|
|
5959
|
+
}
|
|
5960
|
+
],
|
|
5961
|
+
"isReadonly": true,
|
|
5962
|
+
"isOptional": false,
|
|
5963
|
+
"releaseTag": "Beta",
|
|
5964
|
+
"name": "isComposerResizable",
|
|
5965
|
+
"propertyTypeTokenRange": {
|
|
5966
|
+
"startIndex": 1,
|
|
5967
|
+
"endIndex": 2
|
|
5968
|
+
},
|
|
5969
|
+
"isStatic": false,
|
|
5970
|
+
"isProtected": false,
|
|
5971
|
+
"isAbstract": false
|
|
5972
|
+
},
|
|
5883
5973
|
{
|
|
5884
5974
|
"kind": "Property",
|
|
5885
5975
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#isEngaged:member",
|
|
@@ -6108,6 +6198,153 @@
|
|
|
6108
6198
|
"isAbstract": false,
|
|
6109
6199
|
"name": "onChatHeaderMouseDown"
|
|
6110
6200
|
},
|
|
6201
|
+
{
|
|
6202
|
+
"kind": "Method",
|
|
6203
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#onComposerResizeEnd:member(1)",
|
|
6204
|
+
"docComment": "/**\n * End a resize drag and release the pointer capture.\n */\n",
|
|
6205
|
+
"excerptTokens": [
|
|
6206
|
+
{
|
|
6207
|
+
"kind": "Content",
|
|
6208
|
+
"text": "onComposerResizeEnd(e: "
|
|
6209
|
+
},
|
|
6210
|
+
{
|
|
6211
|
+
"kind": "Reference",
|
|
6212
|
+
"text": "PointerEvent",
|
|
6213
|
+
"canonicalReference": "!PointerEvent:interface"
|
|
6214
|
+
},
|
|
6215
|
+
{
|
|
6216
|
+
"kind": "Content",
|
|
6217
|
+
"text": "): "
|
|
6218
|
+
},
|
|
6219
|
+
{
|
|
6220
|
+
"kind": "Content",
|
|
6221
|
+
"text": "void"
|
|
6222
|
+
},
|
|
6223
|
+
{
|
|
6224
|
+
"kind": "Content",
|
|
6225
|
+
"text": ";"
|
|
6226
|
+
}
|
|
6227
|
+
],
|
|
6228
|
+
"isStatic": false,
|
|
6229
|
+
"returnTypeTokenRange": {
|
|
6230
|
+
"startIndex": 3,
|
|
6231
|
+
"endIndex": 4
|
|
6232
|
+
},
|
|
6233
|
+
"releaseTag": "Beta",
|
|
6234
|
+
"isProtected": false,
|
|
6235
|
+
"overloadIndex": 1,
|
|
6236
|
+
"parameters": [
|
|
6237
|
+
{
|
|
6238
|
+
"parameterName": "e",
|
|
6239
|
+
"parameterTypeTokenRange": {
|
|
6240
|
+
"startIndex": 1,
|
|
6241
|
+
"endIndex": 2
|
|
6242
|
+
},
|
|
6243
|
+
"isOptional": false
|
|
6244
|
+
}
|
|
6245
|
+
],
|
|
6246
|
+
"isOptional": false,
|
|
6247
|
+
"isAbstract": false,
|
|
6248
|
+
"name": "onComposerResizeEnd"
|
|
6249
|
+
},
|
|
6250
|
+
{
|
|
6251
|
+
"kind": "Method",
|
|
6252
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#onComposerResizeMove:member(1)",
|
|
6253
|
+
"docComment": "/**\n * Resize while dragging. Dragging up (clientY decreases) grows the composer; the result is clamped between the natural height (lower) and the available headroom/max (upper). No-op unless a drag is active (the handle holds pointer capture), so plain hover-moves are ignored.\n */\n",
|
|
6254
|
+
"excerptTokens": [
|
|
6255
|
+
{
|
|
6256
|
+
"kind": "Content",
|
|
6257
|
+
"text": "onComposerResizeMove(e: "
|
|
6258
|
+
},
|
|
6259
|
+
{
|
|
6260
|
+
"kind": "Reference",
|
|
6261
|
+
"text": "PointerEvent",
|
|
6262
|
+
"canonicalReference": "!PointerEvent:interface"
|
|
6263
|
+
},
|
|
6264
|
+
{
|
|
6265
|
+
"kind": "Content",
|
|
6266
|
+
"text": "): "
|
|
6267
|
+
},
|
|
6268
|
+
{
|
|
6269
|
+
"kind": "Content",
|
|
6270
|
+
"text": "void"
|
|
6271
|
+
},
|
|
6272
|
+
{
|
|
6273
|
+
"kind": "Content",
|
|
6274
|
+
"text": ";"
|
|
6275
|
+
}
|
|
6276
|
+
],
|
|
6277
|
+
"isStatic": false,
|
|
6278
|
+
"returnTypeTokenRange": {
|
|
6279
|
+
"startIndex": 3,
|
|
6280
|
+
"endIndex": 4
|
|
6281
|
+
},
|
|
6282
|
+
"releaseTag": "Beta",
|
|
6283
|
+
"isProtected": false,
|
|
6284
|
+
"overloadIndex": 1,
|
|
6285
|
+
"parameters": [
|
|
6286
|
+
{
|
|
6287
|
+
"parameterName": "e",
|
|
6288
|
+
"parameterTypeTokenRange": {
|
|
6289
|
+
"startIndex": 1,
|
|
6290
|
+
"endIndex": 2
|
|
6291
|
+
},
|
|
6292
|
+
"isOptional": false
|
|
6293
|
+
}
|
|
6294
|
+
],
|
|
6295
|
+
"isOptional": false,
|
|
6296
|
+
"isAbstract": false,
|
|
6297
|
+
"name": "onComposerResizeMove"
|
|
6298
|
+
},
|
|
6299
|
+
{
|
|
6300
|
+
"kind": "Method",
|
|
6301
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#onComposerResizeStart:member(1)",
|
|
6302
|
+
"docComment": "/**\n * Begin a composer resize drag. Captures the pointer so move/up keep firing on the handle even when the cursor leaves its 7px band.\n */\n",
|
|
6303
|
+
"excerptTokens": [
|
|
6304
|
+
{
|
|
6305
|
+
"kind": "Content",
|
|
6306
|
+
"text": "onComposerResizeStart(e: "
|
|
6307
|
+
},
|
|
6308
|
+
{
|
|
6309
|
+
"kind": "Reference",
|
|
6310
|
+
"text": "PointerEvent",
|
|
6311
|
+
"canonicalReference": "!PointerEvent:interface"
|
|
6312
|
+
},
|
|
6313
|
+
{
|
|
6314
|
+
"kind": "Content",
|
|
6315
|
+
"text": "): "
|
|
6316
|
+
},
|
|
6317
|
+
{
|
|
6318
|
+
"kind": "Content",
|
|
6319
|
+
"text": "void"
|
|
6320
|
+
},
|
|
6321
|
+
{
|
|
6322
|
+
"kind": "Content",
|
|
6323
|
+
"text": ";"
|
|
6324
|
+
}
|
|
6325
|
+
],
|
|
6326
|
+
"isStatic": false,
|
|
6327
|
+
"returnTypeTokenRange": {
|
|
6328
|
+
"startIndex": 3,
|
|
6329
|
+
"endIndex": 4
|
|
6330
|
+
},
|
|
6331
|
+
"releaseTag": "Beta",
|
|
6332
|
+
"isProtected": false,
|
|
6333
|
+
"overloadIndex": 1,
|
|
6334
|
+
"parameters": [
|
|
6335
|
+
{
|
|
6336
|
+
"parameterName": "e",
|
|
6337
|
+
"parameterTypeTokenRange": {
|
|
6338
|
+
"startIndex": 1,
|
|
6339
|
+
"endIndex": 2
|
|
6340
|
+
},
|
|
6341
|
+
"isOptional": false
|
|
6342
|
+
}
|
|
6343
|
+
],
|
|
6344
|
+
"isOptional": false,
|
|
6345
|
+
"isAbstract": false,
|
|
6346
|
+
"name": "onComposerResizeStart"
|
|
6347
|
+
},
|
|
6111
6348
|
{
|
|
6112
6349
|
"kind": "Property",
|
|
6113
6350
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#pinLocked:member",
|
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -786,6 +786,15 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
786
786
|
* request (and prompt/tool factories awaiting it) cancels instead of running
|
|
787
787
|
* on to completion or the transport timeout. Called by the host on driver
|
|
788
788
|
* swap and by `OrchestratingDriver.dispose()`. Idempotent.
|
|
789
|
+
*
|
|
790
|
+
* Deliberately does NOT settle `pendingInteractions` here: dispose is never
|
|
791
|
+
* reached while one is pending. The only host-level dispose is the agent-swap
|
|
792
|
+
* rebuild, which is guarded by `isBusy()` — a pending interaction keeps the
|
|
793
|
+
* tool loop suspended (`busy === true`), so the swap is deferred until the
|
|
794
|
+
* widget resolves. Sub-agent child disposes always have an empty pending map
|
|
795
|
+
* (widgets park on the parent via `setHostInteractionRequester`). A pending
|
|
796
|
+
* interaction is instead settled by `resolveInteraction` (user response or
|
|
797
|
+
* timeout), which also stamps history and reverts the chat-input override.
|
|
789
798
|
*/
|
|
790
799
|
dispose(): void;
|
|
791
800
|
/**
|
|
@@ -941,6 +950,15 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
941
950
|
* Marks the interaction message as resolved so it renders read-only on re-render.
|
|
942
951
|
*/
|
|
943
952
|
resolveInteraction(interactionId: string, result: any): void;
|
|
953
|
+
/**
|
|
954
|
+
* Resolve every in-flight interaction with a `'timeout'` result, closing its
|
|
955
|
+
* widget read-only. Used when a sub-agent that owns the open widget times out:
|
|
956
|
+
* the widget is parked in *this* driver's map (interactions resolve on the
|
|
957
|
+
* host, not the child), so cancelling it here unblocks the sub-agent handler
|
|
958
|
+
* awaiting it. The "one interaction at a time" invariant means there is at
|
|
959
|
+
* most one.
|
|
960
|
+
*/
|
|
961
|
+
private cancelPendingInteractions;
|
|
944
962
|
/**
|
|
945
963
|
* Seeds the driver with a prior conversation history so a new component instance
|
|
946
964
|
* can continue an existing conversation. Call this before the first user message.
|
|
@@ -1333,6 +1351,21 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
1333
1351
|
messagesEl?: HTMLElement;
|
|
1334
1352
|
/** Bound to the rapid-text-area chat input via the template ref. */
|
|
1335
1353
|
chatInputEl?: HTMLElement;
|
|
1354
|
+
/**
|
|
1355
|
+
* Explicit composer height (px) once the user has dragged the resize handle;
|
|
1356
|
+
* `null` keeps the default auto-grow behaviour. Written into the
|
|
1357
|
+
* `--composer-height` custom property via the `composerHeightStyle` getter.
|
|
1358
|
+
*/
|
|
1359
|
+
composerHeightPx: number | null;
|
|
1360
|
+
/** Pointer Y and composer height captured at the start of a resize drag. */
|
|
1361
|
+
private _resizeStartY;
|
|
1362
|
+
private _resizeStartHeight;
|
|
1363
|
+
/** The composer's natural (un-resized) height, measured on first drag — used
|
|
1364
|
+
* as the lower bound so the box can't be dragged smaller than it started. */
|
|
1365
|
+
private _composerNaturalHeight;
|
|
1366
|
+
/** Upper bound for the current drag — capped to the headroom above so growing
|
|
1367
|
+
* the composer never pushes the input row's buttons off the bottom. */
|
|
1368
|
+
private _resizeMaxHeight;
|
|
1336
1369
|
/**
|
|
1337
1370
|
* True when the user's last interaction (pointer or keyboard focus) was inside
|
|
1338
1371
|
* the assistant. Defaults to true so the assistant claims focus on first mount.
|
|
@@ -1536,6 +1569,7 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
1536
1569
|
inputTokens?: number;
|
|
1537
1570
|
outputTokens?: number;
|
|
1538
1571
|
cost?: number;
|
|
1572
|
+
externalCostUsd?: number;
|
|
1539
1573
|
responseMeta?: ChatResponseMeta;
|
|
1540
1574
|
kind: "message";
|
|
1541
1575
|
} | {
|
|
@@ -1647,6 +1681,24 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
1647
1681
|
private send;
|
|
1648
1682
|
onChatHeaderMouseDown(e: MouseEvent): void;
|
|
1649
1683
|
handleInteractionCompleted(e: Event): void;
|
|
1684
|
+
/** Whether the message input shows a drag handle to resize its height.
|
|
1685
|
+
* On by default; hosts opt out via `chatConfig.ui.resizableInput: false`. */
|
|
1686
|
+
get isComposerResizable(): boolean;
|
|
1687
|
+
/** Inline style for the chat input: writes the chosen height into the
|
|
1688
|
+
* `--composer-height` custom property (read by `.chat-input` + its control in
|
|
1689
|
+
* `main.styles.ts`). Empty until the user drags (or when resizing is disabled),
|
|
1690
|
+
* so the default applies. */
|
|
1691
|
+
get composerHeightStyle(): string;
|
|
1692
|
+
/** Begin a composer resize drag. Captures the pointer so move/up keep firing
|
|
1693
|
+
* on the handle even when the cursor leaves its 7px band. */
|
|
1694
|
+
onComposerResizeStart(e: PointerEvent): void;
|
|
1695
|
+
/** Resize while dragging. Dragging up (clientY decreases) grows the composer;
|
|
1696
|
+
* the result is clamped between the natural height (lower) and the available
|
|
1697
|
+
* headroom/max (upper). No-op unless a drag is active (the handle holds pointer
|
|
1698
|
+
* capture), so plain hover-moves are ignored. */
|
|
1699
|
+
onComposerResizeMove(e: PointerEvent): void;
|
|
1700
|
+
/** End a resize drag and release the pointer capture. */
|
|
1701
|
+
onComposerResizeEnd(e: PointerEvent): void;
|
|
1650
1702
|
}
|
|
1651
1703
|
|
|
1652
1704
|
/** @internal */
|
|
@@ -1785,7 +1837,7 @@ declare type MetaEventImportance = 'high' | 'normal' | 'low';
|
|
|
1785
1837
|
* Catalogue of meta event names. This is the documented surface — extend it as
|
|
1786
1838
|
* new events are wired in (Tier 2/3 lifecycle, interaction, provider events).
|
|
1787
1839
|
*/
|
|
1788
|
-
declare type MetaEventType = 'assistant.connected' | 'assistant.disconnected' | 'assistant.popout' | 'assistant.popin' | 'driver.created' | 'driver.wired' | 'driver.unwired' | 'state.changed' | 'turn.start' | 'turn.end' | 'turn.retry' | 'turn.error' | 'tool.failed' | 'tool.unresolved' | 'subagent.failed' | 'agent.handoff' | 'agent.pinned' | 'agent.unpinned' | 'provider.selected' | 'interaction.requested' | 'interaction.resolved' | 'context.updated' | 'context.threshold-crossed' | 'panel.toggled' | 'attachment.added' | 'file.read-failed' | 'suggestions.failed';
|
|
1840
|
+
declare type MetaEventType = 'assistant.connected' | 'assistant.disconnected' | 'assistant.popout' | 'assistant.popin' | 'driver.created' | 'driver.wired' | 'driver.unwired' | 'state.changed' | 'turn.start' | 'turn.end' | 'turn.retry' | 'turn.error' | 'tool.failed' | 'tool.unresolved' | 'subagent.started' | 'subagent.completed' | 'subagent.failed' | 'agent.handoff' | 'agent.pinned' | 'agent.unpinned' | 'provider.selected' | 'interaction.requested' | 'interaction.resolved' | 'context.updated' | 'context.threshold-crossed' | 'panel.toggled' | 'attachment.added' | 'file.read-failed' | 'suggestions.failed';
|
|
1789
1841
|
|
|
1790
1842
|
/**
|
|
1791
1843
|
* Orchestrates multiple specialist agents. Sits between `FoundationAiAssistant`
|
|
@@ -255,6 +255,15 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
255
255
|
* request (and prompt/tool factories awaiting it) cancels instead of running
|
|
256
256
|
* on to completion or the transport timeout. Called by the host on driver
|
|
257
257
|
* swap and by `OrchestratingDriver.dispose()`. Idempotent.
|
|
258
|
+
*
|
|
259
|
+
* Deliberately does NOT settle `pendingInteractions` here: dispose is never
|
|
260
|
+
* reached while one is pending. The only host-level dispose is the agent-swap
|
|
261
|
+
* rebuild, which is guarded by `isBusy()` — a pending interaction keeps the
|
|
262
|
+
* tool loop suspended (`busy === true`), so the swap is deferred until the
|
|
263
|
+
* widget resolves. Sub-agent child disposes always have an empty pending map
|
|
264
|
+
* (widgets park on the parent via `setHostInteractionRequester`). A pending
|
|
265
|
+
* interaction is instead settled by `resolveInteraction` (user response or
|
|
266
|
+
* timeout), which also stamps history and reverts the chat-input override.
|
|
258
267
|
*/
|
|
259
268
|
dispose(): void;
|
|
260
269
|
/**
|
|
@@ -410,6 +419,15 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
410
419
|
* Marks the interaction message as resolved so it renders read-only on re-render.
|
|
411
420
|
*/
|
|
412
421
|
resolveInteraction(interactionId: string, result: any): void;
|
|
422
|
+
/**
|
|
423
|
+
* Resolve every in-flight interaction with a `'timeout'` result, closing its
|
|
424
|
+
* widget read-only. Used when a sub-agent that owns the open widget times out:
|
|
425
|
+
* the widget is parked in *this* driver's map (interactions resolve on the
|
|
426
|
+
* host, not the child), so cancelling it here unblocks the sub-agent handler
|
|
427
|
+
* awaiting it. The "one interaction at a time" invariant means there is at
|
|
428
|
+
* most one.
|
|
429
|
+
*/
|
|
430
|
+
private cancelPendingInteractions;
|
|
413
431
|
/**
|
|
414
432
|
* Seeds the driver with a prior conversation history so a new component instance
|
|
415
433
|
* can continue an existing conversation. Call this before the first user message.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAGX,cAAc,EAGd,yBAAyB,
|
|
1
|
+
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAGX,cAAc,EAGd,yBAAyB,EAEzB,qBAAqB,EAEtB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EACV,WAAW,EAGX,iBAAiB,EAGjB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AA6BxE,wFAAwF;AACxF,eAAO,MAAM,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,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAS3C,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA4C/F;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAyC3B;;;;;OAKG;YACW,cAAc;IAgL5B;;;OAGG;IACG,mBAAmB,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA6CrF,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;IAqChB,OAAO,CAAC,aAAa;IAQrB,8EAA8E;IAC9E,OAAO,CAAC,SAAS;IAWjB,mFAAmF;IACnF,OAAO,CAAC,2BAA2B;YAkCrB,WAAW;IA4oBzB,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":"AAmBA,OAAO,uBAAuB,CAAC"}
|
package/dist/dts/main/main.d.ts
CHANGED
|
@@ -189,6 +189,21 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
189
189
|
messagesEl?: HTMLElement;
|
|
190
190
|
/** Bound to the rapid-text-area chat input via the template ref. */
|
|
191
191
|
chatInputEl?: HTMLElement;
|
|
192
|
+
/**
|
|
193
|
+
* Explicit composer height (px) once the user has dragged the resize handle;
|
|
194
|
+
* `null` keeps the default auto-grow behaviour. Written into the
|
|
195
|
+
* `--composer-height` custom property via the `composerHeightStyle` getter.
|
|
196
|
+
*/
|
|
197
|
+
composerHeightPx: number | null;
|
|
198
|
+
/** Pointer Y and composer height captured at the start of a resize drag. */
|
|
199
|
+
private _resizeStartY;
|
|
200
|
+
private _resizeStartHeight;
|
|
201
|
+
/** The composer's natural (un-resized) height, measured on first drag — used
|
|
202
|
+
* as the lower bound so the box can't be dragged smaller than it started. */
|
|
203
|
+
private _composerNaturalHeight;
|
|
204
|
+
/** Upper bound for the current drag — capped to the headroom above so growing
|
|
205
|
+
* the composer never pushes the input row's buttons off the bottom. */
|
|
206
|
+
private _resizeMaxHeight;
|
|
192
207
|
/**
|
|
193
208
|
* True when the user's last interaction (pointer or keyboard focus) was inside
|
|
194
209
|
* the assistant. Defaults to true so the assistant claims focus on first mount.
|
|
@@ -392,6 +407,7 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
392
407
|
inputTokens?: number;
|
|
393
408
|
outputTokens?: number;
|
|
394
409
|
cost?: number;
|
|
410
|
+
externalCostUsd?: number;
|
|
395
411
|
responseMeta?: import("@genesislcap/foundation-ai").ChatResponseMeta;
|
|
396
412
|
kind: "message";
|
|
397
413
|
} | {
|
|
@@ -503,5 +519,23 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
503
519
|
private send;
|
|
504
520
|
onChatHeaderMouseDown(e: MouseEvent): void;
|
|
505
521
|
handleInteractionCompleted(e: Event): void;
|
|
522
|
+
/** Whether the message input shows a drag handle to resize its height.
|
|
523
|
+
* On by default; hosts opt out via `chatConfig.ui.resizableInput: false`. */
|
|
524
|
+
get isComposerResizable(): boolean;
|
|
525
|
+
/** Inline style for the chat input: writes the chosen height into the
|
|
526
|
+
* `--composer-height` custom property (read by `.chat-input` + its control in
|
|
527
|
+
* `main.styles.ts`). Empty until the user drags (or when resizing is disabled),
|
|
528
|
+
* so the default applies. */
|
|
529
|
+
get composerHeightStyle(): string;
|
|
530
|
+
/** Begin a composer resize drag. Captures the pointer so move/up keep firing
|
|
531
|
+
* on the handle even when the cursor leaves its 7px band. */
|
|
532
|
+
onComposerResizeStart(e: PointerEvent): void;
|
|
533
|
+
/** Resize while dragging. Dragging up (clientY decreases) grows the composer;
|
|
534
|
+
* the result is clamped between the natural height (lower) and the available
|
|
535
|
+
* headroom/max (upper). No-op unless a drag is active (the handle holds pointer
|
|
536
|
+
* capture), so plain hover-moves are ignored. */
|
|
537
|
+
onComposerResizeMove(e: PointerEvent): void;
|
|
538
|
+
/** End a resize drag and release the pointer capture. */
|
|
539
|
+
onComposerResizeEnd(e: PointerEvent): void;
|
|
506
540
|
}
|
|
507
541
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,UAAU,EACV,4BAA4B,EAC5B,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAGL,cAAc,EAIf,MAAM,uBAAuB,CAAC;AAW/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAiBlC,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,UAAU,EACV,4BAA4B,EAC5B,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAG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,YAAY,GAAG,IAAI;IAoB5C;;;qDAGiD;IACjD,oBAAoB,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;IAS3C,yDAAyD;IACzD,mBAAmB,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;CAI3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,iDAozBlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,EAAuC,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,EAAuC,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AA2IpD,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,GACxC,oBAAoB,MAAM,KACzB,YAAY,CAAC,qBAAqB,CAqkBpC,CAAC"}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* Catalogue of meta event names. This is the documented surface — extend it as
|
|
28
28
|
* new events are wired in (Tier 2/3 lifecycle, interaction, provider events).
|
|
29
29
|
*/
|
|
30
|
-
export type MetaEventType = 'assistant.connected' | 'assistant.disconnected' | 'assistant.popout' | 'assistant.popin' | 'driver.created' | 'driver.wired' | 'driver.unwired' | 'state.changed' | 'turn.start' | 'turn.end' | 'turn.retry' | 'turn.error' | 'tool.failed' | 'tool.unresolved' | 'subagent.failed' | 'agent.handoff' | 'agent.pinned' | 'agent.unpinned' | 'provider.selected' | 'interaction.requested' | 'interaction.resolved' | 'context.updated' | 'context.threshold-crossed' | 'panel.toggled' | 'attachment.added' | 'file.read-failed' | 'suggestions.failed';
|
|
30
|
+
export type MetaEventType = 'assistant.connected' | 'assistant.disconnected' | 'assistant.popout' | 'assistant.popin' | 'driver.created' | 'driver.wired' | 'driver.unwired' | 'state.changed' | 'turn.start' | 'turn.end' | 'turn.retry' | 'turn.error' | 'tool.failed' | 'tool.unresolved' | 'subagent.started' | 'subagent.completed' | 'subagent.failed' | 'agent.handoff' | 'agent.pinned' | 'agent.unpinned' | 'provider.selected' | 'interaction.requested' | 'interaction.resolved' | 'context.updated' | 'context.threshold-crossed' | 'panel.toggled' | 'attachment.added' | 'file.read-failed' | 'suggestions.failed';
|
|
31
31
|
/**
|
|
32
32
|
* How much a reader should care about an event — lets a consumer (or an AI
|
|
33
33
|
* agent) filter the timeline: skip `low` UI/bookkeeping noise, skim `normal`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug-event-log.d.ts","sourceRoot":"","sources":["../../../src/state/debug-event-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;GAGG;AACH,MAAM,MAAM,aAAa,GAErB,qBAAqB,GACrB,wBAAwB,GACxB,kBAAkB,GAClB,iBAAiB,GAEjB,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAEhB,eAAe,GACf,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,iBAAiB,GACjB,iBAAiB,GAEjB,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GAEnB,uBAAuB,GACvB,sBAAsB,GAEtB,iBAAiB,GACjB,2BAA2B,GAE3B,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,CAAC;AAEzB;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE5D;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,aAAa,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"debug-event-log.d.ts","sourceRoot":"","sources":["../../../src/state/debug-event-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;GAGG;AACH,MAAM,MAAM,aAAa,GAErB,qBAAqB,GACrB,wBAAwB,GACxB,kBAAkB,GAClB,iBAAiB,GAEjB,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAEhB,eAAe,GACf,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,iBAAiB,GAEjB,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GAEnB,uBAAuB,GACvB,sBAAsB,GAEtB,iBAAiB,GACjB,2BAA2B,GAE3B,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,CAAC;AAEzB;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE5D;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAgC5E,CAAC;AAEF,4CAA4C;AAC5C,MAAM,WAAW,SAAS;IACxB,0FAA0F;IAC1F,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,IAAI,EAAE,aAAa,CAAC;IACpB,6EAA6E;IAC7E,UAAU,EAAE,mBAAmB,CAAC;IAChC,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAmBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,aAAa,EACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAyBN;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,yBAAyB,GACzB,gBAAgB,GAChB,oBAAoB,GACpB,gBAAgB,CAAC;AAErB;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,EACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAEN;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,EACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAEN;AAED,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,CAEnE;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAY7C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ChatMessage } from '@genesislcap/foundation-ai';
|
|
2
2
|
/**
|
|
3
|
-
* Sum
|
|
4
|
-
* `
|
|
5
|
-
*
|
|
3
|
+
* Sum cost across a message list: each message's provider-reported LLM `cost`
|
|
4
|
+
* plus any `externalCostUsd` a widget reported for its own external service
|
|
5
|
+
* calls, recursing into each tool call's `subAgentTrace` so LLM calls made by
|
|
6
|
+
* sub-agents (potentially on a different provider with different rates)
|
|
7
|
+
* contribute to the total.
|
|
6
8
|
*
|
|
7
9
|
* Returns 0 when no messages carry a cost — providers that don't report usage
|
|
8
10
|
* metadata (e.g. Chrome built-in) are skipped silently.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sum-costs.d.ts","sourceRoot":"","sources":["../../../src/utils/sum-costs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D
|
|
1
|
+
{"version":3,"file":"sum-costs.d.ts","sourceRoot":"","sources":["../../../src/utils/sum-costs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAUjE"}
|