@genesislcap/ai-assistant 15.15.1 → 15.15.2

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 (31) hide show
  1. package/dist/ai-assistant.api.json +367 -0
  2. package/dist/ai-assistant.d.ts +129 -1
  3. package/dist/chat-driver.cjs +3 -0
  4. package/dist/chat-driver.cjs.map +2 -2
  5. package/dist/chat-driver.mjs +3 -0
  6. package/dist/chat-driver.mjs.map +2 -2
  7. package/dist/custom-elements.json +232 -3
  8. package/dist/dts/main/main.d.ts +129 -0
  9. package/dist/dts/main/main.d.ts.map +1 -1
  10. package/dist/dts/main/main.template.d.ts +0 -1
  11. package/dist/dts/main/main.template.d.ts.map +1 -1
  12. package/dist/dts/main/persistence-broken-sources.test.d.ts +2 -0
  13. package/dist/dts/main/persistence-broken-sources.test.d.ts.map +1 -0
  14. package/dist/dts/state/debug-event-log.d.ts +1 -1
  15. package/dist/dts/state/debug-event-log.d.ts.map +1 -1
  16. package/dist/dts/state/persistence/session-persister.d.ts +76 -0
  17. package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
  18. package/dist/esm/main/main.js +205 -0
  19. package/dist/esm/main/main.template.js +89 -0
  20. package/dist/esm/main/persistence-broken-sources.test.js +180 -0
  21. package/dist/esm/state/debug-event-log.js +3 -0
  22. package/dist/esm/state/persistence/session-persister.js +224 -43
  23. package/dist/esm/state/persistence/session-persister.test.js +237 -3
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/package.json +17 -17
  26. package/src/main/main.template.ts +101 -0
  27. package/src/main/main.ts +230 -0
  28. package/src/main/persistence-broken-sources.test.ts +219 -0
  29. package/src/state/debug-event-log.ts +4 -0
  30. package/src/state/persistence/session-persister.test.ts +302 -33
  31. package/src/state/persistence/session-persister.ts +260 -52
@@ -10063,6 +10063,160 @@
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
+ },
10096
+ {
10097
+ "kind": "Method",
10098
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceBrokenChanged:member(1)",
10099
+ "docComment": "/**\n * Showing and hiding the modal hangs off the PROPERTY, so `persistenceBroken` is the single entry point — for this element's own persister callback and for a host reporting a failure in a keyspace this element knows nothing about (Create's project payload, GENC-1511 §17).\n *\n * It has to be here rather than at the call site because of the `cancel` listener: `cancel` does not bubble, so it cannot be bound from the template, and a caller that shows the modal without attaching it gets a modal Escape closes — which defeats the whole point. Routing every path through one place makes a dismissible variant unreachable.\n */\n",
10100
+ "excerptTokens": [
10101
+ {
10102
+ "kind": "Content",
10103
+ "text": "persistenceBrokenChanged(_old: "
10104
+ },
10105
+ {
10106
+ "kind": "Content",
10107
+ "text": "boolean"
10108
+ },
10109
+ {
10110
+ "kind": "Content",
10111
+ "text": ", broken: "
10112
+ },
10113
+ {
10114
+ "kind": "Content",
10115
+ "text": "boolean"
10116
+ },
10117
+ {
10118
+ "kind": "Content",
10119
+ "text": "): "
10120
+ },
10121
+ {
10122
+ "kind": "Content",
10123
+ "text": "void"
10124
+ },
10125
+ {
10126
+ "kind": "Content",
10127
+ "text": ";"
10128
+ }
10129
+ ],
10130
+ "isStatic": false,
10131
+ "returnTypeTokenRange": {
10132
+ "startIndex": 5,
10133
+ "endIndex": 6
10134
+ },
10135
+ "releaseTag": "Beta",
10136
+ "isProtected": false,
10137
+ "overloadIndex": 1,
10138
+ "parameters": [
10139
+ {
10140
+ "parameterName": "_old",
10141
+ "parameterTypeTokenRange": {
10142
+ "startIndex": 1,
10143
+ "endIndex": 2
10144
+ },
10145
+ "isOptional": false
10146
+ },
10147
+ {
10148
+ "parameterName": "broken",
10149
+ "parameterTypeTokenRange": {
10150
+ "startIndex": 3,
10151
+ "endIndex": 4
10152
+ },
10153
+ "isOptional": false
10154
+ }
10155
+ ],
10156
+ "isOptional": false,
10157
+ "isAbstract": false,
10158
+ "name": "persistenceBrokenChanged"
10159
+ },
10160
+ {
10161
+ "kind": "Property",
10162
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceBrokenDetail:member",
10163
+ "docComment": "/**\n * Optional second line, already composed. A STRING rather than the message-count fields it replaces: quantifying is caller-specific (\"N messages\", \"your last N changes\"), and keeping the template ignorant of what is being counted is what makes it reusable.\n */\n",
10164
+ "excerptTokens": [
10165
+ {
10166
+ "kind": "Content",
10167
+ "text": "persistenceBrokenDetail?: "
10168
+ },
10169
+ {
10170
+ "kind": "Content",
10171
+ "text": "string"
10172
+ },
10173
+ {
10174
+ "kind": "Content",
10175
+ "text": ";"
10176
+ }
10177
+ ],
10178
+ "isReadonly": false,
10179
+ "isOptional": true,
10180
+ "releaseTag": "Beta",
10181
+ "name": "persistenceBrokenDetail",
10182
+ "propertyTypeTokenRange": {
10183
+ "startIndex": 1,
10184
+ "endIndex": 2
10185
+ },
10186
+ "isStatic": false,
10187
+ "isProtected": false,
10188
+ "isAbstract": false
10189
+ },
10190
+ {
10191
+ "kind": "Property",
10192
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceBrokenMessage:member",
10193
+ "docComment": "/**\n * Body copy for the modal; `undefined` uses the session-oriented default in the template. A host reporting a different keyspace overrides it — \"this session has stopped saving\" is simply untrue of a failed project write.\n */\n",
10194
+ "excerptTokens": [
10195
+ {
10196
+ "kind": "Content",
10197
+ "text": "persistenceBrokenMessage?: "
10198
+ },
10199
+ {
10200
+ "kind": "Content",
10201
+ "text": "string"
10202
+ },
10203
+ {
10204
+ "kind": "Content",
10205
+ "text": ";"
10206
+ }
10207
+ ],
10208
+ "isReadonly": false,
10209
+ "isOptional": true,
10210
+ "releaseTag": "Beta",
10211
+ "name": "persistenceBrokenMessage",
10212
+ "propertyTypeTokenRange": {
10213
+ "startIndex": 1,
10214
+ "endIndex": 2
10215
+ },
10216
+ "isStatic": false,
10217
+ "isProtected": false,
10218
+ "isAbstract": false
10219
+ },
10066
10220
  {
10067
10221
  "kind": "Method",
10068
10222
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceChanged:member(1)",
@@ -10137,6 +10291,37 @@
10137
10291
  "isAbstract": false,
10138
10292
  "name": "persistenceChanged"
10139
10293
  },
10294
+ {
10295
+ "kind": "Property",
10296
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceModal:member",
10297
+ "docComment": "/**\n * The modal itself, so it can be shown and made non-dismissible.\n */\n",
10298
+ "excerptTokens": [
10299
+ {
10300
+ "kind": "Content",
10301
+ "text": "persistenceModal?: "
10302
+ },
10303
+ {
10304
+ "kind": "Reference",
10305
+ "text": "Modal",
10306
+ "canonicalReference": "@genesislcap/rapid-design-system!Modal:class"
10307
+ },
10308
+ {
10309
+ "kind": "Content",
10310
+ "text": ";"
10311
+ }
10312
+ ],
10313
+ "isReadonly": false,
10314
+ "isOptional": true,
10315
+ "releaseTag": "Beta",
10316
+ "name": "persistenceModal",
10317
+ "propertyTypeTokenRange": {
10318
+ "startIndex": 1,
10319
+ "endIndex": 2
10320
+ },
10321
+ "isStatic": false,
10322
+ "isProtected": false,
10323
+ "isAbstract": false
10324
+ },
10140
10325
  {
10141
10326
  "kind": "Property",
10142
10327
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#persistenceToggleable:member",
@@ -10462,6 +10647,37 @@
10462
10647
  "isProtected": false,
10463
10648
  "isAbstract": false
10464
10649
  },
10650
+ {
10651
+ "kind": "Method",
10652
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#reloadForPersistence:member(1)",
10653
+ "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",
10654
+ "excerptTokens": [
10655
+ {
10656
+ "kind": "Content",
10657
+ "text": "reloadForPersistence(): "
10658
+ },
10659
+ {
10660
+ "kind": "Content",
10661
+ "text": "void"
10662
+ },
10663
+ {
10664
+ "kind": "Content",
10665
+ "text": ";"
10666
+ }
10667
+ ],
10668
+ "isStatic": false,
10669
+ "returnTypeTokenRange": {
10670
+ "startIndex": 1,
10671
+ "endIndex": 2
10672
+ },
10673
+ "releaseTag": "Beta",
10674
+ "isProtected": false,
10675
+ "overloadIndex": 1,
10676
+ "parameters": [],
10677
+ "isOptional": false,
10678
+ "isAbstract": false,
10679
+ "name": "reloadForPersistence"
10680
+ },
10465
10681
  {
10466
10682
  "kind": "Method",
10467
10683
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#removeAttachment:member(1)",
@@ -10607,6 +10823,102 @@
10607
10823
  "isAbstract": false,
10608
10824
  "name": "removeCostSessionFromHistory"
10609
10825
  },
10826
+ {
10827
+ "kind": "Method",
10828
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#reportPersistenceBroken:member(1)",
10829
+ "docComment": "/**\n * Tell the user their work is no longer being saved, and block until they reload (GENC-1511).\n *\n * Public because the assistant is not the only thing that persists. Its own persister covers `sessions/<key>`; a host may own other keyspaces whose failure is just as costly — Create's `projects/<id>.json` holds the entity model, handlers and VFS, i.e. the app itself — and had no way to reach this modal (§17 of the GENC-1511 plan).\n *\n * Both copy fields are optional and default to the session wording in the template, so the common case stays a bare call. Idempotent per source while already broken: re-reporting the same source refreshes its copy, and the property change only shows a modal that is not open.\n *\n * @param overrides - `message` replaces the body; `detail` adds/replaces the second line; `source` identifies the reporter so its own recovery withdraws only its own warning. Give each independent keyspace its own id — see `brokenSources` for what sharing one costs.\n */\n",
10830
+ "excerptTokens": [
10831
+ {
10832
+ "kind": "Content",
10833
+ "text": "reportPersistenceBroken(overrides?: "
10834
+ },
10835
+ {
10836
+ "kind": "Content",
10837
+ "text": "{\n message?: string;\n detail?: string;\n source?: string;\n }"
10838
+ },
10839
+ {
10840
+ "kind": "Content",
10841
+ "text": "): "
10842
+ },
10843
+ {
10844
+ "kind": "Content",
10845
+ "text": "void"
10846
+ },
10847
+ {
10848
+ "kind": "Content",
10849
+ "text": ";"
10850
+ }
10851
+ ],
10852
+ "isStatic": false,
10853
+ "returnTypeTokenRange": {
10854
+ "startIndex": 3,
10855
+ "endIndex": 4
10856
+ },
10857
+ "releaseTag": "Beta",
10858
+ "isProtected": false,
10859
+ "overloadIndex": 1,
10860
+ "parameters": [
10861
+ {
10862
+ "parameterName": "overrides",
10863
+ "parameterTypeTokenRange": {
10864
+ "startIndex": 1,
10865
+ "endIndex": 2
10866
+ },
10867
+ "isOptional": true
10868
+ }
10869
+ ],
10870
+ "isOptional": false,
10871
+ "isAbstract": false,
10872
+ "name": "reportPersistenceBroken"
10873
+ },
10874
+ {
10875
+ "kind": "Method",
10876
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#reportPersistenceRecovered:member(1)",
10877
+ "docComment": "/**\n * Withdraw one reporter's warning — its save landed, or the host's own store recovered.\n *\n * Only `source`'s entry is removed, so a session recovery cannot cancel a host's still-live project failure (GENC-1511, caught in review; see `brokenSources`). The modal closes only once nothing is broken; while anything remains, the copy falls back to the newest survivor.\n *\n * @param source - must match the id the failure was reported under.\n */\n",
10878
+ "excerptTokens": [
10879
+ {
10880
+ "kind": "Content",
10881
+ "text": "reportPersistenceRecovered(source?: "
10882
+ },
10883
+ {
10884
+ "kind": "Content",
10885
+ "text": "string"
10886
+ },
10887
+ {
10888
+ "kind": "Content",
10889
+ "text": "): "
10890
+ },
10891
+ {
10892
+ "kind": "Content",
10893
+ "text": "void"
10894
+ },
10895
+ {
10896
+ "kind": "Content",
10897
+ "text": ";"
10898
+ }
10899
+ ],
10900
+ "isStatic": false,
10901
+ "returnTypeTokenRange": {
10902
+ "startIndex": 3,
10903
+ "endIndex": 4
10904
+ },
10905
+ "releaseTag": "Beta",
10906
+ "isProtected": false,
10907
+ "overloadIndex": 1,
10908
+ "parameters": [
10909
+ {
10910
+ "parameterName": "source",
10911
+ "parameterTypeTokenRange": {
10912
+ "startIndex": 1,
10913
+ "endIndex": 2
10914
+ },
10915
+ "isOptional": true
10916
+ }
10917
+ ],
10918
+ "isOptional": false,
10919
+ "isAbstract": false,
10920
+ "name": "reportPersistenceRecovered"
10921
+ },
10610
10922
  {
10611
10923
  "kind": "Method",
10612
10924
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#requestBudgetRefresh:member(1)",
@@ -13164,6 +13476,61 @@
13164
13476
  },
13165
13477
  "implementsTokenRanges": []
13166
13478
  },
13479
+ {
13480
+ "kind": "Function",
13481
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistantTemplate:function(1)",
13482
+ "docComment": "",
13483
+ "excerptTokens": [
13484
+ {
13485
+ "kind": "Content",
13486
+ "text": "FoundationAiAssistantTemplate: (designSystemPrefix: "
13487
+ },
13488
+ {
13489
+ "kind": "Content",
13490
+ "text": "string"
13491
+ },
13492
+ {
13493
+ "kind": "Content",
13494
+ "text": ") => "
13495
+ },
13496
+ {
13497
+ "kind": "Reference",
13498
+ "text": "ViewTemplate",
13499
+ "canonicalReference": "@microsoft/fast-element!ViewTemplate:class"
13500
+ },
13501
+ {
13502
+ "kind": "Content",
13503
+ "text": "<"
13504
+ },
13505
+ {
13506
+ "kind": "Reference",
13507
+ "text": "FoundationAiAssistant",
13508
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant:class"
13509
+ },
13510
+ {
13511
+ "kind": "Content",
13512
+ "text": ">"
13513
+ }
13514
+ ],
13515
+ "fileUrlPath": "src/main/main.template.ts",
13516
+ "returnTypeTokenRange": {
13517
+ "startIndex": 3,
13518
+ "endIndex": 7
13519
+ },
13520
+ "releaseTag": "Public",
13521
+ "overloadIndex": 1,
13522
+ "parameters": [
13523
+ {
13524
+ "parameterName": "designSystemPrefix",
13525
+ "parameterTypeTokenRange": {
13526
+ "startIndex": 1,
13527
+ "endIndex": 2
13528
+ },
13529
+ "isOptional": false
13530
+ }
13531
+ ],
13532
+ "name": "FoundationAiAssistantTemplate"
13533
+ },
13167
13534
  {
13168
13535
  "kind": "Class",
13169
13536
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiPopoutManager:class",
@@ -3299,6 +3299,80 @@ 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
+ /**
3313
+ * Which reporters currently consider persistence broken, newest last, each with the copy it
3314
+ * asked for. {@link FoundationAiAssistant.persistenceBroken} is DERIVED from this (`size > 0`) rather than being the
3315
+ * source of truth.
3316
+ *
3317
+ * A plain boolean was wrong the moment there was more than one reporter, and review caught it:
3318
+ * this element's own persister covers `sessions/<key>`, while a host reports its own keyspaces
3319
+ * (Create's `projects/<id>.json`). With one flag, a SESSION save landing after its own broken
3320
+ * episode called `reportPersistenceRecovered()` and closed the modal while the PROJECT store
3321
+ * was still refusing writes — and because Create's own re-entry guard only clears on a
3322
+ * successful project write, the warning could then never be raised again for the life of the
3323
+ * page. The user carried on against a dead store with the warning cancelled by an unrelated
3324
+ * subsystem: the exact failure this modal exists to prevent, on the keyspace that holds the app
3325
+ * rather than the transcript.
3326
+ *
3327
+ * A `Map` and not a `Set` because the copy has to survive the same collision. The winner is the
3328
+ * most recently reported still-broken source (insertion order, so it is deterministic), and when
3329
+ * one recovers the copy falls back to whoever is left instead of reverting to the session
3330
+ * default — which would otherwise state something untrue of the failure still in progress.
3331
+ */
3332
+ private readonly brokenSources;
3333
+ /**
3334
+ * Showing and hiding the modal hangs off the PROPERTY, so `persistenceBroken` is the single
3335
+ * entry point — for this element's own persister callback and for a host reporting a failure in
3336
+ * a keyspace this element knows nothing about (Create's project payload, GENC-1511 §17).
3337
+ *
3338
+ * It has to be here rather than at the call site because of the `cancel` listener: `cancel`
3339
+ * does not bubble, so it cannot be bound from the template, and a caller that shows the modal
3340
+ * without attaching it gets a modal Escape closes — which defeats the whole point. Routing
3341
+ * every path through one place makes a dismissible variant unreachable.
3342
+ */
3343
+ persistenceBrokenChanged(_old: boolean, broken: boolean): void;
3344
+ /** Swallows the native dialog's Escape route. Stored, not inline, so it can be removed again. */
3345
+ private readonly onPersistenceModalCancel;
3346
+ /** The node the guard above is bound to, so removal targets the same one it was added to. */
3347
+ private persistenceEscapeGuardTarget?;
3348
+ /**
3349
+ * Make the modal survive Escape. Bound imperatively because `cancel` does not bubble.
3350
+ *
3351
+ * Attach/detach rather than fire-and-forget: a broken → recovered → broken cycle is reachable
3352
+ * (that is what {@link FoundationAiAssistant.reportPersistenceRecovered} is for), and re-showing previously added a
3353
+ * fresh anonymous closure each time, accumulating duplicate listeners on the dialog.
3354
+ *
3355
+ * A missing `mainElement` is LOGGED rather than ignored. `Dialog` declares it non-optional, so
3356
+ * if it is ever absent the old optional-chain quietly produced an Escape-dismissible modal —
3357
+ * failing open on the one property this modal must never lose.
3358
+ */
3359
+ private attachPersistenceEscapeGuard;
3360
+ /** Remove the Escape guard, if one is bound. Safe to call when there is none. */
3361
+ private detachPersistenceEscapeGuard;
3362
+ /**
3363
+ * Body copy for the modal; `undefined` uses the session-oriented default in the template. A
3364
+ * host reporting a different keyspace overrides it — "this session has stopped saving" is
3365
+ * simply untrue of a failed project write.
3366
+ */
3367
+ persistenceBrokenMessage?: string;
3368
+ /**
3369
+ * Optional second line, already composed. A STRING rather than the message-count fields it
3370
+ * replaces: quantifying is caller-specific ("N messages", "your last N changes"), and keeping
3371
+ * the template ignorant of what is being counted is what makes it reusable.
3372
+ */
3373
+ persistenceBrokenDetail?: string;
3374
+ /** The modal itself, so it can be shown and made non-dismissible. */
3375
+ persistenceModal?: Modal;
3302
3376
  /** Bound to the settings modal tab bar — used to resync selection after reopen. */
3303
3377
  settingsTabsEl?: SettingsModalTabsElement;
3304
3378
  /** Light-DOM nodes assigned to settings modal slots (via `slotted()` bindings). */
@@ -3900,6 +3974,61 @@ export declare class FoundationAiAssistant extends GenesisElement {
3900
3974
  * a remounted element becomes the live source, not the torn-down creator (GENC-1351 §5.10 / #7).
3901
3975
  */
3902
3976
  private buildPersisterDeps;
3977
+ /**
3978
+ * Tell the user their work is no longer being saved, and block until they reload (GENC-1511).
3979
+ *
3980
+ * Public because the assistant is not the only thing that persists. Its own persister covers
3981
+ * `sessions/<key>`; a host may own other keyspaces whose failure is just as costly — Create's
3982
+ * `projects/<id>.json` holds the entity model, handlers and VFS, i.e. the app itself — and had
3983
+ * no way to reach this modal (§17 of the GENC-1511 plan).
3984
+ *
3985
+ * Both copy fields are optional and default to the session wording in the template, so the
3986
+ * common case stays a bare call. Idempotent per source while already broken: re-reporting the
3987
+ * same source refreshes its copy, and the property change only shows a modal that is not open.
3988
+ *
3989
+ * @param overrides - `message` replaces the body; `detail` adds/replaces the second line;
3990
+ * `source` identifies the reporter so its own recovery withdraws only its own warning. Give
3991
+ * each independent keyspace its own id — see `brokenSources` for what sharing one costs.
3992
+ */
3993
+ reportPersistenceBroken(overrides?: {
3994
+ message?: string;
3995
+ detail?: string;
3996
+ source?: string;
3997
+ }): void;
3998
+ /**
3999
+ * Withdraw one reporter's warning — its save landed, or the host's own store recovered.
4000
+ *
4001
+ * Only `source`'s entry is removed, so a session recovery cannot cancel a host's still-live
4002
+ * project failure (GENC-1511, caught in review; see `brokenSources`). The modal closes
4003
+ * only once nothing is broken; while anything remains, the copy falls back to the newest
4004
+ * survivor.
4005
+ *
4006
+ * @param source - must match the id the failure was reported under.
4007
+ */
4008
+ reportPersistenceRecovered(source?: string): void;
4009
+ /**
4010
+ * Recompute the derived flag and the displayed copy from `brokenSources`.
4011
+ *
4012
+ * Copy order is last-in-wins, which is both deterministic (`Map` iterates in insertion order)
4013
+ * and the behaviour a reader expects — the most recent failure is the one described. Setting
4014
+ * `persistenceBroken` last means the modal is only ever shown or closed once the copy backing
4015
+ * it is already correct.
4016
+ */
4017
+ private syncPersistenceBrokenCopy;
4018
+ /** This element's own persister said the session snapshot is not landing (GENC-1511). */
4019
+ private onPersistenceBroken;
4020
+ /**
4021
+ * A session save landed after a broken episode — withdraw OUR warning only (GENC-1511).
4022
+ *
4023
+ * The explicit source is the whole point: a host's project store may still be failing, and
4024
+ * before this was per-source a session recovery closed that modal too.
4025
+ */
4026
+ private onPersistenceRecovered;
4027
+ /**
4028
+ * The modal's only action. A reload re-reads the stored snapshot, which is plain data parsed
4029
+ * from the server, so it also clears the serialisation fault that is the most likely cause.
4030
+ */
4031
+ reloadForPersistence(): void;
3903
4032
  /**
3904
4033
  * First-load persistence init for a freshly created store (GENC-1351). Restores
3905
4034
  * the user's remembered persistence-toggle choice — kept independently of the
@@ -3988,7 +4117,6 @@ export declare class FoundationAiAssistant extends GenesisElement {
3988
4117
  onComposerResizeEnd(e: PointerEvent): void;
3989
4118
  }
3990
4119
 
3991
- /** @internal */
3992
4120
  export declare const FoundationAiAssistantTemplate: (designSystemPrefix: string) => ViewTemplate<FoundationAiAssistant>;
3993
4121
 
3994
4122
  /**
@@ -3564,6 +3564,9 @@ var META_EVENT_IMPORTANCE = {
3564
3564
  "context.threshold-crossed": "high",
3565
3565
  "context.compacted": "high",
3566
3566
  "persistence.restore-orphan": "high",
3567
+ // A save that did not land is silent data loss in progress: the transcript on screen
3568
+ // is no longer backed by the store, and every later turn widens the gap. GENC-1511.
3569
+ "persistence.save-failed": "high",
3567
3570
  "assistant.connected": "normal",
3568
3571
  "assistant.disconnected": "normal",
3569
3572
  "assistant.popout": "normal",