@genesislcap/ai-assistant 14.495.0 → 14.496.1-GENC-1461.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 (43) hide show
  1. package/dist/ai-assistant.api.json +708 -211
  2. package/dist/ai-assistant.d.ts +152 -5
  3. package/dist/chat-driver.cjs +5729 -0
  4. package/dist/chat-driver.cjs.map +7 -0
  5. package/dist/chat-driver.mjs +5681 -0
  6. package/dist/chat-driver.mjs.map +7 -0
  7. package/dist/custom-elements.json +524 -75
  8. package/dist/dts/channel/ai-activity-bus.d.ts +36 -0
  9. package/dist/dts/channel/ai-activity-bus.d.ts.map +1 -1
  10. package/dist/dts/chat-driver-node.d.ts +34 -0
  11. package/dist/dts/chat-driver-node.d.ts.map +1 -0
  12. package/dist/dts/components/ai-driver/ai-driver.d.ts +8 -0
  13. package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
  14. package/dist/dts/components/chat-driver/chat-driver.d.ts +65 -5
  15. package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
  16. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +6 -0
  17. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
  18. package/dist/dts/config/config.d.ts +37 -2
  19. package/dist/dts/config/config.d.ts.map +1 -1
  20. package/dist/dts/main/main.d.ts.map +1 -1
  21. package/dist/dts/state/persistence/build-timeline-entries.d.ts +37 -0
  22. package/dist/dts/state/persistence/build-timeline-entries.d.ts.map +1 -0
  23. package/dist/esm/channel/ai-activity-bus.js +48 -12
  24. package/dist/esm/chat-driver-node.js +48 -0
  25. package/dist/esm/components/chat-driver/chat-driver.js +80 -25
  26. package/dist/esm/components/chat-driver/chat-driver.test.js +66 -40
  27. package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +11 -1
  28. package/dist/esm/main/main.js +26 -29
  29. package/dist/esm/main/popout-interaction-gate.test.js +6 -10
  30. package/dist/esm/state/persistence/build-timeline-entries.js +46 -0
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +29 -19
  33. package/scripts/build-chat-driver-node.mjs +42 -0
  34. package/src/channel/ai-activity-bus.ts +64 -10
  35. package/src/chat-driver-node.ts +74 -0
  36. package/src/components/ai-driver/ai-driver.ts +9 -0
  37. package/src/components/chat-driver/chat-driver.test.ts +77 -62
  38. package/src/components/chat-driver/chat-driver.ts +148 -35
  39. package/src/components/orchestrating-driver/orchestrating-driver.ts +16 -11
  40. package/src/config/config.ts +40 -1
  41. package/src/main/main.ts +25 -41
  42. package/src/main/popout-interaction-gate.test.ts +6 -11
  43. package/src/state/persistence/build-timeline-entries.ts +66 -0
@@ -178,6 +178,116 @@
178
178
  "name": "",
179
179
  "preserveMemberOrder": false,
180
180
  "members": [
181
+ {
182
+ "kind": "Interface",
183
+ "canonicalReference": "@genesislcap/ai-assistant!ActivityBus:interface",
184
+ "docComment": "/**\n * Minimal activity-bus surface the drivers depend on. `ChatDriver`/`OrchestratingDriver` only ever *publish* — accepting this narrow interface (rather than importing the module singleton) lets a headless/server or unit-test host omit the bus entirely, so no live `BroadcastChannel` is ever opened on that path. See {@link NOOP_ACTIVITY_BUS}.\n *\n * @beta\n */\n",
185
+ "excerptTokens": [
186
+ {
187
+ "kind": "Content",
188
+ "text": "export interface ActivityBus "
189
+ }
190
+ ],
191
+ "fileUrlPath": "src/channel/ai-activity-bus.ts",
192
+ "releaseTag": "Beta",
193
+ "name": "ActivityBus",
194
+ "preserveMemberOrder": false,
195
+ "members": [
196
+ {
197
+ "kind": "MethodSignature",
198
+ "canonicalReference": "@genesislcap/ai-assistant!ActivityBus#publish:member(1)",
199
+ "docComment": "",
200
+ "excerptTokens": [
201
+ {
202
+ "kind": "Content",
203
+ "text": "publish<K extends "
204
+ },
205
+ {
206
+ "kind": "Content",
207
+ "text": "keyof "
208
+ },
209
+ {
210
+ "kind": "Reference",
211
+ "text": "AgenticActivityEvents",
212
+ "canonicalReference": "@genesislcap/ai-assistant!AgenticActivityEvents:interface"
213
+ },
214
+ {
215
+ "kind": "Content",
216
+ "text": ">(type: "
217
+ },
218
+ {
219
+ "kind": "Content",
220
+ "text": "K"
221
+ },
222
+ {
223
+ "kind": "Content",
224
+ "text": ", detail: "
225
+ },
226
+ {
227
+ "kind": "Reference",
228
+ "text": "AgenticActivityEvents",
229
+ "canonicalReference": "@genesislcap/ai-assistant!AgenticActivityEvents:interface"
230
+ },
231
+ {
232
+ "kind": "Content",
233
+ "text": "[K]"
234
+ },
235
+ {
236
+ "kind": "Content",
237
+ "text": "): "
238
+ },
239
+ {
240
+ "kind": "Content",
241
+ "text": "void"
242
+ },
243
+ {
244
+ "kind": "Content",
245
+ "text": ";"
246
+ }
247
+ ],
248
+ "isOptional": false,
249
+ "returnTypeTokenRange": {
250
+ "startIndex": 9,
251
+ "endIndex": 10
252
+ },
253
+ "releaseTag": "Beta",
254
+ "overloadIndex": 1,
255
+ "parameters": [
256
+ {
257
+ "parameterName": "type",
258
+ "parameterTypeTokenRange": {
259
+ "startIndex": 4,
260
+ "endIndex": 5
261
+ },
262
+ "isOptional": false
263
+ },
264
+ {
265
+ "parameterName": "detail",
266
+ "parameterTypeTokenRange": {
267
+ "startIndex": 6,
268
+ "endIndex": 8
269
+ },
270
+ "isOptional": false
271
+ }
272
+ ],
273
+ "typeParameters": [
274
+ {
275
+ "typeParameterName": "K",
276
+ "constraintTokenRange": {
277
+ "startIndex": 1,
278
+ "endIndex": 3
279
+ },
280
+ "defaultTypeTokenRange": {
281
+ "startIndex": 0,
282
+ "endIndex": 0
283
+ }
284
+ }
285
+ ],
286
+ "name": "publish"
287
+ }
288
+ ],
289
+ "extendsTokenRanges": []
290
+ },
181
291
  {
182
292
  "kind": "Variable",
183
293
  "canonicalReference": "@genesislcap/ai-assistant!AGENT_PICKER_AUTO_VALUE:var",
@@ -637,6 +747,33 @@
637
747
  "endIndex": 2
638
748
  }
639
749
  },
750
+ {
751
+ "kind": "PropertySignature",
752
+ "canonicalReference": "@genesislcap/ai-assistant!AgenticActivityBusConfig#channelNameFactory:member",
753
+ "docComment": "/**\n * Lazy alternative to {@link AgenticActivityBusConfig.channelName}: called the first time a cross-tab channel is actually needed, in a browser only. Deferring the name computation keeps side effects (e.g. `sessionStorage` reads) out of module-eval and off the non-browser path. Ignored if `channelName` is also set.\n */\n",
754
+ "excerptTokens": [
755
+ {
756
+ "kind": "Content",
757
+ "text": "channelNameFactory?: "
758
+ },
759
+ {
760
+ "kind": "Content",
761
+ "text": "() => string"
762
+ },
763
+ {
764
+ "kind": "Content",
765
+ "text": ";"
766
+ }
767
+ ],
768
+ "isReadonly": false,
769
+ "isOptional": true,
770
+ "releaseTag": "Beta",
771
+ "name": "channelNameFactory",
772
+ "propertyTypeTokenRange": {
773
+ "startIndex": 1,
774
+ "endIndex": 2
775
+ }
776
+ },
640
777
  {
641
778
  "kind": "PropertySignature",
642
779
  "canonicalReference": "@genesislcap/ai-assistant!AgenticActivityBusConfig#crossTabEvents:member",
@@ -2643,6 +2780,48 @@
2643
2780
  "parameters": [],
2644
2781
  "name": "getActiveProviderName"
2645
2782
  },
2783
+ {
2784
+ "kind": "MethodSignature",
2785
+ "canonicalReference": "@genesislcap/ai-assistant!AiDriver#getExternalDiagnostics:member(1)",
2786
+ "docComment": "/**\n * Diagnostic-log entries harvested from resolved interactions (e.g. a server-side ChatDriver's collated debug log, returned on `InteractionResult.diagnostics`). The host folds these into its debug log. Optional for the same leaf/orchestrator reason as `getTurnSnapshots`. (GENC-1461 unified diagnostics.)\n */\n",
2787
+ "excerptTokens": [
2788
+ {
2789
+ "kind": "Content",
2790
+ "text": "getExternalDiagnostics?(): "
2791
+ },
2792
+ {
2793
+ "kind": "Reference",
2794
+ "text": "ReadonlyArray",
2795
+ "canonicalReference": "!ReadonlyArray:interface"
2796
+ },
2797
+ {
2798
+ "kind": "Content",
2799
+ "text": "<"
2800
+ },
2801
+ {
2802
+ "kind": "Reference",
2803
+ "text": "DiagnosticEntry",
2804
+ "canonicalReference": "@genesislcap/ai-assistant!DiagnosticEntry:interface"
2805
+ },
2806
+ {
2807
+ "kind": "Content",
2808
+ "text": ">"
2809
+ },
2810
+ {
2811
+ "kind": "Content",
2812
+ "text": ";"
2813
+ }
2814
+ ],
2815
+ "isOptional": true,
2816
+ "returnTypeTokenRange": {
2817
+ "startIndex": 1,
2818
+ "endIndex": 5
2819
+ },
2820
+ "releaseTag": "Beta",
2821
+ "overloadIndex": 1,
2822
+ "parameters": [],
2823
+ "name": "getExternalDiagnostics"
2824
+ },
2646
2825
  {
2647
2826
  "kind": "MethodSignature",
2648
2827
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#getInteractionContext:member(1)",
@@ -4047,75 +4226,12 @@
4047
4226
  },
4048
4227
  {
4049
4228
  "kind": "Content",
4050
- "text": ", toolHandlers?: "
4051
- },
4052
- {
4053
- "kind": "Reference",
4054
- "text": "ToolHandlersInput",
4055
- "canonicalReference": "@genesislcap/ai-assistant!ToolHandlersInput:type"
4056
- },
4057
- {
4058
- "kind": "Content",
4059
- "text": ", toolDefinitions?: "
4060
- },
4061
- {
4062
- "kind": "Reference",
4063
- "text": "ToolDefinitionsInput",
4064
- "canonicalReference": "@genesislcap/ai-assistant!ToolDefinitionsInput:type"
4065
- },
4066
- {
4067
- "kind": "Content",
4068
- "text": ", systemPrompt?: "
4069
- },
4070
- {
4071
- "kind": "Reference",
4072
- "text": "SystemPromptInput",
4073
- "canonicalReference": "@genesislcap/ai-assistant!SystemPromptInput:type"
4074
- },
4075
- {
4076
- "kind": "Content",
4077
- "text": ", primerHistory?: "
4229
+ "text": ", config?: "
4078
4230
  },
4079
4231
  {
4080
4232
  "kind": "Reference",
4081
- "text": "ChatMessage",
4082
- "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
4083
- },
4084
- {
4085
- "kind": "Content",
4086
- "text": "[]"
4087
- },
4088
- {
4089
- "kind": "Content",
4090
- "text": ", maxToolIterations?: "
4091
- },
4092
- {
4093
- "kind": "Content",
4094
- "text": "number"
4095
- },
4096
- {
4097
- "kind": "Content",
4098
- "text": ", maxFoldOperations?: "
4099
- },
4100
- {
4101
- "kind": "Content",
4102
- "text": "number"
4103
- },
4104
- {
4105
- "kind": "Content",
4106
- "text": ", maxTurnSnapshots?: "
4107
- },
4108
- {
4109
- "kind": "Content",
4110
- "text": "number"
4111
- },
4112
- {
4113
- "kind": "Content",
4114
- "text": ", \n sessionKey?: "
4115
- },
4116
- {
4117
- "kind": "Content",
4118
- "text": "string"
4233
+ "text": "ChatDriverConfig",
4234
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig:interface"
4119
4235
  },
4120
4236
  {
4121
4237
  "kind": "Content",
@@ -4135,92 +4251,36 @@
4135
4251
  "isOptional": false
4136
4252
  },
4137
4253
  {
4138
- "parameterName": "toolHandlers",
4254
+ "parameterName": "config",
4139
4255
  "parameterTypeTokenRange": {
4140
4256
  "startIndex": 3,
4141
4257
  "endIndex": 4
4142
4258
  },
4143
4259
  "isOptional": true
4260
+ }
4261
+ ]
4262
+ },
4263
+ {
4264
+ "kind": "Method",
4265
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#applyAgent:member(1)",
4266
+ "docComment": "/**\n * Swap in a new agent's configuration. Called by OrchestratingDriver before each specialist turn so the shared driver runs with the right tools and prompt.\n */\n",
4267
+ "excerptTokens": [
4268
+ {
4269
+ "kind": "Content",
4270
+ "text": "applyAgent(config: "
4144
4271
  },
4145
4272
  {
4146
- "parameterName": "toolDefinitions",
4147
- "parameterTypeTokenRange": {
4148
- "startIndex": 5,
4149
- "endIndex": 6
4150
- },
4151
- "isOptional": true
4273
+ "kind": "Reference",
4274
+ "text": "AgentConfig",
4275
+ "canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
4152
4276
  },
4153
4277
  {
4154
- "parameterName": "systemPrompt",
4155
- "parameterTypeTokenRange": {
4156
- "startIndex": 7,
4157
- "endIndex": 8
4158
- },
4159
- "isOptional": true
4278
+ "kind": "Content",
4279
+ "text": "): "
4160
4280
  },
4161
4281
  {
4162
- "parameterName": "primerHistory",
4163
- "parameterTypeTokenRange": {
4164
- "startIndex": 9,
4165
- "endIndex": 11
4166
- },
4167
- "isOptional": true
4168
- },
4169
- {
4170
- "parameterName": "maxToolIterations",
4171
- "parameterTypeTokenRange": {
4172
- "startIndex": 12,
4173
- "endIndex": 13
4174
- },
4175
- "isOptional": true
4176
- },
4177
- {
4178
- "parameterName": "maxFoldOperations",
4179
- "parameterTypeTokenRange": {
4180
- "startIndex": 14,
4181
- "endIndex": 15
4182
- },
4183
- "isOptional": true
4184
- },
4185
- {
4186
- "parameterName": "maxTurnSnapshots",
4187
- "parameterTypeTokenRange": {
4188
- "startIndex": 16,
4189
- "endIndex": 17
4190
- },
4191
- "isOptional": true
4192
- },
4193
- {
4194
- "parameterName": "sessionKey",
4195
- "parameterTypeTokenRange": {
4196
- "startIndex": 18,
4197
- "endIndex": 19
4198
- },
4199
- "isOptional": true
4200
- }
4201
- ]
4202
- },
4203
- {
4204
- "kind": "Method",
4205
- "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#applyAgent:member(1)",
4206
- "docComment": "/**\n * Swap in a new agent's configuration. Called by OrchestratingDriver before each specialist turn so the shared driver runs with the right tools and prompt.\n */\n",
4207
- "excerptTokens": [
4208
- {
4209
- "kind": "Content",
4210
- "text": "applyAgent(config: "
4211
- },
4212
- {
4213
- "kind": "Reference",
4214
- "text": "AgentConfig",
4215
- "canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
4216
- },
4217
- {
4218
- "kind": "Content",
4219
- "text": "): "
4220
- },
4221
- {
4222
- "kind": "Content",
4223
- "text": "void"
4282
+ "kind": "Content",
4283
+ "text": "void"
4224
4284
  },
4225
4285
  {
4226
4286
  "kind": "Content",
@@ -4547,6 +4607,51 @@
4547
4607
  "isAbstract": false,
4548
4608
  "name": "getAgentReleaseRequested"
4549
4609
  },
4610
+ {
4611
+ "kind": "Method",
4612
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#getExternalDiagnostics:member(1)",
4613
+ "docComment": "/**\n * Diagnostic-log entries harvested from resolved interactions' `InteractionResult.diagnostics` (e.g. a server-side ChatDriver's collated debug log). The host concatenates these into its own debug log so `downloadDebugLog`/the persisted diagnostics stream include external-engine logs. Opaque, chronologically sorted by the host at assemble time. (GENC-1461 unified diagnostics.)\n */\n",
4614
+ "excerptTokens": [
4615
+ {
4616
+ "kind": "Content",
4617
+ "text": "getExternalDiagnostics(): "
4618
+ },
4619
+ {
4620
+ "kind": "Reference",
4621
+ "text": "ReadonlyArray",
4622
+ "canonicalReference": "!ReadonlyArray:interface"
4623
+ },
4624
+ {
4625
+ "kind": "Content",
4626
+ "text": "<"
4627
+ },
4628
+ {
4629
+ "kind": "Reference",
4630
+ "text": "DiagnosticEntry",
4631
+ "canonicalReference": "@genesislcap/ai-assistant!DiagnosticEntry:interface"
4632
+ },
4633
+ {
4634
+ "kind": "Content",
4635
+ "text": ">"
4636
+ },
4637
+ {
4638
+ "kind": "Content",
4639
+ "text": ";"
4640
+ }
4641
+ ],
4642
+ "isStatic": false,
4643
+ "returnTypeTokenRange": {
4644
+ "startIndex": 1,
4645
+ "endIndex": 5
4646
+ },
4647
+ "releaseTag": "Beta",
4648
+ "isProtected": false,
4649
+ "overloadIndex": 1,
4650
+ "parameters": [],
4651
+ "isOptional": false,
4652
+ "isAbstract": false,
4653
+ "name": "getExternalDiagnostics"
4654
+ },
4550
4655
  {
4551
4656
  "kind": "Method",
4552
4657
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#getHistory:member(1)",
@@ -5302,120 +5407,390 @@
5302
5407
  },
5303
5408
  {
5304
5409
  "kind": "Content",
5305
- "text": "<T>"
5410
+ "text": "<T>"
5411
+ },
5412
+ {
5413
+ "kind": "Content",
5414
+ "text": "): "
5415
+ },
5416
+ {
5417
+ "kind": "Content",
5418
+ "text": "void"
5419
+ },
5420
+ {
5421
+ "kind": "Content",
5422
+ "text": ";"
5423
+ }
5424
+ ],
5425
+ "isStatic": false,
5426
+ "returnTypeTokenRange": {
5427
+ "startIndex": 7,
5428
+ "endIndex": 8
5429
+ },
5430
+ "releaseTag": "Beta",
5431
+ "isProtected": false,
5432
+ "overloadIndex": 1,
5433
+ "parameters": [
5434
+ {
5435
+ "parameterName": "fn",
5436
+ "parameterTypeTokenRange": {
5437
+ "startIndex": 1,
5438
+ "endIndex": 6
5439
+ },
5440
+ "isOptional": false
5441
+ }
5442
+ ],
5443
+ "isOptional": false,
5444
+ "isAbstract": false,
5445
+ "name": "setHostInteractionRequester"
5446
+ },
5447
+ {
5448
+ "kind": "Method",
5449
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#setProviderHistoryTransform:member(1)",
5450
+ "docComment": "/**\n * Optional transform applied to conversation history immediately before each LLM request. Cleared when `undefined`. Does not alter stored history.\n */\n",
5451
+ "excerptTokens": [
5452
+ {
5453
+ "kind": "Content",
5454
+ "text": "setProviderHistoryTransform(transform?: "
5455
+ },
5456
+ {
5457
+ "kind": "Content",
5458
+ "text": "(history: "
5459
+ },
5460
+ {
5461
+ "kind": "Reference",
5462
+ "text": "ChatMessage",
5463
+ "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
5464
+ },
5465
+ {
5466
+ "kind": "Content",
5467
+ "text": "[]) => "
5468
+ },
5469
+ {
5470
+ "kind": "Reference",
5471
+ "text": "ChatMessage",
5472
+ "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
5473
+ },
5474
+ {
5475
+ "kind": "Content",
5476
+ "text": "[]"
5477
+ },
5478
+ {
5479
+ "kind": "Content",
5480
+ "text": "): "
5481
+ },
5482
+ {
5483
+ "kind": "Content",
5484
+ "text": "void"
5485
+ },
5486
+ {
5487
+ "kind": "Content",
5488
+ "text": ";"
5489
+ }
5490
+ ],
5491
+ "isStatic": false,
5492
+ "returnTypeTokenRange": {
5493
+ "startIndex": 7,
5494
+ "endIndex": 8
5495
+ },
5496
+ "releaseTag": "Beta",
5497
+ "isProtected": false,
5498
+ "overloadIndex": 1,
5499
+ "parameters": [
5500
+ {
5501
+ "parameterName": "transform",
5502
+ "parameterTypeTokenRange": {
5503
+ "startIndex": 1,
5504
+ "endIndex": 6
5505
+ },
5506
+ "isOptional": true
5507
+ }
5508
+ ],
5509
+ "isOptional": false,
5510
+ "isAbstract": false,
5511
+ "name": "setProviderHistoryTransform"
5512
+ }
5513
+ ],
5514
+ "extendsTokenRange": {
5515
+ "startIndex": 1,
5516
+ "endIndex": 2
5517
+ },
5518
+ "implementsTokenRanges": [
5519
+ {
5520
+ "startIndex": 3,
5521
+ "endIndex": 4
5522
+ }
5523
+ ]
5524
+ },
5525
+ {
5526
+ "kind": "Interface",
5527
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig:interface",
5528
+ "docComment": "/**\n * Construction-time configuration for {@link ChatDriver}. Everything except the provider registry is optional — most fields are also settable per-agent via `applyAgent`, so a bare `new ChatDriver(registry)` is valid. Mirrors the `(registry, options)` shape of `OrchestratingDriver`.\n *\n * @beta\n */\n",
5529
+ "excerptTokens": [
5530
+ {
5531
+ "kind": "Content",
5532
+ "text": "export interface ChatDriverConfig "
5533
+ }
5534
+ ],
5535
+ "fileUrlPath": "src/components/chat-driver/chat-driver.ts",
5536
+ "releaseTag": "Beta",
5537
+ "name": "ChatDriverConfig",
5538
+ "preserveMemberOrder": false,
5539
+ "members": [
5540
+ {
5541
+ "kind": "PropertySignature",
5542
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig#activityBus:member",
5543
+ "docComment": "/**\n * Activity bus for lifecycle/halo/tool-loop events. Injected by the browser host (the shared cross-tab singleton); omitted off-browser (Node, tests, headless), where it defaults to {@link NOOP_ACTIVITY_BUS} so no `BroadcastChannel` is ever opened.\n */\n",
5544
+ "excerptTokens": [
5545
+ {
5546
+ "kind": "Content",
5547
+ "text": "activityBus?: "
5548
+ },
5549
+ {
5550
+ "kind": "Reference",
5551
+ "text": "ActivityBus",
5552
+ "canonicalReference": "@genesislcap/ai-assistant!ActivityBus:interface"
5553
+ },
5554
+ {
5555
+ "kind": "Content",
5556
+ "text": ";"
5557
+ }
5558
+ ],
5559
+ "isReadonly": false,
5560
+ "isOptional": true,
5561
+ "releaseTag": "Beta",
5562
+ "name": "activityBus",
5563
+ "propertyTypeTokenRange": {
5564
+ "startIndex": 1,
5565
+ "endIndex": 2
5566
+ }
5567
+ },
5568
+ {
5569
+ "kind": "PropertySignature",
5570
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig#maxFoldOperations:member",
5571
+ "docComment": "/**\n * Hard cap on fold operations. Default `5`.\n */\n",
5572
+ "excerptTokens": [
5573
+ {
5574
+ "kind": "Content",
5575
+ "text": "maxFoldOperations?: "
5576
+ },
5577
+ {
5578
+ "kind": "Content",
5579
+ "text": "number"
5580
+ },
5581
+ {
5582
+ "kind": "Content",
5583
+ "text": ";"
5584
+ }
5585
+ ],
5586
+ "isReadonly": false,
5587
+ "isOptional": true,
5588
+ "releaseTag": "Beta",
5589
+ "name": "maxFoldOperations",
5590
+ "propertyTypeTokenRange": {
5591
+ "startIndex": 1,
5592
+ "endIndex": 2
5593
+ }
5594
+ },
5595
+ {
5596
+ "kind": "PropertySignature",
5597
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig#maxToolIterations:member",
5598
+ "docComment": "/**\n * Hard cap on tool-loop iterations. Default `50`.\n */\n",
5599
+ "excerptTokens": [
5600
+ {
5601
+ "kind": "Content",
5602
+ "text": "maxToolIterations?: "
5603
+ },
5604
+ {
5605
+ "kind": "Content",
5606
+ "text": "number"
5607
+ },
5608
+ {
5609
+ "kind": "Content",
5610
+ "text": ";"
5611
+ }
5612
+ ],
5613
+ "isReadonly": false,
5614
+ "isOptional": true,
5615
+ "releaseTag": "Beta",
5616
+ "name": "maxToolIterations",
5617
+ "propertyTypeTokenRange": {
5618
+ "startIndex": 1,
5619
+ "endIndex": 2
5620
+ }
5621
+ },
5622
+ {
5623
+ "kind": "PropertySignature",
5624
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig#maxTurnSnapshots:member",
5625
+ "docComment": "/**\n * Ring-buffer size for per-turn snapshots. Default `400`.\n */\n",
5626
+ "excerptTokens": [
5627
+ {
5628
+ "kind": "Content",
5629
+ "text": "maxTurnSnapshots?: "
5630
+ },
5631
+ {
5632
+ "kind": "Content",
5633
+ "text": "number"
5634
+ },
5635
+ {
5636
+ "kind": "Content",
5637
+ "text": ";"
5638
+ }
5639
+ ],
5640
+ "isReadonly": false,
5641
+ "isOptional": true,
5642
+ "releaseTag": "Beta",
5643
+ "name": "maxTurnSnapshots",
5644
+ "propertyTypeTokenRange": {
5645
+ "startIndex": 1,
5646
+ "endIndex": 2
5647
+ }
5648
+ },
5649
+ {
5650
+ "kind": "PropertySignature",
5651
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig#primerHistory:member",
5652
+ "docComment": "/**\n * Primer history prepended to the conversation.\n */\n",
5653
+ "excerptTokens": [
5654
+ {
5655
+ "kind": "Content",
5656
+ "text": "primerHistory?: "
5306
5657
  },
5307
5658
  {
5308
- "kind": "Content",
5309
- "text": "): "
5659
+ "kind": "Reference",
5660
+ "text": "ChatMessage",
5661
+ "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
5310
5662
  },
5311
5663
  {
5312
5664
  "kind": "Content",
5313
- "text": "void"
5665
+ "text": "[]"
5314
5666
  },
5315
5667
  {
5316
5668
  "kind": "Content",
5317
5669
  "text": ";"
5318
5670
  }
5319
5671
  ],
5320
- "isStatic": false,
5321
- "returnTypeTokenRange": {
5322
- "startIndex": 7,
5323
- "endIndex": 8
5324
- },
5672
+ "isReadonly": false,
5673
+ "isOptional": true,
5325
5674
  "releaseTag": "Beta",
5326
- "isProtected": false,
5327
- "overloadIndex": 1,
5328
- "parameters": [
5329
- {
5330
- "parameterName": "fn",
5331
- "parameterTypeTokenRange": {
5332
- "startIndex": 1,
5333
- "endIndex": 6
5334
- },
5335
- "isOptional": false
5336
- }
5337
- ],
5338
- "isOptional": false,
5339
- "isAbstract": false,
5340
- "name": "setHostInteractionRequester"
5675
+ "name": "primerHistory",
5676
+ "propertyTypeTokenRange": {
5677
+ "startIndex": 1,
5678
+ "endIndex": 3
5679
+ }
5341
5680
  },
5342
5681
  {
5343
- "kind": "Method",
5344
- "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#setProviderHistoryTransform:member(1)",
5345
- "docComment": "/**\n * Optional transform applied to conversation history immediately before each LLM request. Cleared when `undefined`. Does not alter stored history.\n */\n",
5682
+ "kind": "PropertySignature",
5683
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig#sessionKey:member",
5684
+ "docComment": "/**\n * Session identity used to file meta events onto the shared debug-log timeline.\n */\n",
5346
5685
  "excerptTokens": [
5347
5686
  {
5348
5687
  "kind": "Content",
5349
- "text": "setProviderHistoryTransform(transform?: "
5688
+ "text": "sessionKey?: "
5350
5689
  },
5351
5690
  {
5352
5691
  "kind": "Content",
5353
- "text": "(history: "
5692
+ "text": "string"
5354
5693
  },
5355
5694
  {
5356
- "kind": "Reference",
5357
- "text": "ChatMessage",
5358
- "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
5359
- },
5695
+ "kind": "Content",
5696
+ "text": ";"
5697
+ }
5698
+ ],
5699
+ "isReadonly": false,
5700
+ "isOptional": true,
5701
+ "releaseTag": "Beta",
5702
+ "name": "sessionKey",
5703
+ "propertyTypeTokenRange": {
5704
+ "startIndex": 1,
5705
+ "endIndex": 2
5706
+ }
5707
+ },
5708
+ {
5709
+ "kind": "PropertySignature",
5710
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig#systemPrompt:member",
5711
+ "docComment": "/**\n * Initial system prompt (string or per-turn resolver).\n */\n",
5712
+ "excerptTokens": [
5360
5713
  {
5361
5714
  "kind": "Content",
5362
- "text": "[]) => "
5715
+ "text": "systemPrompt?: "
5363
5716
  },
5364
5717
  {
5365
5718
  "kind": "Reference",
5366
- "text": "ChatMessage",
5367
- "canonicalReference": "@genesislcap/foundation-ai!ChatMessage:interface"
5719
+ "text": "SystemPromptInput",
5720
+ "canonicalReference": "@genesislcap/ai-assistant!SystemPromptInput:type"
5368
5721
  },
5369
5722
  {
5370
5723
  "kind": "Content",
5371
- "text": "[]"
5372
- },
5724
+ "text": ";"
5725
+ }
5726
+ ],
5727
+ "isReadonly": false,
5728
+ "isOptional": true,
5729
+ "releaseTag": "Beta",
5730
+ "name": "systemPrompt",
5731
+ "propertyTypeTokenRange": {
5732
+ "startIndex": 1,
5733
+ "endIndex": 2
5734
+ }
5735
+ },
5736
+ {
5737
+ "kind": "PropertySignature",
5738
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig#toolDefinitions:member",
5739
+ "docComment": "/**\n * Initial tool definitions (static array or per-turn factory). Default `[]`.\n */\n",
5740
+ "excerptTokens": [
5373
5741
  {
5374
5742
  "kind": "Content",
5375
- "text": "): "
5743
+ "text": "toolDefinitions?: "
5376
5744
  },
5377
5745
  {
5378
- "kind": "Content",
5379
- "text": "void"
5746
+ "kind": "Reference",
5747
+ "text": "ToolDefinitionsInput",
5748
+ "canonicalReference": "@genesislcap/ai-assistant!ToolDefinitionsInput:type"
5380
5749
  },
5381
5750
  {
5382
5751
  "kind": "Content",
5383
5752
  "text": ";"
5384
5753
  }
5385
5754
  ],
5386
- "isStatic": false,
5387
- "returnTypeTokenRange": {
5388
- "startIndex": 7,
5389
- "endIndex": 8
5390
- },
5755
+ "isReadonly": false,
5756
+ "isOptional": true,
5391
5757
  "releaseTag": "Beta",
5392
- "isProtected": false,
5393
- "overloadIndex": 1,
5394
- "parameters": [
5758
+ "name": "toolDefinitions",
5759
+ "propertyTypeTokenRange": {
5760
+ "startIndex": 1,
5761
+ "endIndex": 2
5762
+ }
5763
+ },
5764
+ {
5765
+ "kind": "PropertySignature",
5766
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig#toolHandlers:member",
5767
+ "docComment": "/**\n * Initial tool handlers (static map or per-turn factory). Default `{}`.\n */\n",
5768
+ "excerptTokens": [
5395
5769
  {
5396
- "parameterName": "transform",
5397
- "parameterTypeTokenRange": {
5398
- "startIndex": 1,
5399
- "endIndex": 6
5400
- },
5401
- "isOptional": true
5770
+ "kind": "Content",
5771
+ "text": "toolHandlers?: "
5772
+ },
5773
+ {
5774
+ "kind": "Reference",
5775
+ "text": "ToolHandlersInput",
5776
+ "canonicalReference": "@genesislcap/ai-assistant!ToolHandlersInput:type"
5777
+ },
5778
+ {
5779
+ "kind": "Content",
5780
+ "text": ";"
5402
5781
  }
5403
5782
  ],
5404
- "isOptional": false,
5405
- "isAbstract": false,
5406
- "name": "setProviderHistoryTransform"
5783
+ "isReadonly": false,
5784
+ "isOptional": true,
5785
+ "releaseTag": "Beta",
5786
+ "name": "toolHandlers",
5787
+ "propertyTypeTokenRange": {
5788
+ "startIndex": 1,
5789
+ "endIndex": 2
5790
+ }
5407
5791
  }
5408
5792
  ],
5409
- "extendsTokenRange": {
5410
- "startIndex": 1,
5411
- "endIndex": 2
5412
- },
5413
- "implementsTokenRanges": [
5414
- {
5415
- "startIndex": 3,
5416
- "endIndex": 4
5417
- }
5418
- ]
5793
+ "extendsTokenRanges": []
5419
5794
  },
5420
5795
  {
5421
5796
  "kind": "Interface",
@@ -12549,6 +12924,30 @@
12549
12924
  ],
12550
12925
  "extendsTokenRanges": []
12551
12926
  },
12927
+ {
12928
+ "kind": "Variable",
12929
+ "canonicalReference": "@genesislcap/ai-assistant!NOOP_ACTIVITY_BUS:var",
12930
+ "docComment": "/**\n * No-op {@link ActivityBus}. The default when no bus is injected (Node, tests, headless server use) — publishing goes nowhere and nothing is left open to tear down.\n *\n * @beta\n */\n",
12931
+ "excerptTokens": [
12932
+ {
12933
+ "kind": "Content",
12934
+ "text": "NOOP_ACTIVITY_BUS: "
12935
+ },
12936
+ {
12937
+ "kind": "Reference",
12938
+ "text": "ActivityBus",
12939
+ "canonicalReference": "@genesislcap/ai-assistant!ActivityBus:interface"
12940
+ }
12941
+ ],
12942
+ "fileUrlPath": "src/channel/ai-activity-bus.ts",
12943
+ "isReadonly": true,
12944
+ "releaseTag": "Beta",
12945
+ "name": "NOOP_ACTIVITY_BUS",
12946
+ "variableTypeTokenRange": {
12947
+ "startIndex": 1,
12948
+ "endIndex": 2
12949
+ }
12950
+ },
12552
12951
  {
12553
12952
  "kind": "Class",
12554
12953
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver:class",
@@ -12616,7 +13015,16 @@
12616
13015
  },
12617
13016
  {
12618
13017
  "kind": "Content",
12619
- "text": "{\n sessionKey?: string;\n maxHandoffs?: number;\n classifierHistoryLength?: number;\n classifierRetries?: number;\n maxToolIterations?: number;\n maxFoldOperations?: number;\n maxTurnSnapshots?: number;\n }"
13018
+ "text": "{\n sessionKey?: string;\n maxHandoffs?: number;\n classifierHistoryLength?: number;\n classifierRetries?: number;\n maxToolIterations?: number;\n maxFoldOperations?: number;\n maxTurnSnapshots?: number;\n activityBus?: "
13019
+ },
13020
+ {
13021
+ "kind": "Reference",
13022
+ "text": "ActivityBus",
13023
+ "canonicalReference": "@genesislcap/ai-assistant!ActivityBus:interface"
13024
+ },
13025
+ {
13026
+ "kind": "Content",
13027
+ "text": ";\n }"
12620
13028
  },
12621
13029
  {
12622
13030
  "kind": "Content",
@@ -12647,7 +13055,7 @@
12647
13055
  "parameterName": "options",
12648
13056
  "parameterTypeTokenRange": {
12649
13057
  "startIndex": 6,
12650
- "endIndex": 7
13058
+ "endIndex": 9
12651
13059
  },
12652
13060
  "isOptional": true
12653
13061
  }
@@ -12961,6 +13369,51 @@
12961
13369
  "isAbstract": false,
12962
13370
  "name": "getActiveProviderName"
12963
13371
  },
13372
+ {
13373
+ "kind": "Method",
13374
+ "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#getExternalDiagnostics:member(1)",
13375
+ "docComment": "/**\n * Delegates to the inner {@link ChatDriver} — interactions resolve there, so it holds the buffer.\n */\n",
13376
+ "excerptTokens": [
13377
+ {
13378
+ "kind": "Content",
13379
+ "text": "getExternalDiagnostics(): "
13380
+ },
13381
+ {
13382
+ "kind": "Reference",
13383
+ "text": "ReadonlyArray",
13384
+ "canonicalReference": "!ReadonlyArray:interface"
13385
+ },
13386
+ {
13387
+ "kind": "Content",
13388
+ "text": "<"
13389
+ },
13390
+ {
13391
+ "kind": "Reference",
13392
+ "text": "DiagnosticEntry",
13393
+ "canonicalReference": "@genesislcap/ai-assistant!DiagnosticEntry:interface"
13394
+ },
13395
+ {
13396
+ "kind": "Content",
13397
+ "text": ">"
13398
+ },
13399
+ {
13400
+ "kind": "Content",
13401
+ "text": ";"
13402
+ }
13403
+ ],
13404
+ "isStatic": false,
13405
+ "returnTypeTokenRange": {
13406
+ "startIndex": 1,
13407
+ "endIndex": 5
13408
+ },
13409
+ "releaseTag": "Beta",
13410
+ "isProtected": false,
13411
+ "overloadIndex": 1,
13412
+ "parameters": [],
13413
+ "isOptional": false,
13414
+ "isAbstract": false,
13415
+ "name": "getExternalDiagnostics"
13416
+ },
12964
13417
  {
12965
13418
  "kind": "Method",
12966
13419
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#getInteractionContext:member(1)",
@@ -14159,6 +14612,50 @@
14159
14612
  "endIndex": 0
14160
14613
  }
14161
14614
  },
14615
+ {
14616
+ "kind": "TypeAlias",
14617
+ "canonicalReference": "@genesislcap/ai-assistant!ResponseSchemaInput:type",
14618
+ "docComment": "/**\n * Structured-output schema for an agent. When set, the model's final (non-tool) answer is constrained to this JSON Schema instead of free text. Either a static schema or a function resolved each tool-loop iteration — return the schema on the turn(s) it should apply and `undefined` otherwise, so \"whole-loop\" vs \"finalize-turn\" enforcement is just what the resolver returns (e.g. `({ state }) => state.machine.matches('finalizing') ? schema : undefined`).\n *\n * Orthogonal to {@link ToolChoiceInput}: an agent can carry both `tools` and a `responseSchema`. Each provider applies it natively where possible (Anthropic `output_config.format`, Gemini JSON mode) and degrades gracefully otherwise. The schema is a plain JSON Schema object; keep to the portable subset providers share (`additionalProperties: false`, explicit `required`, enums, `anyOf` for nullables — no numeric/string constraints or recursion).\n *\n * @beta\n */\n",
14619
+ "excerptTokens": [
14620
+ {
14621
+ "kind": "Content",
14622
+ "text": "export type ResponseSchemaInput = "
14623
+ },
14624
+ {
14625
+ "kind": "Content",
14626
+ "text": "object | ((ctx: "
14627
+ },
14628
+ {
14629
+ "kind": "Reference",
14630
+ "text": "SystemPromptContext",
14631
+ "canonicalReference": "@genesislcap/ai-assistant!SystemPromptContext:interface"
14632
+ },
14633
+ {
14634
+ "kind": "Content",
14635
+ "text": ") => object | undefined | "
14636
+ },
14637
+ {
14638
+ "kind": "Reference",
14639
+ "text": "Promise",
14640
+ "canonicalReference": "!Promise:interface"
14641
+ },
14642
+ {
14643
+ "kind": "Content",
14644
+ "text": "<object | undefined>)"
14645
+ },
14646
+ {
14647
+ "kind": "Content",
14648
+ "text": ";"
14649
+ }
14650
+ ],
14651
+ "fileUrlPath": "src/config/config.ts",
14652
+ "releaseTag": "Beta",
14653
+ "name": "ResponseSchemaInput",
14654
+ "typeTokenRange": {
14655
+ "startIndex": 1,
14656
+ "endIndex": 6
14657
+ }
14658
+ },
14162
14659
  {
14163
14660
  "kind": "Function",
14164
14661
  "canonicalReference": "@genesislcap/ai-assistant!restoreMachine:function(1)",