@genesislcap/ai-assistant 14.439.2 → 14.441.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.
@@ -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",
@@ -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
  *
@@ -2,7 +2,7 @@ import { AIProvider } from '@genesislcap/foundation-ai';
2
2
  import type { ChatAttachment, ChatConfig, ChatInputDuringExecutionMode, ChatMessage } 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,EAAE,UAAU,EAAE,MAAM,4B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Root":"","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,CA+epC,CAAC"}
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,QAA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,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,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;;;;;CASwB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,cAAc,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAkC,oBAAoB,EAAE,CAAC"}
@@ -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
- loadSelectedFiles(e) {
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
- const newAttachments = results
1227
- .filter((r) => r.ok)
1228
- .map((r) => r.attachment);
1229
- const newErrors = results
1230
- .filter((r) => !r.ok)
1231
- .map((r) => r.message);
1232
- if (newAttachments.length)
1233
- this.attachments = [...this.attachments, ...newAttachments];
1234
- if (newErrors.length)
1235
- this.attachmentErrors = [...this.attachmentErrors, ...newErrors];
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) => !(x.state === 'loading' && x.effectiveChatInputDuringExecution === 'hidden'), html `
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}
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.439.2",
4
+ "version": "14.441.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/ai-assistant.d.ts",
@@ -64,24 +64,24 @@
64
64
  }
65
65
  },
66
66
  "devDependencies": {
67
- "@genesislcap/foundation-testing": "14.439.2",
68
- "@genesislcap/genx": "14.439.2",
69
- "@genesislcap/rollup-builder": "14.439.2",
70
- "@genesislcap/ts-builder": "14.439.2",
71
- "@genesislcap/uvu-playwright-builder": "14.439.2",
72
- "@genesislcap/vite-builder": "14.439.2",
73
- "@genesislcap/webpack-builder": "14.439.2",
67
+ "@genesislcap/foundation-testing": "14.441.0",
68
+ "@genesislcap/genx": "14.441.0",
69
+ "@genesislcap/rollup-builder": "14.441.0",
70
+ "@genesislcap/ts-builder": "14.441.0",
71
+ "@genesislcap/uvu-playwright-builder": "14.441.0",
72
+ "@genesislcap/vite-builder": "14.441.0",
73
+ "@genesislcap/webpack-builder": "14.441.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.439.2",
79
- "@genesislcap/foundation-logger": "14.439.2",
80
- "@genesislcap/foundation-redux": "14.439.2",
81
- "@genesislcap/foundation-ui": "14.439.2",
82
- "@genesislcap/foundation-utils": "14.439.2",
83
- "@genesislcap/rapid-design-system": "14.439.2",
84
- "@genesislcap/web-core": "14.439.2",
78
+ "@genesislcap/foundation-ai": "14.441.0",
79
+ "@genesislcap/foundation-logger": "14.441.0",
80
+ "@genesislcap/foundation-redux": "14.441.0",
81
+ "@genesislcap/foundation-ui": "14.441.0",
82
+ "@genesislcap/foundation-utils": "14.441.0",
83
+ "@genesislcap/rapid-design-system": "14.441.0",
84
+ "@genesislcap/web-core": "14.441.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": "facafe045b533f2241f9c74f77503eb8bb1d6699"
96
+ "gitHead": "7aa35983955df48854be7f8e1ea6d56eff71c3b5"
97
97
  }
@@ -554,7 +554,8 @@ ${(tc) => (tc.foldPath?.length ? `${tc.foldPath.join(' › ')} › ` : '')}<stro
554
554
  </div>
555
555
 
556
556
  ${when(
557
- (x) => x.attachments.length > 0 || x.attachmentErrors.length > 0,
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) => !(x.state === 'loading' && x.effectiveChatInputDuringExecution === 'hidden'),
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
@@ -68,6 +68,7 @@ import type {
68
68
  AiAssistantAnimation,
69
69
  AiAssistantState,
70
70
  PopoutMode,
71
+ SubmitMessageResult,
71
72
  SuggestionsState,
72
73
  } from './main.types';
73
74
 
@@ -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 loadSelectedFiles(e: Event): Promise<void> {
1341
- const input = e.target as HTMLInputElement;
1342
- const files = Array.from(input.files ?? []);
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
- const newAttachments = results
1365
- .filter((r): r is Extract<FileResult, { ok: true }> => r.ok)
1366
- .map((r) => r.attachment);
1367
- const newErrors = results
1368
- .filter((r): r is Extract<FileResult, { ok: false }> => !r.ok)
1369
- .map((r) => r.message);
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
- if (newAttachments.length) this.attachments = [...this.attachments, ...newAttachments];
1372
- if (newErrors.length) this.attachmentErrors = [...this.attachmentErrors, ...newErrors];
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') {
@@ -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
  *