@genesislcap/ai-assistant 15.91.0 → 15.92.0-HT-305.1

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.
@@ -103,6 +103,22 @@
103
103
  "package": "@genesislcap/foundation-ai"
104
104
  }
105
105
  },
106
+ {
107
+ "kind": "js",
108
+ "name": "OpenAIProvider",
109
+ "declaration": {
110
+ "name": "OpenAIProvider",
111
+ "package": "@genesislcap/foundation-ai"
112
+ }
113
+ },
114
+ {
115
+ "kind": "js",
116
+ "name": "OpenAITransport",
117
+ "declaration": {
118
+ "name": "OpenAITransport",
119
+ "package": "@genesislcap/foundation-ai"
120
+ }
121
+ },
106
122
  {
107
123
  "kind": "js",
108
124
  "name": "MutableAIProviderRegistry",
@@ -127,6 +143,14 @@
127
143
  "package": "@genesislcap/foundation-ai"
128
144
  }
129
145
  },
146
+ {
147
+ "kind": "js",
148
+ "name": "SUPPORTED_OPENAI_MODEL_IDS",
149
+ "declaration": {
150
+ "name": "SUPPORTED_OPENAI_MODEL_IDS",
151
+ "package": "@genesislcap/foundation-ai"
152
+ }
153
+ },
130
154
  {
131
155
  "kind": "js",
132
156
  "name": "DEFAULT_PROVIDER_REFUSED_MESSAGE",
@@ -287,6 +311,46 @@
287
311
  "package": "@genesislcap/foundation-ai"
288
312
  }
289
313
  },
314
+ {
315
+ "kind": "js",
316
+ "name": "OPENAI_CACHE_WRITE_12H_MULTIPLIER",
317
+ "declaration": {
318
+ "name": "OPENAI_CACHE_WRITE_12H_MULTIPLIER",
319
+ "package": "@genesislcap/foundation-ai"
320
+ }
321
+ },
322
+ {
323
+ "kind": "js",
324
+ "name": "OPENAI_CACHE_WRITE_30M_MULTIPLIER",
325
+ "declaration": {
326
+ "name": "OPENAI_CACHE_WRITE_30M_MULTIPLIER",
327
+ "package": "@genesislcap/foundation-ai"
328
+ }
329
+ },
330
+ {
331
+ "kind": "js",
332
+ "name": "OPENAI_LONG_CONTEXT_THRESHOLD",
333
+ "declaration": {
334
+ "name": "OPENAI_LONG_CONTEXT_THRESHOLD",
335
+ "package": "@genesislcap/foundation-ai"
336
+ }
337
+ },
338
+ {
339
+ "kind": "js",
340
+ "name": "openaiRatesFor",
341
+ "declaration": {
342
+ "name": "openaiRatesFor",
343
+ "package": "@genesislcap/foundation-ai"
344
+ }
345
+ },
346
+ {
347
+ "kind": "js",
348
+ "name": "openaiTokenCost",
349
+ "declaration": {
350
+ "name": "openaiTokenCost",
351
+ "package": "@genesislcap/foundation-ai"
352
+ }
353
+ },
290
354
  {
291
355
  "kind": "js",
292
356
  "name": "vendorOfModel",
@@ -487,6 +551,14 @@
487
551
  "package": "@genesislcap/foundation-ai"
488
552
  }
489
553
  },
554
+ {
555
+ "kind": "js",
556
+ "name": "OpenAIModelId",
557
+ "declaration": {
558
+ "name": "OpenAIModelId",
559
+ "package": "@genesislcap/foundation-ai"
560
+ }
561
+ },
490
562
  {
491
563
  "kind": "js",
492
564
  "name": "AITierId",
@@ -551,6 +623,14 @@
551
623
  "package": "@genesislcap/foundation-ai"
552
624
  }
553
625
  },
626
+ {
627
+ "kind": "js",
628
+ "name": "OpenAIUsageRecord",
629
+ "declaration": {
630
+ "name": "OpenAIUsageRecord",
631
+ "package": "@genesislcap/foundation-ai"
632
+ }
633
+ },
554
634
  {
555
635
  "kind": "js",
556
636
  "name": "TokenCost",
@@ -5211,371 +5291,140 @@
5211
5291
  },
5212
5292
  {
5213
5293
  "kind": "javascript-module",
5214
- "path": "src/config/config.ts",
5294
+ "path": "src/components/flowing-waves-indicator.ts",
5215
5295
  "declarations": [
5216
5296
  {
5217
- "kind": "function",
5218
- "name": "defineAgent",
5219
- "description": "Identity helper that infers the narrowest possible type for an agent config,\npreserving string literal types (including `name`) without requiring `as const`.\n\nUse this when you need `typeof myAgent` to carry the literal `name` type —\nfor example, when wiring `ChatToolHandlers<typeof myAgent>`.\n\n```ts\nconst myAgent = defineAgent({ name: 'my_agent', ... });\ntype Handlers = ChatToolHandlers<typeof myAgent>;\n// requestSubAgent name param is now typed as 'my_agent'\n```"
5297
+ "kind": "class",
5298
+ "description": "Animated \"flowing waves\" loading indicator — coloured organic waves (in the\nfour brand colours) whose bumps swell, shrink, merge and split across a line,\ntapering to nothing at both ends. Where the colours overlap they blend\nadditively toward white.\n\nVisual sibling of the dots loading indicator; interchangeable with the other\nloading styles for the \"assistant is working\" state.",
5299
+ "name": "AiFlowingWavesIndicator",
5300
+ "members": [
5301
+ {
5302
+ "kind": "field",
5303
+ "name": "startTime",
5304
+ "type": {
5305
+ "text": "number | undefined"
5306
+ },
5307
+ "privacy": "private"
5308
+ },
5309
+ {
5310
+ "kind": "field",
5311
+ "name": "animFrame",
5312
+ "type": {
5313
+ "text": "number | undefined"
5314
+ },
5315
+ "privacy": "private"
5316
+ },
5317
+ {
5318
+ "kind": "field",
5319
+ "name": "bandPaths",
5320
+ "type": {
5321
+ "text": "SVGPathElement[] | undefined"
5322
+ },
5323
+ "privacy": "private"
5324
+ },
5325
+ {
5326
+ "kind": "method",
5327
+ "name": "tick",
5328
+ "privacy": "private",
5329
+ "parameters": [
5330
+ {
5331
+ "name": "now",
5332
+ "optional": true,
5333
+ "type": {
5334
+ "text": "number"
5335
+ }
5336
+ }
5337
+ ]
5338
+ },
5339
+ {
5340
+ "kind": "method",
5341
+ "name": "buildBand",
5342
+ "privacy": "private",
5343
+ "static": true,
5344
+ "return": {
5345
+ "type": {
5346
+ "text": "string"
5347
+ }
5348
+ },
5349
+ "parameters": [
5350
+ {
5351
+ "name": "cfg",
5352
+ "type": {
5353
+ "text": "BandConfig"
5354
+ }
5355
+ },
5356
+ {
5357
+ "name": "frame",
5358
+ "type": {
5359
+ "text": "number"
5360
+ }
5361
+ }
5362
+ ],
5363
+ "description": "Trace one band for the given frame: a baseline-plus-harmonics half-thickness\nprofile, clamped at 0 (so the band pinches to nothing between bumps) and\ntapered to 0 at both ends."
5364
+ }
5365
+ ],
5366
+ "superclass": {
5367
+ "name": "GenesisElement",
5368
+ "package": "@genesislcap/web-core"
5369
+ },
5370
+ "tagName": "ai-flowing-waves-indicator",
5371
+ "customElement": true
5220
5372
  }
5221
5373
  ],
5222
5374
  "exports": [
5223
5375
  {
5224
5376
  "kind": "js",
5225
- "name": "CachePolicy",
5226
- "declaration": {
5227
- "name": "CachePolicy",
5228
- "module": "src/config/config.ts"
5229
- }
5230
- },
5231
- {
5232
- "kind": "js",
5233
- "name": "ChatFallback",
5234
- "declaration": {
5235
- "name": "ChatFallback",
5236
- "module": "src/config/config.ts"
5237
- }
5238
- },
5239
- {
5240
- "kind": "js",
5241
- "name": "ChatInputDuringExecutionMode",
5242
- "declaration": {
5243
- "name": "ChatInputDuringExecutionMode",
5244
- "module": "src/config/config.ts"
5245
- }
5246
- },
5247
- {
5248
- "kind": "js",
5249
- "name": "ChatThinkingPolicy",
5250
- "declaration": {
5251
- "name": "ChatThinkingPolicy",
5252
- "module": "src/config/config.ts"
5253
- }
5254
- },
5255
- {
5256
- "kind": "js",
5257
- "name": "ChatToolChoice",
5377
+ "name": "AiFlowingWavesIndicator",
5258
5378
  "declaration": {
5259
- "name": "ChatToolChoice",
5260
- "module": "src/config/config.ts"
5379
+ "name": "AiFlowingWavesIndicator",
5380
+ "module": "src/components/flowing-waves-indicator.ts"
5261
5381
  }
5262
5382
  },
5263
5383
  {
5264
- "kind": "js",
5265
- "name": "defineAgent",
5384
+ "kind": "custom-element-definition",
5385
+ "name": "ai-flowing-waves-indicator",
5266
5386
  "declaration": {
5267
- "name": "defineAgent",
5268
- "module": "src/config/config.ts"
5387
+ "name": "AiFlowingWavesIndicator",
5388
+ "module": "src/components/flowing-waves-indicator.ts"
5269
5389
  }
5270
5390
  }
5271
5391
  ]
5272
5392
  },
5273
5393
  {
5274
5394
  "kind": "javascript-module",
5275
- "path": "src/config/define-stateful-agent.ts",
5395
+ "path": "src/components/halo-overlay.ts",
5276
5396
  "declarations": [
5277
5397
  {
5278
- "kind": "function",
5279
- "name": "restoreMachine",
5280
- "return": {
5281
- "type": {
5282
- "text": "void"
5283
- }
5284
- },
5285
- "parameters": [
5398
+ "kind": "class",
5399
+ "description": "Animated halo overlay — rotating conic-gradient border with an inward glow.\n\nDrop inside any `position: relative; overflow: hidden` container and toggle\nthe `active` attribute to show/hide the effect.",
5400
+ "name": "AiHaloOverlay",
5401
+ "members": [
5286
5402
  {
5287
- "name": "machine",
5403
+ "kind": "field",
5404
+ "name": "active",
5288
5405
  "type": {
5289
- "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
5406
+ "text": "boolean"
5290
5407
  },
5291
- "description": "the machine to restore (already constructed/started)."
5408
+ "default": "false"
5292
5409
  },
5293
5410
  {
5294
- "name": "restored",
5411
+ "kind": "field",
5412
+ "name": "speed",
5295
5413
  "type": {
5296
- "text": "unknown"
5414
+ "text": "number"
5297
5415
  },
5298
- "description": "the agent's serialized image (`ctx.restored` in `init`)."
5416
+ "default": "1.5",
5417
+ "description": "Rotation speed in degrees per frame. Default: 1.5 (≈ 4 s per full revolution at 60 fps)."
5299
5418
  },
5300
5419
  {
5301
- "name": "key",
5302
- "default": "'machine'",
5303
- "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
5304
- }
5305
- ],
5306
- "description": "Restore a foundation-state-machine instance from a snapshot produced by the\ndefault serializer (or `machine.getPersistedSnapshot()`). Call inside a\nstateful agent's `init` to resume the machine in its exact prior place:\n\n```ts\ninit: ({ restored }) => {\n const machine = new MyMachine();\n restoreMachine(machine, restored); // resume, or no-op on a fresh start\n return { machine };\n}\n```\n\nNo-ops when there is nothing to restore (a fresh session), leaving the\nfreshly-constructed machine in its initial state."
5307
- },
5308
- {
5309
- "kind": "function",
5310
- "name": "defineStatefulAgent",
5311
- "return": {
5312
- "type": {
5313
- "text": "AgentConfig"
5314
- }
5315
- },
5316
- "parameters": [
5317
- {
5318
- "name": "opts",
5420
+ "kind": "field",
5421
+ "name": "direction",
5319
5422
  "type": {
5320
- "text": "StatefulAgentInit<S>"
5321
- }
5322
- }
5323
- ],
5324
- "description": "Build an `AgentConfig` whose `systemPrompt`, `toolDefinitions`, and tool\nhandlers all close over a long-lived state object created on activation.\n\nThe framework wires the lifecycle: `init` on `onActivate`, `dispose` on\n`onDeactivate`. State is held inside the helper's closure — never exposed on\nthe resulting `AgentConfig` — so the redux serializer doesn't see it."
5325
- },
5326
- {
5327
- "kind": "function",
5328
- "name": "defineAutopilot",
5329
- "return": {
5330
- "type": {
5331
- "text": "AutopilotConfig<S>"
5332
- }
5333
- },
5334
- "parameters": [
5335
- {
5336
- "name": "config",
5337
- "type": {
5338
- "text": "AutopilotConfig<S>"
5339
- }
5340
- }
5341
- ],
5342
- "description": "Define an autopilot for a stateful agent whose state is `S` (GENC-1660). An identity function\nthat exists for its type: the resolvers get `S`, and the result goes on `defineStatefulAgent`'s\n`autopilot` option."
5343
- }
5344
- ],
5345
- "exports": [
5346
- {
5347
- "kind": "js",
5348
- "name": "restoreMachine",
5349
- "declaration": {
5350
- "name": "restoreMachine",
5351
- "module": "src/config/define-stateful-agent.ts"
5352
- }
5353
- },
5354
- {
5355
- "kind": "js",
5356
- "name": "defineStatefulAgent",
5357
- "declaration": {
5358
- "name": "defineStatefulAgent",
5359
- "module": "src/config/define-stateful-agent.ts"
5360
- }
5361
- },
5362
- {
5363
- "kind": "js",
5364
- "name": "defineAutopilot",
5365
- "declaration": {
5366
- "name": "defineAutopilot",
5367
- "module": "src/config/define-stateful-agent.ts"
5368
- }
5369
- }
5370
- ]
5371
- },
5372
- {
5373
- "kind": "javascript-module",
5374
- "path": "src/config/fallback-agents.ts",
5375
- "declarations": [
5376
- {
5377
- "kind": "variable",
5378
- "name": "friendlyFallbackAgent",
5379
- "type": {
5380
- "text": "FallbackAgentConfig"
5381
- },
5382
- "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a warm, friendly assistant. For general conversation like \"Hi\" or \"How are you\", you can have a friendly chat. For anything more complex, you cannot directly help, but you can explain what specialists are available. The available specialists are:\\n\\n{{agents}}\\n\\nPolitely let the user know what you can help with and invite them to rephrase their request if it is outside your scope.`,\n}",
5383
- "description": "A warm, conversational fallback agent. Acknowledges it can't help directly,\nexplains what the available specialists can do, and invites the user to retry.\n\nThe system prompt is generated at runtime by `OrchestratingDriver` from the\nspecialist list — no manual authoring required."
5384
- },
5385
- {
5386
- "kind": "variable",
5387
- "name": "strictFallbackAgent",
5388
- "type": {
5389
- "text": "FallbackAgentConfig"
5390
- },
5391
- "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a concise assistant. The user's request is outside your scope. The available specialists are: {{agents}}.\n\n{{unroutable}}\n\nAnswer in a single short sentence. Do not elaborate.`,\n}",
5392
- "description": "A brief, professional fallback agent. States what is available without\nelaboration. The `{{agents}}` placeholder is replaced at runtime by\n`OrchestratingDriver` with the generated specialist list.\n\nThe `{{unroutable}}` placeholder positions `UNROUTABLE_INSTRUCTION` — the framework's\ninstruction for a substantive request no specialist covers, which is otherwise APPENDED to a\nstring-form prompt. Positioned rather than appended for one reason: this preset's whole point is\nbrevity, and appended text would be the last thing the model reads. Putting the block above the\nbrevity rule leaves \"a single short sentence\" with the recency, so the two compose instead of\ncompeting. A prompt whose tone rules matter should do the same."
5393
- }
5394
- ],
5395
- "exports": [
5396
- {
5397
- "kind": "js",
5398
- "name": "friendlyFallbackAgent",
5399
- "declaration": {
5400
- "name": "friendlyFallbackAgent",
5401
- "module": "src/config/fallback-agents.ts"
5402
- }
5403
- },
5404
- {
5405
- "kind": "js",
5406
- "name": "strictFallbackAgent",
5407
- "declaration": {
5408
- "name": "strictFallbackAgent",
5409
- "module": "src/config/fallback-agents.ts"
5410
- }
5411
- }
5412
- ]
5413
- },
5414
- {
5415
- "kind": "javascript-module",
5416
- "path": "src/config/index.ts",
5417
- "declarations": [],
5418
- "exports": [
5419
- {
5420
- "kind": "js",
5421
- "name": "*",
5422
- "declaration": {
5423
- "name": "*",
5424
- "package": "./config"
5425
- }
5426
- },
5427
- {
5428
- "kind": "js",
5429
- "name": "*",
5430
- "declaration": {
5431
- "name": "*",
5432
- "package": "./fallback-agents"
5433
- }
5434
- }
5435
- ]
5436
- },
5437
- {
5438
- "kind": "javascript-module",
5439
- "path": "src/config/validate-providers.ts",
5440
- "declarations": [],
5441
- "exports": []
5442
- },
5443
- {
5444
- "kind": "javascript-module",
5445
- "path": "src/components/flowing-waves-indicator.ts",
5446
- "declarations": [
5447
- {
5448
- "kind": "class",
5449
- "description": "Animated \"flowing waves\" loading indicator — coloured organic waves (in the\nfour brand colours) whose bumps swell, shrink, merge and split across a line,\ntapering to nothing at both ends. Where the colours overlap they blend\nadditively toward white.\n\nVisual sibling of the dots loading indicator; interchangeable with the other\nloading styles for the \"assistant is working\" state.",
5450
- "name": "AiFlowingWavesIndicator",
5451
- "members": [
5452
- {
5453
- "kind": "field",
5454
- "name": "startTime",
5455
- "type": {
5456
- "text": "number | undefined"
5457
- },
5458
- "privacy": "private"
5459
- },
5460
- {
5461
- "kind": "field",
5462
- "name": "animFrame",
5463
- "type": {
5464
- "text": "number | undefined"
5465
- },
5466
- "privacy": "private"
5467
- },
5468
- {
5469
- "kind": "field",
5470
- "name": "bandPaths",
5471
- "type": {
5472
- "text": "SVGPathElement[] | undefined"
5473
- },
5474
- "privacy": "private"
5475
- },
5476
- {
5477
- "kind": "method",
5478
- "name": "tick",
5479
- "privacy": "private",
5480
- "parameters": [
5481
- {
5482
- "name": "now",
5483
- "optional": true,
5484
- "type": {
5485
- "text": "number"
5486
- }
5487
- }
5488
- ]
5489
- },
5490
- {
5491
- "kind": "method",
5492
- "name": "buildBand",
5493
- "privacy": "private",
5494
- "static": true,
5495
- "return": {
5496
- "type": {
5497
- "text": "string"
5498
- }
5499
- },
5500
- "parameters": [
5501
- {
5502
- "name": "cfg",
5503
- "type": {
5504
- "text": "BandConfig"
5505
- }
5506
- },
5507
- {
5508
- "name": "frame",
5509
- "type": {
5510
- "text": "number"
5511
- }
5512
- }
5513
- ],
5514
- "description": "Trace one band for the given frame: a baseline-plus-harmonics half-thickness\nprofile, clamped at 0 (so the band pinches to nothing between bumps) and\ntapered to 0 at both ends."
5515
- }
5516
- ],
5517
- "superclass": {
5518
- "name": "GenesisElement",
5519
- "package": "@genesislcap/web-core"
5520
- },
5521
- "tagName": "ai-flowing-waves-indicator",
5522
- "customElement": true
5523
- }
5524
- ],
5525
- "exports": [
5526
- {
5527
- "kind": "js",
5528
- "name": "AiFlowingWavesIndicator",
5529
- "declaration": {
5530
- "name": "AiFlowingWavesIndicator",
5531
- "module": "src/components/flowing-waves-indicator.ts"
5532
- }
5533
- },
5534
- {
5535
- "kind": "custom-element-definition",
5536
- "name": "ai-flowing-waves-indicator",
5537
- "declaration": {
5538
- "name": "AiFlowingWavesIndicator",
5539
- "module": "src/components/flowing-waves-indicator.ts"
5540
- }
5541
- }
5542
- ]
5543
- },
5544
- {
5545
- "kind": "javascript-module",
5546
- "path": "src/components/halo-overlay.ts",
5547
- "declarations": [
5548
- {
5549
- "kind": "class",
5550
- "description": "Animated halo overlay — rotating conic-gradient border with an inward glow.\n\nDrop inside any `position: relative; overflow: hidden` container and toggle\nthe `active` attribute to show/hide the effect.",
5551
- "name": "AiHaloOverlay",
5552
- "members": [
5553
- {
5554
- "kind": "field",
5555
- "name": "active",
5556
- "type": {
5557
- "text": "boolean"
5558
- },
5559
- "default": "false"
5560
- },
5561
- {
5562
- "kind": "field",
5563
- "name": "speed",
5564
- "type": {
5565
- "text": "number"
5566
- },
5567
- "default": "1.5",
5568
- "description": "Rotation speed in degrees per frame. Default: 1.5 (≈ 4 s per full revolution at 60 fps)."
5569
- },
5570
- {
5571
- "kind": "field",
5572
- "name": "direction",
5573
- "type": {
5574
- "text": "'cw' | 'ccw'"
5575
- },
5576
- "default": "'cw'",
5577
- "description": "Rotation direction. Default: 'cw' (clockwise)."
5578
- },
5423
+ "text": "'cw' | 'ccw'"
5424
+ },
5425
+ "default": "'cw'",
5426
+ "description": "Rotation direction. Default: 'cw' (clockwise)."
5427
+ },
5579
5428
  {
5580
5429
  "kind": "field",
5581
5430
  "name": "borderSize",
@@ -5966,20 +5815,251 @@
5966
5815
  },
5967
5816
  {
5968
5817
  "kind": "javascript-module",
5969
- "path": "src/genesis/calendar.ts",
5970
- "declarations": [],
5971
- "exports": []
5972
- },
5973
- {
5974
- "kind": "javascript-module",
5975
- "path": "src/genesis/config.ts",
5818
+ "path": "src/config/config.ts",
5976
5819
  "declarations": [
5977
5820
  {
5978
- "kind": "variable",
5979
- "name": "DEFAULT_MAX_ROWS",
5980
- "type": {
5981
- "text": "number"
5982
- },
5821
+ "kind": "function",
5822
+ "name": "defineAgent",
5823
+ "description": "Identity helper that infers the narrowest possible type for an agent config,\npreserving string literal types (including `name`) without requiring `as const`.\n\nUse this when you need `typeof myAgent` to carry the literal `name` type —\nfor example, when wiring `ChatToolHandlers<typeof myAgent>`.\n\n```ts\nconst myAgent = defineAgent({ name: 'my_agent', ... });\ntype Handlers = ChatToolHandlers<typeof myAgent>;\n// requestSubAgent name param is now typed as 'my_agent'\n```"
5824
+ }
5825
+ ],
5826
+ "exports": [
5827
+ {
5828
+ "kind": "js",
5829
+ "name": "CachePolicy",
5830
+ "declaration": {
5831
+ "name": "CachePolicy",
5832
+ "module": "src/config/config.ts"
5833
+ }
5834
+ },
5835
+ {
5836
+ "kind": "js",
5837
+ "name": "ChatFallback",
5838
+ "declaration": {
5839
+ "name": "ChatFallback",
5840
+ "module": "src/config/config.ts"
5841
+ }
5842
+ },
5843
+ {
5844
+ "kind": "js",
5845
+ "name": "ChatInputDuringExecutionMode",
5846
+ "declaration": {
5847
+ "name": "ChatInputDuringExecutionMode",
5848
+ "module": "src/config/config.ts"
5849
+ }
5850
+ },
5851
+ {
5852
+ "kind": "js",
5853
+ "name": "ChatThinkingPolicy",
5854
+ "declaration": {
5855
+ "name": "ChatThinkingPolicy",
5856
+ "module": "src/config/config.ts"
5857
+ }
5858
+ },
5859
+ {
5860
+ "kind": "js",
5861
+ "name": "ChatToolChoice",
5862
+ "declaration": {
5863
+ "name": "ChatToolChoice",
5864
+ "module": "src/config/config.ts"
5865
+ }
5866
+ },
5867
+ {
5868
+ "kind": "js",
5869
+ "name": "defineAgent",
5870
+ "declaration": {
5871
+ "name": "defineAgent",
5872
+ "module": "src/config/config.ts"
5873
+ }
5874
+ }
5875
+ ]
5876
+ },
5877
+ {
5878
+ "kind": "javascript-module",
5879
+ "path": "src/config/define-stateful-agent.ts",
5880
+ "declarations": [
5881
+ {
5882
+ "kind": "function",
5883
+ "name": "restoreMachine",
5884
+ "return": {
5885
+ "type": {
5886
+ "text": "void"
5887
+ }
5888
+ },
5889
+ "parameters": [
5890
+ {
5891
+ "name": "machine",
5892
+ "type": {
5893
+ "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
5894
+ },
5895
+ "description": "the machine to restore (already constructed/started)."
5896
+ },
5897
+ {
5898
+ "name": "restored",
5899
+ "type": {
5900
+ "text": "unknown"
5901
+ },
5902
+ "description": "the agent's serialized image (`ctx.restored` in `init`)."
5903
+ },
5904
+ {
5905
+ "name": "key",
5906
+ "default": "'machine'",
5907
+ "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
5908
+ }
5909
+ ],
5910
+ "description": "Restore a foundation-state-machine instance from a snapshot produced by the\ndefault serializer (or `machine.getPersistedSnapshot()`). Call inside a\nstateful agent's `init` to resume the machine in its exact prior place:\n\n```ts\ninit: ({ restored }) => {\n const machine = new MyMachine();\n restoreMachine(machine, restored); // resume, or no-op on a fresh start\n return { machine };\n}\n```\n\nNo-ops when there is nothing to restore (a fresh session), leaving the\nfreshly-constructed machine in its initial state."
5911
+ },
5912
+ {
5913
+ "kind": "function",
5914
+ "name": "defineStatefulAgent",
5915
+ "return": {
5916
+ "type": {
5917
+ "text": "AgentConfig"
5918
+ }
5919
+ },
5920
+ "parameters": [
5921
+ {
5922
+ "name": "opts",
5923
+ "type": {
5924
+ "text": "StatefulAgentInit<S>"
5925
+ }
5926
+ }
5927
+ ],
5928
+ "description": "Build an `AgentConfig` whose `systemPrompt`, `toolDefinitions`, and tool\nhandlers all close over a long-lived state object created on activation.\n\nThe framework wires the lifecycle: `init` on `onActivate`, `dispose` on\n`onDeactivate`. State is held inside the helper's closure — never exposed on\nthe resulting `AgentConfig` — so the redux serializer doesn't see it."
5929
+ },
5930
+ {
5931
+ "kind": "function",
5932
+ "name": "defineAutopilot",
5933
+ "return": {
5934
+ "type": {
5935
+ "text": "AutopilotConfig<S>"
5936
+ }
5937
+ },
5938
+ "parameters": [
5939
+ {
5940
+ "name": "config",
5941
+ "type": {
5942
+ "text": "AutopilotConfig<S>"
5943
+ }
5944
+ }
5945
+ ],
5946
+ "description": "Define an autopilot for a stateful agent whose state is `S` (GENC-1660). An identity function\nthat exists for its type: the resolvers get `S`, and the result goes on `defineStatefulAgent`'s\n`autopilot` option."
5947
+ }
5948
+ ],
5949
+ "exports": [
5950
+ {
5951
+ "kind": "js",
5952
+ "name": "restoreMachine",
5953
+ "declaration": {
5954
+ "name": "restoreMachine",
5955
+ "module": "src/config/define-stateful-agent.ts"
5956
+ }
5957
+ },
5958
+ {
5959
+ "kind": "js",
5960
+ "name": "defineStatefulAgent",
5961
+ "declaration": {
5962
+ "name": "defineStatefulAgent",
5963
+ "module": "src/config/define-stateful-agent.ts"
5964
+ }
5965
+ },
5966
+ {
5967
+ "kind": "js",
5968
+ "name": "defineAutopilot",
5969
+ "declaration": {
5970
+ "name": "defineAutopilot",
5971
+ "module": "src/config/define-stateful-agent.ts"
5972
+ }
5973
+ }
5974
+ ]
5975
+ },
5976
+ {
5977
+ "kind": "javascript-module",
5978
+ "path": "src/config/fallback-agents.ts",
5979
+ "declarations": [
5980
+ {
5981
+ "kind": "variable",
5982
+ "name": "friendlyFallbackAgent",
5983
+ "type": {
5984
+ "text": "FallbackAgentConfig"
5985
+ },
5986
+ "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a warm, friendly assistant. For general conversation like \"Hi\" or \"How are you\", you can have a friendly chat. For anything more complex, you cannot directly help, but you can explain what specialists are available. The available specialists are:\\n\\n{{agents}}\\n\\nPolitely let the user know what you can help with and invite them to rephrase their request if it is outside your scope.`,\n}",
5987
+ "description": "A warm, conversational fallback agent. Acknowledges it can't help directly,\nexplains what the available specialists can do, and invites the user to retry.\n\nThe system prompt is generated at runtime by `OrchestratingDriver` from the\nspecialist list — no manual authoring required."
5988
+ },
5989
+ {
5990
+ "kind": "variable",
5991
+ "name": "strictFallbackAgent",
5992
+ "type": {
5993
+ "text": "FallbackAgentConfig"
5994
+ },
5995
+ "default": "{\n name: 'Assistant',\n fallback: true,\n systemPrompt: `You are a concise assistant. The user's request is outside your scope. The available specialists are: {{agents}}.\n\n{{unroutable}}\n\nAnswer in a single short sentence. Do not elaborate.`,\n}",
5996
+ "description": "A brief, professional fallback agent. States what is available without\nelaboration. The `{{agents}}` placeholder is replaced at runtime by\n`OrchestratingDriver` with the generated specialist list.\n\nThe `{{unroutable}}` placeholder positions `UNROUTABLE_INSTRUCTION` — the framework's\ninstruction for a substantive request no specialist covers, which is otherwise APPENDED to a\nstring-form prompt. Positioned rather than appended for one reason: this preset's whole point is\nbrevity, and appended text would be the last thing the model reads. Putting the block above the\nbrevity rule leaves \"a single short sentence\" with the recency, so the two compose instead of\ncompeting. A prompt whose tone rules matter should do the same."
5997
+ }
5998
+ ],
5999
+ "exports": [
6000
+ {
6001
+ "kind": "js",
6002
+ "name": "friendlyFallbackAgent",
6003
+ "declaration": {
6004
+ "name": "friendlyFallbackAgent",
6005
+ "module": "src/config/fallback-agents.ts"
6006
+ }
6007
+ },
6008
+ {
6009
+ "kind": "js",
6010
+ "name": "strictFallbackAgent",
6011
+ "declaration": {
6012
+ "name": "strictFallbackAgent",
6013
+ "module": "src/config/fallback-agents.ts"
6014
+ }
6015
+ }
6016
+ ]
6017
+ },
6018
+ {
6019
+ "kind": "javascript-module",
6020
+ "path": "src/config/index.ts",
6021
+ "declarations": [],
6022
+ "exports": [
6023
+ {
6024
+ "kind": "js",
6025
+ "name": "*",
6026
+ "declaration": {
6027
+ "name": "*",
6028
+ "package": "./config"
6029
+ }
6030
+ },
6031
+ {
6032
+ "kind": "js",
6033
+ "name": "*",
6034
+ "declaration": {
6035
+ "name": "*",
6036
+ "package": "./fallback-agents"
6037
+ }
6038
+ }
6039
+ ]
6040
+ },
6041
+ {
6042
+ "kind": "javascript-module",
6043
+ "path": "src/config/validate-providers.ts",
6044
+ "declarations": [],
6045
+ "exports": []
6046
+ },
6047
+ {
6048
+ "kind": "javascript-module",
6049
+ "path": "src/genesis/calendar.ts",
6050
+ "declarations": [],
6051
+ "exports": []
6052
+ },
6053
+ {
6054
+ "kind": "javascript-module",
6055
+ "path": "src/genesis/config.ts",
6056
+ "declarations": [
6057
+ {
6058
+ "kind": "variable",
6059
+ "name": "DEFAULT_MAX_ROWS",
6060
+ "type": {
6061
+ "text": "number"
6062
+ },
5983
6063
  "default": "50",
5984
6064
  "description": "The default read cap, and the ceiling the config may raise it to."
5985
6065
  },
@@ -18185,196 +18265,155 @@
18185
18265
  },
18186
18266
  {
18187
18267
  "kind": "javascript-module",
18188
- "path": "src/components/ai-driver/ai-driver.ts",
18189
- "declarations": [
18190
- {
18191
- "kind": "variable",
18192
- "name": "AI_DRIVER_EVENT_TYPES",
18193
- "description": "The event types in AiDriverEventMap, as a runtime list. Built from a record keyed by the\nmap, so adding an event to the map without adding it here is a compile error."
18194
- }
18195
- ],
18196
- "exports": [
18197
- {
18198
- "kind": "js",
18199
- "name": "AI_DRIVER_EVENT_TYPES",
18200
- "declaration": {
18201
- "name": "AI_DRIVER_EVENT_TYPES",
18202
- "module": "src/components/ai-driver/ai-driver.ts"
18203
- }
18204
- }
18205
- ]
18206
- },
18207
- {
18208
- "kind": "javascript-module",
18209
- "path": "src/components/ai-driver/base-driver-decorator.ts",
18268
+ "path": "src/components/agent-session/agent-session.ts",
18210
18269
  "declarations": [
18211
18270
  {
18212
18271
  "kind": "class",
18213
- "description": "The base of every driver decorator (GENC-1660): an AiDriver that wraps another and\npasses every member, and every event in AiDriverEventMap, through to it.\n\nA decorator extends this and overrides only what it changes, so decorators stack in any order\nand a member or event added to `AiDriver` reaches the host through every layer by default.\n`OrchestratingDriver` is one; it used to forward by hand, and twice a member it did not forward\nsilently did nothing for every multi-agent host (`recordExternalCost`, then\n`getHistoryForPersistence`).\n\nAbstract with no abstract members, so it cannot be constructed on its own: a decorator that\nchanges nothing is not one.\n\nOptional `AiDriver` members are implemented here unconditionally, as a forward that falls back\nto the \"not supported\" answer when the inner driver lacks them. A host that feature-detects with\n`?.` therefore always finds them, and gets the same answer it would from the inner driver.",
18214
- "name": "BaseDriverDecorator",
18272
+ "description": "The stateful-agent contract: which agent is active, whether a flow or a user pin holds routing,\nand the `onActivate` / `onDeactivate` lifecycle around a swap. Either driver can own one.\n\nKnows nothing about routing, tool surfaces or transcripts — whether an agent is terminal, the\nhand-off stack, the divider in history all stay with the orchestrator, which is the only thing\nwith agents to route between.",
18273
+ "name": "AgentSession",
18215
18274
  "members": [
18216
18275
  {
18217
18276
  "kind": "field",
18218
- "name": "detachers",
18277
+ "name": "lifecycleAbortController",
18278
+ "privacy": "private",
18279
+ "readonly": true,
18280
+ "default": "new AbortController()",
18281
+ "description": "Aborted on disposal. Threaded into `AgentLifecycleContext.signal` so long-running\n`onActivate` work can bail if the session disconnects."
18282
+ },
18283
+ {
18284
+ "kind": "field",
18285
+ "name": "active",
18219
18286
  "type": {
18220
- "text": "Array<() => void>"
18287
+ "text": "AgentConfig | undefined"
18288
+ },
18289
+ "privacy": "private"
18290
+ },
18291
+ {
18292
+ "kind": "field",
18293
+ "name": "pinned",
18294
+ "type": {
18295
+ "text": "string | null"
18221
18296
  },
18222
18297
  "privacy": "private",
18223
- "readonly": true,
18224
- "default": "[]",
18225
- "description": "Undoes this layer's hold on its inner driver; see BaseDriverDecorator.detach."
18298
+ "default": "null",
18299
+ "description": "Sticky user pick from the picker (or the host's `setAgent` API). Only changes on explicit\nuser action. Survives flow completion: when a stateful agent releases, the user-pin stays put\nand routing falls back to it on the next turn."
18226
18300
  },
18227
18301
  {
18228
- "kind": "method",
18229
- "name": "detach",
18230
- "return": {
18231
- "type": {
18232
- "text": "void"
18233
- }
18302
+ "kind": "field",
18303
+ "name": "flowOwner",
18304
+ "type": {
18305
+ "text": "string | null"
18234
18306
  },
18235
- "description": "Let go of the inner driver WITHOUT disposing it: stop forwarding its events, and undo whatever\na subclass registered through BaseDriverDecorator.onDetach (its interceptors, its\ncapabilities, its own listeners). For dropping or replacing a decorator while the driver it\nwrapped lives on — otherwise the old layer keeps re-dispatching every event and is never\ncollected. Idempotent. `dispose()` detaches too."
18307
+ "privacy": "private",
18308
+ "default": "null",
18309
+ "description": "Transient flow lock — set when a stateful agent activates, cleared on release. While\nnon-null, routing precedence goes to this agent and the picker is locked. Independent of\nthe user pin so completing a flow doesn't wipe the user's sticky choice."
18236
18310
  },
18237
18311
  {
18238
- "kind": "method",
18239
- "name": "onDetach",
18240
- "privacy": "protected",
18241
- "return": {
18242
- "type": {
18243
- "text": "void"
18244
- }
18312
+ "kind": "field",
18313
+ "name": "restoredStates",
18314
+ "type": {
18315
+ "text": "Record<string, unknown>"
18245
18316
  },
18246
- "parameters": [
18247
- {
18248
- "name": "undo",
18249
- "type": {
18250
- "text": "() => void"
18251
- }
18252
- }
18253
- ],
18254
- "description": "Register something BaseDriverDecorator.detach must undo."
18317
+ "privacy": "private",
18318
+ "default": "{}",
18319
+ "description": "Per-agent restored state for a rehydrated session, keyed by agent name. Primed by the host on\nrestore; each entry is passed to that agent's `onActivate` as `ctx.restored` on its next\nactivation, then deleted so a later re-activation starts fresh."
18320
+ },
18321
+ {
18322
+ "kind": "field",
18323
+ "name": "activation",
18324
+ "type": {
18325
+ "text": "Promise<unknown>"
18326
+ },
18327
+ "privacy": "private",
18328
+ "description": "The tail of the activation queue — see AgentSession.activate."
18329
+ },
18330
+ {
18331
+ "kind": "field",
18332
+ "name": "suspended",
18333
+ "type": {
18334
+ "text": "AgentConfig[]"
18335
+ },
18336
+ "privacy": "private",
18337
+ "default": "[]",
18338
+ "description": "Callers waiting in a hand-off (GENC-1737), oldest first: still live, so never deactivated by\nthe hand-off, and resumed without `onActivate`. Empty after a reload, when a caller has no live\nstate and is activated again from its saved state instead."
18339
+ },
18340
+ {
18341
+ "kind": "field",
18342
+ "name": "handOffData",
18343
+ "privacy": "private",
18344
+ "default": "new Map<string, unknown>()",
18345
+ "description": "The `data` of the hand-off that activated each agent (GENC-1737), for its tool handlers: kept\nwhile it is active or waits as a caller, and dropped when its activation ends."
18255
18346
  },
18256
18347
  {
18257
18348
  "kind": "method",
18258
- "name": "sendMessage",
18349
+ "name": "getActive",
18259
18350
  "return": {
18260
18351
  "type": {
18261
- "text": "Promise<ChatDriverResult>"
18352
+ "text": "AgentConfig | undefined"
18262
18353
  }
18263
18354
  },
18264
- "parameters": [
18265
- {
18266
- "name": "input",
18267
- "type": {
18268
- "text": "string"
18269
- }
18270
- },
18271
- {
18272
- "name": "attachments",
18273
- "optional": true,
18274
- "type": {
18275
- "text": "ChatAttachment[]"
18276
- }
18277
- },
18278
- {
18279
- "name": "options",
18280
- "optional": true,
18281
- "type": {
18282
- "text": "SendMessageOptions"
18283
- }
18284
- }
18285
- ]
18355
+ "description": "The active agent, or `undefined` before the first activation and after a release."
18286
18356
  },
18287
18357
  {
18288
18358
  "kind": "method",
18289
- "name": "continueFromHistory",
18359
+ "name": "getPinned",
18290
18360
  "return": {
18291
18361
  "type": {
18292
- "text": "Promise<ChatDriverResult>"
18362
+ "text": "string | null"
18293
18363
  }
18294
18364
  },
18295
- "parameters": [
18296
- {
18297
- "name": "transientPrimer",
18298
- "optional": true,
18299
- "type": {
18300
- "text": "ChatMessage[]"
18301
- }
18302
- },
18303
- {
18304
- "name": "options",
18305
- "optional": true,
18306
- "type": {
18307
- "text": "ContinueFromHistoryOptions"
18308
- }
18309
- }
18310
- ]
18365
+ "description": "The sticky user pin, or `null` for automatic routing."
18311
18366
  },
18312
18367
  {
18313
18368
  "kind": "method",
18314
- "name": "resolveInteraction",
18369
+ "name": "getFlowOwner",
18315
18370
  "return": {
18316
18371
  "type": {
18317
- "text": "void"
18372
+ "text": "string | null"
18318
18373
  }
18319
18374
  },
18320
- "parameters": [
18321
- {
18322
- "name": "interactionId",
18323
- "type": {
18324
- "text": "string"
18325
- }
18326
- },
18327
- {
18328
- "name": "result",
18329
- "type": {
18330
- "text": "unknown"
18331
- }
18332
- }
18333
- ]
18375
+ "description": "The transient flow lock, or `null` when no flow holds routing."
18334
18376
  },
18335
18377
  {
18336
18378
  "kind": "method",
18337
- "name": "recordExternalCost",
18379
+ "name": "getLockedName",
18338
18380
  "return": {
18339
18381
  "type": {
18340
- "text": "boolean"
18382
+ "text": "string | null"
18341
18383
  }
18342
18384
  },
18343
18385
  "parameters": [
18344
18386
  {
18345
- "name": "interactionId",
18346
- "type": {
18347
- "text": "string"
18348
- }
18349
- },
18350
- {
18351
- "name": "costUsd",
18387
+ "name": "pin",
18388
+ "default": "this.pinned",
18352
18389
  "type": {
18353
- "text": "number"
18390
+ "text": "string | null"
18354
18391
  }
18355
18392
  }
18356
- ]
18393
+ ],
18394
+ "description": "The name routing is locked to, flow lock first. A flow in progress outranks the user's\nsticky pick for the duration of the flow; neither being set means automatic routing.\n`pin`, when given, stands in for the sticky pick: one message routed its own way."
18357
18395
  },
18358
18396
  {
18359
18397
  "kind": "method",
18360
- "name": "getInteractionContext",
18398
+ "name": "setPinned",
18361
18399
  "return": {
18362
18400
  "type": {
18363
- "text": "InteractionContext | undefined"
18401
+ "text": "void"
18364
18402
  }
18365
18403
  },
18366
18404
  "parameters": [
18367
18405
  {
18368
- "name": "interactionId",
18406
+ "name": "name",
18369
18407
  "type": {
18370
- "text": "string"
18408
+ "text": "string | null"
18371
18409
  }
18372
18410
  }
18373
- ]
18411
+ ],
18412
+ "description": "Set the sticky user pin. `null` returns to automatic routing."
18374
18413
  },
18375
18414
  {
18376
18415
  "kind": "method",
18377
- "name": "loadHistory",
18416
+ "name": "setFlowOwner",
18378
18417
  "return": {
18379
18418
  "type": {
18380
18419
  "text": "void"
@@ -18382,16 +18421,17 @@
18382
18421
  },
18383
18422
  "parameters": [
18384
18423
  {
18385
- "name": "messages",
18424
+ "name": "name",
18386
18425
  "type": {
18387
- "text": "ChatMessage[]"
18426
+ "text": "string | null"
18388
18427
  }
18389
18428
  }
18390
- ]
18429
+ ],
18430
+ "description": "Set the flow-owner lock directly — used to restore state on driver reconstruction\n(agents-array changes, pop-in/pop-out), not to steer routing. Writes without firing hooks or\nreporting a transition, because the flow it names is already running."
18391
18431
  },
18392
18432
  {
18393
18433
  "kind": "method",
18394
- "name": "primeRestoredAgentState",
18434
+ "name": "primeRestoredStates",
18395
18435
  "return": {
18396
18436
  "type": {
18397
18437
  "text": "void"
@@ -18404,11 +18444,12 @@
18404
18444
  "text": "Record<string, unknown>"
18405
18445
  }
18406
18446
  }
18407
- ]
18447
+ ],
18448
+ "description": "Prime per-agent restored state for a rehydrated session. Replaces any pending entries."
18408
18449
  },
18409
18450
  {
18410
18451
  "kind": "method",
18411
- "name": "canRestoreFlowOwner",
18452
+ "name": "hasRestoredState",
18412
18453
  "return": {
18413
18454
  "type": {
18414
18455
  "text": "boolean"
@@ -18421,14 +18462,15 @@
18421
18462
  "text": "string"
18422
18463
  }
18423
18464
  }
18424
- ]
18465
+ ],
18466
+ "description": "Whether a restored snapshot is waiting for this agent's next activation."
18425
18467
  },
18426
18468
  {
18427
18469
  "kind": "method",
18428
- "name": "canResumeRestoredFlow",
18470
+ "name": "getHandOffData",
18429
18471
  "return": {
18430
18472
  "type": {
18431
- "text": "boolean"
18473
+ "text": "unknown"
18432
18474
  }
18433
18475
  },
18434
18476
  "parameters": [
@@ -18438,161 +18480,166 @@
18438
18480
  "text": "string"
18439
18481
  }
18440
18482
  }
18441
- ]
18483
+ ],
18484
+ "description": "The `data` of the hand-off that activated `agentName`, if one did and carried any."
18442
18485
  },
18443
18486
  {
18444
18487
  "kind": "method",
18445
- "name": "resumeRestoredFlow",
18488
+ "name": "setHandOffData",
18446
18489
  "return": {
18447
18490
  "type": {
18448
- "text": "Promise<ChatDriverResult | undefined>"
18491
+ "text": "void"
18449
18492
  }
18450
18493
  },
18451
18494
  "parameters": [
18452
18495
  {
18453
- "name": "resumeNote",
18454
- "optional": true,
18496
+ "name": "agentName",
18455
18497
  "type": {
18456
18498
  "text": "string"
18457
18499
  }
18458
18500
  },
18459
18501
  {
18460
- "name": "agent",
18461
- "optional": true,
18502
+ "name": "data",
18462
18503
  "type": {
18463
- "text": "AgentConfig"
18504
+ "text": "unknown"
18464
18505
  }
18465
18506
  }
18466
- ]
18507
+ ],
18508
+ "description": "Record the `data` a hand-off activated `agentName` with, or restore it; `undefined` drops it."
18467
18509
  },
18468
18510
  {
18469
18511
  "kind": "method",
18470
- "name": "getRawHistory",
18512
+ "name": "dropFlowLock",
18471
18513
  "return": {
18472
18514
  "type": {
18473
- "text": "readonly ChatMessage[]"
18515
+ "text": "void"
18474
18516
  }
18475
- }
18517
+ },
18518
+ "description": "Drop the flow lock and leave the active agent active (GENC-1737): a plain agent holding it with\nno hand-off behind it is done once its turn ends."
18476
18519
  },
18477
18520
  {
18478
18521
  "kind": "method",
18479
- "name": "getHistoryForPersistence",
18522
+ "name": "getSuspended",
18480
18523
  "return": {
18481
18524
  "type": {
18482
- "text": "ChatMessage[]"
18525
+ "text": "readonly AgentConfig[]"
18483
18526
  }
18484
- }
18527
+ },
18528
+ "description": "The callers waiting in a hand-off whose state is live, oldest first."
18485
18529
  },
18486
18530
  {
18487
18531
  "kind": "method",
18488
- "name": "getCondensePoliciesForPersistence",
18532
+ "name": "handOff",
18489
18533
  "return": {
18490
18534
  "type": {
18491
- "text": "PersistedCondensePolicy[]"
18535
+ "text": "Promise<AgentTransition>"
18492
18536
  }
18493
18537
  },
18494
18538
  "parameters": [
18495
18539
  {
18496
- "name": "messages",
18540
+ "name": "target",
18497
18541
  "type": {
18498
- "text": "readonly ChatMessage[]"
18542
+ "text": "AgentConfig"
18543
+ }
18544
+ },
18545
+ {
18546
+ "name": "options",
18547
+ "type": {
18548
+ "text": "{ suspendCaller: boolean }"
18499
18549
  }
18500
18550
  }
18501
- ]
18551
+ ],
18552
+ "description": "Make `target` active for a hand-off (GENC-1737), holding the flow lock whatever kind of agent\nit is, since a waiting caller depends on it. With `suspendCaller` the active agent waits:\nit is not deactivated and keeps its state. Without it the active agent is deactivated as on\nany swap: a one-way hand-off from a target, whose waiting caller then waits for the new\ntarget. Queued with AgentSession.activate."
18502
18553
  },
18503
18554
  {
18504
18555
  "kind": "method",
18505
- "name": "restoreCondensePolicies",
18556
+ "name": "resume",
18506
18557
  "return": {
18507
18558
  "type": {
18508
- "text": "{\n restored: number;\n awaitingReactivation: number;\n }"
18559
+ "text": "Promise<AgentTransition>"
18509
18560
  }
18510
18561
  },
18511
18562
  "parameters": [
18512
18563
  {
18513
- "name": "entries",
18564
+ "name": "caller",
18514
18565
  "type": {
18515
- "text": "readonly unknown[] | undefined"
18566
+ "text": "AgentConfig"
18567
+ }
18568
+ },
18569
+ {
18570
+ "name": "lock",
18571
+ "type": {
18572
+ "text": "boolean"
18516
18573
  }
18517
18574
  }
18518
- ]
18575
+ ],
18576
+ "description": "Make a waiting caller active again when its hand-off ends (GENC-1737). One whose state is live\nresumes without `onActivate`, since it was never deactivated; after a reload it is activated\nfrom its saved state like any other agent. `lock` keeps the flow lock on it: it held it before,\nor another caller is still waiting further down."
18519
18577
  },
18520
18578
  {
18521
18579
  "kind": "method",
18522
- "name": "getHandOffStack",
18580
+ "name": "endSuspended",
18523
18581
  "return": {
18524
18582
  "type": {
18525
- "text": "HandOffFrame[]"
18583
+ "text": "Promise<void>"
18526
18584
  }
18527
- }
18585
+ },
18586
+ "description": "Deactivate the callers left waiting by hand-offs that ended without a hand-back, newest first,\nwhen no teardown follows to do it (GENC-1737)."
18528
18587
  },
18529
18588
  {
18530
18589
  "kind": "method",
18531
- "name": "restoreHandOffStack",
18590
+ "name": "activate",
18532
18591
  "return": {
18533
18592
  "type": {
18534
- "text": "{ resume?: { agent: string; note: string }; droppedLocks?: string[] }"
18593
+ "text": "Promise<AgentTransition>"
18535
18594
  }
18536
18595
  },
18537
18596
  "parameters": [
18538
18597
  {
18539
- "name": "saved",
18540
- "type": {
18541
- "text": "unknown"
18542
- }
18543
- },
18544
- {
18545
- "name": "savedStates",
18546
- "type": {
18547
- "text": "Record<string, unknown>"
18548
- }
18549
- },
18550
- {
18551
- "name": "interrupted",
18598
+ "name": "agent",
18552
18599
  "type": {
18553
- "text": "boolean"
18600
+ "text": "AgentConfig"
18554
18601
  }
18555
18602
  }
18556
- ]
18603
+ ],
18604
+ "description": "Make `agent` active, firing the lifecycle hooks around the swap: outgoing `onDeactivate`\nfirst, then incoming `onActivate`. Both are awaited so heavy activation work (a machine\nrestore, say) completes before the agent's first turn runs, and a throw from either is logged\nrather than propagated — an agent whose hook fails still activates.\n\nRe-activating the same agent by name is not a switch: no hooks fire, no lock moves, and no\nhandoff is recorded. That guard matters because a per-turn re-resolve calls through here.\n\nSingle-flight (GENC-1662): calls run one after another, never interleaved. `active` is only\nset once the hooks have finished, so two overlapping calls for the same agent would otherwise\nboth see a switch and run `onActivate` twice — and a restored `init` would be overwritten by a\nfresh one that finished later. That overlap became possible when a restore started activating\nthe flow owner outside a turn, where a send can land mid-activation."
18557
18605
  },
18558
18606
  {
18559
18607
  "kind": "method",
18560
- "name": "unwindHandOffs",
18608
+ "name": "activateNow",
18609
+ "privacy": "private",
18561
18610
  "return": {
18562
18611
  "type": {
18563
- "text": "Promise<void>"
18612
+ "text": "Promise<AgentTransition>"
18564
18613
  }
18565
18614
  },
18566
18615
  "parameters": [
18567
18616
  {
18568
- "name": "kind",
18617
+ "name": "agent",
18569
18618
  "type": {
18570
- "text": "Extract<HandOffOutcomeKind, 'cleared' | 'state-lost'>"
18619
+ "text": "AgentConfig"
18571
18620
  }
18621
+ },
18622
+ {
18623
+ "name": "{ lock = false, suspendPrevious = false }",
18624
+ "default": "{}"
18572
18625
  }
18573
- ]
18574
- },
18575
- {
18576
- "kind": "method",
18577
- "name": "serializeWaitingCallers",
18578
- "return": {
18579
- "type": {
18580
- "text": "Record<string, unknown>"
18581
- }
18582
- }
18626
+ ],
18627
+ "description": "`lock` takes the flow lock whatever kind of agent it is, and `suspendPrevious` leaves the\noutgoing agent waiting instead of deactivating it, as a hand-off does (GENC-1737)."
18583
18628
  },
18584
18629
  {
18585
18630
  "kind": "method",
18586
- "name": "getHandOffData",
18631
+ "name": "release",
18587
18632
  "return": {
18588
18633
  "type": {
18589
- "text": "Record<string, unknown>"
18634
+ "text": "Promise<AgentTransition | undefined>"
18590
18635
  }
18591
- }
18636
+ },
18637
+ "description": "Release the active agent: fire `onDeactivate` and drop the flow lock.\n\nThe user pin is intentionally **not** cleared — someone who explicitly picked this agent\nshould stay on it after the flow ends, so the next message starts a fresh flow on the same\nagent rather than routing through the classifier.\n\nReturns `undefined` when there was no active agent, so a caller can skip its events."
18592
18638
  },
18593
18639
  {
18594
18640
  "kind": "method",
18595
- "name": "restoreHandOffData",
18641
+ "name": "reportTransition",
18642
+ "privacy": "private",
18596
18643
  "return": {
18597
18644
  "type": {
18598
18645
  "text": "void"
@@ -18600,83 +18647,133 @@
18600
18647
  },
18601
18648
  "parameters": [
18602
18649
  {
18603
- "name": "saved",
18604
- "type": {
18605
- "text": "unknown"
18606
- }
18607
- },
18608
- {
18609
- "name": "interrupted",
18650
+ "name": "transition",
18610
18651
  "type": {
18611
- "text": "boolean"
18652
+ "text": "AgentTransition"
18612
18653
  }
18613
18654
  }
18614
- ]
18655
+ ],
18656
+ "description": "Hand a transition to the owner. A throwing listener is logged rather than propagated, for the\nsame reason a throwing hook is: the transition has already happened, and failing the caller\nwould leave it believing it had not."
18615
18657
  },
18616
18658
  {
18617
18659
  "kind": "method",
18618
- "name": "getActiveAgent",
18660
+ "name": "dispose",
18619
18661
  "return": {
18620
18662
  "type": {
18621
- "text": "AgentConfig | undefined"
18663
+ "text": "Promise<void>"
18622
18664
  }
18623
- }
18665
+ },
18666
+ "description": "Fire `onDeactivate` on the active agent and abort pending lifecycle work, for session\nteardown, so machines release resources cleanly. The session is not reusable afterwards: the\nabort signal stays aborted, so a later `activate` would hand its hook a dead signal.\n\n`onDeactivate` runs **before** the abort, deliberately: teardown that needs to flush state\nwould otherwise be handed an already-aborted signal and have to skip its own work. The cost is\nthat an `onActivate` still in flight keeps running until `onDeactivate` finishes — both hold\nthe same signal. Acceptable because the two are sequenced by `activate`, so overlap only\nhappens if a hook resolves before the work it started; a hook that must stop immediately\nshould own its own cancellation."
18624
18667
  },
18625
18668
  {
18626
18669
  "kind": "method",
18627
- "name": "setPinnedAgent",
18670
+ "name": "fireDeactivate",
18671
+ "privacy": "private",
18628
18672
  "return": {
18629
18673
  "type": {
18630
- "text": "void"
18674
+ "text": "Promise<void>"
18631
18675
  }
18632
18676
  },
18633
18677
  "parameters": [
18634
18678
  {
18635
- "name": "name",
18679
+ "name": "agent",
18636
18680
  "type": {
18637
- "text": "string | null"
18681
+ "text": "AgentConfig"
18638
18682
  }
18639
- }
18640
- ]
18641
- },
18642
- {
18643
- "kind": "method",
18644
- "name": "setFlowOwner",
18645
- "return": {
18646
- "type": {
18647
- "text": "void"
18648
- }
18649
- },
18650
- "parameters": [
18683
+ },
18651
18684
  {
18652
- "name": "name",
18685
+ "name": "reason",
18653
18686
  "type": {
18654
- "text": "string | null"
18687
+ "text": "'switch' | 'release' | 'dispose'"
18655
18688
  }
18656
18689
  }
18657
- ]
18658
- },
18690
+ ],
18691
+ "description": "The one place `onDeactivate` is invoked. `reason` only reaches the warning text, which is what\ntells a log reader which path fired."
18692
+ }
18693
+ ]
18694
+ }
18695
+ ],
18696
+ "exports": [
18697
+ {
18698
+ "kind": "js",
18699
+ "name": "AgentSession",
18700
+ "declaration": {
18701
+ "name": "AgentSession",
18702
+ "module": "src/components/agent-session/agent-session.ts"
18703
+ }
18704
+ }
18705
+ ]
18706
+ },
18707
+ {
18708
+ "kind": "javascript-module",
18709
+ "path": "src/components/agent-session/index.ts",
18710
+ "declarations": [],
18711
+ "exports": [
18712
+ {
18713
+ "kind": "js",
18714
+ "name": "*",
18715
+ "declaration": {
18716
+ "name": "*",
18717
+ "package": "./agent-session"
18718
+ }
18719
+ }
18720
+ ]
18721
+ },
18722
+ {
18723
+ "kind": "javascript-module",
18724
+ "path": "src/components/ai-driver/ai-driver.ts",
18725
+ "declarations": [
18726
+ {
18727
+ "kind": "variable",
18728
+ "name": "AI_DRIVER_EVENT_TYPES",
18729
+ "description": "The event types in AiDriverEventMap, as a runtime list. Built from a record keyed by the\nmap, so adding an event to the map without adding it here is a compile error."
18730
+ }
18731
+ ],
18732
+ "exports": [
18733
+ {
18734
+ "kind": "js",
18735
+ "name": "AI_DRIVER_EVENT_TYPES",
18736
+ "declaration": {
18737
+ "name": "AI_DRIVER_EVENT_TYPES",
18738
+ "module": "src/components/ai-driver/ai-driver.ts"
18739
+ }
18740
+ }
18741
+ ]
18742
+ },
18743
+ {
18744
+ "kind": "javascript-module",
18745
+ "path": "src/components/ai-driver/base-driver-decorator.ts",
18746
+ "declarations": [
18747
+ {
18748
+ "kind": "class",
18749
+ "description": "The base of every driver decorator (GENC-1660): an AiDriver that wraps another and\npasses every member, and every event in AiDriverEventMap, through to it.\n\nA decorator extends this and overrides only what it changes, so decorators stack in any order\nand a member or event added to `AiDriver` reaches the host through every layer by default.\n`OrchestratingDriver` is one; it used to forward by hand, and twice a member it did not forward\nsilently did nothing for every multi-agent host (`recordExternalCost`, then\n`getHistoryForPersistence`).\n\nAbstract with no abstract members, so it cannot be constructed on its own: a decorator that\nchanges nothing is not one.\n\nOptional `AiDriver` members are implemented here unconditionally, as a forward that falls back\nto the \"not supported\" answer when the inner driver lacks them. A host that feature-detects with\n`?.` therefore always finds them, and gets the same answer it would from the inner driver.",
18750
+ "name": "BaseDriverDecorator",
18751
+ "members": [
18659
18752
  {
18660
- "kind": "method",
18661
- "name": "getFlowOwner",
18662
- "return": {
18663
- "type": {
18664
- "text": "string | null"
18665
- }
18666
- }
18753
+ "kind": "field",
18754
+ "name": "detachers",
18755
+ "type": {
18756
+ "text": "Array<() => void>"
18757
+ },
18758
+ "privacy": "private",
18759
+ "readonly": true,
18760
+ "default": "[]",
18761
+ "description": "Undoes this layer's hold on its inner driver; see BaseDriverDecorator.detach."
18667
18762
  },
18668
18763
  {
18669
18764
  "kind": "method",
18670
- "name": "getInteractionCheckpoints",
18765
+ "name": "detach",
18671
18766
  "return": {
18672
18767
  "type": {
18673
- "text": "readonly PersistedInteractionCheckpoint[]"
18768
+ "text": "void"
18674
18769
  }
18675
- }
18770
+ },
18771
+ "description": "Let go of the inner driver WITHOUT disposing it: stop forwarding its events, and undo whatever\na subclass registered through BaseDriverDecorator.onDetach (its interceptors, its\ncapabilities, its own listeners). For dropping or replacing a decorator while the driver it\nwrapped lives on — otherwise the old layer keeps re-dispatching every event and is never\ncollected. Idempotent. `dispose()` detaches too."
18676
18772
  },
18677
18773
  {
18678
18774
  "kind": "method",
18679
- "name": "restoreInteractionCheckpoints",
18775
+ "name": "onDetach",
18776
+ "privacy": "protected",
18680
18777
  "return": {
18681
18778
  "type": {
18682
18779
  "text": "void"
@@ -18684,63 +18781,76 @@
18684
18781
  },
18685
18782
  "parameters": [
18686
18783
  {
18687
- "name": "saved",
18784
+ "name": "undo",
18688
18785
  "type": {
18689
- "text": "readonly PersistedInteractionCheckpoint[]"
18786
+ "text": "() => void"
18690
18787
  }
18691
18788
  }
18692
- ]
18693
- },
18694
- {
18695
- "kind": "method",
18696
- "name": "getInteractionCheckpoint",
18697
- "return": {
18698
- "type": {
18699
- "text": "PersistedInteractionCheckpoint | undefined"
18700
- }
18701
- }
18789
+ ],
18790
+ "description": "Register something BaseDriverDecorator.detach must undo."
18702
18791
  },
18703
18792
  {
18704
18793
  "kind": "method",
18705
- "name": "restoreInteractionCheckpoint",
18794
+ "name": "sendMessage",
18706
18795
  "return": {
18707
18796
  "type": {
18708
- "text": "void"
18797
+ "text": "Promise<ChatDriverResult>"
18709
18798
  }
18710
18799
  },
18711
18800
  "parameters": [
18712
18801
  {
18713
- "name": "saved",
18802
+ "name": "input",
18714
18803
  "type": {
18715
- "text": "PersistedInteractionCheckpoint | undefined"
18804
+ "text": "string"
18716
18805
  }
18717
- }
18806
+ },
18807
+ {
18808
+ "name": "attachments",
18809
+ "optional": true,
18810
+ "type": {
18811
+ "text": "ChatAttachment[]"
18812
+ }
18813
+ },
18814
+ {
18815
+ "name": "options",
18816
+ "optional": true,
18817
+ "type": {
18818
+ "text": "SendMessageOptions"
18819
+ }
18820
+ }
18718
18821
  ]
18719
18822
  },
18720
18823
  {
18721
18824
  "kind": "method",
18722
- "name": "addInteractionInterceptor",
18825
+ "name": "continueFromHistory",
18723
18826
  "return": {
18724
18827
  "type": {
18725
- "text": "() => void"
18828
+ "text": "Promise<ChatDriverResult>"
18726
18829
  }
18727
18830
  },
18728
18831
  "parameters": [
18729
18832
  {
18730
- "name": "interceptor",
18833
+ "name": "transientPrimer",
18834
+ "optional": true,
18731
18835
  "type": {
18732
- "text": "InteractionInterceptor"
18836
+ "text": "ChatMessage[]"
18837
+ }
18838
+ },
18839
+ {
18840
+ "name": "options",
18841
+ "optional": true,
18842
+ "type": {
18843
+ "text": "ContinueFromHistoryOptions"
18733
18844
  }
18734
18845
  }
18735
- ],
18736
- "description": "Forwarded, so an interceptor installed on any layer lands on the driver that opens the\ninteractions. A decorator that answers interactions installs its own on `this.inner`."
18846
+ ]
18737
18847
  },
18738
18848
  {
18739
18849
  "kind": "method",
18740
- "name": "invokeAsUser",
18850
+ "name": "resolveInteraction",
18741
18851
  "return": {
18742
18852
  "type": {
18743
- "text": "Promise<InvokeResult>"
18853
+ "text": "void"
18744
18854
  }
18745
18855
  },
18746
18856
  "parameters": [
@@ -18751,469 +18861,384 @@
18751
18861
  }
18752
18862
  },
18753
18863
  {
18754
- "name": "action",
18755
- "type": {
18756
- "text": "string"
18757
- }
18758
- },
18759
- {
18760
- "name": "args",
18761
- "optional": true,
18864
+ "name": "result",
18762
18865
  "type": {
18763
18866
  "text": "unknown"
18764
18867
  }
18765
18868
  }
18766
- ],
18767
- "description": "Forwarded: the interaction belongs to the driver that opened it. An inner driver that cannot\nrun actions answers as if the interaction had ended."
18869
+ ]
18768
18870
  },
18769
18871
  {
18770
18872
  "kind": "method",
18771
- "name": "presentInteraction",
18873
+ "name": "recordExternalCost",
18772
18874
  "return": {
18773
18875
  "type": {
18774
- "text": "Promise<T>"
18876
+ "text": "boolean"
18775
18877
  }
18776
18878
  },
18777
18879
  "parameters": [
18778
18880
  {
18779
- "name": "componentName",
18881
+ "name": "interactionId",
18780
18882
  "type": {
18781
18883
  "text": "string"
18782
18884
  }
18783
18885
  },
18784
18886
  {
18785
- "name": "data",
18786
- "type": {
18787
- "text": "unknown"
18788
- }
18789
- },
18790
- {
18791
- "name": "options",
18792
- "optional": true,
18887
+ "name": "costUsd",
18793
18888
  "type": {
18794
- "text": "InteractionRequestOptions"
18889
+ "text": "number"
18795
18890
  }
18796
18891
  }
18797
18892
  ]
18798
18893
  },
18799
18894
  {
18800
18895
  "kind": "method",
18801
- "name": "provideHandlerCapability",
18896
+ "name": "getInteractionContext",
18802
18897
  "return": {
18803
18898
  "type": {
18804
- "text": "() => void"
18899
+ "text": "InteractionContext | undefined"
18805
18900
  }
18806
18901
  },
18807
18902
  "parameters": [
18808
18903
  {
18809
- "name": "name",
18904
+ "name": "interactionId",
18810
18905
  "type": {
18811
18906
  "text": "string"
18812
18907
  }
18813
- },
18908
+ }
18909
+ ]
18910
+ },
18911
+ {
18912
+ "kind": "method",
18913
+ "name": "loadHistory",
18914
+ "return": {
18915
+ "type": {
18916
+ "text": "void"
18917
+ }
18918
+ },
18919
+ "parameters": [
18814
18920
  {
18815
- "name": "factory",
18921
+ "name": "messages",
18816
18922
  "type": {
18817
- "text": "HandlerCapabilityFactory"
18923
+ "text": "ChatMessage[]"
18818
18924
  }
18819
18925
  }
18820
18926
  ]
18821
18927
  },
18822
18928
  {
18823
18929
  "kind": "method",
18824
- "name": "getContextReserve",
18930
+ "name": "primeRestoredAgentState",
18825
18931
  "return": {
18826
18932
  "type": {
18827
- "text": "ContextReserveResolution | undefined"
18933
+ "text": "void"
18828
18934
  }
18829
- }
18935
+ },
18936
+ "parameters": [
18937
+ {
18938
+ "name": "snapshots",
18939
+ "type": {
18940
+ "text": "Record<string, unknown>"
18941
+ }
18942
+ }
18943
+ ]
18830
18944
  },
18831
18945
  {
18832
18946
  "kind": "method",
18833
- "name": "getPreambleTokens",
18947
+ "name": "canRestoreFlowOwner",
18834
18948
  "return": {
18835
18949
  "type": {
18836
- "text": "number | undefined"
18950
+ "text": "boolean"
18837
18951
  }
18838
- }
18952
+ },
18953
+ "parameters": [
18954
+ {
18955
+ "name": "agentName",
18956
+ "type": {
18957
+ "text": "string"
18958
+ }
18959
+ }
18960
+ ]
18839
18961
  },
18840
18962
  {
18841
18963
  "kind": "method",
18842
- "name": "setContextGuard",
18964
+ "name": "canResumeRestoredFlow",
18843
18965
  "return": {
18844
18966
  "type": {
18845
- "text": "void"
18967
+ "text": "boolean"
18846
18968
  }
18847
18969
  },
18848
18970
  "parameters": [
18849
18971
  {
18850
- "name": "policy",
18851
- "optional": true,
18972
+ "name": "agentName",
18852
18973
  "type": {
18853
- "text": "ContextGuardPolicy"
18974
+ "text": "string"
18854
18975
  }
18855
18976
  }
18856
18977
  ]
18857
18978
  },
18858
18979
  {
18859
18980
  "kind": "method",
18860
- "name": "compact",
18981
+ "name": "resumeRestoredFlow",
18861
18982
  "return": {
18862
18983
  "type": {
18863
- "text": "Promise<ChatMessage | null>"
18984
+ "text": "Promise<ChatDriverResult | undefined>"
18864
18985
  }
18865
18986
  },
18866
18987
  "parameters": [
18867
18988
  {
18868
- "name": "options",
18989
+ "name": "resumeNote",
18869
18990
  "optional": true,
18870
18991
  "type": {
18871
- "text": "CompactionPlanOptions"
18992
+ "text": "string"
18993
+ }
18994
+ },
18995
+ {
18996
+ "name": "agent",
18997
+ "optional": true,
18998
+ "type": {
18999
+ "text": "AgentConfig"
18872
19000
  }
18873
19001
  }
18874
19002
  ]
18875
19003
  },
18876
19004
  {
18877
19005
  "kind": "method",
18878
- "name": "getCompactionPlan",
19006
+ "name": "getRawHistory",
18879
19007
  "return": {
18880
19008
  "type": {
18881
- "text": "CompactionProjection | null"
19009
+ "text": "readonly ChatMessage[]"
19010
+ }
19011
+ }
19012
+ },
19013
+ {
19014
+ "kind": "method",
19015
+ "name": "getHistoryForPersistence",
19016
+ "return": {
19017
+ "type": {
19018
+ "text": "ChatMessage[]"
19019
+ }
19020
+ }
19021
+ },
19022
+ {
19023
+ "kind": "method",
19024
+ "name": "getCondensePoliciesForPersistence",
19025
+ "return": {
19026
+ "type": {
19027
+ "text": "PersistedCondensePolicy[]"
18882
19028
  }
18883
19029
  },
18884
19030
  "parameters": [
18885
19031
  {
18886
- "name": "options",
18887
- "optional": true,
19032
+ "name": "messages",
18888
19033
  "type": {
18889
- "text": "CompactionPlanOptions"
19034
+ "text": "readonly ChatMessage[]"
18890
19035
  }
18891
19036
  }
18892
19037
  ]
18893
19038
  },
18894
19039
  {
18895
19040
  "kind": "method",
18896
- "name": "canCompact",
19041
+ "name": "restoreCondensePolicies",
18897
19042
  "return": {
18898
19043
  "type": {
18899
- "text": "boolean"
19044
+ "text": "{\n restored: number;\n awaitingReactivation: number;\n }"
18900
19045
  }
18901
19046
  },
18902
19047
  "parameters": [
18903
19048
  {
18904
- "name": "options",
18905
- "optional": true,
19049
+ "name": "entries",
18906
19050
  "type": {
18907
- "text": "CompactionPlanOptions"
19051
+ "text": "readonly unknown[] | undefined"
18908
19052
  }
18909
19053
  }
18910
19054
  ]
18911
19055
  },
18912
19056
  {
18913
19057
  "kind": "method",
18914
- "name": "isBusy",
19058
+ "name": "getHandOffStack",
18915
19059
  "return": {
18916
19060
  "type": {
18917
- "text": "boolean"
19061
+ "text": "HandOffFrame[]"
18918
19062
  }
18919
19063
  }
18920
19064
  },
18921
19065
  {
18922
19066
  "kind": "method",
18923
- "name": "getSuggestions",
19067
+ "name": "restoreHandOffStack",
18924
19068
  "return": {
18925
19069
  "type": {
18926
- "text": "Promise<string[]>"
19070
+ "text": "{ resume?: { agent: string; note: string }; droppedLocks?: string[] }"
18927
19071
  }
18928
19072
  },
18929
19073
  "parameters": [
18930
19074
  {
18931
- "name": "history",
19075
+ "name": "saved",
18932
19076
  "type": {
18933
- "text": "ChatMessage[]"
19077
+ "text": "unknown"
18934
19078
  }
18935
19079
  },
18936
19080
  {
18937
- "name": "prompt",
19081
+ "name": "savedStates",
18938
19082
  "type": {
18939
- "text": "string"
19083
+ "text": "Record<string, unknown>"
18940
19084
  }
18941
19085
  },
18942
19086
  {
18943
- "name": "count",
19087
+ "name": "interrupted",
18944
19088
  "type": {
18945
- "text": "number"
19089
+ "text": "boolean"
18946
19090
  }
18947
- },
19091
+ }
19092
+ ]
19093
+ },
19094
+ {
19095
+ "kind": "method",
19096
+ "name": "unwindHandOffs",
19097
+ "return": {
19098
+ "type": {
19099
+ "text": "Promise<void>"
19100
+ }
19101
+ },
19102
+ "parameters": [
18948
19103
  {
18949
- "name": "allAgentInfo",
18950
- "optional": true,
19104
+ "name": "kind",
18951
19105
  "type": {
18952
- "text": "AllAgentSummary[]"
19106
+ "text": "Extract<HandOffOutcomeKind, 'cleared' | 'state-lost'>"
18953
19107
  }
18954
19108
  }
18955
19109
  ]
18956
19110
  },
18957
19111
  {
18958
19112
  "kind": "method",
18959
- "name": "getTurnSnapshots",
19113
+ "name": "serializeWaitingCallers",
18960
19114
  "return": {
18961
19115
  "type": {
18962
- "text": "ReadonlyArray<TurnSnapshot>"
19116
+ "text": "Record<string, unknown>"
18963
19117
  }
18964
19118
  }
18965
19119
  },
18966
19120
  {
18967
19121
  "kind": "method",
18968
- "name": "getExternalDiagnostics",
19122
+ "name": "getHandOffData",
18969
19123
  "return": {
18970
19124
  "type": {
18971
- "text": "ReadonlyArray<DiagnosticEntry>"
19125
+ "text": "Record<string, unknown>"
18972
19126
  }
18973
- },
18974
- "description": "The inner driver's entries. Diagnostics compose down the stack: a decorator with entries of\nits own overrides this and appends them to `super.getExternalDiagnostics()`."
19127
+ }
18975
19128
  },
18976
19129
  {
18977
19130
  "kind": "method",
18978
- "name": "getActiveProviderName",
19131
+ "name": "restoreHandOffData",
18979
19132
  "return": {
18980
19133
  "type": {
18981
- "text": "string"
19134
+ "text": "void"
18982
19135
  }
18983
- }
19136
+ },
19137
+ "parameters": [
19138
+ {
19139
+ "name": "saved",
19140
+ "type": {
19141
+ "text": "unknown"
19142
+ }
19143
+ },
19144
+ {
19145
+ "name": "interrupted",
19146
+ "type": {
19147
+ "text": "boolean"
19148
+ }
19149
+ }
19150
+ ]
18984
19151
  },
18985
19152
  {
18986
19153
  "kind": "method",
18987
- "name": "dispose",
19154
+ "name": "getActiveAgent",
18988
19155
  "return": {
18989
19156
  "type": {
18990
- "text": "void | Promise<void>"
19157
+ "text": "AgentConfig | undefined"
18991
19158
  }
18992
19159
  }
18993
19160
  },
18994
19161
  {
18995
19162
  "kind": "method",
18996
- "name": "cancel",
19163
+ "name": "setPinnedAgent",
18997
19164
  "return": {
18998
19165
  "type": {
18999
19166
  "text": "void"
19000
19167
  }
19001
- }
19002
- }
19003
- ],
19004
- "superclass": {
19005
- "name": "EventTarget",
19006
- "module": "src/components/ai-driver/base-driver-decorator.ts"
19007
- }
19008
- }
19009
- ],
19010
- "exports": [
19011
- {
19012
- "kind": "js",
19013
- "name": "BaseDriverDecorator",
19014
- "declaration": {
19015
- "name": "BaseDriverDecorator",
19016
- "module": "src/components/ai-driver/base-driver-decorator.ts"
19017
- }
19018
- }
19019
- ]
19020
- },
19021
- {
19022
- "kind": "javascript-module",
19023
- "path": "src/components/ai-driver/index.ts",
19024
- "declarations": [],
19025
- "exports": [
19026
- {
19027
- "kind": "js",
19028
- "name": "AiDriver",
19029
- "declaration": {
19030
- "name": "AiDriver",
19031
- "module": "./ai-driver"
19032
- }
19033
- },
19034
- {
19035
- "kind": "js",
19036
- "name": "AiDriverEventMap",
19037
- "declaration": {
19038
- "name": "AiDriverEventMap",
19039
- "module": "./ai-driver"
19040
- }
19041
- },
19042
- {
19043
- "kind": "js",
19044
- "name": "AI_DRIVER_EVENT_TYPES",
19045
- "declaration": {
19046
- "name": "AI_DRIVER_EVENT_TYPES",
19047
- "module": "./ai-driver"
19048
- }
19049
- },
19050
- {
19051
- "kind": "js",
19052
- "name": "BaseDriverDecorator",
19053
- "declaration": {
19054
- "name": "BaseDriverDecorator",
19055
- "module": "./base-driver-decorator"
19056
- }
19057
- }
19058
- ]
19059
- },
19060
- {
19061
- "kind": "javascript-module",
19062
- "path": "src/components/ai-driver/stub-driver.ts",
19063
- "declarations": [],
19064
- "exports": []
19065
- },
19066
- {
19067
- "kind": "javascript-module",
19068
- "path": "src/components/agent-session/agent-session.ts",
19069
- "declarations": [
19070
- {
19071
- "kind": "class",
19072
- "description": "The stateful-agent contract: which agent is active, whether a flow or a user pin holds routing,\nand the `onActivate` / `onDeactivate` lifecycle around a swap. Either driver can own one.\n\nKnows nothing about routing, tool surfaces or transcripts — whether an agent is terminal, the\nhand-off stack, the divider in history all stay with the orchestrator, which is the only thing\nwith agents to route between.",
19073
- "name": "AgentSession",
19074
- "members": [
19075
- {
19076
- "kind": "field",
19077
- "name": "lifecycleAbortController",
19078
- "privacy": "private",
19079
- "readonly": true,
19080
- "default": "new AbortController()",
19081
- "description": "Aborted on disposal. Threaded into `AgentLifecycleContext.signal` so long-running\n`onActivate` work can bail if the session disconnects."
19082
- },
19083
- {
19084
- "kind": "field",
19085
- "name": "active",
19086
- "type": {
19087
- "text": "AgentConfig | undefined"
19088
- },
19089
- "privacy": "private"
19090
- },
19091
- {
19092
- "kind": "field",
19093
- "name": "pinned",
19094
- "type": {
19095
- "text": "string | null"
19096
- },
19097
- "privacy": "private",
19098
- "default": "null",
19099
- "description": "Sticky user pick from the picker (or the host's `setAgent` API). Only changes on explicit\nuser action. Survives flow completion: when a stateful agent releases, the user-pin stays put\nand routing falls back to it on the next turn."
19100
- },
19101
- {
19102
- "kind": "field",
19103
- "name": "flowOwner",
19104
- "type": {
19105
- "text": "string | null"
19106
19168
  },
19107
- "privacy": "private",
19108
- "default": "null",
19109
- "description": "Transient flow lock — set when a stateful agent activates, cleared on release. While\nnon-null, routing precedence goes to this agent and the picker is locked. Independent of\nthe user pin so completing a flow doesn't wipe the user's sticky choice."
19110
- },
19111
- {
19112
- "kind": "field",
19113
- "name": "restoredStates",
19114
- "type": {
19115
- "text": "Record<string, unknown>"
19116
- },
19117
- "privacy": "private",
19118
- "default": "{}",
19119
- "description": "Per-agent restored state for a rehydrated session, keyed by agent name. Primed by the host on\nrestore; each entry is passed to that agent's `onActivate` as `ctx.restored` on its next\nactivation, then deleted so a later re-activation starts fresh."
19120
- },
19121
- {
19122
- "kind": "field",
19123
- "name": "activation",
19124
- "type": {
19125
- "text": "Promise<unknown>"
19126
- },
19127
- "privacy": "private",
19128
- "description": "The tail of the activation queue — see AgentSession.activate."
19129
- },
19130
- {
19131
- "kind": "field",
19132
- "name": "suspended",
19133
- "type": {
19134
- "text": "AgentConfig[]"
19135
- },
19136
- "privacy": "private",
19137
- "default": "[]",
19138
- "description": "Callers waiting in a hand-off (GENC-1737), oldest first: still live, so never deactivated by\nthe hand-off, and resumed without `onActivate`. Empty after a reload, when a caller has no live\nstate and is activated again from its saved state instead."
19139
- },
19140
- {
19141
- "kind": "field",
19142
- "name": "handOffData",
19143
- "privacy": "private",
19144
- "default": "new Map<string, unknown>()",
19145
- "description": "The `data` of the hand-off that activated each agent (GENC-1737), for its tool handlers: kept\nwhile it is active or waits as a caller, and dropped when its activation ends."
19169
+ "parameters": [
19170
+ {
19171
+ "name": "name",
19172
+ "type": {
19173
+ "text": "string | null"
19174
+ }
19175
+ }
19176
+ ]
19146
19177
  },
19147
19178
  {
19148
19179
  "kind": "method",
19149
- "name": "getActive",
19180
+ "name": "setFlowOwner",
19150
19181
  "return": {
19151
19182
  "type": {
19152
- "text": "AgentConfig | undefined"
19183
+ "text": "void"
19153
19184
  }
19154
19185
  },
19155
- "description": "The active agent, or `undefined` before the first activation and after a release."
19186
+ "parameters": [
19187
+ {
19188
+ "name": "name",
19189
+ "type": {
19190
+ "text": "string | null"
19191
+ }
19192
+ }
19193
+ ]
19156
19194
  },
19157
19195
  {
19158
19196
  "kind": "method",
19159
- "name": "getPinned",
19197
+ "name": "getFlowOwner",
19160
19198
  "return": {
19161
19199
  "type": {
19162
19200
  "text": "string | null"
19163
19201
  }
19164
- },
19165
- "description": "The sticky user pin, or `null` for automatic routing."
19202
+ }
19166
19203
  },
19167
19204
  {
19168
19205
  "kind": "method",
19169
- "name": "getFlowOwner",
19206
+ "name": "getInteractionCheckpoints",
19170
19207
  "return": {
19171
19208
  "type": {
19172
- "text": "string | null"
19209
+ "text": "readonly PersistedInteractionCheckpoint[]"
19173
19210
  }
19174
- },
19175
- "description": "The transient flow lock, or `null` when no flow holds routing."
19211
+ }
19176
19212
  },
19177
19213
  {
19178
19214
  "kind": "method",
19179
- "name": "getLockedName",
19215
+ "name": "restoreInteractionCheckpoints",
19180
19216
  "return": {
19181
19217
  "type": {
19182
- "text": "string | null"
19218
+ "text": "void"
19183
19219
  }
19184
19220
  },
19185
19221
  "parameters": [
19186
19222
  {
19187
- "name": "pin",
19188
- "default": "this.pinned",
19223
+ "name": "saved",
19189
19224
  "type": {
19190
- "text": "string | null"
19225
+ "text": "readonly PersistedInteractionCheckpoint[]"
19191
19226
  }
19192
19227
  }
19193
- ],
19194
- "description": "The name routing is locked to, flow lock first. A flow in progress outranks the user's\nsticky pick for the duration of the flow; neither being set means automatic routing.\n`pin`, when given, stands in for the sticky pick: one message routed its own way."
19228
+ ]
19195
19229
  },
19196
19230
  {
19197
19231
  "kind": "method",
19198
- "name": "setPinned",
19232
+ "name": "getInteractionCheckpoint",
19199
19233
  "return": {
19200
19234
  "type": {
19201
- "text": "void"
19202
- }
19203
- },
19204
- "parameters": [
19205
- {
19206
- "name": "name",
19207
- "type": {
19208
- "text": "string | null"
19209
- }
19235
+ "text": "PersistedInteractionCheckpoint | undefined"
19210
19236
  }
19211
- ],
19212
- "description": "Set the sticky user pin. `null` returns to automatic routing."
19237
+ }
19213
19238
  },
19214
19239
  {
19215
19240
  "kind": "method",
19216
- "name": "setFlowOwner",
19241
+ "name": "restoreInteractionCheckpoint",
19217
19242
  "return": {
19218
19243
  "type": {
19219
19244
  "text": "void"
@@ -19221,304 +19246,359 @@
19221
19246
  },
19222
19247
  "parameters": [
19223
19248
  {
19224
- "name": "name",
19249
+ "name": "saved",
19225
19250
  "type": {
19226
- "text": "string | null"
19251
+ "text": "PersistedInteractionCheckpoint | undefined"
19227
19252
  }
19228
19253
  }
19229
- ],
19230
- "description": "Set the flow-owner lock directly — used to restore state on driver reconstruction\n(agents-array changes, pop-in/pop-out), not to steer routing. Writes without firing hooks or\nreporting a transition, because the flow it names is already running."
19254
+ ]
19231
19255
  },
19232
19256
  {
19233
19257
  "kind": "method",
19234
- "name": "primeRestoredStates",
19258
+ "name": "addInteractionInterceptor",
19235
19259
  "return": {
19236
19260
  "type": {
19237
- "text": "void"
19261
+ "text": "() => void"
19238
19262
  }
19239
19263
  },
19240
19264
  "parameters": [
19241
19265
  {
19242
- "name": "snapshots",
19266
+ "name": "interceptor",
19243
19267
  "type": {
19244
- "text": "Record<string, unknown>"
19268
+ "text": "InteractionInterceptor"
19245
19269
  }
19246
19270
  }
19247
19271
  ],
19248
- "description": "Prime per-agent restored state for a rehydrated session. Replaces any pending entries."
19272
+ "description": "Forwarded, so an interceptor installed on any layer lands on the driver that opens the\ninteractions. A decorator that answers interactions installs its own on `this.inner`."
19249
19273
  },
19250
19274
  {
19251
19275
  "kind": "method",
19252
- "name": "hasRestoredState",
19276
+ "name": "invokeAsUser",
19253
19277
  "return": {
19254
19278
  "type": {
19255
- "text": "boolean"
19279
+ "text": "Promise<InvokeResult>"
19256
19280
  }
19257
19281
  },
19258
19282
  "parameters": [
19259
19283
  {
19260
- "name": "agentName",
19284
+ "name": "interactionId",
19261
19285
  "type": {
19262
19286
  "text": "string"
19263
19287
  }
19288
+ },
19289
+ {
19290
+ "name": "action",
19291
+ "type": {
19292
+ "text": "string"
19293
+ }
19294
+ },
19295
+ {
19296
+ "name": "args",
19297
+ "optional": true,
19298
+ "type": {
19299
+ "text": "unknown"
19300
+ }
19264
19301
  }
19265
19302
  ],
19266
- "description": "Whether a restored snapshot is waiting for this agent's next activation."
19303
+ "description": "Forwarded: the interaction belongs to the driver that opened it. An inner driver that cannot\nrun actions answers as if the interaction had ended."
19267
19304
  },
19268
19305
  {
19269
19306
  "kind": "method",
19270
- "name": "getHandOffData",
19307
+ "name": "presentInteraction",
19271
19308
  "return": {
19272
19309
  "type": {
19273
- "text": "unknown"
19310
+ "text": "Promise<T>"
19274
19311
  }
19275
19312
  },
19276
19313
  "parameters": [
19277
19314
  {
19278
- "name": "agentName",
19315
+ "name": "componentName",
19279
19316
  "type": {
19280
19317
  "text": "string"
19281
19318
  }
19319
+ },
19320
+ {
19321
+ "name": "data",
19322
+ "type": {
19323
+ "text": "unknown"
19324
+ }
19325
+ },
19326
+ {
19327
+ "name": "options",
19328
+ "optional": true,
19329
+ "type": {
19330
+ "text": "InteractionRequestOptions"
19331
+ }
19282
19332
  }
19283
- ],
19284
- "description": "The `data` of the hand-off that activated `agentName`, if one did and carried any."
19333
+ ]
19285
19334
  },
19286
19335
  {
19287
19336
  "kind": "method",
19288
- "name": "setHandOffData",
19337
+ "name": "provideHandlerCapability",
19289
19338
  "return": {
19290
19339
  "type": {
19291
- "text": "void"
19340
+ "text": "() => void"
19292
19341
  }
19293
19342
  },
19294
19343
  "parameters": [
19295
19344
  {
19296
- "name": "agentName",
19345
+ "name": "name",
19297
19346
  "type": {
19298
19347
  "text": "string"
19299
19348
  }
19300
19349
  },
19301
19350
  {
19302
- "name": "data",
19351
+ "name": "factory",
19303
19352
  "type": {
19304
- "text": "unknown"
19353
+ "text": "HandlerCapabilityFactory"
19305
19354
  }
19306
19355
  }
19307
- ],
19308
- "description": "Record the `data` a hand-off activated `agentName` with, or restore it; `undefined` drops it."
19356
+ ]
19309
19357
  },
19310
19358
  {
19311
19359
  "kind": "method",
19312
- "name": "dropFlowLock",
19360
+ "name": "getContextReserve",
19313
19361
  "return": {
19314
19362
  "type": {
19315
- "text": "void"
19363
+ "text": "ContextReserveResolution | undefined"
19316
19364
  }
19317
- },
19318
- "description": "Drop the flow lock and leave the active agent active (GENC-1737): a plain agent holding it with\nno hand-off behind it is done once its turn ends."
19365
+ }
19319
19366
  },
19320
19367
  {
19321
19368
  "kind": "method",
19322
- "name": "getSuspended",
19369
+ "name": "getPreambleTokens",
19323
19370
  "return": {
19324
19371
  "type": {
19325
- "text": "readonly AgentConfig[]"
19372
+ "text": "number | undefined"
19326
19373
  }
19327
- },
19328
- "description": "The callers waiting in a hand-off whose state is live, oldest first."
19374
+ }
19329
19375
  },
19330
19376
  {
19331
19377
  "kind": "method",
19332
- "name": "handOff",
19378
+ "name": "setContextGuard",
19333
19379
  "return": {
19334
19380
  "type": {
19335
- "text": "Promise<AgentTransition>"
19381
+ "text": "void"
19336
19382
  }
19337
19383
  },
19338
19384
  "parameters": [
19339
19385
  {
19340
- "name": "target",
19341
- "type": {
19342
- "text": "AgentConfig"
19343
- }
19344
- },
19345
- {
19346
- "name": "options",
19386
+ "name": "policy",
19387
+ "optional": true,
19347
19388
  "type": {
19348
- "text": "{ suspendCaller: boolean }"
19389
+ "text": "ContextGuardPolicy"
19349
19390
  }
19350
19391
  }
19351
- ],
19352
- "description": "Make `target` active for a hand-off (GENC-1737), holding the flow lock whatever kind of agent\nit is, since a waiting caller depends on it. With `suspendCaller` the active agent waits:\nit is not deactivated and keeps its state. Without it the active agent is deactivated as on\nany swap: a one-way hand-off from a target, whose waiting caller then waits for the new\ntarget. Queued with AgentSession.activate."
19392
+ ]
19353
19393
  },
19354
19394
  {
19355
19395
  "kind": "method",
19356
- "name": "resume",
19396
+ "name": "compact",
19357
19397
  "return": {
19358
19398
  "type": {
19359
- "text": "Promise<AgentTransition>"
19399
+ "text": "Promise<ChatMessage | null>"
19360
19400
  }
19361
19401
  },
19362
19402
  "parameters": [
19363
19403
  {
19364
- "name": "caller",
19365
- "type": {
19366
- "text": "AgentConfig"
19367
- }
19368
- },
19369
- {
19370
- "name": "lock",
19404
+ "name": "options",
19405
+ "optional": true,
19371
19406
  "type": {
19372
- "text": "boolean"
19407
+ "text": "CompactionPlanOptions"
19373
19408
  }
19374
19409
  }
19375
- ],
19376
- "description": "Make a waiting caller active again when its hand-off ends (GENC-1737). One whose state is live\nresumes without `onActivate`, since it was never deactivated; after a reload it is activated\nfrom its saved state like any other agent. `lock` keeps the flow lock on it: it held it before,\nor another caller is still waiting further down."
19410
+ ]
19377
19411
  },
19378
19412
  {
19379
19413
  "kind": "method",
19380
- "name": "endSuspended",
19414
+ "name": "getCompactionPlan",
19381
19415
  "return": {
19382
19416
  "type": {
19383
- "text": "Promise<void>"
19417
+ "text": "CompactionProjection | null"
19384
19418
  }
19385
19419
  },
19386
- "description": "Deactivate the callers left waiting by hand-offs that ended without a hand-back, newest first,\nwhen no teardown follows to do it (GENC-1737)."
19420
+ "parameters": [
19421
+ {
19422
+ "name": "options",
19423
+ "optional": true,
19424
+ "type": {
19425
+ "text": "CompactionPlanOptions"
19426
+ }
19427
+ }
19428
+ ]
19387
19429
  },
19388
19430
  {
19389
19431
  "kind": "method",
19390
- "name": "activate",
19432
+ "name": "canCompact",
19391
19433
  "return": {
19392
19434
  "type": {
19393
- "text": "Promise<AgentTransition>"
19435
+ "text": "boolean"
19394
19436
  }
19395
19437
  },
19396
19438
  "parameters": [
19397
19439
  {
19398
- "name": "agent",
19440
+ "name": "options",
19441
+ "optional": true,
19399
19442
  "type": {
19400
- "text": "AgentConfig"
19443
+ "text": "CompactionPlanOptions"
19401
19444
  }
19402
19445
  }
19403
- ],
19404
- "description": "Make `agent` active, firing the lifecycle hooks around the swap: outgoing `onDeactivate`\nfirst, then incoming `onActivate`. Both are awaited so heavy activation work (a machine\nrestore, say) completes before the agent's first turn runs, and a throw from either is logged\nrather than propagated — an agent whose hook fails still activates.\n\nRe-activating the same agent by name is not a switch: no hooks fire, no lock moves, and no\nhandoff is recorded. That guard matters because a per-turn re-resolve calls through here.\n\nSingle-flight (GENC-1662): calls run one after another, never interleaved. `active` is only\nset once the hooks have finished, so two overlapping calls for the same agent would otherwise\nboth see a switch and run `onActivate` twice — and a restored `init` would be overwritten by a\nfresh one that finished later. That overlap became possible when a restore started activating\nthe flow owner outside a turn, where a send can land mid-activation."
19446
+ ]
19405
19447
  },
19406
19448
  {
19407
19449
  "kind": "method",
19408
- "name": "activateNow",
19409
- "privacy": "private",
19450
+ "name": "isBusy",
19410
19451
  "return": {
19411
19452
  "type": {
19412
- "text": "Promise<AgentTransition>"
19453
+ "text": "boolean"
19454
+ }
19455
+ }
19456
+ },
19457
+ {
19458
+ "kind": "method",
19459
+ "name": "getSuggestions",
19460
+ "return": {
19461
+ "type": {
19462
+ "text": "Promise<string[]>"
19413
19463
  }
19414
19464
  },
19415
19465
  "parameters": [
19416
19466
  {
19417
- "name": "agent",
19467
+ "name": "history",
19418
19468
  "type": {
19419
- "text": "AgentConfig"
19469
+ "text": "ChatMessage[]"
19420
19470
  }
19421
19471
  },
19422
19472
  {
19423
- "name": "{ lock = false, suspendPrevious = false }",
19424
- "default": "{}"
19473
+ "name": "prompt",
19474
+ "type": {
19475
+ "text": "string"
19476
+ }
19477
+ },
19478
+ {
19479
+ "name": "count",
19480
+ "type": {
19481
+ "text": "number"
19482
+ }
19483
+ },
19484
+ {
19485
+ "name": "allAgentInfo",
19486
+ "optional": true,
19487
+ "type": {
19488
+ "text": "AllAgentSummary[]"
19489
+ }
19425
19490
  }
19426
- ],
19427
- "description": "`lock` takes the flow lock whatever kind of agent it is, and `suspendPrevious` leaves the\noutgoing agent waiting instead of deactivating it, as a hand-off does (GENC-1737)."
19491
+ ]
19428
19492
  },
19429
19493
  {
19430
19494
  "kind": "method",
19431
- "name": "release",
19495
+ "name": "getTurnSnapshots",
19432
19496
  "return": {
19433
19497
  "type": {
19434
- "text": "Promise<AgentTransition | undefined>"
19498
+ "text": "ReadonlyArray<TurnSnapshot>"
19435
19499
  }
19436
- },
19437
- "description": "Release the active agent: fire `onDeactivate` and drop the flow lock.\n\nThe user pin is intentionally **not** cleared — someone who explicitly picked this agent\nshould stay on it after the flow ends, so the next message starts a fresh flow on the same\nagent rather than routing through the classifier.\n\nReturns `undefined` when there was no active agent, so a caller can skip its events."
19500
+ }
19438
19501
  },
19439
19502
  {
19440
19503
  "kind": "method",
19441
- "name": "reportTransition",
19442
- "privacy": "private",
19504
+ "name": "getExternalDiagnostics",
19443
19505
  "return": {
19444
19506
  "type": {
19445
- "text": "void"
19507
+ "text": "ReadonlyArray<DiagnosticEntry>"
19446
19508
  }
19447
19509
  },
19448
- "parameters": [
19449
- {
19450
- "name": "transition",
19451
- "type": {
19452
- "text": "AgentTransition"
19453
- }
19510
+ "description": "The inner driver's entries. Diagnostics compose down the stack: a decorator with entries of\nits own overrides this and appends them to `super.getExternalDiagnostics()`."
19511
+ },
19512
+ {
19513
+ "kind": "method",
19514
+ "name": "getActiveProviderName",
19515
+ "return": {
19516
+ "type": {
19517
+ "text": "string"
19454
19518
  }
19455
- ],
19456
- "description": "Hand a transition to the owner. A throwing listener is logged rather than propagated, for the\nsame reason a throwing hook is: the transition has already happened, and failing the caller\nwould leave it believing it had not."
19519
+ }
19457
19520
  },
19458
19521
  {
19459
19522
  "kind": "method",
19460
19523
  "name": "dispose",
19461
19524
  "return": {
19462
19525
  "type": {
19463
- "text": "Promise<void>"
19526
+ "text": "void | Promise<void>"
19464
19527
  }
19465
- },
19466
- "description": "Fire `onDeactivate` on the active agent and abort pending lifecycle work, for session\nteardown, so machines release resources cleanly. The session is not reusable afterwards: the\nabort signal stays aborted, so a later `activate` would hand its hook a dead signal.\n\n`onDeactivate` runs **before** the abort, deliberately: teardown that needs to flush state\nwould otherwise be handed an already-aborted signal and have to skip its own work. The cost is\nthat an `onActivate` still in flight keeps running until `onDeactivate` finishes — both hold\nthe same signal. Acceptable because the two are sequenced by `activate`, so overlap only\nhappens if a hook resolves before the work it started; a hook that must stop immediately\nshould own its own cancellation."
19528
+ }
19467
19529
  },
19468
19530
  {
19469
19531
  "kind": "method",
19470
- "name": "fireDeactivate",
19471
- "privacy": "private",
19532
+ "name": "cancel",
19472
19533
  "return": {
19473
19534
  "type": {
19474
- "text": "Promise<void>"
19475
- }
19476
- },
19477
- "parameters": [
19478
- {
19479
- "name": "agent",
19480
- "type": {
19481
- "text": "AgentConfig"
19482
- }
19483
- },
19484
- {
19485
- "name": "reason",
19486
- "type": {
19487
- "text": "'switch' | 'release' | 'dispose'"
19488
- }
19535
+ "text": "void"
19489
19536
  }
19490
- ],
19491
- "description": "The one place `onDeactivate` is invoked. `reason` only reaches the warning text, which is what\ntells a log reader which path fired."
19537
+ }
19492
19538
  }
19493
- ]
19539
+ ],
19540
+ "superclass": {
19541
+ "name": "EventTarget",
19542
+ "module": "src/components/ai-driver/base-driver-decorator.ts"
19543
+ }
19494
19544
  }
19495
19545
  ],
19496
19546
  "exports": [
19497
19547
  {
19498
19548
  "kind": "js",
19499
- "name": "AgentSession",
19549
+ "name": "BaseDriverDecorator",
19500
19550
  "declaration": {
19501
- "name": "AgentSession",
19502
- "module": "src/components/agent-session/agent-session.ts"
19551
+ "name": "BaseDriverDecorator",
19552
+ "module": "src/components/ai-driver/base-driver-decorator.ts"
19503
19553
  }
19504
19554
  }
19505
19555
  ]
19506
19556
  },
19507
19557
  {
19508
19558
  "kind": "javascript-module",
19509
- "path": "src/components/agent-session/index.ts",
19559
+ "path": "src/components/ai-driver/index.ts",
19510
19560
  "declarations": [],
19511
19561
  "exports": [
19512
19562
  {
19513
19563
  "kind": "js",
19514
- "name": "*",
19564
+ "name": "AiDriver",
19515
19565
  "declaration": {
19516
- "name": "*",
19517
- "package": "./agent-session"
19566
+ "name": "AiDriver",
19567
+ "module": "./ai-driver"
19568
+ }
19569
+ },
19570
+ {
19571
+ "kind": "js",
19572
+ "name": "AiDriverEventMap",
19573
+ "declaration": {
19574
+ "name": "AiDriverEventMap",
19575
+ "module": "./ai-driver"
19576
+ }
19577
+ },
19578
+ {
19579
+ "kind": "js",
19580
+ "name": "AI_DRIVER_EVENT_TYPES",
19581
+ "declaration": {
19582
+ "name": "AI_DRIVER_EVENT_TYPES",
19583
+ "module": "./ai-driver"
19584
+ }
19585
+ },
19586
+ {
19587
+ "kind": "js",
19588
+ "name": "BaseDriverDecorator",
19589
+ "declaration": {
19590
+ "name": "BaseDriverDecorator",
19591
+ "module": "./base-driver-decorator"
19518
19592
  }
19519
19593
  }
19520
19594
  ]
19521
19595
  },
19596
+ {
19597
+ "kind": "javascript-module",
19598
+ "path": "src/components/ai-driver/stub-driver.ts",
19599
+ "declarations": [],
19600
+ "exports": []
19601
+ },
19522
19602
  {
19523
19603
  "kind": "javascript-module",
19524
19604
  "path": "src/components/chat-bubble/chat-bubble.styles.ts",