@genesislcap/ai-assistant 14.439.3 → 14.443.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/api-extractor.json +9 -9
- package/dist/ai-assistant.api.json +173 -0
- package/dist/ai-assistant.d.ts +48 -0
- package/dist/dts/components/popout-manager/popout-manager.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +36 -2
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/dts/main/main.types.d.ts +13 -0
- package/dist/dts/main/main.types.d.ts.map +1 -1
- package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
- package/dist/dts/suggestions/chat-suggestions.d.ts.map +1 -1
- package/dist/dts/tags/index.d.ts +1 -0
- package/dist/dts/tags/index.d.ts.map +1 -1
- package/dist/esm/components/chat-driver/chat-driver.js +7 -7
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +6 -6
- package/dist/esm/components/popout-manager/popout-manager.js +1 -0
- package/dist/esm/main/main.js +104 -15
- package/dist/esm/main/main.template.js +3 -2
- package/dist/esm/suggestions/chat-suggestions.js +1 -2
- package/dist/esm/tags/index.js +1 -0
- package/package.json +18 -18
- package/src/components/chat-driver/chat-driver.ts +7 -7
- package/src/components/orchestrating-driver/orchestrating-driver.ts +6 -6
- package/src/components/popout-manager/popout-manager.ts +1 -0
- package/src/main/main.template.ts +6 -3
- package/src/main/main.ts +101 -15
- package/src/main/main.types.ts +14 -0
- package/src/state/ai-assistant-slice.ts +1 -1
- package/src/suggestions/chat-suggestions.ts +9 -2
- package/src/tags/index.ts +1 -0
- package/tsconfig.json +1 -3
package/api-extractor.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "../../../../api-extractor.json",
|
|
4
|
+
"messages": {
|
|
5
|
+
"extractorMessageReporting": {
|
|
6
|
+
"ae-wrong-input-file-type": {
|
|
7
|
+
"logLevel": "none"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
11
|
}
|
|
@@ -4427,6 +4427,36 @@
|
|
|
4427
4427
|
"isProtected": false,
|
|
4428
4428
|
"isAbstract": false
|
|
4429
4429
|
},
|
|
4430
|
+
{
|
|
4431
|
+
"kind": "Property",
|
|
4432
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#composerHiddenByConfig:member",
|
|
4433
|
+
"docComment": "/**\n * Whether the built-in composer (input row + attachment chips) is hidden by the host's `chatConfig.ui.hideComposer` setting. Used by the template to gate those blocks. Marked `@volatile` because the `'while-splash'` branch reads `showingSplash` only conditionally, so FAST cannot rely on cached dependency tracking.\n */\n",
|
|
4434
|
+
"excerptTokens": [
|
|
4435
|
+
{
|
|
4436
|
+
"kind": "Content",
|
|
4437
|
+
"text": "get composerHiddenByConfig(): "
|
|
4438
|
+
},
|
|
4439
|
+
{
|
|
4440
|
+
"kind": "Content",
|
|
4441
|
+
"text": "boolean"
|
|
4442
|
+
},
|
|
4443
|
+
{
|
|
4444
|
+
"kind": "Content",
|
|
4445
|
+
"text": ";"
|
|
4446
|
+
}
|
|
4447
|
+
],
|
|
4448
|
+
"isReadonly": true,
|
|
4449
|
+
"isOptional": false,
|
|
4450
|
+
"releaseTag": "Beta",
|
|
4451
|
+
"name": "composerHiddenByConfig",
|
|
4452
|
+
"propertyTypeTokenRange": {
|
|
4453
|
+
"startIndex": 1,
|
|
4454
|
+
"endIndex": 2
|
|
4455
|
+
},
|
|
4456
|
+
"isStatic": false,
|
|
4457
|
+
"isProtected": false,
|
|
4458
|
+
"isAbstract": false
|
|
4459
|
+
},
|
|
4430
4460
|
{
|
|
4431
4461
|
"kind": "Method",
|
|
4432
4462
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#connectedCallback:member(1)",
|
|
@@ -6322,6 +6352,77 @@
|
|
|
6322
6352
|
"isProtected": false,
|
|
6323
6353
|
"isAbstract": false
|
|
6324
6354
|
},
|
|
6355
|
+
{
|
|
6356
|
+
"kind": "Method",
|
|
6357
|
+
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#submitMessage:member(1)",
|
|
6358
|
+
"docComment": "/**\n * Programmatically submit a message. Equivalent to the user typing into the built-in composer and pressing send, but callable from external code — most commonly a custom input rendered inside `slot=\"splash\"` when paired with `chatConfig.ui.hideComposer`.\n *\n * The input fully describes the turn: `text` and `files` REPLACE any current composer state (they are not appended to it). Files are validated against `chatConfig.ui.acceptedFiles` using the same pipeline as the composer's attach button.\n *\n * Atomic on validation: if any file fails validation, no attachments are committed and no send is dispatched. Failure messages are returned in `errors` AND appended to the `attachmentErrors` observable so the built-in chip UI still surfaces them when visible.\n *\n * Resolves once the underlying send has been kicked off — it does NOT await the assistant's response.\n *\n * @beta\n */\n",
|
|
6359
|
+
"excerptTokens": [
|
|
6360
|
+
{
|
|
6361
|
+
"kind": "Content",
|
|
6362
|
+
"text": "submitMessage(input: "
|
|
6363
|
+
},
|
|
6364
|
+
{
|
|
6365
|
+
"kind": "Content",
|
|
6366
|
+
"text": "{\n text?: string;\n files?: "
|
|
6367
|
+
},
|
|
6368
|
+
{
|
|
6369
|
+
"kind": "Reference",
|
|
6370
|
+
"text": "File",
|
|
6371
|
+
"canonicalReference": "!File:interface"
|
|
6372
|
+
},
|
|
6373
|
+
{
|
|
6374
|
+
"kind": "Content",
|
|
6375
|
+
"text": "[];\n }"
|
|
6376
|
+
},
|
|
6377
|
+
{
|
|
6378
|
+
"kind": "Content",
|
|
6379
|
+
"text": "): "
|
|
6380
|
+
},
|
|
6381
|
+
{
|
|
6382
|
+
"kind": "Reference",
|
|
6383
|
+
"text": "Promise",
|
|
6384
|
+
"canonicalReference": "!Promise:interface"
|
|
6385
|
+
},
|
|
6386
|
+
{
|
|
6387
|
+
"kind": "Content",
|
|
6388
|
+
"text": "<"
|
|
6389
|
+
},
|
|
6390
|
+
{
|
|
6391
|
+
"kind": "Reference",
|
|
6392
|
+
"text": "SubmitMessageResult",
|
|
6393
|
+
"canonicalReference": "@genesislcap/ai-assistant!SubmitMessageResult:interface"
|
|
6394
|
+
},
|
|
6395
|
+
{
|
|
6396
|
+
"kind": "Content",
|
|
6397
|
+
"text": ">"
|
|
6398
|
+
},
|
|
6399
|
+
{
|
|
6400
|
+
"kind": "Content",
|
|
6401
|
+
"text": ";"
|
|
6402
|
+
}
|
|
6403
|
+
],
|
|
6404
|
+
"isStatic": false,
|
|
6405
|
+
"returnTypeTokenRange": {
|
|
6406
|
+
"startIndex": 5,
|
|
6407
|
+
"endIndex": 9
|
|
6408
|
+
},
|
|
6409
|
+
"releaseTag": "Beta",
|
|
6410
|
+
"isProtected": false,
|
|
6411
|
+
"overloadIndex": 1,
|
|
6412
|
+
"parameters": [
|
|
6413
|
+
{
|
|
6414
|
+
"parameterName": "input",
|
|
6415
|
+
"parameterTypeTokenRange": {
|
|
6416
|
+
"startIndex": 1,
|
|
6417
|
+
"endIndex": 4
|
|
6418
|
+
},
|
|
6419
|
+
"isOptional": false
|
|
6420
|
+
}
|
|
6421
|
+
],
|
|
6422
|
+
"isOptional": false,
|
|
6423
|
+
"isAbstract": false,
|
|
6424
|
+
"name": "submitMessage"
|
|
6425
|
+
},
|
|
6325
6426
|
{
|
|
6326
6427
|
"kind": "Property",
|
|
6327
6428
|
"canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#suggestionsState:member",
|
|
@@ -8510,6 +8611,78 @@
|
|
|
8510
8611
|
"endIndex": 2
|
|
8511
8612
|
}
|
|
8512
8613
|
},
|
|
8614
|
+
{
|
|
8615
|
+
"kind": "Interface",
|
|
8616
|
+
"canonicalReference": "@genesislcap/ai-assistant!SubmitMessageResult:interface",
|
|
8617
|
+
"docComment": "/**\n * Result returned by {@link FoundationAiAssistant.submitMessage}.\n *\n * `ok` is `false` when the assistant is busy, the message is empty, or any supplied file failed validation — in which case no send was dispatched and `errors` lists the reasons.\n *\n * @beta\n */\n",
|
|
8618
|
+
"excerptTokens": [
|
|
8619
|
+
{
|
|
8620
|
+
"kind": "Content",
|
|
8621
|
+
"text": "export interface SubmitMessageResult "
|
|
8622
|
+
}
|
|
8623
|
+
],
|
|
8624
|
+
"fileUrlPath": "src/main/main.types.ts",
|
|
8625
|
+
"releaseTag": "Beta",
|
|
8626
|
+
"name": "SubmitMessageResult",
|
|
8627
|
+
"preserveMemberOrder": false,
|
|
8628
|
+
"members": [
|
|
8629
|
+
{
|
|
8630
|
+
"kind": "PropertySignature",
|
|
8631
|
+
"canonicalReference": "@genesislcap/ai-assistant!SubmitMessageResult#errors:member",
|
|
8632
|
+
"docComment": "",
|
|
8633
|
+
"excerptTokens": [
|
|
8634
|
+
{
|
|
8635
|
+
"kind": "Content",
|
|
8636
|
+
"text": "errors: "
|
|
8637
|
+
},
|
|
8638
|
+
{
|
|
8639
|
+
"kind": "Content",
|
|
8640
|
+
"text": "string[]"
|
|
8641
|
+
},
|
|
8642
|
+
{
|
|
8643
|
+
"kind": "Content",
|
|
8644
|
+
"text": ";"
|
|
8645
|
+
}
|
|
8646
|
+
],
|
|
8647
|
+
"isReadonly": false,
|
|
8648
|
+
"isOptional": false,
|
|
8649
|
+
"releaseTag": "Beta",
|
|
8650
|
+
"name": "errors",
|
|
8651
|
+
"propertyTypeTokenRange": {
|
|
8652
|
+
"startIndex": 1,
|
|
8653
|
+
"endIndex": 2
|
|
8654
|
+
}
|
|
8655
|
+
},
|
|
8656
|
+
{
|
|
8657
|
+
"kind": "PropertySignature",
|
|
8658
|
+
"canonicalReference": "@genesislcap/ai-assistant!SubmitMessageResult#ok:member",
|
|
8659
|
+
"docComment": "",
|
|
8660
|
+
"excerptTokens": [
|
|
8661
|
+
{
|
|
8662
|
+
"kind": "Content",
|
|
8663
|
+
"text": "ok: "
|
|
8664
|
+
},
|
|
8665
|
+
{
|
|
8666
|
+
"kind": "Content",
|
|
8667
|
+
"text": "boolean"
|
|
8668
|
+
},
|
|
8669
|
+
{
|
|
8670
|
+
"kind": "Content",
|
|
8671
|
+
"text": ";"
|
|
8672
|
+
}
|
|
8673
|
+
],
|
|
8674
|
+
"isReadonly": false,
|
|
8675
|
+
"isOptional": false,
|
|
8676
|
+
"releaseTag": "Beta",
|
|
8677
|
+
"name": "ok",
|
|
8678
|
+
"propertyTypeTokenRange": {
|
|
8679
|
+
"startIndex": 1,
|
|
8680
|
+
"endIndex": 2
|
|
8681
|
+
}
|
|
8682
|
+
}
|
|
8683
|
+
],
|
|
8684
|
+
"extendsTokenRanges": []
|
|
8685
|
+
},
|
|
8513
8686
|
{
|
|
8514
8687
|
"kind": "TypeAlias",
|
|
8515
8688
|
"canonicalReference": "@genesislcap/ai-assistant!SuggestionsState:type",
|
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -927,6 +927,14 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
927
927
|
* `'disabled'`.
|
|
928
928
|
*/
|
|
929
929
|
get agentPicker(): AgentPickerMode;
|
|
930
|
+
/**
|
|
931
|
+
* Whether the built-in composer (input row + attachment chips) is hidden by
|
|
932
|
+
* the host's `chatConfig.ui.hideComposer` setting. Used by the template to
|
|
933
|
+
* gate those blocks. Marked `@volatile` because the `'while-splash'` branch
|
|
934
|
+
* reads `showingSplash` only conditionally, so FAST cannot rely on cached
|
|
935
|
+
* dependency tracking.
|
|
936
|
+
*/
|
|
937
|
+
get composerHiddenByConfig(): boolean;
|
|
930
938
|
debugStateFactory?: () => unknown;
|
|
931
939
|
/** When set, enables Redux DevTools for this instance's session store. */
|
|
932
940
|
debugRedux: boolean;
|
|
@@ -1243,9 +1251,35 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
1243
1251
|
removeAttachmentError(message: string): void;
|
|
1244
1252
|
private isAcceptedFile;
|
|
1245
1253
|
private readFileAsText;
|
|
1254
|
+
private processFiles;
|
|
1246
1255
|
private loadSelectedFiles;
|
|
1247
1256
|
handleSendClick(): void;
|
|
1248
1257
|
handleSuggestionClick(suggestion: string): void;
|
|
1258
|
+
/**
|
|
1259
|
+
* Programmatically submit a message. Equivalent to the user typing into the
|
|
1260
|
+
* built-in composer and pressing send, but callable from external code — most
|
|
1261
|
+
* commonly a custom input rendered inside `slot="splash"` when paired with
|
|
1262
|
+
* `chatConfig.ui.hideComposer`.
|
|
1263
|
+
*
|
|
1264
|
+
* The input fully describes the turn: `text` and `files` REPLACE any current
|
|
1265
|
+
* composer state (they are not appended to it). Files are validated against
|
|
1266
|
+
* `chatConfig.ui.acceptedFiles` using the same pipeline as the composer's
|
|
1267
|
+
* attach button.
|
|
1268
|
+
*
|
|
1269
|
+
* Atomic on validation: if any file fails validation, no attachments are
|
|
1270
|
+
* committed and no send is dispatched. Failure messages are returned in
|
|
1271
|
+
* `errors` AND appended to the `attachmentErrors` observable so the built-in
|
|
1272
|
+
* chip UI still surfaces them when visible.
|
|
1273
|
+
*
|
|
1274
|
+
* Resolves once the underlying send has been kicked off — it does NOT await
|
|
1275
|
+
* the assistant's response.
|
|
1276
|
+
*
|
|
1277
|
+
* @beta
|
|
1278
|
+
*/
|
|
1279
|
+
submitMessage(input: {
|
|
1280
|
+
text?: string;
|
|
1281
|
+
files?: File[];
|
|
1282
|
+
}): Promise<SubmitMessageResult>;
|
|
1249
1283
|
private fetchSuggestions;
|
|
1250
1284
|
private send;
|
|
1251
1285
|
onChatHeaderMouseDown(e: MouseEvent): void;
|
|
@@ -1588,6 +1622,20 @@ export declare interface StatefulAgentInit<S> {
|
|
|
1588
1622
|
*/
|
|
1589
1623
|
export declare const strictFallbackAgent: FallbackAgentConfig;
|
|
1590
1624
|
|
|
1625
|
+
/**
|
|
1626
|
+
* Result returned by {@link FoundationAiAssistant.submitMessage}.
|
|
1627
|
+
*
|
|
1628
|
+
* `ok` is `false` when the assistant is busy, the message is empty, or any
|
|
1629
|
+
* supplied file failed validation — in which case no send was dispatched and
|
|
1630
|
+
* `errors` lists the reasons.
|
|
1631
|
+
*
|
|
1632
|
+
* @beta
|
|
1633
|
+
*/
|
|
1634
|
+
export declare interface SubmitMessageResult {
|
|
1635
|
+
ok: boolean;
|
|
1636
|
+
errors: string[];
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1591
1639
|
/**
|
|
1592
1640
|
* State of the chat suggestions feature.
|
|
1593
1641
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popout-manager.d.ts","sourceRoot":"","sources":["../../../../src/components/popout-manager/popout-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAoB,MAAM,uBAAuB,CAAC;AAGxF;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,qEAAqE;IACrE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,IAAI,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAMa,yBAA0B,SAAQ,cAAc;IAC3D,mFAAmF;IACvE,OAAO,UAAS;IAE5B,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,CAAa;IAE9B,iBAAiB;
|
|
1
|
+
{"version":3,"file":"popout-manager.d.ts","sourceRoot":"","sources":["../../../../src/components/popout-manager/popout-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAoB,MAAM,uBAAuB,CAAC;AAGxF;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,qEAAqE;IACrE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,IAAI,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAMa,yBAA0B,SAAQ,cAAc;IAC3D,mFAAmF;IACvE,OAAO,UAAS;IAE5B,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,CAAa;IAE9B,iBAAiB;IAkCjB,oBAAoB;IAOpB,cAAc;IAUd,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAKpD,sBAAsB,IAAI,IAAI;IAM9B;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAKlC;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,yBAAyB,GAAG,SAAS,CAE1E"}
|
package/dist/dts/main/main.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AIProvider } from '@genesislcap/foundation-ai';
|
|
2
1
|
import type { ChatAttachment, ChatConfig, ChatInputDuringExecutionMode, ChatMessage } from '@genesislcap/foundation-ai';
|
|
2
|
+
import { AIProvider } from '@genesislcap/foundation-ai';
|
|
3
3
|
import { GenesisElement } from '@genesislcap/web-core';
|
|
4
4
|
import type { AgentConfig } from '../config/config';
|
|
5
|
-
import type { AgentPickerMode, AiAssistantAnimation, AiAssistantState, PopoutMode, SuggestionsState } from './main.types';
|
|
5
|
+
import type { AgentPickerMode, AiAssistantAnimation, AiAssistantState, PopoutMode, SubmitMessageResult, SuggestionsState } from './main.types';
|
|
6
6
|
/**
|
|
7
7
|
* Foundation AI Assistant component.
|
|
8
8
|
*
|
|
@@ -41,6 +41,14 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
41
41
|
* `'disabled'`.
|
|
42
42
|
*/
|
|
43
43
|
get agentPicker(): AgentPickerMode;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the built-in composer (input row + attachment chips) is hidden by
|
|
46
|
+
* the host's `chatConfig.ui.hideComposer` setting. Used by the template to
|
|
47
|
+
* gate those blocks. Marked `@volatile` because the `'while-splash'` branch
|
|
48
|
+
* reads `showingSplash` only conditionally, so FAST cannot rely on cached
|
|
49
|
+
* dependency tracking.
|
|
50
|
+
*/
|
|
51
|
+
get composerHiddenByConfig(): boolean;
|
|
44
52
|
debugStateFactory?: () => unknown;
|
|
45
53
|
/** When set, enables Redux DevTools for this instance's session store. */
|
|
46
54
|
debugRedux: boolean;
|
|
@@ -357,9 +365,35 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
357
365
|
removeAttachmentError(message: string): void;
|
|
358
366
|
private isAcceptedFile;
|
|
359
367
|
private readFileAsText;
|
|
368
|
+
private processFiles;
|
|
360
369
|
private loadSelectedFiles;
|
|
361
370
|
handleSendClick(): void;
|
|
362
371
|
handleSuggestionClick(suggestion: string): void;
|
|
372
|
+
/**
|
|
373
|
+
* Programmatically submit a message. Equivalent to the user typing into the
|
|
374
|
+
* built-in composer and pressing send, but callable from external code — most
|
|
375
|
+
* commonly a custom input rendered inside `slot="splash"` when paired with
|
|
376
|
+
* `chatConfig.ui.hideComposer`.
|
|
377
|
+
*
|
|
378
|
+
* The input fully describes the turn: `text` and `files` REPLACE any current
|
|
379
|
+
* composer state (they are not appended to it). Files are validated against
|
|
380
|
+
* `chatConfig.ui.acceptedFiles` using the same pipeline as the composer's
|
|
381
|
+
* attach button.
|
|
382
|
+
*
|
|
383
|
+
* Atomic on validation: if any file fails validation, no attachments are
|
|
384
|
+
* committed and no send is dispatched. Failure messages are returned in
|
|
385
|
+
* `errors` AND appended to the `attachmentErrors` observable so the built-in
|
|
386
|
+
* chip UI still surfaces them when visible.
|
|
387
|
+
*
|
|
388
|
+
* Resolves once the underlying send has been kicked off — it does NOT await
|
|
389
|
+
* the assistant's response.
|
|
390
|
+
*
|
|
391
|
+
* @beta
|
|
392
|
+
*/
|
|
393
|
+
submitMessage(input: {
|
|
394
|
+
text?: string;
|
|
395
|
+
files?: File[];
|
|
396
|
+
}): Promise<SubmitMessageResult>;
|
|
363
397
|
private fetchSuggestions;
|
|
364
398
|
private send;
|
|
365
399
|
onChatHeaderMouseDown(e: MouseEvent): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,4BAA4B,EAC5B,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAGL,cAAc,EAIf,MAAM,uBAAuB,CAAC;AAW/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAepD,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAiEtB;;;;;;;;;;;;;GAaG;AACH,qBAOa,qBAAsB,SAAQ,cAAc;IAC3C,UAAU,EAAG,UAAU,CAAC;IAExB,kBAAkB,EAAE,MAAM,CAAW;IACZ,WAAW,EAAE,MAAM,CAAuB;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC5C,WAAW,EAAE,MAAM,CAA0B;IACrD;;;;;OAKG;IACiC,UAAU,CAAC,EAAE,UAAU,CAAC;IAC5D;;;OAGG;IACS,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,UAAU,EAAE,UAAU,CAAM;IAExC;;;OAGG;IACH,IAAI,WAAW,IAAI,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AAG,IAAI;IAIhC,gBAAgB,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI;IAIlD,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAU5C,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,cAAc;YASR,YAAY;YAgCZ,iBAAiB;IAS/B,eAAe;IAIf,qBAAqB,CAAC,UAAU,EAAE,MAAM;IAKxC;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,aAAa,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;YA0C7E,gBAAgB;YA4DhB,IAAI;IAyClB,qBAAqB,CAAC,CAAC,EAAE,UAAU;IAYnC,0BAA0B,CAAC,CAAC,EAAE,KAAK;CAQpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAA2B,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAoIpD,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,GACxC,oBAAoB,MAAM,KACzB,YAAY,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAA2B,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAoIpD,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,GACxC,oBAAoB,MAAM,KACzB,YAAY,CAAC,qBAAqB,CAkfpC,CAAC"}
|
|
@@ -13,6 +13,19 @@ export type AiAssistantState = 'idle' | 'loading' | 'error';
|
|
|
13
13
|
*/
|
|
14
14
|
export type PopoutMode = 'expand' | 'collapse';
|
|
15
15
|
export type { AgentPickerMode } from '@genesislcap/foundation-ai';
|
|
16
|
+
/**
|
|
17
|
+
* Result returned by {@link FoundationAiAssistant.submitMessage}.
|
|
18
|
+
*
|
|
19
|
+
* `ok` is `false` when the assistant is busy, the message is empty, or any
|
|
20
|
+
* supplied file failed validation — in which case no send was dispatched and
|
|
21
|
+
* `errors` lists the reasons.
|
|
22
|
+
*
|
|
23
|
+
* @beta
|
|
24
|
+
*/
|
|
25
|
+
export interface SubmitMessageResult {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
errors: string[];
|
|
28
|
+
}
|
|
16
29
|
/**
|
|
17
30
|
* State of the chat suggestions feature.
|
|
18
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.types.d.ts","sourceRoot":"","sources":["../../../src/main/main.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/C,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,GAC3C;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,OAAO,EAAE,M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B,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-assistant-slice.d.ts","sourceRoot":"","sources":["../../../src/state/ai-assistant-slice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ai-assistant-slice.d.ts","sourceRoot":"","sources":["../../../src/state/ai-assistant-slice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEnG;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,IAAI,EAAE,4BAA4B,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,gBAAgB,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,wBAAwB,EAAE,OAAO,CAAC;IAClC,iBAAiB,EAAE,oBAAoB,EAAE,CAAC;IAC1C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,kEAAkE;IAClE,cAAc,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,c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
|
1
|
-
{"version":3,"file":"chat-suggestions.d.ts","sourceRoot":"","sources":["../../../src/suggestions/chat-suggestions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-suggestions.d.ts","sourceRoot":"","sources":["../../../src/suggestions/chat-suggestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EAMf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AA+I3D,qBAKa,eAAgB,SAAQ,cAAc;IAEjD,KAAK,EAAE,gBAAgB,CAAsB;IAE7C,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;CAGhD"}
|
package/dist/dts/tags/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
|
@@ -674,7 +674,7 @@ export class ChatDriver extends EventTarget {
|
|
|
674
674
|
// ---------------------------------------------------------------------------
|
|
675
675
|
// Tool loop
|
|
676
676
|
// ---------------------------------------------------------------------------
|
|
677
|
-
//
|
|
677
|
+
// oxlint-disable-next-line complexity
|
|
678
678
|
runToolLoop(userInput, attachments, transientPrimer) {
|
|
679
679
|
return __awaiter(this, void 0, void 0, function* () {
|
|
680
680
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -706,7 +706,7 @@ export class ChatDriver extends EventTarget {
|
|
|
706
706
|
// Sequential await is required — each iteration must see fresh values
|
|
707
707
|
// before constructing the LLM request.
|
|
708
708
|
if (this.toolDefinitionsFactory) {
|
|
709
|
-
//
|
|
709
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
710
710
|
this.toolDefinitions = yield this.toolDefinitionsFactory(promptCtx);
|
|
711
711
|
}
|
|
712
712
|
// Same story for the handler-map factory: re-resolve so dispatch sees
|
|
@@ -714,11 +714,11 @@ export class ChatDriver extends EventTarget {
|
|
|
714
714
|
// tool definitions exposed above. Folds are forbidden when this is set,
|
|
715
715
|
// so the fold-mutation paths on `this.toolHandlers` are unreachable.
|
|
716
716
|
if (this.toolHandlersFactory) {
|
|
717
|
-
//
|
|
717
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
718
718
|
this.toolHandlers = yield this.toolHandlersFactory(promptCtx);
|
|
719
719
|
}
|
|
720
720
|
const resolvedSystemPrompt = typeof this.systemPrompt === 'function'
|
|
721
|
-
? //
|
|
721
|
+
? // oxlint-disable-next-line no-await-in-loop
|
|
722
722
|
yield this.systemPrompt(promptCtx)
|
|
723
723
|
: this.systemPrompt;
|
|
724
724
|
// Re-resolve the per-turn display label. Falls back to the canonical
|
|
@@ -726,7 +726,7 @@ export class ChatDriver extends EventTarget {
|
|
|
726
726
|
// and turn snapshots for UX only; routing/history-transform continues
|
|
727
727
|
// to read `activeAgentName`.
|
|
728
728
|
if (typeof this.displayName === 'function') {
|
|
729
|
-
//
|
|
729
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
730
730
|
this.activeAgentLabel = yield this.displayName(promptCtx);
|
|
731
731
|
}
|
|
732
732
|
const foldSuffix = this.buildFoldSystemPromptSuffix();
|
|
@@ -764,7 +764,7 @@ export class ChatDriver extends EventTarget {
|
|
|
764
764
|
};
|
|
765
765
|
let response;
|
|
766
766
|
try {
|
|
767
|
-
//
|
|
767
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
768
768
|
response = yield this.aiProvider.chat(historyForCall, userInputForCall, options);
|
|
769
769
|
}
|
|
770
770
|
catch (e) {
|
|
@@ -822,7 +822,7 @@ export class ChatDriver extends EventTarget {
|
|
|
822
822
|
let anyRealToolExecuted = false;
|
|
823
823
|
let hitUnknownToolLimit = false;
|
|
824
824
|
if (toolCalls.length > 0) {
|
|
825
|
-
//
|
|
825
|
+
// oxlint-disable-next-line no-await-in-loop -- Promise.all is correct parallelism, not sequential loop awaiting
|
|
826
826
|
yield Promise.all(toolCalls.map((tc) => __awaiter(this, void 0, void 0, function* () {
|
|
827
827
|
// Check for fold facade
|
|
828
828
|
const fold = this.getFold(tc.name);
|
|
@@ -156,18 +156,18 @@ export class OrchestratingDriver extends EventTarget {
|
|
|
156
156
|
let handoffSummary = '';
|
|
157
157
|
let remainingTask = '';
|
|
158
158
|
while (true) {
|
|
159
|
-
//
|
|
159
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
160
160
|
yield this.applyAgent(currentAgent);
|
|
161
161
|
let result;
|
|
162
162
|
if (isHandoff) {
|
|
163
163
|
const contextPrimer = handoffSummary
|
|
164
164
|
? [{ role: 'user', content: `[Context from previous agent]: ${handoffSummary}` }]
|
|
165
165
|
: [];
|
|
166
|
-
//
|
|
166
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
167
167
|
result = yield this.chatDriver.continueFromHistory(contextPrimer);
|
|
168
168
|
}
|
|
169
169
|
else {
|
|
170
|
-
//
|
|
170
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
171
171
|
result = yield this.chatDriver.sendMessage(input, attachments);
|
|
172
172
|
}
|
|
173
173
|
// Release check: a stateful agent called `releaseAgent` from a terminal
|
|
@@ -175,7 +175,7 @@ export class OrchestratingDriver extends EventTarget {
|
|
|
175
175
|
// classifier-mode. The LLM has already emitted its final wrap-up message
|
|
176
176
|
// by the time we get here — release is purely a teardown.
|
|
177
177
|
if (this.chatDriver.getAgentReleaseRequested()) {
|
|
178
|
-
//
|
|
178
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
179
179
|
yield this.releaseActiveAgent();
|
|
180
180
|
break;
|
|
181
181
|
}
|
|
@@ -194,7 +194,7 @@ export class OrchestratingDriver extends EventTarget {
|
|
|
194
194
|
isHandoff = true;
|
|
195
195
|
const updatedHistory = this.chatDriver.getHistory();
|
|
196
196
|
this.dispatchEvent(new CustomEvent('orchestrating-start'));
|
|
197
|
-
//
|
|
197
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
198
198
|
currentAgent = yield this.classify(remainingTask, updatedHistory);
|
|
199
199
|
}
|
|
200
200
|
return { reason: 'done' };
|
|
@@ -392,7 +392,7 @@ export class OrchestratingDriver extends EventTarget {
|
|
|
392
392
|
systemPrompt: classifierPrompt,
|
|
393
393
|
tools: [routingTool],
|
|
394
394
|
};
|
|
395
|
-
//
|
|
395
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
396
396
|
const response = yield this.aiProvider.chat([], input, options);
|
|
397
397
|
const tc = (_b = response.toolCalls) === null || _b === void 0 ? void 0 : _b[0];
|
|
398
398
|
const index = (tc === null || tc === void 0 ? void 0 : tc.name) === 'select_agent' ? tc.args.agent_index : -1;
|
|
@@ -35,6 +35,7 @@ let FoundationAiPopoutManager = class FoundationAiPopoutManager extends GenesisE
|
|
|
35
35
|
}
|
|
36
36
|
connectedCallback() {
|
|
37
37
|
super.connectedCallback();
|
|
38
|
+
// oxlint-disable-next-line typescript-eslint(no-this-alias) -- module-level singleton, not a local alias
|
|
38
39
|
_aiPopoutManager = this;
|
|
39
40
|
const bubble = this.querySelector('foundation-ai-chat-bubble');
|
|
40
41
|
const assistantEl = bubble === null || bubble === void 0 ? void 0 : bubble.querySelector('[slot="dialog-content"]');
|
package/dist/esm/main/main.js
CHANGED
|
@@ -153,6 +153,22 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
153
153
|
var _a, _b;
|
|
154
154
|
return (_b = (_a = this.chatConfig.picker) === null || _a === void 0 ? void 0 : _a.mode) !== null && _b !== void 0 ? _b : 'disabled';
|
|
155
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Whether the built-in composer (input row + attachment chips) is hidden by
|
|
158
|
+
* the host's `chatConfig.ui.hideComposer` setting. Used by the template to
|
|
159
|
+
* gate those blocks. Marked `@volatile` because the `'while-splash'` branch
|
|
160
|
+
* reads `showingSplash` only conditionally, so FAST cannot rely on cached
|
|
161
|
+
* dependency tracking.
|
|
162
|
+
*/
|
|
163
|
+
get composerHiddenByConfig() {
|
|
164
|
+
var _a;
|
|
165
|
+
const hide = (_a = this.chatConfig.ui) === null || _a === void 0 ? void 0 : _a.hideComposer;
|
|
166
|
+
if (hide === 'always')
|
|
167
|
+
return true;
|
|
168
|
+
if (hide === 'while-splash' && this.showingSplash)
|
|
169
|
+
return true;
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
156
172
|
get messages() {
|
|
157
173
|
var _a, _b;
|
|
158
174
|
return (_b = (_a = this._sessionRef) === null || _a === void 0 ? void 0 : _a.store.aiAssistant.messages) !== null && _b !== void 0 ? _b : [];
|
|
@@ -1201,12 +1217,8 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
1201
1217
|
reader.readAsText(file);
|
|
1202
1218
|
});
|
|
1203
1219
|
}
|
|
1204
|
-
|
|
1220
|
+
processFiles(files) {
|
|
1205
1221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1206
|
-
var _a;
|
|
1207
|
-
const input = e.target;
|
|
1208
|
-
const files = Array.from((_a = input.files) !== null && _a !== void 0 ? _a : []);
|
|
1209
|
-
input.value = '';
|
|
1210
1222
|
const results = yield Promise.all(files.map((file) => __awaiter(this, void 0, void 0, function* () {
|
|
1211
1223
|
if (!this.isAcceptedFile(file)) {
|
|
1212
1224
|
return { ok: false, message: `"${file.name}" is not an accepted file type.` };
|
|
@@ -1223,16 +1235,27 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
1223
1235
|
return { ok: false, message: `Failed to read "${file.name}".` };
|
|
1224
1236
|
}
|
|
1225
1237
|
})));
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1238
|
+
return {
|
|
1239
|
+
attachments: results
|
|
1240
|
+
.filter((r) => r.ok)
|
|
1241
|
+
.map((r) => r.attachment),
|
|
1242
|
+
errors: results
|
|
1243
|
+
.filter((r) => !r.ok)
|
|
1244
|
+
.map((r) => r.message),
|
|
1245
|
+
};
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
loadSelectedFiles(e) {
|
|
1249
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1250
|
+
var _a;
|
|
1251
|
+
const input = e.target;
|
|
1252
|
+
const files = Array.from((_a = input.files) !== null && _a !== void 0 ? _a : []);
|
|
1253
|
+
input.value = '';
|
|
1254
|
+
const { attachments, errors } = yield this.processFiles(files);
|
|
1255
|
+
if (attachments.length)
|
|
1256
|
+
this.attachments = [...this.attachments, ...attachments];
|
|
1257
|
+
if (errors.length)
|
|
1258
|
+
this.attachmentErrors = [...this.attachmentErrors, ...errors];
|
|
1236
1259
|
});
|
|
1237
1260
|
}
|
|
1238
1261
|
handleSendClick() {
|
|
@@ -1242,6 +1265,69 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
1242
1265
|
this.inputValue = suggestion;
|
|
1243
1266
|
this.send();
|
|
1244
1267
|
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Programmatically submit a message. Equivalent to the user typing into the
|
|
1270
|
+
* built-in composer and pressing send, but callable from external code — most
|
|
1271
|
+
* commonly a custom input rendered inside `slot="splash"` when paired with
|
|
1272
|
+
* `chatConfig.ui.hideComposer`.
|
|
1273
|
+
*
|
|
1274
|
+
* The input fully describes the turn: `text` and `files` REPLACE any current
|
|
1275
|
+
* composer state (they are not appended to it). Files are validated against
|
|
1276
|
+
* `chatConfig.ui.acceptedFiles` using the same pipeline as the composer's
|
|
1277
|
+
* attach button.
|
|
1278
|
+
*
|
|
1279
|
+
* Atomic on validation: if any file fails validation, no attachments are
|
|
1280
|
+
* committed and no send is dispatched. Failure messages are returned in
|
|
1281
|
+
* `errors` AND appended to the `attachmentErrors` observable so the built-in
|
|
1282
|
+
* chip UI still surfaces them when visible.
|
|
1283
|
+
*
|
|
1284
|
+
* Resolves once the underlying send has been kicked off — it does NOT await
|
|
1285
|
+
* the assistant's response.
|
|
1286
|
+
*
|
|
1287
|
+
* @beta
|
|
1288
|
+
*/
|
|
1289
|
+
submitMessage(input) {
|
|
1290
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1291
|
+
var _a, _b, _c;
|
|
1292
|
+
if (this.state === 'loading') {
|
|
1293
|
+
return { ok: false, errors: ['Assistant is busy'] };
|
|
1294
|
+
}
|
|
1295
|
+
let nextAttachments = [];
|
|
1296
|
+
if ((_a = input.files) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1297
|
+
const { attachments, errors } = yield this.processFiles(input.files);
|
|
1298
|
+
// State may have flipped to 'loading' during the async file processing
|
|
1299
|
+
// (e.g. a concurrent send via the composer). Re-check before committing
|
|
1300
|
+
// any composer state. Beyond this point execution is synchronous up to
|
|
1301
|
+
// `await this.send()`, and `send()` sets `state='loading'` before its
|
|
1302
|
+
// own first await — so no further race window exists.
|
|
1303
|
+
// (Cast widens through TS's narrowing of `this.state` from the earlier
|
|
1304
|
+
// early-return; the getter can return a different value across an await.)
|
|
1305
|
+
if (this.state === 'loading') {
|
|
1306
|
+
return { ok: false, errors: ['Assistant is busy'] };
|
|
1307
|
+
}
|
|
1308
|
+
if (errors.length) {
|
|
1309
|
+
this.attachmentErrors = errors;
|
|
1310
|
+
return { ok: false, errors };
|
|
1311
|
+
}
|
|
1312
|
+
nextAttachments = attachments;
|
|
1313
|
+
}
|
|
1314
|
+
const text = ((_b = input.text) !== null && _b !== void 0 ? _b : '').trim();
|
|
1315
|
+
if (!text && !nextAttachments.length) {
|
|
1316
|
+
return { ok: false, errors: ['Empty message'] };
|
|
1317
|
+
}
|
|
1318
|
+
this.inputValue = text;
|
|
1319
|
+
this.attachments = nextAttachments;
|
|
1320
|
+
this.attachmentErrors = [];
|
|
1321
|
+
try {
|
|
1322
|
+
yield this.send();
|
|
1323
|
+
return { ok: true, errors: [] };
|
|
1324
|
+
}
|
|
1325
|
+
catch (e) {
|
|
1326
|
+
logger.error('submitMessage send failed:', e);
|
|
1327
|
+
return { ok: false, errors: [(_c = e === null || e === void 0 ? void 0 : e.message) !== null && _c !== void 0 ? _c : 'Send failed'] };
|
|
1328
|
+
}
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1245
1331
|
fetchSuggestions() {
|
|
1246
1332
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1247
1333
|
var _a;
|
|
@@ -1392,6 +1478,9 @@ __decorate([
|
|
|
1392
1478
|
__decorate([
|
|
1393
1479
|
observable
|
|
1394
1480
|
], FoundationAiAssistant.prototype, "chatConfig", void 0);
|
|
1481
|
+
__decorate([
|
|
1482
|
+
volatile
|
|
1483
|
+
], FoundationAiAssistant.prototype, "composerHiddenByConfig", null);
|
|
1395
1484
|
__decorate([
|
|
1396
1485
|
observable
|
|
1397
1486
|
], FoundationAiAssistant.prototype, "debugStateFactory", void 0);
|
|
@@ -420,7 +420,7 @@ ${(tc) => { var _a; return (((_a = tc.foldPath) === null || _a === void 0 ? void
|
|
|
420
420
|
`)}
|
|
421
421
|
</div>
|
|
422
422
|
|
|
423
|
-
${when((x) => x.attachments.length > 0 || x.attachmentErrors.length > 0, html `
|
|
423
|
+
${when((x) => !x.composerHiddenByConfig && (x.attachments.length > 0 || x.attachmentErrors.length > 0), html `
|
|
424
424
|
<div class="attachment-chips" part="attachment-chips">
|
|
425
425
|
${repeat((x) => x.attachments, html `
|
|
426
426
|
<span class="attachment-chip" part="attachment-chip">
|
|
@@ -455,7 +455,8 @@ ${(tc) => { var _a; return (((_a = tc.foldPath) === null || _a === void 0 ? void
|
|
|
455
455
|
></chat-suggestions>
|
|
456
456
|
`)}
|
|
457
457
|
${when((x) => x.agentPickerEnabled && x.agentPickerOpen, agentPickerPanelTemplate)}
|
|
458
|
-
${when((x) => !
|
|
458
|
+
${when((x) => !x.composerHiddenByConfig &&
|
|
459
|
+
!(x.state === 'loading' && x.effectiveChatInputDuringExecution === 'hidden'), html `
|
|
459
460
|
<div class="input-row" part="input-row">
|
|
460
461
|
${when((x) => { var _a; return x.agentPickerEnabled || !!((_a = x.chatConfig.ui) === null || _a === void 0 ? void 0 : _a.acceptedFiles); }, inputLeftControlsTemplate)}
|
|
461
462
|
<${textareaTag}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { customElement, observable, html, css, repeat, when } from '@genesislcap/web-core';
|
|
3
|
-
import { GenesisElement } from '@genesislcap/web-core';
|
|
2
|
+
import { customElement, GenesisElement, observable, html, css, repeat, when, } from '@genesislcap/web-core';
|
|
4
3
|
const PILL_ANIMATION_STAGGER_MS = 70;
|
|
5
4
|
const template = html `
|
|
6
5
|
${when((x) => x.state.status === 'loading', html `
|
package/dist/esm/tags/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/ai-assistant",
|
|
3
3
|
"description": "Genesis AI Assistant micro-frontend",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.443.0",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/ai-assistant.d.ts",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"serve": "genx serve",
|
|
54
54
|
"test": "genx test",
|
|
55
55
|
"test:coverage": "genx test --coverage",
|
|
56
|
-
"lint": "genx lint
|
|
57
|
-
"lint:fix": "genx lint --fix"
|
|
56
|
+
"lint": "genx lint -l ox",
|
|
57
|
+
"lint:fix": "genx lint -l ox --fix"
|
|
58
58
|
},
|
|
59
59
|
"madge": {
|
|
60
60
|
"detectiveOptions": {
|
|
@@ -64,24 +64,24 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@genesislcap/foundation-testing": "14.
|
|
68
|
-
"@genesislcap/genx": "14.
|
|
69
|
-
"@genesislcap/rollup-builder": "14.
|
|
70
|
-
"@genesislcap/ts-builder": "14.
|
|
71
|
-
"@genesislcap/uvu-playwright-builder": "14.
|
|
72
|
-
"@genesislcap/vite-builder": "14.
|
|
73
|
-
"@genesislcap/webpack-builder": "14.
|
|
67
|
+
"@genesislcap/foundation-testing": "14.443.0",
|
|
68
|
+
"@genesislcap/genx": "14.443.0",
|
|
69
|
+
"@genesislcap/rollup-builder": "14.443.0",
|
|
70
|
+
"@genesislcap/ts-builder": "14.443.0",
|
|
71
|
+
"@genesislcap/uvu-playwright-builder": "14.443.0",
|
|
72
|
+
"@genesislcap/vite-builder": "14.443.0",
|
|
73
|
+
"@genesislcap/webpack-builder": "14.443.0",
|
|
74
74
|
"@types/dompurify": "^3.0.5",
|
|
75
75
|
"@types/marked": "^5.0.2"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@genesislcap/foundation-ai": "14.
|
|
79
|
-
"@genesislcap/foundation-logger": "14.
|
|
80
|
-
"@genesislcap/foundation-redux": "14.
|
|
81
|
-
"@genesislcap/foundation-ui": "14.
|
|
82
|
-
"@genesislcap/foundation-utils": "14.
|
|
83
|
-
"@genesislcap/rapid-design-system": "14.
|
|
84
|
-
"@genesislcap/web-core": "14.
|
|
78
|
+
"@genesislcap/foundation-ai": "14.443.0",
|
|
79
|
+
"@genesislcap/foundation-logger": "14.443.0",
|
|
80
|
+
"@genesislcap/foundation-redux": "14.443.0",
|
|
81
|
+
"@genesislcap/foundation-ui": "14.443.0",
|
|
82
|
+
"@genesislcap/foundation-utils": "14.443.0",
|
|
83
|
+
"@genesislcap/rapid-design-system": "14.443.0",
|
|
84
|
+
"@genesislcap/web-core": "14.443.0",
|
|
85
85
|
"dompurify": "^3.3.1",
|
|
86
86
|
"marked": "^17.0.3"
|
|
87
87
|
},
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "057cb7a0d06f339094c8634a413e4a6e1aa95659"
|
|
97
97
|
}
|
|
@@ -925,7 +925,7 @@ export class ChatDriver extends EventTarget implements AiDriver {
|
|
|
925
925
|
// Tool loop
|
|
926
926
|
// ---------------------------------------------------------------------------
|
|
927
927
|
|
|
928
|
-
//
|
|
928
|
+
// oxlint-disable-next-line complexity
|
|
929
929
|
private async runToolLoop(
|
|
930
930
|
userInput: string,
|
|
931
931
|
attachments?: ChatAttachment[],
|
|
@@ -965,7 +965,7 @@ export class ChatDriver extends EventTarget implements AiDriver {
|
|
|
965
965
|
// Sequential await is required — each iteration must see fresh values
|
|
966
966
|
// before constructing the LLM request.
|
|
967
967
|
if (this.toolDefinitionsFactory) {
|
|
968
|
-
//
|
|
968
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
969
969
|
this.toolDefinitions = await this.toolDefinitionsFactory(promptCtx);
|
|
970
970
|
}
|
|
971
971
|
// Same story for the handler-map factory: re-resolve so dispatch sees
|
|
@@ -973,13 +973,13 @@ export class ChatDriver extends EventTarget implements AiDriver {
|
|
|
973
973
|
// tool definitions exposed above. Folds are forbidden when this is set,
|
|
974
974
|
// so the fold-mutation paths on `this.toolHandlers` are unreachable.
|
|
975
975
|
if (this.toolHandlersFactory) {
|
|
976
|
-
//
|
|
976
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
977
977
|
this.toolHandlers = await this.toolHandlersFactory(promptCtx);
|
|
978
978
|
}
|
|
979
979
|
|
|
980
980
|
const resolvedSystemPrompt =
|
|
981
981
|
typeof this.systemPrompt === 'function'
|
|
982
|
-
? //
|
|
982
|
+
? // oxlint-disable-next-line no-await-in-loop
|
|
983
983
|
await this.systemPrompt(promptCtx)
|
|
984
984
|
: this.systemPrompt;
|
|
985
985
|
|
|
@@ -988,7 +988,7 @@ export class ChatDriver extends EventTarget implements AiDriver {
|
|
|
988
988
|
// and turn snapshots for UX only; routing/history-transform continues
|
|
989
989
|
// to read `activeAgentName`.
|
|
990
990
|
if (typeof this.displayName === 'function') {
|
|
991
|
-
//
|
|
991
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
992
992
|
this.activeAgentLabel = await this.displayName(promptCtx);
|
|
993
993
|
}
|
|
994
994
|
|
|
@@ -1034,7 +1034,7 @@ export class ChatDriver extends EventTarget implements AiDriver {
|
|
|
1034
1034
|
|
|
1035
1035
|
let response: ChatMessage;
|
|
1036
1036
|
try {
|
|
1037
|
-
//
|
|
1037
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
1038
1038
|
response = await this.aiProvider.chat!(historyForCall, userInputForCall, options);
|
|
1039
1039
|
} catch (e) {
|
|
1040
1040
|
if (e instanceof MalformedFunctionCallError) {
|
|
@@ -1104,7 +1104,7 @@ export class ChatDriver extends EventTarget implements AiDriver {
|
|
|
1104
1104
|
let hitUnknownToolLimit = false;
|
|
1105
1105
|
|
|
1106
1106
|
if (toolCalls.length > 0) {
|
|
1107
|
-
//
|
|
1107
|
+
// oxlint-disable-next-line no-await-in-loop -- Promise.all is correct parallelism, not sequential loop awaiting
|
|
1108
1108
|
await Promise.all(
|
|
1109
1109
|
toolCalls.map(async (tc) => {
|
|
1110
1110
|
// Check for fold facade
|
|
@@ -240,7 +240,7 @@ export class OrchestratingDriver extends EventTarget implements AiDriver {
|
|
|
240
240
|
let remainingTask = '';
|
|
241
241
|
|
|
242
242
|
while (true) {
|
|
243
|
-
//
|
|
243
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
244
244
|
await this.applyAgent(currentAgent);
|
|
245
245
|
|
|
246
246
|
let result: ChatDriverResult;
|
|
@@ -248,10 +248,10 @@ export class OrchestratingDriver extends EventTarget implements AiDriver {
|
|
|
248
248
|
const contextPrimer: ChatMessage[] = handoffSummary
|
|
249
249
|
? [{ role: 'user', content: `[Context from previous agent]: ${handoffSummary}` }]
|
|
250
250
|
: [];
|
|
251
|
-
//
|
|
251
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
252
252
|
result = await this.chatDriver.continueFromHistory(contextPrimer);
|
|
253
253
|
} else {
|
|
254
|
-
//
|
|
254
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
255
255
|
result = await this.chatDriver.sendMessage(input, attachments);
|
|
256
256
|
}
|
|
257
257
|
|
|
@@ -260,7 +260,7 @@ export class OrchestratingDriver extends EventTarget implements AiDriver {
|
|
|
260
260
|
// classifier-mode. The LLM has already emitted its final wrap-up message
|
|
261
261
|
// by the time we get here — release is purely a teardown.
|
|
262
262
|
if (this.chatDriver.getAgentReleaseRequested()) {
|
|
263
|
-
//
|
|
263
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
264
264
|
await this.releaseActiveAgent();
|
|
265
265
|
break;
|
|
266
266
|
}
|
|
@@ -285,7 +285,7 @@ export class OrchestratingDriver extends EventTarget implements AiDriver {
|
|
|
285
285
|
|
|
286
286
|
const updatedHistory = this.chatDriver.getHistory() as ChatMessage[];
|
|
287
287
|
this.dispatchEvent(new CustomEvent('orchestrating-start'));
|
|
288
|
-
//
|
|
288
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
289
289
|
currentAgent = await this.classify(remainingTask, updatedHistory);
|
|
290
290
|
}
|
|
291
291
|
|
|
@@ -493,7 +493,7 @@ export class OrchestratingDriver extends EventTarget implements AiDriver {
|
|
|
493
493
|
systemPrompt: classifierPrompt,
|
|
494
494
|
tools: [routingTool],
|
|
495
495
|
};
|
|
496
|
-
//
|
|
496
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
497
497
|
const response = await this.aiProvider.chat!([], input, options);
|
|
498
498
|
const tc = response.toolCalls?.[0];
|
|
499
499
|
const index = tc?.name === 'select_agent' ? (tc.args.agent_index as number) : -1;
|
|
@@ -64,6 +64,7 @@ export class FoundationAiPopoutManager extends GenesisElement {
|
|
|
64
64
|
|
|
65
65
|
connectedCallback() {
|
|
66
66
|
super.connectedCallback();
|
|
67
|
+
// oxlint-disable-next-line typescript-eslint(no-this-alias) -- module-level singleton, not a local alias
|
|
67
68
|
_aiPopoutManager = this;
|
|
68
69
|
|
|
69
70
|
const bubble = this.querySelector('foundation-ai-chat-bubble');
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* lines let the formatter inject whitespace between them.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { isChatToolCallUnknown } from '@genesislcap/foundation-ai';
|
|
19
18
|
import type { ChatAttachment, ChatMessage, ChatToolCall } from '@genesislcap/foundation-ai';
|
|
19
|
+
import { isChatToolCallUnknown } from '@genesislcap/foundation-ai';
|
|
20
20
|
import { html, ref, repeat, when, ViewTemplate } from '@genesislcap/web-core';
|
|
21
21
|
import type { FoundationAiAssistant } from './main';
|
|
22
22
|
import { ANIMATION_DEFS } from './main.types';
|
|
@@ -554,7 +554,8 @@ ${(tc) => (tc.foldPath?.length ? `${tc.foldPath.join(' › ')} › ` : '')}<stro
|
|
|
554
554
|
</div>
|
|
555
555
|
|
|
556
556
|
${when(
|
|
557
|
-
(x) =>
|
|
557
|
+
(x) =>
|
|
558
|
+
!x.composerHiddenByConfig && (x.attachments.length > 0 || x.attachmentErrors.length > 0),
|
|
558
559
|
html<FoundationAiAssistant>`
|
|
559
560
|
<div class="attachment-chips" part="attachment-chips">
|
|
560
561
|
${repeat(
|
|
@@ -602,7 +603,9 @@ ${(tc) => (tc.foldPath?.length ? `${tc.foldPath.join(' › ')} › ` : '')}<stro
|
|
|
602
603
|
)}
|
|
603
604
|
${when((x) => x.agentPickerEnabled && x.agentPickerOpen, agentPickerPanelTemplate)}
|
|
604
605
|
${when(
|
|
605
|
-
(x) =>
|
|
606
|
+
(x) =>
|
|
607
|
+
!x.composerHiddenByConfig &&
|
|
608
|
+
!(x.state === 'loading' && x.effectiveChatInputDuringExecution === 'hidden'),
|
|
606
609
|
html<FoundationAiAssistant>`
|
|
607
610
|
<div class="input-row" part="input-row">
|
|
608
611
|
${when(
|
package/src/main/main.ts
CHANGED
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
//
|
|
22
22
|
// =============================================================================
|
|
23
23
|
|
|
24
|
-
import { AIProvider } from '@genesislcap/foundation-ai';
|
|
25
24
|
import type {
|
|
26
25
|
ChatAttachment,
|
|
27
26
|
ChatConfig,
|
|
28
27
|
ChatInputDuringExecutionMode,
|
|
29
28
|
ChatMessage,
|
|
30
29
|
} from '@genesislcap/foundation-ai';
|
|
30
|
+
import { AIProvider } from '@genesislcap/foundation-ai';
|
|
31
31
|
import { avoidTreeShaking } from '@genesislcap/foundation-utils';
|
|
32
32
|
import {
|
|
33
33
|
customElement,
|
|
@@ -62,14 +62,15 @@ import { logger } from '../utils/logger';
|
|
|
62
62
|
import { expandToolTree } from '../utils/tool-fold';
|
|
63
63
|
import { styles } from './main.styles';
|
|
64
64
|
import { FoundationAiAssistantTemplate } from './main.template';
|
|
65
|
-
import { ALL_ANIMATIONS } from './main.types';
|
|
66
65
|
import type {
|
|
67
66
|
AgentPickerMode,
|
|
68
67
|
AiAssistantAnimation,
|
|
69
68
|
AiAssistantState,
|
|
70
69
|
PopoutMode,
|
|
70
|
+
SubmitMessageResult,
|
|
71
71
|
SuggestionsState,
|
|
72
72
|
} from './main.types';
|
|
73
|
+
import { ALL_ANIMATIONS } from './main.types';
|
|
73
74
|
|
|
74
75
|
/** Context window sizes (in tokens) for known models. */
|
|
75
76
|
/**
|
|
@@ -182,6 +183,22 @@ export class FoundationAiAssistant extends GenesisElement {
|
|
|
182
183
|
get agentPicker(): AgentPickerMode {
|
|
183
184
|
return this.chatConfig.picker?.mode ?? 'disabled';
|
|
184
185
|
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Whether the built-in composer (input row + attachment chips) is hidden by
|
|
189
|
+
* the host's `chatConfig.ui.hideComposer` setting. Used by the template to
|
|
190
|
+
* gate those blocks. Marked `@volatile` because the `'while-splash'` branch
|
|
191
|
+
* reads `showingSplash` only conditionally, so FAST cannot rely on cached
|
|
192
|
+
* dependency tracking.
|
|
193
|
+
*/
|
|
194
|
+
@volatile
|
|
195
|
+
get composerHiddenByConfig(): boolean {
|
|
196
|
+
const hide = this.chatConfig.ui?.hideComposer;
|
|
197
|
+
if (hide === 'always') return true;
|
|
198
|
+
if (hide === 'while-splash' && this.showingSplash) return true;
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
|
|
185
202
|
@observable debugStateFactory?: () => unknown;
|
|
186
203
|
/** When set, enables Redux DevTools for this instance's session store. */
|
|
187
204
|
@attr({ attribute: 'debug-redux', mode: 'boolean' }) debugRedux = false;
|
|
@@ -1337,11 +1354,9 @@ export class FoundationAiAssistant extends GenesisElement {
|
|
|
1337
1354
|
});
|
|
1338
1355
|
}
|
|
1339
1356
|
|
|
1340
|
-
private async
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
input.value = '';
|
|
1344
|
-
|
|
1357
|
+
private async processFiles(
|
|
1358
|
+
files: File[],
|
|
1359
|
+
): Promise<{ attachments: ChatAttachment[]; errors: string[] }> {
|
|
1345
1360
|
type FileResult = { ok: true; attachment: ChatAttachment } | { ok: false; message: string };
|
|
1346
1361
|
const results = await Promise.all(
|
|
1347
1362
|
files.map(async (file): Promise<FileResult> => {
|
|
@@ -1361,15 +1376,23 @@ export class FoundationAiAssistant extends GenesisElement {
|
|
|
1361
1376
|
}),
|
|
1362
1377
|
);
|
|
1363
1378
|
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1379
|
+
return {
|
|
1380
|
+
attachments: results
|
|
1381
|
+
.filter((r): r is Extract<FileResult, { ok: true }> => r.ok)
|
|
1382
|
+
.map((r) => r.attachment),
|
|
1383
|
+
errors: results
|
|
1384
|
+
.filter((r): r is Extract<FileResult, { ok: false }> => !r.ok)
|
|
1385
|
+
.map((r) => r.message),
|
|
1386
|
+
};
|
|
1387
|
+
}
|
|
1370
1388
|
|
|
1371
|
-
|
|
1372
|
-
|
|
1389
|
+
private async loadSelectedFiles(e: Event): Promise<void> {
|
|
1390
|
+
const input = e.target as HTMLInputElement;
|
|
1391
|
+
const files = Array.from(input.files ?? []);
|
|
1392
|
+
input.value = '';
|
|
1393
|
+
const { attachments, errors } = await this.processFiles(files);
|
|
1394
|
+
if (attachments.length) this.attachments = [...this.attachments, ...attachments];
|
|
1395
|
+
if (errors.length) this.attachmentErrors = [...this.attachmentErrors, ...errors];
|
|
1373
1396
|
}
|
|
1374
1397
|
|
|
1375
1398
|
handleSendClick() {
|
|
@@ -1381,6 +1404,69 @@ export class FoundationAiAssistant extends GenesisElement {
|
|
|
1381
1404
|
this.send();
|
|
1382
1405
|
}
|
|
1383
1406
|
|
|
1407
|
+
/**
|
|
1408
|
+
* Programmatically submit a message. Equivalent to the user typing into the
|
|
1409
|
+
* built-in composer and pressing send, but callable from external code — most
|
|
1410
|
+
* commonly a custom input rendered inside `slot="splash"` when paired with
|
|
1411
|
+
* `chatConfig.ui.hideComposer`.
|
|
1412
|
+
*
|
|
1413
|
+
* The input fully describes the turn: `text` and `files` REPLACE any current
|
|
1414
|
+
* composer state (they are not appended to it). Files are validated against
|
|
1415
|
+
* `chatConfig.ui.acceptedFiles` using the same pipeline as the composer's
|
|
1416
|
+
* attach button.
|
|
1417
|
+
*
|
|
1418
|
+
* Atomic on validation: if any file fails validation, no attachments are
|
|
1419
|
+
* committed and no send is dispatched. Failure messages are returned in
|
|
1420
|
+
* `errors` AND appended to the `attachmentErrors` observable so the built-in
|
|
1421
|
+
* chip UI still surfaces them when visible.
|
|
1422
|
+
*
|
|
1423
|
+
* Resolves once the underlying send has been kicked off — it does NOT await
|
|
1424
|
+
* the assistant's response.
|
|
1425
|
+
*
|
|
1426
|
+
* @beta
|
|
1427
|
+
*/
|
|
1428
|
+
async submitMessage(input: { text?: string; files?: File[] }): Promise<SubmitMessageResult> {
|
|
1429
|
+
if (this.state === 'loading') {
|
|
1430
|
+
return { ok: false, errors: ['Assistant is busy'] };
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
let nextAttachments: ChatAttachment[] = [];
|
|
1434
|
+
if (input.files?.length) {
|
|
1435
|
+
const { attachments, errors } = await this.processFiles(input.files);
|
|
1436
|
+
// State may have flipped to 'loading' during the async file processing
|
|
1437
|
+
// (e.g. a concurrent send via the composer). Re-check before committing
|
|
1438
|
+
// any composer state. Beyond this point execution is synchronous up to
|
|
1439
|
+
// `await this.send()`, and `send()` sets `state='loading'` before its
|
|
1440
|
+
// own first await — so no further race window exists.
|
|
1441
|
+
// (Cast widens through TS's narrowing of `this.state` from the earlier
|
|
1442
|
+
// early-return; the getter can return a different value across an await.)
|
|
1443
|
+
if ((this.state as string) === 'loading') {
|
|
1444
|
+
return { ok: false, errors: ['Assistant is busy'] };
|
|
1445
|
+
}
|
|
1446
|
+
if (errors.length) {
|
|
1447
|
+
this.attachmentErrors = errors;
|
|
1448
|
+
return { ok: false, errors };
|
|
1449
|
+
}
|
|
1450
|
+
nextAttachments = attachments;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
const text = (input.text ?? '').trim();
|
|
1454
|
+
if (!text && !nextAttachments.length) {
|
|
1455
|
+
return { ok: false, errors: ['Empty message'] };
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
this.inputValue = text;
|
|
1459
|
+
this.attachments = nextAttachments;
|
|
1460
|
+
this.attachmentErrors = [];
|
|
1461
|
+
try {
|
|
1462
|
+
await this.send();
|
|
1463
|
+
return { ok: true, errors: [] };
|
|
1464
|
+
} catch (e) {
|
|
1465
|
+
logger.error('submitMessage send failed:', e);
|
|
1466
|
+
return { ok: false, errors: [(e as Error)?.message ?? 'Send failed'] };
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1384
1470
|
private async fetchSuggestions() {
|
|
1385
1471
|
const suggestionsConfig = this.chatConfig.suggestions;
|
|
1386
1472
|
if (!this.driver || !suggestionsConfig || suggestionsConfig.behavior === 'never') {
|
package/src/main/main.types.ts
CHANGED
|
@@ -16,6 +16,20 @@ export type PopoutMode = 'expand' | 'collapse';
|
|
|
16
16
|
|
|
17
17
|
export type { AgentPickerMode } from '@genesislcap/foundation-ai';
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Result returned by {@link FoundationAiAssistant.submitMessage}.
|
|
21
|
+
*
|
|
22
|
+
* `ok` is `false` when the assistant is busy, the message is empty, or any
|
|
23
|
+
* supplied file failed validation — in which case no send was dispatched and
|
|
24
|
+
* `errors` lists the reasons.
|
|
25
|
+
*
|
|
26
|
+
* @beta
|
|
27
|
+
*/
|
|
28
|
+
export interface SubmitMessageResult {
|
|
29
|
+
ok: boolean;
|
|
30
|
+
errors: string[];
|
|
31
|
+
}
|
|
32
|
+
|
|
19
33
|
/**
|
|
20
34
|
* State of the chat suggestions feature.
|
|
21
35
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChatInputDuringExecutionMode, ChatMessage } from '@genesislcap/foundation-ai';
|
|
2
|
-
import { createSlice } from '@genesislcap/foundation-redux';
|
|
3
2
|
import type { PayloadAction } from '@genesislcap/foundation-redux';
|
|
3
|
+
import { createSlice } from '@genesislcap/foundation-redux';
|
|
4
4
|
import type { AgentConfig } from '../config/config';
|
|
5
5
|
import type { AiAssistantAnimation, AiAssistantState, SuggestionsState } from '../main/main.types';
|
|
6
6
|
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
customElement,
|
|
3
|
+
GenesisElement,
|
|
4
|
+
observable,
|
|
5
|
+
html,
|
|
6
|
+
css,
|
|
7
|
+
repeat,
|
|
8
|
+
when,
|
|
9
|
+
} from '@genesislcap/web-core';
|
|
3
10
|
import type { SuggestionsState } from '../main/main.types';
|
|
4
11
|
|
|
5
12
|
type LoadedState = { status: 'loaded'; suggestions: string[] };
|
package/src/tags/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|