@genesislcap/ai-assistant 15.19.6 → 15.20.0-alpha.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 (52) hide show
  1. package/dist/ai-assistant.api.json +707 -69
  2. package/dist/ai-assistant.d.ts +443 -25
  3. package/dist/chat-driver.cjs +440 -34
  4. package/dist/chat-driver.cjs.map +4 -4
  5. package/dist/chat-driver.mjs +440 -34
  6. package/dist/chat-driver.mjs.map +4 -4
  7. package/dist/custom-elements.json +709 -47
  8. package/dist/dts/components/ai-driver/ai-driver.d.ts +40 -7
  9. package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
  10. package/dist/dts/components/chat-driver/chat-driver.d.ts +81 -2
  11. package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
  12. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +23 -3
  13. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
  14. package/dist/dts/config/config.d.ts +44 -0
  15. package/dist/dts/config/config.d.ts.map +1 -1
  16. package/dist/dts/main/main.d.ts +187 -5
  17. package/dist/dts/main/main.d.ts.map +1 -1
  18. package/dist/dts/main/main.styles.d.ts.map +1 -1
  19. package/dist/dts/main/main.template.d.ts.map +1 -1
  20. package/dist/dts/state/persistence/diagnostics-cursors.d.ts +7 -2
  21. package/dist/dts/state/persistence/diagnostics-cursors.d.ts.map +1 -1
  22. package/dist/dts/state/persistence/diagnostics.d.ts +30 -0
  23. package/dist/dts/state/persistence/diagnostics.d.ts.map +1 -1
  24. package/dist/dts/state/persistence/session-persister.d.ts +18 -0
  25. package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
  26. package/dist/dts/utils/condense-history.d.ts +35 -0
  27. package/dist/dts/utils/condense-history.d.ts.map +1 -1
  28. package/dist/dts/utils/context-tokens.d.ts +156 -0
  29. package/dist/dts/utils/context-tokens.d.ts.map +1 -0
  30. package/dist/dts/utils/history-transform.d.ts +76 -14
  31. package/dist/dts/utils/history-transform.d.ts.map +1 -1
  32. package/dist/dts/utils/resolve-context-budget.d.ts +98 -0
  33. package/dist/dts/utils/resolve-context-budget.d.ts.map +1 -0
  34. package/dist/esm/components/chat-driver/chat-driver.js +200 -35
  35. package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +28 -4
  36. package/dist/esm/main/main.js +400 -24
  37. package/dist/esm/main/main.styles.js +128 -0
  38. package/dist/esm/main/main.template.js +64 -29
  39. package/dist/esm/state/debug-event-log.js +1 -1
  40. package/dist/esm/state/persistence/diagnostics-cursors.js +1 -1
  41. package/dist/esm/state/persistence/diagnostics.js +49 -0
  42. package/dist/esm/state/persistence/session-persister.js +38 -18
  43. package/dist/esm/utils/condense-history.js +125 -26
  44. package/dist/esm/utils/context-tokens.js +339 -0
  45. package/dist/esm/utils/history-transform.js +101 -19
  46. package/dist/esm/utils/resolve-context-budget.js +84 -0
  47. package/package.json +16 -16
  48. package/sandbox/README.md +93 -4
  49. package/sandbox/controls.ts +77 -10
  50. package/sandbox/fixtures.ts +163 -6
  51. package/sandbox/sandbox.css +54 -1
  52. package/sandbox/sandbox.ts +384 -7
@@ -2464,11 +2464,20 @@
2464
2464
  {
2465
2465
  "kind": "MethodSignature",
2466
2466
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#canCompact:member(1)",
2467
- "docComment": "/**\n * Whether `compact()` would compact something right now — a summarizable run of older turns exists behind a clean boundary. The UI gates its \"Compact\" affordance on this, so the button reflects the exact history `compact()` acts on (GENC-1351). Optional — only history-owning drivers implement it.\n */\n",
2467
+ "docComment": "/**\n * Whether `compact()` would compact something right now. Convenience over {@link AiDriver.getCompactionPlan} — prefer the plan where the caller needs to say how much would be reclaimed. Optional — only history-owning drivers implement it.\n */\n",
2468
2468
  "excerptTokens": [
2469
2469
  {
2470
2470
  "kind": "Content",
2471
- "text": "canCompact?(): "
2471
+ "text": "canCompact?(options?: "
2472
+ },
2473
+ {
2474
+ "kind": "Reference",
2475
+ "text": "CompactionPlanOptions",
2476
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionPlanOptions:interface"
2477
+ },
2478
+ {
2479
+ "kind": "Content",
2480
+ "text": "): "
2472
2481
  },
2473
2482
  {
2474
2483
  "kind": "Content",
@@ -2481,22 +2490,40 @@
2481
2490
  ],
2482
2491
  "isOptional": true,
2483
2492
  "returnTypeTokenRange": {
2484
- "startIndex": 1,
2485
- "endIndex": 2
2493
+ "startIndex": 3,
2494
+ "endIndex": 4
2486
2495
  },
2487
2496
  "releaseTag": "Beta",
2488
2497
  "overloadIndex": 1,
2489
- "parameters": [],
2498
+ "parameters": [
2499
+ {
2500
+ "parameterName": "options",
2501
+ "parameterTypeTokenRange": {
2502
+ "startIndex": 1,
2503
+ "endIndex": 2
2504
+ },
2505
+ "isOptional": true
2506
+ }
2507
+ ],
2490
2508
  "name": "canCompact"
2491
2509
  },
2492
2510
  {
2493
2511
  "kind": "MethodSignature",
2494
2512
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#compact:member(1)",
2495
- "docComment": "/**\n * Destructively compact older conversation turns into a single `compacted-summary` message (GENC-1351 §5.7), summarizing them via the default provider's one-shot `prompt()`. Atomic: history changes only on success. Resolves to the created summary message, or `null` when there is nothing worth compacting or the provider cannot summarize. Optional — only drivers that own history implement it.\n */\n",
2513
+ "docComment": "/**\n * Destructively compact older conversation turns into a single `compacted-summary` message (GENC-1351 §5.7), summarizing them via the default provider's one-shot `prompt()`. Atomic: history changes only on success. Resolves to the created summary message, or `null` when there is nothing worth compacting or the provider cannot summarize. Optional — only drivers that own history implement it.\n *\n * Pass the same `options` used for {@link AiDriver.getCompactionPlan} so the action does exactly what the affordance advertised.\n */\n",
2496
2514
  "excerptTokens": [
2497
2515
  {
2498
2516
  "kind": "Content",
2499
- "text": "compact?(): "
2517
+ "text": "compact?(options?: "
2518
+ },
2519
+ {
2520
+ "kind": "Reference",
2521
+ "text": "CompactionPlanOptions",
2522
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionPlanOptions:interface"
2523
+ },
2524
+ {
2525
+ "kind": "Content",
2526
+ "text": "): "
2500
2527
  },
2501
2528
  {
2502
2529
  "kind": "Reference",
@@ -2523,12 +2550,21 @@
2523
2550
  ],
2524
2551
  "isOptional": true,
2525
2552
  "returnTypeTokenRange": {
2526
- "startIndex": 1,
2527
- "endIndex": 5
2553
+ "startIndex": 3,
2554
+ "endIndex": 7
2528
2555
  },
2529
2556
  "releaseTag": "Beta",
2530
2557
  "overloadIndex": 1,
2531
- "parameters": [],
2558
+ "parameters": [
2559
+ {
2560
+ "parameterName": "options",
2561
+ "parameterTypeTokenRange": {
2562
+ "startIndex": 1,
2563
+ "endIndex": 2
2564
+ },
2565
+ "isOptional": true
2566
+ }
2567
+ ],
2532
2568
  "name": "compact"
2533
2569
  },
2534
2570
  {
@@ -2693,6 +2729,57 @@
2693
2729
  "parameters": [],
2694
2730
  "name": "getActiveProviderName"
2695
2731
  },
2732
+ {
2733
+ "kind": "MethodSignature",
2734
+ "canonicalReference": "@genesislcap/ai-assistant!AiDriver#getCompactionPlan:member(1)",
2735
+ "docComment": "/**\n * What compacting right now would cost and reclaim, without running the summarizer (GENC-1567) — or `null` when there is no safe cut, or the projected reclaim is not worth the call.\n *\n * The single source of truth for every compaction affordance: the menu's enabled state, its tooltip, the context gate's banner copy, and the action itself all read this, so none of them can promise a reclaim the action does not deliver. Optional — only history-owning drivers implement it.\n */\n",
2736
+ "excerptTokens": [
2737
+ {
2738
+ "kind": "Content",
2739
+ "text": "getCompactionPlan?(options?: "
2740
+ },
2741
+ {
2742
+ "kind": "Reference",
2743
+ "text": "CompactionPlanOptions",
2744
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionPlanOptions:interface"
2745
+ },
2746
+ {
2747
+ "kind": "Content",
2748
+ "text": "): "
2749
+ },
2750
+ {
2751
+ "kind": "Reference",
2752
+ "text": "CompactionProjection",
2753
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionProjection:interface"
2754
+ },
2755
+ {
2756
+ "kind": "Content",
2757
+ "text": " | null"
2758
+ },
2759
+ {
2760
+ "kind": "Content",
2761
+ "text": ";"
2762
+ }
2763
+ ],
2764
+ "isOptional": true,
2765
+ "returnTypeTokenRange": {
2766
+ "startIndex": 3,
2767
+ "endIndex": 5
2768
+ },
2769
+ "releaseTag": "Beta",
2770
+ "overloadIndex": 1,
2771
+ "parameters": [
2772
+ {
2773
+ "parameterName": "options",
2774
+ "parameterTypeTokenRange": {
2775
+ "startIndex": 1,
2776
+ "endIndex": 2
2777
+ },
2778
+ "isOptional": true
2779
+ }
2780
+ ],
2781
+ "name": "getCompactionPlan"
2782
+ },
2696
2783
  {
2697
2784
  "kind": "MethodSignature",
2698
2785
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#getExternalDiagnostics:member(1)",
@@ -2735,6 +2822,39 @@
2735
2822
  "parameters": [],
2736
2823
  "name": "getExternalDiagnostics"
2737
2824
  },
2825
+ {
2826
+ "kind": "MethodSignature",
2827
+ "canonicalReference": "@genesislcap/ai-assistant!AiDriver#getHistoryForPersistence:member(1)",
2828
+ "docComment": "/**\n * The history a host should PERSIST — {@link AiDriver.getRawHistory} with tool payloads the driver has already condensed out of the model's context replaced by the stubs it sent (GENC-1566). Optional: a driver that does not implement tool-context condensation has nothing to project, and a caller falls back to {@link AiDriver.getRawHistory}.\n */\n",
2829
+ "excerptTokens": [
2830
+ {
2831
+ "kind": "Content",
2832
+ "text": "getHistoryForPersistence?(): "
2833
+ },
2834
+ {
2835
+ "kind": "Reference",
2836
+ "text": "ChatMessage",
2837
+ "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
2838
+ },
2839
+ {
2840
+ "kind": "Content",
2841
+ "text": "[]"
2842
+ },
2843
+ {
2844
+ "kind": "Content",
2845
+ "text": ";"
2846
+ }
2847
+ ],
2848
+ "isOptional": true,
2849
+ "returnTypeTokenRange": {
2850
+ "startIndex": 1,
2851
+ "endIndex": 3
2852
+ },
2853
+ "releaseTag": "Beta",
2854
+ "overloadIndex": 1,
2855
+ "parameters": [],
2856
+ "name": "getHistoryForPersistence"
2857
+ },
2738
2858
  {
2739
2859
  "kind": "MethodSignature",
2740
2860
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#getInteractionContext:member(1)",
@@ -3301,6 +3421,52 @@
3301
3421
  }
3302
3422
  ],
3303
3423
  "name": "sendMessage"
3424
+ },
3425
+ {
3426
+ "kind": "MethodSignature",
3427
+ "canonicalReference": "@genesislcap/ai-assistant!AiDriver#setContextGuard:member(1)",
3428
+ "docComment": "/**\n * Set the mid-loop context guard (GENC-1567). `undefined` disables it.\n *\n * Carries a margin rather than an absolute threshold: the window belongs to whichever provider the next call resolves to, which the driver learns during the call and the host cannot know until afterwards. The host owns the policy; the driver applies it against the model actually being addressed. Optional — only drivers that own a tool loop implement it.\n */\n",
3429
+ "excerptTokens": [
3430
+ {
3431
+ "kind": "Content",
3432
+ "text": "setContextGuard?(policy?: "
3433
+ },
3434
+ {
3435
+ "kind": "Reference",
3436
+ "text": "ContextGuardPolicy",
3437
+ "canonicalReference": "@genesislcap/ai-assistant!ContextGuardPolicy:interface"
3438
+ },
3439
+ {
3440
+ "kind": "Content",
3441
+ "text": "): "
3442
+ },
3443
+ {
3444
+ "kind": "Content",
3445
+ "text": "void"
3446
+ },
3447
+ {
3448
+ "kind": "Content",
3449
+ "text": ";"
3450
+ }
3451
+ ],
3452
+ "isOptional": true,
3453
+ "returnTypeTokenRange": {
3454
+ "startIndex": 3,
3455
+ "endIndex": 4
3456
+ },
3457
+ "releaseTag": "Beta",
3458
+ "overloadIndex": 1,
3459
+ "parameters": [
3460
+ {
3461
+ "parameterName": "policy",
3462
+ "parameterTypeTokenRange": {
3463
+ "startIndex": 1,
3464
+ "endIndex": 2
3465
+ },
3466
+ "isOptional": true
3467
+ }
3468
+ ],
3469
+ "name": "setContextGuard"
3304
3470
  }
3305
3471
  ],
3306
3472
  "extendsTokenRanges": [
@@ -4250,7 +4416,7 @@
4250
4416
  {
4251
4417
  "kind": "Class",
4252
4418
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver:class",
4253
- "docComment": "/**\n * Plain TS class that drives a multi-turn chat conversation, including the tool-call loop. Owned by `FoundationAiAssistant` — created in `connectedCallback`, torn down in `disconnectedCallback`.\n *\n * Dispatches `'history-updated'` events on itself so the owning element can observe changes.\n *\n * @fires\n *\n * history-updated - Fired whenever the in-memory chat history changes (append, tool loop, interaction resolution, post-resolve external cost) with the full history snapshot. detail: `ReadonlyArray<ChatMessage>`\n *\n * @beta\n */\n",
4419
+ "docComment": "",
4254
4420
  "excerptTokens": [
4255
4421
  {
4256
4422
  "kind": "Content",
@@ -4276,7 +4442,7 @@
4276
4442
  }
4277
4443
  ],
4278
4444
  "fileUrlPath": "src/components/chat-driver/chat-driver.ts",
4279
- "releaseTag": "Beta",
4445
+ "releaseTag": "Public",
4280
4446
  "isAbstract": false,
4281
4447
  "name": "ChatDriver",
4282
4448
  "preserveMemberOrder": false,
@@ -4309,7 +4475,7 @@
4309
4475
  "text": ");"
4310
4476
  }
4311
4477
  ],
4312
- "releaseTag": "Beta",
4478
+ "releaseTag": "Public",
4313
4479
  "isProtected": false,
4314
4480
  "overloadIndex": 1,
4315
4481
  "parameters": [
@@ -4363,7 +4529,7 @@
4363
4529
  "startIndex": 3,
4364
4530
  "endIndex": 4
4365
4531
  },
4366
- "releaseTag": "Beta",
4532
+ "releaseTag": "Public",
4367
4533
  "isProtected": false,
4368
4534
  "overloadIndex": 1,
4369
4535
  "parameters": [
@@ -4403,7 +4569,7 @@
4403
4569
  "startIndex": 1,
4404
4570
  "endIndex": 2
4405
4571
  },
4406
- "releaseTag": "Beta",
4572
+ "releaseTag": "Public",
4407
4573
  "isProtected": false,
4408
4574
  "overloadIndex": 1,
4409
4575
  "parameters": [],
@@ -4418,7 +4584,16 @@
4418
4584
  "excerptTokens": [
4419
4585
  {
4420
4586
  "kind": "Content",
4421
- "text": "canCompact(): "
4587
+ "text": "canCompact(options?: "
4588
+ },
4589
+ {
4590
+ "kind": "Reference",
4591
+ "text": "CompactionPlanOptions",
4592
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionPlanOptions:interface"
4593
+ },
4594
+ {
4595
+ "kind": "Content",
4596
+ "text": "): "
4422
4597
  },
4423
4598
  {
4424
4599
  "kind": "Content",
@@ -4431,13 +4606,22 @@
4431
4606
  ],
4432
4607
  "isStatic": false,
4433
4608
  "returnTypeTokenRange": {
4434
- "startIndex": 1,
4435
- "endIndex": 2
4609
+ "startIndex": 3,
4610
+ "endIndex": 4
4436
4611
  },
4437
- "releaseTag": "Beta",
4612
+ "releaseTag": "Public",
4438
4613
  "isProtected": false,
4439
4614
  "overloadIndex": 1,
4440
- "parameters": [],
4615
+ "parameters": [
4616
+ {
4617
+ "parameterName": "options",
4618
+ "parameterTypeTokenRange": {
4619
+ "startIndex": 1,
4620
+ "endIndex": 2
4621
+ },
4622
+ "isOptional": true
4623
+ }
4624
+ ],
4441
4625
  "isOptional": false,
4442
4626
  "isAbstract": false,
4443
4627
  "name": "canCompact"
@@ -4449,7 +4633,16 @@
4449
4633
  "excerptTokens": [
4450
4634
  {
4451
4635
  "kind": "Content",
4452
- "text": "compact(): "
4636
+ "text": "compact(options?: "
4637
+ },
4638
+ {
4639
+ "kind": "Reference",
4640
+ "text": "CompactionPlanOptions",
4641
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionPlanOptions:interface"
4642
+ },
4643
+ {
4644
+ "kind": "Content",
4645
+ "text": "): "
4453
4646
  },
4454
4647
  {
4455
4648
  "kind": "Reference",
@@ -4476,13 +4669,22 @@
4476
4669
  ],
4477
4670
  "isStatic": false,
4478
4671
  "returnTypeTokenRange": {
4479
- "startIndex": 1,
4480
- "endIndex": 5
4672
+ "startIndex": 3,
4673
+ "endIndex": 7
4481
4674
  },
4482
- "releaseTag": "Beta",
4675
+ "releaseTag": "Public",
4483
4676
  "isProtected": false,
4484
4677
  "overloadIndex": 1,
4485
- "parameters": [],
4678
+ "parameters": [
4679
+ {
4680
+ "parameterName": "options",
4681
+ "parameterTypeTokenRange": {
4682
+ "startIndex": 1,
4683
+ "endIndex": 2
4684
+ },
4685
+ "isOptional": true
4686
+ }
4687
+ ],
4486
4688
  "isOptional": false,
4487
4689
  "isAbstract": false,
4488
4690
  "name": "compact"
@@ -4537,7 +4739,7 @@
4537
4739
  "startIndex": 4,
4538
4740
  "endIndex": 8
4539
4741
  },
4540
- "releaseTag": "Beta",
4742
+ "releaseTag": "Public",
4541
4743
  "isProtected": false,
4542
4744
  "overloadIndex": 1,
4543
4745
  "parameters": [
@@ -4577,7 +4779,7 @@
4577
4779
  "startIndex": 1,
4578
4780
  "endIndex": 2
4579
4781
  },
4580
- "releaseTag": "Beta",
4782
+ "releaseTag": "Public",
4581
4783
  "isProtected": false,
4582
4784
  "overloadIndex": 1,
4583
4785
  "parameters": [],
@@ -4608,7 +4810,7 @@
4608
4810
  "startIndex": 1,
4609
4811
  "endIndex": 2
4610
4812
  },
4611
- "releaseTag": "Beta",
4813
+ "releaseTag": "Public",
4612
4814
  "isProtected": false,
4613
4815
  "overloadIndex": 1,
4614
4816
  "parameters": [],
@@ -4639,7 +4841,7 @@
4639
4841
  "startIndex": 1,
4640
4842
  "endIndex": 2
4641
4843
  },
4642
- "releaseTag": "Beta",
4844
+ "releaseTag": "Public",
4643
4845
  "isProtected": false,
4644
4846
  "overloadIndex": 1,
4645
4847
  "parameters": [],
@@ -4670,7 +4872,7 @@
4670
4872
  "startIndex": 1,
4671
4873
  "endIndex": 2
4672
4874
  },
4673
- "releaseTag": "Beta",
4875
+ "releaseTag": "Public",
4674
4876
  "isProtected": false,
4675
4877
  "overloadIndex": 1,
4676
4878
  "parameters": [],
@@ -4678,6 +4880,60 @@
4678
4880
  "isAbstract": false,
4679
4881
  "name": "getAgentReleaseRequested"
4680
4882
  },
4883
+ {
4884
+ "kind": "Method",
4885
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#getCompactionPlan:member(1)",
4886
+ "docComment": "/**\n * What compacting right now would cost and reclaim, without running the summarizer (GENC-1567) — or `null` when there is no safe cut, or the projected reclaim is not worth the call.\n *\n * The single source of truth for every compaction affordance: the menu's enabled state, its tooltip, the context gate's banner copy, and the action itself all read this, so none of them can promise a reclaim the action does not deliver. Optional — only history-owning drivers implement it.\n */\n",
4887
+ "excerptTokens": [
4888
+ {
4889
+ "kind": "Content",
4890
+ "text": "getCompactionPlan(options?: "
4891
+ },
4892
+ {
4893
+ "kind": "Reference",
4894
+ "text": "CompactionPlanOptions",
4895
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionPlanOptions:interface"
4896
+ },
4897
+ {
4898
+ "kind": "Content",
4899
+ "text": "): "
4900
+ },
4901
+ {
4902
+ "kind": "Reference",
4903
+ "text": "CompactionProjection",
4904
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionProjection:interface"
4905
+ },
4906
+ {
4907
+ "kind": "Content",
4908
+ "text": " | null"
4909
+ },
4910
+ {
4911
+ "kind": "Content",
4912
+ "text": ";"
4913
+ }
4914
+ ],
4915
+ "isStatic": false,
4916
+ "returnTypeTokenRange": {
4917
+ "startIndex": 3,
4918
+ "endIndex": 5
4919
+ },
4920
+ "releaseTag": "Public",
4921
+ "isProtected": false,
4922
+ "overloadIndex": 1,
4923
+ "parameters": [
4924
+ {
4925
+ "parameterName": "options",
4926
+ "parameterTypeTokenRange": {
4927
+ "startIndex": 1,
4928
+ "endIndex": 2
4929
+ },
4930
+ "isOptional": true
4931
+ }
4932
+ ],
4933
+ "isOptional": false,
4934
+ "isAbstract": false,
4935
+ "name": "getCompactionPlan"
4936
+ },
4681
4937
  {
4682
4938
  "kind": "Method",
4683
4939
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#getExternalDiagnostics:member(1)",
@@ -4715,7 +4971,7 @@
4715
4971
  "startIndex": 1,
4716
4972
  "endIndex": 5
4717
4973
  },
4718
- "releaseTag": "Beta",
4974
+ "releaseTag": "Public",
4719
4975
  "isProtected": false,
4720
4976
  "overloadIndex": 1,
4721
4977
  "parameters": [],
@@ -4760,7 +5016,7 @@
4760
5016
  "startIndex": 1,
4761
5017
  "endIndex": 5
4762
5018
  },
4763
- "releaseTag": "Beta",
5019
+ "releaseTag": "Public",
4764
5020
  "isProtected": false,
4765
5021
  "overloadIndex": 1,
4766
5022
  "parameters": [],
@@ -4768,6 +5024,42 @@
4768
5024
  "isAbstract": false,
4769
5025
  "name": "getHistory"
4770
5026
  },
5027
+ {
5028
+ "kind": "Method",
5029
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#getHistoryForPersistence:member(1)",
5030
+ "docComment": "/**\n * The transcript as it should be **stored**: every tool payload the model has already stopped seeing replaced by the same stub it was sent (GENC-1566). Live history is untouched — this returns a copy.\n *\n * Condensation deliberately spares stored history, because the live transcript and the debug export both read it. A host writing that transcript to durable storage inherits the other half of that decision: it stores payloads the driver has already retired, on every autosave, for the life of the session. Measured on one small Create session — 58,187 chars, 7.4% of a 790 KB session object, across five payloads worth 14,434 tokens of context, written 86 times.\n *\n * Only already-collapsed payloads are touched, so this can never store a stub for something the model can still see, and it has no side effects (see `condenseForPersistence`, which is internal). A host that wants the unredacted transcript still calls {@link ChatDriver.getRawHistory}, and a diagnostics stream that keeps full payloads is unaffected — which is what makes the elision recoverable.\n */\n",
5031
+ "excerptTokens": [
5032
+ {
5033
+ "kind": "Content",
5034
+ "text": "getHistoryForPersistence(): "
5035
+ },
5036
+ {
5037
+ "kind": "Reference",
5038
+ "text": "ChatMessage",
5039
+ "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
5040
+ },
5041
+ {
5042
+ "kind": "Content",
5043
+ "text": "[]"
5044
+ },
5045
+ {
5046
+ "kind": "Content",
5047
+ "text": ";"
5048
+ }
5049
+ ],
5050
+ "isStatic": false,
5051
+ "returnTypeTokenRange": {
5052
+ "startIndex": 1,
5053
+ "endIndex": 3
5054
+ },
5055
+ "releaseTag": "Public",
5056
+ "isProtected": false,
5057
+ "overloadIndex": 1,
5058
+ "parameters": [],
5059
+ "isOptional": false,
5060
+ "isAbstract": false,
5061
+ "name": "getHistoryForPersistence"
5062
+ },
4771
5063
  {
4772
5064
  "kind": "Method",
4773
5065
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#getInteractionContext:member(1)",
@@ -4804,7 +5096,7 @@
4804
5096
  "startIndex": 3,
4805
5097
  "endIndex": 5
4806
5098
  },
4807
- "releaseTag": "Beta",
5099
+ "releaseTag": "Public",
4808
5100
  "isProtected": false,
4809
5101
  "overloadIndex": 1,
4810
5102
  "parameters": [
@@ -4853,7 +5145,7 @@
4853
5145
  "startIndex": 1,
4854
5146
  "endIndex": 4
4855
5147
  },
4856
- "releaseTag": "Beta",
5148
+ "releaseTag": "Public",
4857
5149
  "isProtected": false,
4858
5150
  "overloadIndex": 1,
4859
5151
  "parameters": [],
@@ -4884,7 +5176,7 @@
4884
5176
  "startIndex": 1,
4885
5177
  "endIndex": 2
4886
5178
  },
4887
- "releaseTag": "Beta",
5179
+ "releaseTag": "Public",
4888
5180
  "isProtected": false,
4889
5181
  "overloadIndex": 1,
4890
5182
  "parameters": [],
@@ -4942,7 +5234,7 @@
4942
5234
  "startIndex": 1,
4943
5235
  "endIndex": 8
4944
5236
  },
4945
- "releaseTag": "Beta",
5237
+ "releaseTag": "Public",
4946
5238
  "isProtected": false,
4947
5239
  "overloadIndex": 1,
4948
5240
  "parameters": [],
@@ -5020,7 +5312,7 @@
5020
5312
  "startIndex": 11,
5021
5313
  "endIndex": 13
5022
5314
  },
5023
- "releaseTag": "Beta",
5315
+ "releaseTag": "Public",
5024
5316
  "isProtected": false,
5025
5317
  "overloadIndex": 1,
5026
5318
  "parameters": [
@@ -5098,7 +5390,7 @@
5098
5390
  "startIndex": 1,
5099
5391
  "endIndex": 5
5100
5392
  },
5101
- "releaseTag": "Beta",
5393
+ "releaseTag": "Public",
5102
5394
  "isProtected": false,
5103
5395
  "overloadIndex": 1,
5104
5396
  "parameters": [],
@@ -5129,7 +5421,7 @@
5129
5421
  "startIndex": 1,
5130
5422
  "endIndex": 2
5131
5423
  },
5132
- "releaseTag": "Beta",
5424
+ "releaseTag": "Public",
5133
5425
  "isProtected": false,
5134
5426
  "overloadIndex": 1,
5135
5427
  "parameters": [],
@@ -5173,7 +5465,7 @@
5173
5465
  "startIndex": 4,
5174
5466
  "endIndex": 5
5175
5467
  },
5176
- "releaseTag": "Beta",
5468
+ "releaseTag": "Public",
5177
5469
  "isProtected": false,
5178
5470
  "overloadIndex": 1,
5179
5471
  "parameters": [
@@ -5213,7 +5505,7 @@
5213
5505
  "startIndex": 1,
5214
5506
  "endIndex": 2
5215
5507
  },
5216
- "releaseTag": "Beta",
5508
+ "releaseTag": "Public",
5217
5509
  "isProtected": false,
5218
5510
  "overloadIndex": 1,
5219
5511
  "parameters": [],
@@ -5327,7 +5619,7 @@
5327
5619
  "startIndex": 5,
5328
5620
  "endIndex": 6
5329
5621
  },
5330
- "releaseTag": "Beta",
5622
+ "releaseTag": "Public",
5331
5623
  "isProtected": false,
5332
5624
  "overloadIndex": 1,
5333
5625
  "parameters": [
@@ -5418,7 +5710,7 @@
5418
5710
  "startIndex": 7,
5419
5711
  "endIndex": 9
5420
5712
  },
5421
- "releaseTag": "Beta",
5713
+ "releaseTag": "Public",
5422
5714
  "isProtected": false,
5423
5715
  "overloadIndex": 1,
5424
5716
  "parameters": [
@@ -5490,7 +5782,7 @@
5490
5782
  "startIndex": 5,
5491
5783
  "endIndex": 6
5492
5784
  },
5493
- "releaseTag": "Beta",
5785
+ "releaseTag": "Public",
5494
5786
  "isProtected": false,
5495
5787
  "overloadIndex": 1,
5496
5788
  "parameters": [
@@ -5573,7 +5865,7 @@
5573
5865
  "startIndex": 6,
5574
5866
  "endIndex": 10
5575
5867
  },
5576
- "releaseTag": "Beta",
5868
+ "releaseTag": "Public",
5577
5869
  "isProtected": false,
5578
5870
  "overloadIndex": 1,
5579
5871
  "parameters": [
@@ -5598,6 +5890,55 @@
5598
5890
  "isAbstract": false,
5599
5891
  "name": "sendMessage"
5600
5892
  },
5893
+ {
5894
+ "kind": "Method",
5895
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#setContextGuard:member(1)",
5896
+ "docComment": "/**\n * Set the mid-loop context guard. Its margin is deliberately far smaller than the reserve that blocks NEW turns: that reserve exists so an accepted turn can spend it, and a guard set at the same line would kill every turn that used the headroom it was given.\n */\n",
5897
+ "excerptTokens": [
5898
+ {
5899
+ "kind": "Content",
5900
+ "text": "setContextGuard(policy?: "
5901
+ },
5902
+ {
5903
+ "kind": "Reference",
5904
+ "text": "ContextGuardPolicy",
5905
+ "canonicalReference": "@genesislcap/ai-assistant!ContextGuardPolicy:interface"
5906
+ },
5907
+ {
5908
+ "kind": "Content",
5909
+ "text": "): "
5910
+ },
5911
+ {
5912
+ "kind": "Content",
5913
+ "text": "void"
5914
+ },
5915
+ {
5916
+ "kind": "Content",
5917
+ "text": ";"
5918
+ }
5919
+ ],
5920
+ "isStatic": false,
5921
+ "returnTypeTokenRange": {
5922
+ "startIndex": 3,
5923
+ "endIndex": 4
5924
+ },
5925
+ "releaseTag": "Public",
5926
+ "isProtected": false,
5927
+ "overloadIndex": 1,
5928
+ "parameters": [
5929
+ {
5930
+ "parameterName": "policy",
5931
+ "parameterTypeTokenRange": {
5932
+ "startIndex": 1,
5933
+ "endIndex": 2
5934
+ },
5935
+ "isOptional": true
5936
+ }
5937
+ ],
5938
+ "isOptional": false,
5939
+ "isAbstract": false,
5940
+ "name": "setContextGuard"
5941
+ },
5601
5942
  {
5602
5943
  "kind": "Method",
5603
5944
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#setHostInteractionRequester:member(1)",
@@ -5647,7 +5988,7 @@
5647
5988
  "startIndex": 7,
5648
5989
  "endIndex": 8
5649
5990
  },
5650
- "releaseTag": "Beta",
5991
+ "releaseTag": "Public",
5651
5992
  "isProtected": false,
5652
5993
  "overloadIndex": 1,
5653
5994
  "parameters": [
@@ -5667,7 +6008,7 @@
5667
6008
  {
5668
6009
  "kind": "Method",
5669
6010
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#setProviderHistoryTransform:member(1)",
5670
- "docComment": "/**\n * Optional transform applied to conversation history immediately before each LLM request. Cleared when `undefined`. Does not alter stored history.\n */\n",
6011
+ "docComment": "",
5671
6012
  "excerptTokens": [
5672
6013
  {
5673
6014
  "kind": "Content",
@@ -5713,7 +6054,7 @@
5713
6054
  "startIndex": 7,
5714
6055
  "endIndex": 8
5715
6056
  },
5716
- "releaseTag": "Beta",
6057
+ "releaseTag": "Public",
5717
6058
  "isProtected": false,
5718
6059
  "overloadIndex": 1,
5719
6060
  "parameters": [
@@ -6190,28 +6531,54 @@
6190
6531
  },
6191
6532
  {
6192
6533
  "kind": "Content",
6193
- "text": "<"
6194
- },
6195
- {
6196
- "kind": "Reference",
6197
- "text": "ChatMessage",
6198
- "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
6534
+ "text": "<"
6535
+ },
6536
+ {
6537
+ "kind": "Reference",
6538
+ "text": "ChatMessage",
6539
+ "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
6540
+ },
6541
+ {
6542
+ "kind": "Content",
6543
+ "text": ">>"
6544
+ },
6545
+ {
6546
+ "kind": "Content",
6547
+ "text": ";"
6548
+ }
6549
+ ],
6550
+ "fileUrlPath": "src/components/chat-driver/chat-driver.ts",
6551
+ "releaseTag": "Beta",
6552
+ "name": "ChatHistoryUpdatedEvent",
6553
+ "typeTokenRange": {
6554
+ "startIndex": 1,
6555
+ "endIndex": 7
6556
+ }
6557
+ },
6558
+ {
6559
+ "kind": "TypeAlias",
6560
+ "canonicalReference": "@genesislcap/ai-assistant!ContextReserveInput:type",
6561
+ "docComment": "/**\n * Context headroom an agent reserves for itself, in tokens.\n *\n * A plain number, unlike the value-or-resolver shape `provider` / `temperature` / `resumable` use. The resolver form was drafted for it and removed before release: the gate is recomputed from a synchronous getter with no turn context to resolve against, so no path could ever have invoked one. Accepting a type-correct option that is guaranteed to do nothing is worse than not offering it — a warning after the fact still leaves the configuration inert.\n *\n * It can widen to a resolver later without breaking a caller, since every existing `number` stays valid.\n *\n * @beta\n */\n",
6562
+ "excerptTokens": [
6563
+ {
6564
+ "kind": "Content",
6565
+ "text": "export type ContextReserveInput = "
6199
6566
  },
6200
6567
  {
6201
6568
  "kind": "Content",
6202
- "text": ">>"
6569
+ "text": "number"
6203
6570
  },
6204
6571
  {
6205
6572
  "kind": "Content",
6206
6573
  "text": ";"
6207
6574
  }
6208
6575
  ],
6209
- "fileUrlPath": "src/components/chat-driver/chat-driver.ts",
6576
+ "fileUrlPath": "src/config/config.ts",
6210
6577
  "releaseTag": "Beta",
6211
- "name": "ChatHistoryUpdatedEvent",
6578
+ "name": "ContextReserveInput",
6212
6579
  "typeTokenRange": {
6213
6580
  "startIndex": 1,
6214
- "endIndex": 7
6581
+ "endIndex": 2
6215
6582
  }
6216
6583
  },
6217
6584
  {
@@ -8149,7 +8516,7 @@
8149
8516
  {
8150
8517
  "kind": "Property",
8151
8518
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#compactable:member",
8152
- "docComment": "/**\n * Whether the menu's \"Compact\" action would do anything (GENC-1351 §5.7). Delegates to `driver.canCompact()` so the gate uses the exact same history `compact()` acts on — one source of truth. Also reads `messages`, purely to stay reactive as the conversation grows: the driver's history isn't a tracked observable, so the button keys its re-evaluation off the Redux mirror.\n */\n",
8519
+ "docComment": "/**\n * Whether the menu's \"Compact\" action would do anything (GENC-1351 §5.7, GENC-1567). Delegates to the driver's plan so the gate uses the exact same history `compact()` acts on, judged against the same budget — one source of truth for both whether a cut is legal and whether it reclaims enough.\n */\n",
8153
8520
  "excerptTokens": [
8154
8521
  {
8155
8522
  "kind": "Content",
@@ -8206,6 +8573,41 @@
8206
8573
  "isProtected": false,
8207
8574
  "isAbstract": false
8208
8575
  },
8576
+ {
8577
+ "kind": "Property",
8578
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#compactionPlan:member",
8579
+ "docComment": "/**\n * What compacting right now would reclaim, or `null` when it would not be worth it (GENC-1567). Sized against {@link FoundationAiAssistant.contextBudget}, so the plan aims at this model's window rather than a fixed default.\n *\n * Reads `messages` to stay reactive as the conversation grows: the driver's history is not a tracked observable, so every consumer of this keys its re-evaluation off the Redux mirror.\n */\n",
8580
+ "excerptTokens": [
8581
+ {
8582
+ "kind": "Content",
8583
+ "text": "get compactionPlan(): "
8584
+ },
8585
+ {
8586
+ "kind": "Reference",
8587
+ "text": "CompactionProjection",
8588
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionProjection:interface"
8589
+ },
8590
+ {
8591
+ "kind": "Content",
8592
+ "text": " | null"
8593
+ },
8594
+ {
8595
+ "kind": "Content",
8596
+ "text": ";"
8597
+ }
8598
+ ],
8599
+ "isReadonly": true,
8600
+ "isOptional": false,
8601
+ "releaseTag": "Beta",
8602
+ "name": "compactionPlan",
8603
+ "propertyTypeTokenRange": {
8604
+ "startIndex": 1,
8605
+ "endIndex": 3
8606
+ },
8607
+ "isStatic": false,
8608
+ "isProtected": false,
8609
+ "isAbstract": false
8610
+ },
8209
8611
  {
8210
8612
  "kind": "Method",
8211
8613
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#compactSession:member(1)",
@@ -8423,6 +8825,67 @@
8423
8825
  "isAbstract": false,
8424
8826
  "name": "connectedCallback"
8425
8827
  },
8828
+ {
8829
+ "kind": "Property",
8830
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#contextBudget:member",
8831
+ "docComment": "/**\n * Context-headroom thresholds for the active model (GENC-1567) — the warning and block lines, plus the tail budget compaction aims at.\n *\n * The agent's own `contextReserve` is deliberately NOT folded in here. This is the AMBIENT budget, which protects any turn from any agent; a per-agent reserve is an additional, larger requirement checked when that agent takes ownership of a flow, where there is a turn context to resolve its function form against.\n *\n * Overhead is read off `messages` (the Redux mirror) rather than the driver's own history, which the compaction plan uses. That is safe rather than sloppy: `estimateSystemOverhead` only looks at messages BEFORE the first usage-bearing one, and the two lists agree completely that early — the drift between mirror and driver history is only ever at the tail.\n */\n",
8832
+ "excerptTokens": [
8833
+ {
8834
+ "kind": "Content",
8835
+ "text": "get contextBudget(): "
8836
+ },
8837
+ {
8838
+ "kind": "Reference",
8839
+ "text": "ResolvedContextBudget",
8840
+ "canonicalReference": "@genesislcap/ai-assistant!~ResolvedContextBudget:interface"
8841
+ },
8842
+ {
8843
+ "kind": "Content",
8844
+ "text": ";"
8845
+ }
8846
+ ],
8847
+ "isReadonly": true,
8848
+ "isOptional": false,
8849
+ "releaseTag": "Beta",
8850
+ "name": "contextBudget",
8851
+ "propertyTypeTokenRange": {
8852
+ "startIndex": 1,
8853
+ "endIndex": 2
8854
+ },
8855
+ "isStatic": false,
8856
+ "isProtected": false,
8857
+ "isAbstract": false
8858
+ },
8859
+ {
8860
+ "kind": "Property",
8861
+ "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#contextGate:member",
8862
+ "docComment": "/**\n * How close this conversation is to the model's context window (GENC-1567).\n *\n * **Derived, never latched** — the opposite of {@link FoundationAiAssistant.blocked}. A budget wall stays set because nothing the user does fixes it; this clears itself the moment the conversation shrinks, which is precisely what the user is being asked to do. The two must not be conflated: `blocked` is also deliberately preserved across `resetSession`, and a context gate obviously must not survive starting a new chat.\n *\n * **A flow in progress is never blocked, only warned.** Machine state lives outside the transcript, so a stateful flow is not desynced by compaction — but the summary can still drop detail the flow's own prompt leans on, and blocking mid-journey would strand the user between a flow they cannot finish and a compaction that is a poor idea right there. Letting the flow complete and gating on the way out is the lesser harm; the headroom reserve exists so this is rare rather than routine.\n */\n",
8863
+ "excerptTokens": [
8864
+ {
8865
+ "kind": "Content",
8866
+ "text": "get contextGate(): "
8867
+ },
8868
+ {
8869
+ "kind": "Content",
8870
+ "text": "'ok' | 'warn' | 'blocked'"
8871
+ },
8872
+ {
8873
+ "kind": "Content",
8874
+ "text": ";"
8875
+ }
8876
+ ],
8877
+ "isReadonly": true,
8878
+ "isOptional": false,
8879
+ "releaseTag": "Beta",
8880
+ "name": "contextGate",
8881
+ "propertyTypeTokenRange": {
8882
+ "startIndex": 1,
8883
+ "endIndex": 2
8884
+ },
8885
+ "isStatic": false,
8886
+ "isProtected": false,
8887
+ "isAbstract": false
8888
+ },
8426
8889
  {
8427
8890
  "kind": "Property",
8428
8891
  "canonicalReference": "@genesislcap/ai-assistant!FoundationAiAssistant#contextLimit:member",
@@ -14772,11 +15235,20 @@
14772
15235
  {
14773
15236
  "kind": "Method",
14774
15237
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#canCompact:member(1)",
14775
- "docComment": "/**\n * Whether `compact()` would compact something right now — a summarizable run of older turns exists behind a clean boundary. The UI gates its \"Compact\" affordance on this, so the button reflects the exact history `compact()` acts on (GENC-1351). Optional — only history-owning drivers implement it.\n */\n",
15238
+ "docComment": "/**\n * Whether `compact()` would compact something right now. Convenience over {@link AiDriver.getCompactionPlan} — prefer the plan where the caller needs to say how much would be reclaimed. Optional — only history-owning drivers implement it.\n */\n",
14776
15239
  "excerptTokens": [
14777
15240
  {
14778
15241
  "kind": "Content",
14779
- "text": "canCompact(): "
15242
+ "text": "canCompact(options?: "
15243
+ },
15244
+ {
15245
+ "kind": "Reference",
15246
+ "text": "CompactionPlanOptions",
15247
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionPlanOptions:interface"
15248
+ },
15249
+ {
15250
+ "kind": "Content",
15251
+ "text": "): "
14780
15252
  },
14781
15253
  {
14782
15254
  "kind": "Content",
@@ -14789,13 +15261,22 @@
14789
15261
  ],
14790
15262
  "isStatic": false,
14791
15263
  "returnTypeTokenRange": {
14792
- "startIndex": 1,
14793
- "endIndex": 2
15264
+ "startIndex": 3,
15265
+ "endIndex": 4
14794
15266
  },
14795
15267
  "releaseTag": "Beta",
14796
15268
  "isProtected": false,
14797
15269
  "overloadIndex": 1,
14798
- "parameters": [],
15270
+ "parameters": [
15271
+ {
15272
+ "parameterName": "options",
15273
+ "parameterTypeTokenRange": {
15274
+ "startIndex": 1,
15275
+ "endIndex": 2
15276
+ },
15277
+ "isOptional": true
15278
+ }
15279
+ ],
14799
15280
  "isOptional": false,
14800
15281
  "isAbstract": false,
14801
15282
  "name": "canCompact"
@@ -14803,11 +15284,20 @@
14803
15284
  {
14804
15285
  "kind": "Method",
14805
15286
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#compact:member(1)",
14806
- "docComment": "/**\n * Destructively compact older conversation turns into a single `compacted-summary` message (GENC-1351 §5.7), summarizing them via the default provider's one-shot `prompt()`. Atomic: history changes only on success. Resolves to the created summary message, or `null` when there is nothing worth compacting or the provider cannot summarize. Optional — only drivers that own history implement it.\n */\n",
15287
+ "docComment": "/**\n * Destructively compact older conversation turns into a single `compacted-summary` message (GENC-1351 §5.7), summarizing them via the default provider's one-shot `prompt()`. Atomic: history changes only on success. Resolves to the created summary message, or `null` when there is nothing worth compacting or the provider cannot summarize. Optional — only drivers that own history implement it.\n *\n * Pass the same `options` used for {@link AiDriver.getCompactionPlan} so the action does exactly what the affordance advertised.\n */\n",
14807
15288
  "excerptTokens": [
14808
15289
  {
14809
15290
  "kind": "Content",
14810
- "text": "compact(): "
15291
+ "text": "compact(options?: "
15292
+ },
15293
+ {
15294
+ "kind": "Reference",
15295
+ "text": "CompactionPlanOptions",
15296
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionPlanOptions:interface"
15297
+ },
15298
+ {
15299
+ "kind": "Content",
15300
+ "text": "): "
14811
15301
  },
14812
15302
  {
14813
15303
  "kind": "Reference",
@@ -14834,13 +15324,22 @@
14834
15324
  ],
14835
15325
  "isStatic": false,
14836
15326
  "returnTypeTokenRange": {
14837
- "startIndex": 1,
14838
- "endIndex": 5
15327
+ "startIndex": 3,
15328
+ "endIndex": 7
14839
15329
  },
14840
15330
  "releaseTag": "Beta",
14841
15331
  "isProtected": false,
14842
15332
  "overloadIndex": 1,
14843
- "parameters": [],
15333
+ "parameters": [
15334
+ {
15335
+ "parameterName": "options",
15336
+ "parameterTypeTokenRange": {
15337
+ "startIndex": 1,
15338
+ "endIndex": 2
15339
+ },
15340
+ "isOptional": true
15341
+ }
15342
+ ],
14844
15343
  "isOptional": false,
14845
15344
  "isAbstract": false,
14846
15345
  "name": "compact"
@@ -15015,6 +15514,60 @@
15015
15514
  "isAbstract": false,
15016
15515
  "name": "getActiveProviderName"
15017
15516
  },
15517
+ {
15518
+ "kind": "Method",
15519
+ "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#getCompactionPlan:member(1)",
15520
+ "docComment": "/**\n * What compacting right now would cost and reclaim, without running the summarizer (GENC-1567) — or `null` when there is no safe cut, or the projected reclaim is not worth the call.\n *\n * The single source of truth for every compaction affordance: the menu's enabled state, its tooltip, the context gate's banner copy, and the action itself all read this, so none of them can promise a reclaim the action does not deliver. Optional — only history-owning drivers implement it.\n */\n",
15521
+ "excerptTokens": [
15522
+ {
15523
+ "kind": "Content",
15524
+ "text": "getCompactionPlan(options?: "
15525
+ },
15526
+ {
15527
+ "kind": "Reference",
15528
+ "text": "CompactionPlanOptions",
15529
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionPlanOptions:interface"
15530
+ },
15531
+ {
15532
+ "kind": "Content",
15533
+ "text": "): "
15534
+ },
15535
+ {
15536
+ "kind": "Reference",
15537
+ "text": "CompactionProjection",
15538
+ "canonicalReference": "@genesislcap/ai-assistant!~CompactionProjection:interface"
15539
+ },
15540
+ {
15541
+ "kind": "Content",
15542
+ "text": " | null"
15543
+ },
15544
+ {
15545
+ "kind": "Content",
15546
+ "text": ";"
15547
+ }
15548
+ ],
15549
+ "isStatic": false,
15550
+ "returnTypeTokenRange": {
15551
+ "startIndex": 3,
15552
+ "endIndex": 5
15553
+ },
15554
+ "releaseTag": "Beta",
15555
+ "isProtected": false,
15556
+ "overloadIndex": 1,
15557
+ "parameters": [
15558
+ {
15559
+ "parameterName": "options",
15560
+ "parameterTypeTokenRange": {
15561
+ "startIndex": 1,
15562
+ "endIndex": 2
15563
+ },
15564
+ "isOptional": true
15565
+ }
15566
+ ],
15567
+ "isOptional": false,
15568
+ "isAbstract": false,
15569
+ "name": "getCompactionPlan"
15570
+ },
15018
15571
  {
15019
15572
  "kind": "Method",
15020
15573
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#getExternalDiagnostics:member(1)",
@@ -15060,6 +15613,42 @@
15060
15613
  "isAbstract": false,
15061
15614
  "name": "getExternalDiagnostics"
15062
15615
  },
15616
+ {
15617
+ "kind": "Method",
15618
+ "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#getHistoryForPersistence:member(1)",
15619
+ "docComment": "/**\n * Delegates to the inner {@link ChatDriver} — condensation policies are registered there, so it is the only object that knows which payloads the model has stopped seeing (GENC-1566).\n *\n * **This forward is the whole feature, for any multi-agent host.** `AiDriver` declares `getHistoryForPersistence` optional, and `SessionPersister` calls it through `?.`, falling back to {@link OrchestratingDriver.getRawHistory}. This class does NOT extend `ChatDriver` — it wraps one — so without an explicit forward the optional call resolves to `undefined` and every host on an orchestrating driver silently keeps persisting the full payloads. Measured exactly that way on a Create run: 10 `context.condensed` events fired, and the session still stored the two largest `read_context` results at 26,907 and 23,060 chars. The method existed, the tests passed, and the feature did nothing.\n */\n",
15620
+ "excerptTokens": [
15621
+ {
15622
+ "kind": "Content",
15623
+ "text": "getHistoryForPersistence(): "
15624
+ },
15625
+ {
15626
+ "kind": "Reference",
15627
+ "text": "ChatMessage",
15628
+ "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
15629
+ },
15630
+ {
15631
+ "kind": "Content",
15632
+ "text": "[]"
15633
+ },
15634
+ {
15635
+ "kind": "Content",
15636
+ "text": ";"
15637
+ }
15638
+ ],
15639
+ "isStatic": false,
15640
+ "returnTypeTokenRange": {
15641
+ "startIndex": 1,
15642
+ "endIndex": 3
15643
+ },
15644
+ "releaseTag": "Beta",
15645
+ "isProtected": false,
15646
+ "overloadIndex": 1,
15647
+ "parameters": [],
15648
+ "isOptional": false,
15649
+ "isAbstract": false,
15650
+ "name": "getHistoryForPersistence"
15651
+ },
15063
15652
  {
15064
15653
  "kind": "Method",
15065
15654
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#getInteractionContext:member(1)",
@@ -15657,6 +16246,55 @@
15657
16246
  "isAbstract": false,
15658
16247
  "name": "sendMessage"
15659
16248
  },
16249
+ {
16250
+ "kind": "Method",
16251
+ "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#setContextGuard:member(1)",
16252
+ "docComment": "/**\n * Set the mid-loop context guard (GENC-1567). `undefined` disables it.\n *\n * Carries a margin rather than an absolute threshold: the window belongs to whichever provider the next call resolves to, which the driver learns during the call and the host cannot know until afterwards. The host owns the policy; the driver applies it against the model actually being addressed. Optional — only drivers that own a tool loop implement it.\n */\n",
16253
+ "excerptTokens": [
16254
+ {
16255
+ "kind": "Content",
16256
+ "text": "setContextGuard(policy?: "
16257
+ },
16258
+ {
16259
+ "kind": "Reference",
16260
+ "text": "ContextGuardPolicy",
16261
+ "canonicalReference": "@genesislcap/ai-assistant!ContextGuardPolicy:interface"
16262
+ },
16263
+ {
16264
+ "kind": "Content",
16265
+ "text": "): "
16266
+ },
16267
+ {
16268
+ "kind": "Content",
16269
+ "text": "void"
16270
+ },
16271
+ {
16272
+ "kind": "Content",
16273
+ "text": ";"
16274
+ }
16275
+ ],
16276
+ "isStatic": false,
16277
+ "returnTypeTokenRange": {
16278
+ "startIndex": 3,
16279
+ "endIndex": 4
16280
+ },
16281
+ "releaseTag": "Beta",
16282
+ "isProtected": false,
16283
+ "overloadIndex": 1,
16284
+ "parameters": [
16285
+ {
16286
+ "parameterName": "policy",
16287
+ "parameterTypeTokenRange": {
16288
+ "startIndex": 1,
16289
+ "endIndex": 2
16290
+ },
16291
+ "isOptional": true
16292
+ }
16293
+ ],
16294
+ "isOptional": false,
16295
+ "isAbstract": false,
16296
+ "name": "setContextGuard"
16297
+ },
15660
16298
  {
15661
16299
  "kind": "Method",
15662
16300
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#setFlowOwner:member(1)",