@genesislcap/ai-assistant 15.14.2 → 15.15.0-GENC-1511.3

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.
Files changed (42) hide show
  1. package/dist/ai-assistant.api.json +212 -5
  2. package/dist/ai-assistant.d.ts +32 -1
  3. package/dist/chat-driver.cjs +288 -70
  4. package/dist/chat-driver.cjs.map +4 -4
  5. package/dist/chat-driver.mjs +288 -70
  6. package/dist/chat-driver.mjs.map +4 -4
  7. package/dist/custom-elements.json +136 -3
  8. package/dist/dts/chat-driver-node.d.ts +1 -1
  9. package/dist/dts/chat-driver-node.d.ts.map +1 -1
  10. package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
  11. package/dist/dts/main/main.d.ts +32 -0
  12. package/dist/dts/main/main.d.ts.map +1 -1
  13. package/dist/dts/main/main.template.d.ts +0 -1
  14. package/dist/dts/main/main.template.d.ts.map +1 -1
  15. package/dist/dts/state/debug-event-log.d.ts +1 -1
  16. package/dist/dts/state/debug-event-log.d.ts.map +1 -1
  17. package/dist/dts/state/persistence/session-persister.d.ts +76 -0
  18. package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
  19. package/dist/dts/utils/condense-history.d.ts.map +1 -1
  20. package/dist/dts/utils/history-transform.d.ts.map +1 -1
  21. package/dist/esm/components/chat-driver/chat-driver.js +34 -7
  22. package/dist/esm/main/main.js +60 -0
  23. package/dist/esm/main/main.template.js +91 -0
  24. package/dist/esm/state/debug-event-log.js +3 -0
  25. package/dist/esm/state/persistence/session-persister.js +218 -43
  26. package/dist/esm/state/persistence/session-persister.test.js +237 -3
  27. package/dist/esm/utils/condense-history.js +31 -7
  28. package/dist/esm/utils/condense-history.test.js +68 -1
  29. package/dist/esm/utils/history-transform.js +8 -1
  30. package/dist/esm/utils/history-transform.test.js +22 -1
  31. package/package.json +17 -17
  32. package/src/chat-driver-node.ts +7 -0
  33. package/src/components/chat-driver/chat-driver.ts +48 -3
  34. package/src/main/main.template.ts +105 -0
  35. package/src/main/main.ts +59 -0
  36. package/src/state/debug-event-log.ts +4 -0
  37. package/src/state/persistence/session-persister.test.ts +302 -33
  38. package/src/state/persistence/session-persister.ts +254 -52
  39. package/src/utils/condense-history.test.ts +84 -2
  40. package/src/utils/condense-history.ts +27 -4
  41. package/src/utils/history-transform.test.ts +31 -0
  42. package/src/utils/history-transform.ts +7 -1
@@ -3286,7 +3286,7 @@
3286
3286
  {
3287
3287
  "kind": "Reference",
3288
3288
  "text": "ChatAttachment",
3289
- "canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:interface"
3289
+ "canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:type"
3290
3290
  },
3291
3291
  {
3292
3292
  "kind": "Content",
@@ -5515,7 +5515,7 @@
5515
5515
  {
5516
5516
  "kind": "Reference",
5517
5517
  "text": "ChatAttachment",
5518
- "canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:interface"
5518
+ "canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:type"
5519
5519
  },
5520
5520
  {
5521
5521
  "kind": "Content",
@@ -7723,7 +7723,7 @@
7723
7723
  {
7724
7724
  "kind": "Reference",
7725
7725
  "text": "ChatAttachment",
7726
- "canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:interface"
7726
+ "canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:type"
7727
7727
  },
7728
7728
  {
7729
7729
  "kind": "Content",
@@ -10063,6 +10063,36 @@
10063
10063
  "isProtected": false,
10064
10064
  "isAbstract": false
10065
10065
  },
10066
+ {
10067
+ "kind": "Property",
10068
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceBroken:member",
10069
+ "docComment": "/**\n * GENC-1511 — persistence has failed repeatedly and it is no longer saving. Drives a BLOCKING modal with a single Reload action: the whole failure class this ticket exists for is one the user cannot see, and a passive indicator is close to invisible (Will worked for 3h17m past the point his session stopped saving, with nothing on screen to tell him).\n *\n * Set only at a moment when reloading is SAFE — the persister gates it on the active agent being resumable, so we never advise a reload while an agent's in-flight work would be lost.\n */\n",
10070
+ "excerptTokens": [
10071
+ {
10072
+ "kind": "Content",
10073
+ "text": "persistenceBroken: "
10074
+ },
10075
+ {
10076
+ "kind": "Content",
10077
+ "text": "boolean"
10078
+ },
10079
+ {
10080
+ "kind": "Content",
10081
+ "text": ";"
10082
+ }
10083
+ ],
10084
+ "isReadonly": false,
10085
+ "isOptional": false,
10086
+ "releaseTag": "Beta",
10087
+ "name": "persistenceBroken",
10088
+ "propertyTypeTokenRange": {
10089
+ "startIndex": 1,
10090
+ "endIndex": 2
10091
+ },
10092
+ "isStatic": false,
10093
+ "isProtected": false,
10094
+ "isAbstract": false
10095
+ },
10066
10096
  {
10067
10097
  "kind": "Method",
10068
10098
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceChanged:member(1)",
@@ -10137,6 +10167,67 @@
10137
10167
  "isAbstract": false,
10138
10168
  "name": "persistenceChanged"
10139
10169
  },
10170
+ {
10171
+ "kind": "Property",
10172
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceLastSavedAt:member",
10173
+ "docComment": "/**\n * `savedAt` of the last snapshot that landed, for the modal's copy.\n */\n",
10174
+ "excerptTokens": [
10175
+ {
10176
+ "kind": "Content",
10177
+ "text": "persistenceLastSavedAt?: "
10178
+ },
10179
+ {
10180
+ "kind": "Content",
10181
+ "text": "string"
10182
+ },
10183
+ {
10184
+ "kind": "Content",
10185
+ "text": ";"
10186
+ }
10187
+ ],
10188
+ "isReadonly": false,
10189
+ "isOptional": true,
10190
+ "releaseTag": "Beta",
10191
+ "name": "persistenceLastSavedAt",
10192
+ "propertyTypeTokenRange": {
10193
+ "startIndex": 1,
10194
+ "endIndex": 2
10195
+ },
10196
+ "isStatic": false,
10197
+ "isProtected": false,
10198
+ "isAbstract": false
10199
+ },
10200
+ {
10201
+ "kind": "Property",
10202
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceModal:member",
10203
+ "docComment": "/**\n * The modal itself, so it can be shown and made non-dismissible.\n */\n",
10204
+ "excerptTokens": [
10205
+ {
10206
+ "kind": "Content",
10207
+ "text": "persistenceModal?: "
10208
+ },
10209
+ {
10210
+ "kind": "Reference",
10211
+ "text": "Modal",
10212
+ "canonicalReference": "@genesislcap/rapid-design-system!Modal:class"
10213
+ },
10214
+ {
10215
+ "kind": "Content",
10216
+ "text": ";"
10217
+ }
10218
+ ],
10219
+ "isReadonly": false,
10220
+ "isOptional": true,
10221
+ "releaseTag": "Beta",
10222
+ "name": "persistenceModal",
10223
+ "propertyTypeTokenRange": {
10224
+ "startIndex": 1,
10225
+ "endIndex": 2
10226
+ },
10227
+ "isStatic": false,
10228
+ "isProtected": false,
10229
+ "isAbstract": false
10230
+ },
10140
10231
  {
10141
10232
  "kind": "Property",
10142
10233
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceToggleable:member",
@@ -10167,6 +10258,36 @@
10167
10258
  "isProtected": false,
10168
10259
  "isAbstract": false
10169
10260
  },
10261
+ {
10262
+ "kind": "Property",
10263
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceUnsavedMessages:member",
10264
+ "docComment": "/**\n * Messages in the live transcript the store does not have, for the modal's copy.\n */\n",
10265
+ "excerptTokens": [
10266
+ {
10267
+ "kind": "Content",
10268
+ "text": "persistenceUnsavedMessages: "
10269
+ },
10270
+ {
10271
+ "kind": "Content",
10272
+ "text": "number"
10273
+ },
10274
+ {
10275
+ "kind": "Content",
10276
+ "text": ";"
10277
+ }
10278
+ ],
10279
+ "isReadonly": false,
10280
+ "isOptional": false,
10281
+ "releaseTag": "Beta",
10282
+ "name": "persistenceUnsavedMessages",
10283
+ "propertyTypeTokenRange": {
10284
+ "startIndex": 1,
10285
+ "endIndex": 2
10286
+ },
10287
+ "isStatic": false,
10288
+ "isProtected": false,
10289
+ "isAbstract": false
10290
+ },
10170
10291
  {
10171
10292
  "kind": "Property",
10172
10293
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#pinLocked:member",
@@ -10462,6 +10583,37 @@
10462
10583
  "isProtected": false,
10463
10584
  "isAbstract": false
10464
10585
  },
10586
+ {
10587
+ "kind": "Method",
10588
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#reloadForPersistence:member(1)",
10589
+ "docComment": "/**\n * The modal's only action. A reload re-reads the stored snapshot, which is plain data parsed from the server, so it also clears the serialisation fault that is the most likely cause.\n */\n",
10590
+ "excerptTokens": [
10591
+ {
10592
+ "kind": "Content",
10593
+ "text": "reloadForPersistence(): "
10594
+ },
10595
+ {
10596
+ "kind": "Content",
10597
+ "text": "void"
10598
+ },
10599
+ {
10600
+ "kind": "Content",
10601
+ "text": ";"
10602
+ }
10603
+ ],
10604
+ "isStatic": false,
10605
+ "returnTypeTokenRange": {
10606
+ "startIndex": 1,
10607
+ "endIndex": 2
10608
+ },
10609
+ "releaseTag": "Beta",
10610
+ "isProtected": false,
10611
+ "overloadIndex": 1,
10612
+ "parameters": [],
10613
+ "isOptional": false,
10614
+ "isAbstract": false,
10615
+ "name": "reloadForPersistence"
10616
+ },
10465
10617
  {
10466
10618
  "kind": "Method",
10467
10619
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#removeAttachment:member(1)",
@@ -10474,7 +10626,7 @@
10474
10626
  {
10475
10627
  "kind": "Reference",
10476
10628
  "text": "ChatAttachment",
10477
- "canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:interface"
10629
+ "canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:type"
10478
10630
  },
10479
10631
  {
10480
10632
  "kind": "Content",
@@ -13164,6 +13316,61 @@
13164
13316
  },
13165
13317
  "implementsTokenRanges": []
13166
13318
  },
13319
+ {
13320
+ "kind": "Function",
13321
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistantTemplate:function(1)",
13322
+ "docComment": "",
13323
+ "excerptTokens": [
13324
+ {
13325
+ "kind": "Content",
13326
+ "text": "FoundationAiAssistantTemplate: (designSystemPrefix: "
13327
+ },
13328
+ {
13329
+ "kind": "Content",
13330
+ "text": "string"
13331
+ },
13332
+ {
13333
+ "kind": "Content",
13334
+ "text": ") => "
13335
+ },
13336
+ {
13337
+ "kind": "Reference",
13338
+ "text": "ViewTemplate",
13339
+ "canonicalReference": "@microsoft/fast-element!ViewTemplate:class"
13340
+ },
13341
+ {
13342
+ "kind": "Content",
13343
+ "text": "<"
13344
+ },
13345
+ {
13346
+ "kind": "Reference",
13347
+ "text": "FoundationAiAssistant",
13348
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant:class"
13349
+ },
13350
+ {
13351
+ "kind": "Content",
13352
+ "text": ">"
13353
+ }
13354
+ ],
13355
+ "fileUrlPath": "src/main/main.template.ts",
13356
+ "returnTypeTokenRange": {
13357
+ "startIndex": 3,
13358
+ "endIndex": 7
13359
+ },
13360
+ "releaseTag": "Public",
13361
+ "overloadIndex": 1,
13362
+ "parameters": [
13363
+ {
13364
+ "parameterName": "designSystemPrefix",
13365
+ "parameterTypeTokenRange": {
13366
+ "startIndex": 1,
13367
+ "endIndex": 2
13368
+ },
13369
+ "isOptional": false
13370
+ }
13371
+ ],
13372
+ "name": "FoundationAiAssistantTemplate"
13373
+ },
13167
13374
  {
13168
13375
  "kind": "Class",
13169
13376
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiPopoutManager:class",
@@ -14973,7 +15180,7 @@
14973
15180
  {
14974
15181
  "kind": "Reference",
14975
15182
  "text": "ChatAttachment",
14976
- "canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:interface"
15183
+ "canonicalReference": "@genesislcap/foundation-ai!ChatAttachment:type"
14977
15184
  },
14978
15185
  {
14979
15186
  "kind": "Content",
@@ -3299,6 +3299,22 @@ export declare class FoundationAiAssistant extends GenesisElement {
3299
3299
  settingsModalTab: SettingsModalTab;
3300
3300
  /** Bound to the design-system modal via the template ref. */
3301
3301
  settingsModal?: Modal;
3302
+ /**
3303
+ * GENC-1511 — persistence has failed repeatedly and it is no longer saving. Drives a BLOCKING
3304
+ * modal with a single Reload action: the whole failure class this ticket exists for is one the
3305
+ * user cannot see, and a passive indicator is close to invisible (Will worked for 3h17m past
3306
+ * the point his session stopped saving, with nothing on screen to tell him).
3307
+ *
3308
+ * Set only at a moment when reloading is SAFE — the persister gates it on the active agent
3309
+ * being resumable, so we never advise a reload while an agent's in-flight work would be lost.
3310
+ */
3311
+ persistenceBroken: boolean;
3312
+ /** Messages in the live transcript the store does not have, for the modal's copy. */
3313
+ persistenceUnsavedMessages: number;
3314
+ /** `savedAt` of the last snapshot that landed, for the modal's copy. */
3315
+ persistenceLastSavedAt?: string;
3316
+ /** The modal itself, so it can be shown and made non-dismissible. */
3317
+ persistenceModal?: Modal;
3302
3318
  /** Bound to the settings modal tab bar — used to resync selection after reopen. */
3303
3319
  settingsTabsEl?: SettingsModalTabsElement;
3304
3320
  /** Light-DOM nodes assigned to settings modal slots (via `slotted()` bindings). */
@@ -3900,6 +3916,22 @@ export declare class FoundationAiAssistant extends GenesisElement {
3900
3916
  * a remounted element becomes the live source, not the torn-down creator (GENC-1351 §5.10 / #7).
3901
3917
  */
3902
3918
  private buildPersisterDeps;
3919
+ /**
3920
+ * Persistence is broken and it is now safe to advise a reload (GENC-1511). Shows a modal with
3921
+ * no way out but Reload — deliberately: continuing to work produces output that will be lost,
3922
+ * so anything dismissible is an invitation to keep going. The dismissal routes are both closed
3923
+ * explicitly — `show-close-icon` is off in the template, and the native `<dialog>`'s Escape
3924
+ * handling is cancelled on `mainElement` below, since `cancel` does not bubble and cannot be
3925
+ * bound from the template.
3926
+ */
3927
+ private onPersistenceBroken;
3928
+ /** A save landed after a broken episode — withdraw the warning (GENC-1511). */
3929
+ private onPersistenceRecovered;
3930
+ /**
3931
+ * The modal's only action. A reload re-reads the stored snapshot, which is plain data parsed
3932
+ * from the server, so it also clears the serialisation fault that is the most likely cause.
3933
+ */
3934
+ reloadForPersistence(): void;
3903
3935
  /**
3904
3936
  * First-load persistence init for a freshly created store (GENC-1351). Restores
3905
3937
  * the user's remembered persistence-toggle choice — kept independently of the
@@ -3988,7 +4020,6 @@ export declare class FoundationAiAssistant extends GenesisElement {
3988
4020
  onComposerResizeEnd(e: PointerEvent): void;
3989
4021
  }
3990
4022
 
3991
- /** @internal */
3992
4023
  export declare const FoundationAiAssistantTemplate: (designSystemPrefix: string) => ViewTemplate<FoundationAiAssistant>;
3993
4024
 
3994
4025
  /**