@genesislcap/ai-assistant 15.73.0-FUI-2628.4 → 15.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/custom-elements.json +629 -629
  2. package/package.json +17 -17
@@ -1322,75 +1322,200 @@
1322
1322
  },
1323
1323
  {
1324
1324
  "kind": "javascript-module",
1325
- "path": "src/channel/ai-activity-bus.ts",
1325
+ "path": "src/autopilot/autopilot-driver.ts",
1326
1326
  "declarations": [
1327
1327
  {
1328
1328
  "kind": "variable",
1329
- "name": "NOOP_ACTIVITY_BUS",
1329
+ "name": "AUTOPILOT_CLAIMANT",
1330
1330
  "type": {
1331
- "text": "ActivityBus"
1331
+ "text": "string"
1332
1332
  },
1333
- "default": "{ publish: () => {} }",
1334
- "description": "No-op ActivityBus. The default when no bus is injected (Node, tests, headless\nserver use) — publishing goes nowhere and nothing is left open to tear down."
1333
+ "default": "'autopilot'",
1334
+ "description": "The holder id the autopilot claims interactions as."
1335
1335
  },
1336
1336
  {
1337
1337
  "kind": "class",
1338
- "description": "Typed in-process event bus for AI assistant activity events.\n\nDispatches events synchronously to all local subscribers in the same JS module instance\n(i.e. the same browser tab). Events listed in `crossTabEvents` are additionally forwarded\nvia a shared `BroadcastChannel` so that other tabs on the same origin receive them.",
1339
- "name": "AgenticActivityBus",
1338
+ "description": "Autopilot (GENC-1660): a driver decorator that answers the questions a working agent asks the\nuser, on their behalf, grounded in the agent's autopilot config (for bootstrap, the brief).\n\nNeither side calls the other. The working agent asks as it always does; this driver claims the\ninteractions its policy allows, while it is running for that flow, and answers each in one short\nturn on the flow's `AutopilotSession`. It plugs in only through the generic extension points\n— an interaction interceptor, a handler capability and the flow lifecycle — so the core knows\nnothing about it, and it wraps any `AiDriver`.",
1339
+ "name": "AutopilotDriver",
1340
1340
  "members": [
1341
1341
  {
1342
1342
  "kind": "field",
1343
- "name": "subscribers",
1343
+ "name": "agents",
1344
+ "type": {
1345
+ "text": "readonly AgentConfig[]"
1346
+ },
1344
1347
  "privacy": "private",
1345
- "readonly": true,
1346
- "default": "new Map<string, Set<AnyHandler>>()"
1348
+ "readonly": true
1347
1349
  },
1348
1350
  {
1349
1351
  "kind": "field",
1350
- "name": "crossTabEvents",
1352
+ "name": "providerRegistry",
1351
1353
  "type": {
1352
- "text": "Set<string>"
1354
+ "text": "AIProviderRegistry"
1353
1355
  },
1354
1356
  "privacy": "private",
1355
- "readonly": true,
1356
- "default": "new Set(config?.crossTabEvents ?? [])"
1357
+ "readonly": true
1357
1358
  },
1358
1359
  {
1359
1360
  "kind": "field",
1360
- "name": "channelNameFactory",
1361
+ "name": "sessionKey",
1361
1362
  "type": {
1362
- "text": "() => string | undefined"
1363
+ "text": "string"
1363
1364
  },
1364
1365
  "privacy": "private",
1365
1366
  "readonly": true
1366
1367
  },
1367
1368
  {
1368
1369
  "kind": "field",
1369
- "name": "channel",
1370
+ "name": "listeners",
1371
+ "privacy": "private",
1372
+ "readonly": true,
1373
+ "default": "new Set<() => void>()"
1374
+ },
1375
+ {
1376
+ "kind": "field",
1377
+ "name": "sessions",
1378
+ "privacy": "private",
1379
+ "readonly": true,
1380
+ "default": "new Map<string, AutopilotSession>()"
1381
+ },
1382
+ {
1383
+ "kind": "field",
1384
+ "name": "onFor",
1370
1385
  "type": {
1371
- "text": "BroadcastChannel | undefined"
1386
+ "text": "string | null"
1387
+ },
1388
+ "privacy": "private",
1389
+ "default": "null",
1390
+ "description": "The flow the mode applies to: set when it is first switched, cleared when that flow ends."
1391
+ },
1392
+ {
1393
+ "kind": "field",
1394
+ "name": "mode",
1395
+ "type": {
1396
+ "text": "'paused' | 'running'"
1397
+ },
1398
+ "privacy": "private",
1399
+ "default": "'paused'"
1400
+ },
1401
+ {
1402
+ "kind": "field",
1403
+ "name": "pauseState",
1404
+ "type": {
1405
+ "text": "AutopilotHostState['pause'] | undefined"
1372
1406
  },
1373
1407
  "privacy": "private"
1374
1408
  },
1375
1409
  {
1376
1410
  "kind": "field",
1377
- "name": "channelInitialised",
1411
+ "name": "held",
1378
1412
  "type": {
1379
- "text": "boolean"
1413
+ "text": "Held | undefined"
1414
+ },
1415
+ "privacy": "private"
1416
+ },
1417
+ {
1418
+ "kind": "field",
1419
+ "name": "refinements",
1420
+ "type": {
1421
+ "text": "{ key: string; count: number } | undefined"
1380
1422
  },
1381
1423
  "privacy": "private",
1382
- "default": "false"
1424
+ "description": "Written answers given on the current step, for the refinement limit."
1383
1425
  },
1384
1426
  {
1385
- "kind": "method",
1386
- "name": "ensureChannel",
1427
+ "kind": "field",
1428
+ "name": "watchdog",
1429
+ "type": {
1430
+ "text": "ReturnType<typeof setTimeout> | undefined"
1431
+ },
1387
1432
  "privacy": "private",
1388
- "return": {
1389
- "type": {
1390
- "text": "void"
1391
- }
1433
+ "description": "The watchdog's next check, while a claimed interaction is pending."
1434
+ },
1435
+ {
1436
+ "kind": "field",
1437
+ "name": "endedDiagnostics",
1438
+ "type": {
1439
+ "text": "DiagnosticEntry[]"
1392
1440
  },
1393
- "description": "Lazily open the cross-tab `BroadcastChannel` on first use. Deferred (rather than\ncreated in the constructor) so that importing this module, or constructing the bus\noff-browser (Node, tests, headless server), never opens a live channel or reads\n`sessionStorage` — both would keep a Node event loop alive and hang the process.\nCross-tab forwarding is inherently browser-only, so channel creation is gated on a\nbrowser environment; elsewhere the bus stays purely in-process."
1441
+ "privacy": "private",
1442
+ "readonly": true,
1443
+ "default": "[]",
1444
+ "description": "What sessions that have ended did, kept for the debug log."
1445
+ },
1446
+ {
1447
+ "kind": "field",
1448
+ "name": "consecutiveReplies",
1449
+ "type": {
1450
+ "text": "number"
1451
+ },
1452
+ "privacy": "private",
1453
+ "default": "0",
1454
+ "description": "Written answers sent in a row; see `MAX_CONSECUTIVE_REPLIES`."
1455
+ },
1456
+ {
1457
+ "kind": "field",
1458
+ "name": "turnHandBack",
1459
+ "type": {
1460
+ "text": "{ why: string } | undefined"
1461
+ },
1462
+ "privacy": "private",
1463
+ "description": "Set while the turn-level hand-back waits on the person."
1464
+ },
1465
+ {
1466
+ "kind": "field",
1467
+ "name": "restored",
1468
+ "type": {
1469
+ "text": "PersistedAutopilotMode | undefined"
1470
+ },
1471
+ "privacy": "private",
1472
+ "description": "A mode restored with the session, waiting for its flow to become the owner again."
1473
+ },
1474
+ {
1475
+ "kind": "field",
1476
+ "name": "generation",
1477
+ "type": {
1478
+ "text": "number"
1479
+ },
1480
+ "privacy": "private",
1481
+ "default": "0",
1482
+ "description": "Bumped on every pause and resume, and when its sessions end. A written answer is sent only if\nnone came between asking for it and its landing: one started before a pause is stale after it,\neven once resumed."
1483
+ },
1484
+ {
1485
+ "kind": "field",
1486
+ "name": "turnsInFlight",
1487
+ "type": {
1488
+ "text": "number"
1489
+ },
1490
+ "privacy": "private",
1491
+ "default": "0",
1492
+ "description": "Working turns this driver has started that have not ended yet; see `working`."
1493
+ },
1494
+ {
1495
+ "kind": "field",
1496
+ "name": "answersInFlight",
1497
+ "type": {
1498
+ "text": "number"
1499
+ },
1500
+ "privacy": "private",
1501
+ "default": "0",
1502
+ "description": "Written questions being answered right now; see `working`."
1503
+ },
1504
+ {
1505
+ "kind": "field",
1506
+ "name": "state",
1507
+ "type": {
1508
+ "text": "AutopilotHostState"
1509
+ },
1510
+ "readonly": true
1511
+ },
1512
+ {
1513
+ "kind": "field",
1514
+ "name": "copy",
1515
+ "type": {
1516
+ "text": "AutopilotCopy"
1517
+ },
1518
+ "readonly": true
1394
1519
  },
1395
1520
  {
1396
1521
  "kind": "method",
@@ -1402,76 +1527,53 @@
1402
1527
  },
1403
1528
  "parameters": [
1404
1529
  {
1405
- "name": "type",
1406
- "type": {
1407
- "text": "K"
1408
- }
1409
- },
1410
- {
1411
- "name": "handler",
1530
+ "name": "listener",
1412
1531
  "type": {
1413
- "text": "(detail: AgenticActivityEvents[K]) => void"
1532
+ "text": "() => void"
1414
1533
  }
1415
1534
  }
1416
- ],
1417
- "description": "Subscribe to an event. Returns an unsubscribe function — call it in\n`disconnectedCallback` to avoid memory leaks."
1535
+ ]
1418
1536
  },
1419
1537
  {
1420
1538
  "kind": "method",
1421
- "name": "publish",
1539
+ "name": "pause",
1422
1540
  "return": {
1423
1541
  "type": {
1424
1542
  "text": "void"
1425
1543
  }
1426
- },
1427
- "parameters": [
1428
- {
1429
- "name": "type",
1430
- "type": {
1431
- "text": "K"
1432
- }
1433
- },
1434
- {
1435
- "name": "detail",
1436
- "type": {
1437
- "text": "AgenticActivityEvents[K]"
1438
- }
1439
- }
1440
- ],
1441
- "description": "Publish an event to all local subscribers and, if configured, to other tabs\nvia BroadcastChannel."
1544
+ }
1442
1545
  },
1443
1546
  {
1444
1547
  "kind": "method",
1445
- "name": "addCrossTabEvent",
1548
+ "name": "resume",
1446
1549
  "return": {
1447
1550
  "type": {
1448
1551
  "text": "void"
1449
1552
  }
1450
- },
1451
- "parameters": [
1452
- {
1453
- "name": "type",
1454
- "type": {
1455
- "text": "keyof AgenticActivityEvents"
1456
- }
1457
- }
1458
- ],
1459
- "description": "Add an event type to the cross-tab forwarding set at runtime.\nMust be called before the first AgenticActivityBus.publish of that event type."
1553
+ }
1460
1554
  },
1461
1555
  {
1462
1556
  "kind": "method",
1463
- "name": "close",
1557
+ "name": "stop",
1464
1558
  "return": {
1465
1559
  "type": {
1466
1560
  "text": "void"
1467
1561
  }
1562
+ }
1563
+ },
1564
+ {
1565
+ "kind": "method",
1566
+ "name": "getPersistedMode",
1567
+ "return": {
1568
+ "type": {
1569
+ "text": "PersistedAutopilotMode | undefined"
1570
+ }
1468
1571
  },
1469
- "description": "Close the underlying BroadcastChannel. Call once on application teardown if needed."
1572
+ "description": "The mode to save with the session, while it is set for the current flow."
1470
1573
  },
1471
1574
  {
1472
1575
  "kind": "method",
1473
- "name": "notifyLocal",
1474
- "privacy": "private",
1576
+ "name": "restorePersistedMode",
1475
1577
  "return": {
1476
1578
  "type": {
1477
1579
  "text": "void"
@@ -1479,392 +1581,9 @@
1479
1581
  },
1480
1582
  "parameters": [
1481
1583
  {
1482
- "name": "type",
1483
- "type": {
1484
- "text": "string"
1485
- }
1486
- },
1487
- {
1488
- "name": "detail",
1584
+ "name": "saved",
1489
1585
  "type": {
1490
- "text": "unknown"
1491
- }
1492
- }
1493
- ]
1494
- }
1495
- ]
1496
- },
1497
- {
1498
- "kind": "variable",
1499
- "name": "agenticActivityBus",
1500
- "default": "new AgenticActivityBus({\n crossTabEvents: ['halo-start', 'halo-stop', 'tool-loop-start', 'tool-loop-end'],\n // Lazy: the tab-scoped name (and its `sessionStorage` read) is computed on first\n // cross-tab use in a browser, not at module-eval — so importing this module is\n // side-effect-free and Node/test-safe.\n channelNameFactory: () => getTabScopedChannelName('foundation-ai-activity'),\n})",
1501
- "description": "Pre-instantiated singleton event bus for AI assistant activity.\n\n- `halo-start` / `halo-stop` are forwarded via a tab-scoped `BroadcastChannel` so that\n popout windows opened from this tab show halo animations, while remaining isolated from\n unrelated tabs on the same origin (tab-scoped channel name).\n- `tool-loop-start` / `tool-loop-end` are cross-tab for the same reason: they describe the\n assistant's lifecycle (a turn beginning / ending), and the most common subscribers\n (workspace transitions, post-turn deferred recomputation, UI gates tied to the assistant\n being idle) need the event regardless of whether the user is interacting with the chat\n in the main tab or a popout window. Tab-local-only telemetry can subscribe and filter.\n- `chat-popout` / `chat-popin` are in-memory only — they must only affect the tab where the\n user clicked."
1502
- }
1503
- ],
1504
- "exports": [
1505
- {
1506
- "kind": "js",
1507
- "name": "NOOP_ACTIVITY_BUS",
1508
- "declaration": {
1509
- "name": "NOOP_ACTIVITY_BUS",
1510
- "module": "src/channel/ai-activity-bus.ts"
1511
- }
1512
- },
1513
- {
1514
- "kind": "js",
1515
- "name": "AgenticActivityBus",
1516
- "declaration": {
1517
- "name": "AgenticActivityBus",
1518
- "module": "src/channel/ai-activity-bus.ts"
1519
- }
1520
- },
1521
- {
1522
- "kind": "js",
1523
- "name": "agenticActivityBus",
1524
- "declaration": {
1525
- "name": "agenticActivityBus",
1526
- "module": "src/channel/ai-activity-bus.ts"
1527
- }
1528
- }
1529
- ]
1530
- },
1531
- {
1532
- "kind": "javascript-module",
1533
- "path": "src/channel/ai-activity-channel.ts",
1534
- "declarations": [],
1535
- "exports": []
1536
- },
1537
- {
1538
- "kind": "javascript-module",
1539
- "path": "src/channel/autopilot-needs-user.ts",
1540
- "declarations": [
1541
- {
1542
- "kind": "function",
1543
- "name": "setAutopilotNeedsUser",
1544
- "return": {
1545
- "type": {
1546
- "text": "void"
1547
- }
1548
- },
1549
- "parameters": [
1550
- {
1551
- "name": "sessionKey",
1552
- "type": {
1553
- "text": "string"
1554
- }
1555
- },
1556
- {
1557
- "name": "needsUser",
1558
- "type": {
1559
- "text": "boolean"
1560
- }
1561
- }
1562
- ],
1563
- "description": "Set it for one session, announcing `autopilot-needs-user` when it changes."
1564
- },
1565
- {
1566
- "kind": "function",
1567
- "name": "autopilotNeedsUser",
1568
- "return": {
1569
- "type": {
1570
- "text": "boolean"
1571
- }
1572
- },
1573
- "parameters": [
1574
- {
1575
- "name": "sessionKey",
1576
- "optional": true,
1577
- "type": {
1578
- "text": "string"
1579
- }
1580
- }
1581
- ],
1582
- "description": "Whether a session has something waiting on the person — or, without a key (a bubble that cannot\ntell which assistant it holds), whether any session has."
1583
- }
1584
- ],
1585
- "exports": [
1586
- {
1587
- "kind": "js",
1588
- "name": "setAutopilotNeedsUser",
1589
- "declaration": {
1590
- "name": "setAutopilotNeedsUser",
1591
- "module": "src/channel/autopilot-needs-user.ts"
1592
- }
1593
- },
1594
- {
1595
- "kind": "js",
1596
- "name": "autopilotNeedsUser",
1597
- "declaration": {
1598
- "name": "autopilotNeedsUser",
1599
- "module": "src/channel/autopilot-needs-user.ts"
1600
- }
1601
- }
1602
- ]
1603
- },
1604
- {
1605
- "kind": "javascript-module",
1606
- "path": "src/autopilot/autopilot-driver.ts",
1607
- "declarations": [
1608
- {
1609
- "kind": "variable",
1610
- "name": "AUTOPILOT_CLAIMANT",
1611
- "type": {
1612
- "text": "string"
1613
- },
1614
- "default": "'autopilot'",
1615
- "description": "The holder id the autopilot claims interactions as."
1616
- },
1617
- {
1618
- "kind": "class",
1619
- "description": "Autopilot (GENC-1660): a driver decorator that answers the questions a working agent asks the\nuser, on their behalf, grounded in the agent's autopilot config (for bootstrap, the brief).\n\nNeither side calls the other. The working agent asks as it always does; this driver claims the\ninteractions its policy allows, while it is running for that flow, and answers each in one short\nturn on the flow's `AutopilotSession`. It plugs in only through the generic extension points\n— an interaction interceptor, a handler capability and the flow lifecycle — so the core knows\nnothing about it, and it wraps any `AiDriver`.",
1620
- "name": "AutopilotDriver",
1621
- "members": [
1622
- {
1623
- "kind": "field",
1624
- "name": "agents",
1625
- "type": {
1626
- "text": "readonly AgentConfig[]"
1627
- },
1628
- "privacy": "private",
1629
- "readonly": true
1630
- },
1631
- {
1632
- "kind": "field",
1633
- "name": "providerRegistry",
1634
- "type": {
1635
- "text": "AIProviderRegistry"
1636
- },
1637
- "privacy": "private",
1638
- "readonly": true
1639
- },
1640
- {
1641
- "kind": "field",
1642
- "name": "sessionKey",
1643
- "type": {
1644
- "text": "string"
1645
- },
1646
- "privacy": "private",
1647
- "readonly": true
1648
- },
1649
- {
1650
- "kind": "field",
1651
- "name": "listeners",
1652
- "privacy": "private",
1653
- "readonly": true,
1654
- "default": "new Set<() => void>()"
1655
- },
1656
- {
1657
- "kind": "field",
1658
- "name": "sessions",
1659
- "privacy": "private",
1660
- "readonly": true,
1661
- "default": "new Map<string, AutopilotSession>()"
1662
- },
1663
- {
1664
- "kind": "field",
1665
- "name": "onFor",
1666
- "type": {
1667
- "text": "string | null"
1668
- },
1669
- "privacy": "private",
1670
- "default": "null",
1671
- "description": "The flow the mode applies to: set when it is first switched, cleared when that flow ends."
1672
- },
1673
- {
1674
- "kind": "field",
1675
- "name": "mode",
1676
- "type": {
1677
- "text": "'paused' | 'running'"
1678
- },
1679
- "privacy": "private",
1680
- "default": "'paused'"
1681
- },
1682
- {
1683
- "kind": "field",
1684
- "name": "pauseState",
1685
- "type": {
1686
- "text": "AutopilotHostState['pause'] | undefined"
1687
- },
1688
- "privacy": "private"
1689
- },
1690
- {
1691
- "kind": "field",
1692
- "name": "held",
1693
- "type": {
1694
- "text": "Held | undefined"
1695
- },
1696
- "privacy": "private"
1697
- },
1698
- {
1699
- "kind": "field",
1700
- "name": "refinements",
1701
- "type": {
1702
- "text": "{ key: string; count: number } | undefined"
1703
- },
1704
- "privacy": "private",
1705
- "description": "Written answers given on the current step, for the refinement limit."
1706
- },
1707
- {
1708
- "kind": "field",
1709
- "name": "watchdog",
1710
- "type": {
1711
- "text": "ReturnType<typeof setTimeout> | undefined"
1712
- },
1713
- "privacy": "private",
1714
- "description": "The watchdog's next check, while a claimed interaction is pending."
1715
- },
1716
- {
1717
- "kind": "field",
1718
- "name": "endedDiagnostics",
1719
- "type": {
1720
- "text": "DiagnosticEntry[]"
1721
- },
1722
- "privacy": "private",
1723
- "readonly": true,
1724
- "default": "[]",
1725
- "description": "What sessions that have ended did, kept for the debug log."
1726
- },
1727
- {
1728
- "kind": "field",
1729
- "name": "consecutiveReplies",
1730
- "type": {
1731
- "text": "number"
1732
- },
1733
- "privacy": "private",
1734
- "default": "0",
1735
- "description": "Written answers sent in a row; see `MAX_CONSECUTIVE_REPLIES`."
1736
- },
1737
- {
1738
- "kind": "field",
1739
- "name": "turnHandBack",
1740
- "type": {
1741
- "text": "{ why: string } | undefined"
1742
- },
1743
- "privacy": "private",
1744
- "description": "Set while the turn-level hand-back waits on the person."
1745
- },
1746
- {
1747
- "kind": "field",
1748
- "name": "restored",
1749
- "type": {
1750
- "text": "PersistedAutopilotMode | undefined"
1751
- },
1752
- "privacy": "private",
1753
- "description": "A mode restored with the session, waiting for its flow to become the owner again."
1754
- },
1755
- {
1756
- "kind": "field",
1757
- "name": "generation",
1758
- "type": {
1759
- "text": "number"
1760
- },
1761
- "privacy": "private",
1762
- "default": "0",
1763
- "description": "Bumped on every pause and resume, and when its sessions end. A written answer is sent only if\nnone came between asking for it and its landing: one started before a pause is stale after it,\neven once resumed."
1764
- },
1765
- {
1766
- "kind": "field",
1767
- "name": "turnsInFlight",
1768
- "type": {
1769
- "text": "number"
1770
- },
1771
- "privacy": "private",
1772
- "default": "0",
1773
- "description": "Working turns this driver has started that have not ended yet; see `working`."
1774
- },
1775
- {
1776
- "kind": "field",
1777
- "name": "answersInFlight",
1778
- "type": {
1779
- "text": "number"
1780
- },
1781
- "privacy": "private",
1782
- "default": "0",
1783
- "description": "Written questions being answered right now; see `working`."
1784
- },
1785
- {
1786
- "kind": "field",
1787
- "name": "state",
1788
- "type": {
1789
- "text": "AutopilotHostState"
1790
- },
1791
- "readonly": true
1792
- },
1793
- {
1794
- "kind": "field",
1795
- "name": "copy",
1796
- "type": {
1797
- "text": "AutopilotCopy"
1798
- },
1799
- "readonly": true
1800
- },
1801
- {
1802
- "kind": "method",
1803
- "name": "subscribe",
1804
- "return": {
1805
- "type": {
1806
- "text": "() => void"
1807
- }
1808
- },
1809
- "parameters": [
1810
- {
1811
- "name": "listener",
1812
- "type": {
1813
- "text": "() => void"
1814
- }
1815
- }
1816
- ]
1817
- },
1818
- {
1819
- "kind": "method",
1820
- "name": "pause",
1821
- "return": {
1822
- "type": {
1823
- "text": "void"
1824
- }
1825
- }
1826
- },
1827
- {
1828
- "kind": "method",
1829
- "name": "resume",
1830
- "return": {
1831
- "type": {
1832
- "text": "void"
1833
- }
1834
- }
1835
- },
1836
- {
1837
- "kind": "method",
1838
- "name": "stop",
1839
- "return": {
1840
- "type": {
1841
- "text": "void"
1842
- }
1843
- }
1844
- },
1845
- {
1846
- "kind": "method",
1847
- "name": "getPersistedMode",
1848
- "return": {
1849
- "type": {
1850
- "text": "PersistedAutopilotMode | undefined"
1851
- }
1852
- },
1853
- "description": "The mode to save with the session, while it is set for the current flow."
1854
- },
1855
- {
1856
- "kind": "method",
1857
- "name": "restorePersistedMode",
1858
- "return": {
1859
- "type": {
1860
- "text": "void"
1861
- }
1862
- },
1863
- "parameters": [
1864
- {
1865
- "name": "saved",
1866
- "type": {
1867
- "text": "PersistedAutopilotMode | undefined"
1586
+ "text": "PersistedAutopilotMode | undefined"
1868
1587
  }
1869
1588
  }
1870
1589
  ],
@@ -4067,83 +3786,236 @@
4067
3786
  }
4068
3787
  },
4069
3788
  {
4070
- "kind": "js",
4071
- "name": "AutopilotHandBack",
4072
- "declaration": {
4073
- "name": "AutopilotHandBack",
4074
- "module": "./hand-back/hand-back"
4075
- }
4076
- }
4077
- ]
4078
- },
4079
- {
4080
- "kind": "javascript-module",
4081
- "path": "src/config/config.ts",
4082
- "declarations": [
4083
- {
4084
- "kind": "function",
4085
- "name": "defineAgent",
4086
- "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```"
3789
+ "kind": "js",
3790
+ "name": "AutopilotHandBack",
3791
+ "declaration": {
3792
+ "name": "AutopilotHandBack",
3793
+ "module": "./hand-back/hand-back"
3794
+ }
3795
+ }
3796
+ ]
3797
+ },
3798
+ {
3799
+ "kind": "javascript-module",
3800
+ "path": "src/channel/ai-activity-bus.ts",
3801
+ "declarations": [
3802
+ {
3803
+ "kind": "variable",
3804
+ "name": "NOOP_ACTIVITY_BUS",
3805
+ "type": {
3806
+ "text": "ActivityBus"
3807
+ },
3808
+ "default": "{ publish: () => {} }",
3809
+ "description": "No-op ActivityBus. The default when no bus is injected (Node, tests, headless\nserver use) — publishing goes nowhere and nothing is left open to tear down."
3810
+ },
3811
+ {
3812
+ "kind": "class",
3813
+ "description": "Typed in-process event bus for AI assistant activity events.\n\nDispatches events synchronously to all local subscribers in the same JS module instance\n(i.e. the same browser tab). Events listed in `crossTabEvents` are additionally forwarded\nvia a shared `BroadcastChannel` so that other tabs on the same origin receive them.",
3814
+ "name": "AgenticActivityBus",
3815
+ "members": [
3816
+ {
3817
+ "kind": "field",
3818
+ "name": "subscribers",
3819
+ "privacy": "private",
3820
+ "readonly": true,
3821
+ "default": "new Map<string, Set<AnyHandler>>()"
3822
+ },
3823
+ {
3824
+ "kind": "field",
3825
+ "name": "crossTabEvents",
3826
+ "type": {
3827
+ "text": "Set<string>"
3828
+ },
3829
+ "privacy": "private",
3830
+ "readonly": true,
3831
+ "default": "new Set(config?.crossTabEvents ?? [])"
3832
+ },
3833
+ {
3834
+ "kind": "field",
3835
+ "name": "channelNameFactory",
3836
+ "type": {
3837
+ "text": "() => string | undefined"
3838
+ },
3839
+ "privacy": "private",
3840
+ "readonly": true
3841
+ },
3842
+ {
3843
+ "kind": "field",
3844
+ "name": "channel",
3845
+ "type": {
3846
+ "text": "BroadcastChannel | undefined"
3847
+ },
3848
+ "privacy": "private"
3849
+ },
3850
+ {
3851
+ "kind": "field",
3852
+ "name": "channelInitialised",
3853
+ "type": {
3854
+ "text": "boolean"
3855
+ },
3856
+ "privacy": "private",
3857
+ "default": "false"
3858
+ },
3859
+ {
3860
+ "kind": "method",
3861
+ "name": "ensureChannel",
3862
+ "privacy": "private",
3863
+ "return": {
3864
+ "type": {
3865
+ "text": "void"
3866
+ }
3867
+ },
3868
+ "description": "Lazily open the cross-tab `BroadcastChannel` on first use. Deferred (rather than\ncreated in the constructor) so that importing this module, or constructing the bus\noff-browser (Node, tests, headless server), never opens a live channel or reads\n`sessionStorage` — both would keep a Node event loop alive and hang the process.\nCross-tab forwarding is inherently browser-only, so channel creation is gated on a\nbrowser environment; elsewhere the bus stays purely in-process."
3869
+ },
3870
+ {
3871
+ "kind": "method",
3872
+ "name": "subscribe",
3873
+ "return": {
3874
+ "type": {
3875
+ "text": "() => void"
3876
+ }
3877
+ },
3878
+ "parameters": [
3879
+ {
3880
+ "name": "type",
3881
+ "type": {
3882
+ "text": "K"
3883
+ }
3884
+ },
3885
+ {
3886
+ "name": "handler",
3887
+ "type": {
3888
+ "text": "(detail: AgenticActivityEvents[K]) => void"
3889
+ }
3890
+ }
3891
+ ],
3892
+ "description": "Subscribe to an event. Returns an unsubscribe function — call it in\n`disconnectedCallback` to avoid memory leaks."
3893
+ },
3894
+ {
3895
+ "kind": "method",
3896
+ "name": "publish",
3897
+ "return": {
3898
+ "type": {
3899
+ "text": "void"
3900
+ }
3901
+ },
3902
+ "parameters": [
3903
+ {
3904
+ "name": "type",
3905
+ "type": {
3906
+ "text": "K"
3907
+ }
3908
+ },
3909
+ {
3910
+ "name": "detail",
3911
+ "type": {
3912
+ "text": "AgenticActivityEvents[K]"
3913
+ }
3914
+ }
3915
+ ],
3916
+ "description": "Publish an event to all local subscribers and, if configured, to other tabs\nvia BroadcastChannel."
3917
+ },
3918
+ {
3919
+ "kind": "method",
3920
+ "name": "addCrossTabEvent",
3921
+ "return": {
3922
+ "type": {
3923
+ "text": "void"
3924
+ }
3925
+ },
3926
+ "parameters": [
3927
+ {
3928
+ "name": "type",
3929
+ "type": {
3930
+ "text": "keyof AgenticActivityEvents"
3931
+ }
3932
+ }
3933
+ ],
3934
+ "description": "Add an event type to the cross-tab forwarding set at runtime.\nMust be called before the first AgenticActivityBus.publish of that event type."
3935
+ },
3936
+ {
3937
+ "kind": "method",
3938
+ "name": "close",
3939
+ "return": {
3940
+ "type": {
3941
+ "text": "void"
3942
+ }
3943
+ },
3944
+ "description": "Close the underlying BroadcastChannel. Call once on application teardown if needed."
3945
+ },
3946
+ {
3947
+ "kind": "method",
3948
+ "name": "notifyLocal",
3949
+ "privacy": "private",
3950
+ "return": {
3951
+ "type": {
3952
+ "text": "void"
3953
+ }
3954
+ },
3955
+ "parameters": [
3956
+ {
3957
+ "name": "type",
3958
+ "type": {
3959
+ "text": "string"
3960
+ }
3961
+ },
3962
+ {
3963
+ "name": "detail",
3964
+ "type": {
3965
+ "text": "unknown"
3966
+ }
3967
+ }
3968
+ ]
3969
+ }
3970
+ ]
3971
+ },
3972
+ {
3973
+ "kind": "variable",
3974
+ "name": "agenticActivityBus",
3975
+ "default": "new AgenticActivityBus({\n crossTabEvents: ['halo-start', 'halo-stop', 'tool-loop-start', 'tool-loop-end'],\n // Lazy: the tab-scoped name (and its `sessionStorage` read) is computed on first\n // cross-tab use in a browser, not at module-eval — so importing this module is\n // side-effect-free and Node/test-safe.\n channelNameFactory: () => getTabScopedChannelName('foundation-ai-activity'),\n})",
3976
+ "description": "Pre-instantiated singleton event bus for AI assistant activity.\n\n- `halo-start` / `halo-stop` are forwarded via a tab-scoped `BroadcastChannel` so that\n popout windows opened from this tab show halo animations, while remaining isolated from\n unrelated tabs on the same origin (tab-scoped channel name).\n- `tool-loop-start` / `tool-loop-end` are cross-tab for the same reason: they describe the\n assistant's lifecycle (a turn beginning / ending), and the most common subscribers\n (workspace transitions, post-turn deferred recomputation, UI gates tied to the assistant\n being idle) need the event regardless of whether the user is interacting with the chat\n in the main tab or a popout window. Tab-local-only telemetry can subscribe and filter.\n- `chat-popout` / `chat-popin` are in-memory only — they must only affect the tab where the\n user clicked."
4087
3977
  }
4088
3978
  ],
4089
3979
  "exports": [
4090
3980
  {
4091
3981
  "kind": "js",
4092
- "name": "CachePolicy",
4093
- "declaration": {
4094
- "name": "CachePolicy",
4095
- "module": "src/config/config.ts"
4096
- }
4097
- },
4098
- {
4099
- "kind": "js",
4100
- "name": "ChatFallback",
4101
- "declaration": {
4102
- "name": "ChatFallback",
4103
- "module": "src/config/config.ts"
4104
- }
4105
- },
4106
- {
4107
- "kind": "js",
4108
- "name": "ChatInputDuringExecutionMode",
4109
- "declaration": {
4110
- "name": "ChatInputDuringExecutionMode",
4111
- "module": "src/config/config.ts"
4112
- }
4113
- },
4114
- {
4115
- "kind": "js",
4116
- "name": "ChatThinkingPolicy",
3982
+ "name": "NOOP_ACTIVITY_BUS",
4117
3983
  "declaration": {
4118
- "name": "ChatThinkingPolicy",
4119
- "module": "src/config/config.ts"
3984
+ "name": "NOOP_ACTIVITY_BUS",
3985
+ "module": "src/channel/ai-activity-bus.ts"
4120
3986
  }
4121
3987
  },
4122
3988
  {
4123
3989
  "kind": "js",
4124
- "name": "ChatToolChoice",
3990
+ "name": "AgenticActivityBus",
4125
3991
  "declaration": {
4126
- "name": "ChatToolChoice",
4127
- "module": "src/config/config.ts"
3992
+ "name": "AgenticActivityBus",
3993
+ "module": "src/channel/ai-activity-bus.ts"
4128
3994
  }
4129
3995
  },
4130
3996
  {
4131
3997
  "kind": "js",
4132
- "name": "defineAgent",
3998
+ "name": "agenticActivityBus",
4133
3999
  "declaration": {
4134
- "name": "defineAgent",
4135
- "module": "src/config/config.ts"
4000
+ "name": "agenticActivityBus",
4001
+ "module": "src/channel/ai-activity-bus.ts"
4136
4002
  }
4137
4003
  }
4138
4004
  ]
4139
4005
  },
4140
4006
  {
4141
4007
  "kind": "javascript-module",
4142
- "path": "src/config/define-stateful-agent.ts",
4008
+ "path": "src/channel/ai-activity-channel.ts",
4009
+ "declarations": [],
4010
+ "exports": []
4011
+ },
4012
+ {
4013
+ "kind": "javascript-module",
4014
+ "path": "src/channel/autopilot-needs-user.ts",
4143
4015
  "declarations": [
4144
4016
  {
4145
4017
  "kind": "function",
4146
- "name": "restoreMachine",
4018
+ "name": "setAutopilotNeedsUser",
4147
4019
  "return": {
4148
4020
  "type": {
4149
4021
  "text": "void"
@@ -4151,162 +4023,59 @@
4151
4023
  },
4152
4024
  "parameters": [
4153
4025
  {
4154
- "name": "machine",
4155
- "type": {
4156
- "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
4157
- },
4158
- "description": "the machine to restore (already constructed/started)."
4159
- },
4160
- {
4161
- "name": "restored",
4026
+ "name": "sessionKey",
4162
4027
  "type": {
4163
- "text": "unknown"
4164
- },
4165
- "description": "the agent's serialized image (`ctx.restored` in `init`)."
4028
+ "text": "string"
4029
+ }
4166
4030
  },
4167
4031
  {
4168
- "name": "key",
4169
- "default": "'machine'",
4170
- "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
4171
- }
4172
- ],
4173
- "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."
4174
- },
4175
- {
4176
- "kind": "function",
4177
- "name": "defineStatefulAgent",
4178
- "return": {
4179
- "type": {
4180
- "text": "AgentConfig"
4181
- }
4182
- },
4183
- "parameters": [
4184
- {
4185
- "name": "opts",
4032
+ "name": "needsUser",
4186
4033
  "type": {
4187
- "text": "StatefulAgentInit<S>"
4034
+ "text": "boolean"
4188
4035
  }
4189
4036
  }
4190
4037
  ],
4191
- "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."
4038
+ "description": "Set it for one session, announcing `autopilot-needs-user` when it changes."
4192
4039
  },
4193
4040
  {
4194
4041
  "kind": "function",
4195
- "name": "defineAutopilot",
4042
+ "name": "autopilotNeedsUser",
4196
4043
  "return": {
4197
4044
  "type": {
4198
- "text": "AutopilotConfig<S>"
4045
+ "text": "boolean"
4199
4046
  }
4200
4047
  },
4201
4048
  "parameters": [
4202
4049
  {
4203
- "name": "config",
4050
+ "name": "sessionKey",
4051
+ "optional": true,
4204
4052
  "type": {
4205
- "text": "AutopilotConfig<S>"
4053
+ "text": "string"
4206
4054
  }
4207
4055
  }
4208
4056
  ],
4209
- "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."
4210
- }
4211
- ],
4212
- "exports": [
4213
- {
4214
- "kind": "js",
4215
- "name": "restoreMachine",
4216
- "declaration": {
4217
- "name": "restoreMachine",
4218
- "module": "src/config/define-stateful-agent.ts"
4219
- }
4220
- },
4221
- {
4222
- "kind": "js",
4223
- "name": "defineStatefulAgent",
4224
- "declaration": {
4225
- "name": "defineStatefulAgent",
4226
- "module": "src/config/define-stateful-agent.ts"
4227
- }
4228
- },
4229
- {
4230
- "kind": "js",
4231
- "name": "defineAutopilot",
4232
- "declaration": {
4233
- "name": "defineAutopilot",
4234
- "module": "src/config/define-stateful-agent.ts"
4235
- }
4236
- }
4237
- ]
4238
- },
4239
- {
4240
- "kind": "javascript-module",
4241
- "path": "src/config/fallback-agents.ts",
4242
- "declarations": [
4243
- {
4244
- "kind": "variable",
4245
- "name": "friendlyFallbackAgent",
4246
- "type": {
4247
- "text": "FallbackAgentConfig"
4248
- },
4249
- "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}",
4250
- "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."
4251
- },
4252
- {
4253
- "kind": "variable",
4254
- "name": "strictFallbackAgent",
4255
- "type": {
4256
- "text": "FallbackAgentConfig"
4257
- },
4258
- "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}",
4259
- "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."
4260
- }
4261
- ],
4262
- "exports": [
4263
- {
4264
- "kind": "js",
4265
- "name": "friendlyFallbackAgent",
4266
- "declaration": {
4267
- "name": "friendlyFallbackAgent",
4268
- "module": "src/config/fallback-agents.ts"
4269
- }
4270
- },
4271
- {
4272
- "kind": "js",
4273
- "name": "strictFallbackAgent",
4274
- "declaration": {
4275
- "name": "strictFallbackAgent",
4276
- "module": "src/config/fallback-agents.ts"
4277
- }
4057
+ "description": "Whether a session has something waiting on the person — or, without a key (a bubble that cannot\ntell which assistant it holds), whether any session has."
4278
4058
  }
4279
- ]
4280
- },
4281
- {
4282
- "kind": "javascript-module",
4283
- "path": "src/config/index.ts",
4284
- "declarations": [],
4059
+ ],
4285
4060
  "exports": [
4286
4061
  {
4287
4062
  "kind": "js",
4288
- "name": "*",
4063
+ "name": "setAutopilotNeedsUser",
4289
4064
  "declaration": {
4290
- "name": "*",
4291
- "package": "./config"
4065
+ "name": "setAutopilotNeedsUser",
4066
+ "module": "src/channel/autopilot-needs-user.ts"
4292
4067
  }
4293
4068
  },
4294
4069
  {
4295
4070
  "kind": "js",
4296
- "name": "*",
4071
+ "name": "autopilotNeedsUser",
4297
4072
  "declaration": {
4298
- "name": "*",
4299
- "package": "./fallback-agents"
4073
+ "name": "autopilotNeedsUser",
4074
+ "module": "src/channel/autopilot-needs-user.ts"
4300
4075
  }
4301
4076
  }
4302
4077
  ]
4303
4078
  },
4304
- {
4305
- "kind": "javascript-module",
4306
- "path": "src/config/validate-providers.ts",
4307
- "declarations": [],
4308
- "exports": []
4309
- },
4310
4079
  {
4311
4080
  "kind": "javascript-module",
4312
4081
  "path": "src/components/flowing-waves-indicator.ts",
@@ -4831,6 +4600,237 @@
4831
4600
  }
4832
4601
  ]
4833
4602
  },
4603
+ {
4604
+ "kind": "javascript-module",
4605
+ "path": "src/config/config.ts",
4606
+ "declarations": [
4607
+ {
4608
+ "kind": "function",
4609
+ "name": "defineAgent",
4610
+ "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```"
4611
+ }
4612
+ ],
4613
+ "exports": [
4614
+ {
4615
+ "kind": "js",
4616
+ "name": "CachePolicy",
4617
+ "declaration": {
4618
+ "name": "CachePolicy",
4619
+ "module": "src/config/config.ts"
4620
+ }
4621
+ },
4622
+ {
4623
+ "kind": "js",
4624
+ "name": "ChatFallback",
4625
+ "declaration": {
4626
+ "name": "ChatFallback",
4627
+ "module": "src/config/config.ts"
4628
+ }
4629
+ },
4630
+ {
4631
+ "kind": "js",
4632
+ "name": "ChatInputDuringExecutionMode",
4633
+ "declaration": {
4634
+ "name": "ChatInputDuringExecutionMode",
4635
+ "module": "src/config/config.ts"
4636
+ }
4637
+ },
4638
+ {
4639
+ "kind": "js",
4640
+ "name": "ChatThinkingPolicy",
4641
+ "declaration": {
4642
+ "name": "ChatThinkingPolicy",
4643
+ "module": "src/config/config.ts"
4644
+ }
4645
+ },
4646
+ {
4647
+ "kind": "js",
4648
+ "name": "ChatToolChoice",
4649
+ "declaration": {
4650
+ "name": "ChatToolChoice",
4651
+ "module": "src/config/config.ts"
4652
+ }
4653
+ },
4654
+ {
4655
+ "kind": "js",
4656
+ "name": "defineAgent",
4657
+ "declaration": {
4658
+ "name": "defineAgent",
4659
+ "module": "src/config/config.ts"
4660
+ }
4661
+ }
4662
+ ]
4663
+ },
4664
+ {
4665
+ "kind": "javascript-module",
4666
+ "path": "src/config/define-stateful-agent.ts",
4667
+ "declarations": [
4668
+ {
4669
+ "kind": "function",
4670
+ "name": "restoreMachine",
4671
+ "return": {
4672
+ "type": {
4673
+ "text": "void"
4674
+ }
4675
+ },
4676
+ "parameters": [
4677
+ {
4678
+ "name": "machine",
4679
+ "type": {
4680
+ "text": "{ stop: () => void; start: (options?: { state?: unknown }) => void }"
4681
+ },
4682
+ "description": "the machine to restore (already constructed/started)."
4683
+ },
4684
+ {
4685
+ "name": "restored",
4686
+ "type": {
4687
+ "text": "unknown"
4688
+ },
4689
+ "description": "the agent's serialized image (`ctx.restored` in `init`)."
4690
+ },
4691
+ {
4692
+ "name": "key",
4693
+ "default": "'machine'",
4694
+ "description": "the property the machine occupies in the snapshot; defaults to\n`'machine'` to match the conventional `{ machine }` state bag."
4695
+ }
4696
+ ],
4697
+ "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."
4698
+ },
4699
+ {
4700
+ "kind": "function",
4701
+ "name": "defineStatefulAgent",
4702
+ "return": {
4703
+ "type": {
4704
+ "text": "AgentConfig"
4705
+ }
4706
+ },
4707
+ "parameters": [
4708
+ {
4709
+ "name": "opts",
4710
+ "type": {
4711
+ "text": "StatefulAgentInit<S>"
4712
+ }
4713
+ }
4714
+ ],
4715
+ "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."
4716
+ },
4717
+ {
4718
+ "kind": "function",
4719
+ "name": "defineAutopilot",
4720
+ "return": {
4721
+ "type": {
4722
+ "text": "AutopilotConfig<S>"
4723
+ }
4724
+ },
4725
+ "parameters": [
4726
+ {
4727
+ "name": "config",
4728
+ "type": {
4729
+ "text": "AutopilotConfig<S>"
4730
+ }
4731
+ }
4732
+ ],
4733
+ "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."
4734
+ }
4735
+ ],
4736
+ "exports": [
4737
+ {
4738
+ "kind": "js",
4739
+ "name": "restoreMachine",
4740
+ "declaration": {
4741
+ "name": "restoreMachine",
4742
+ "module": "src/config/define-stateful-agent.ts"
4743
+ }
4744
+ },
4745
+ {
4746
+ "kind": "js",
4747
+ "name": "defineStatefulAgent",
4748
+ "declaration": {
4749
+ "name": "defineStatefulAgent",
4750
+ "module": "src/config/define-stateful-agent.ts"
4751
+ }
4752
+ },
4753
+ {
4754
+ "kind": "js",
4755
+ "name": "defineAutopilot",
4756
+ "declaration": {
4757
+ "name": "defineAutopilot",
4758
+ "module": "src/config/define-stateful-agent.ts"
4759
+ }
4760
+ }
4761
+ ]
4762
+ },
4763
+ {
4764
+ "kind": "javascript-module",
4765
+ "path": "src/config/fallback-agents.ts",
4766
+ "declarations": [
4767
+ {
4768
+ "kind": "variable",
4769
+ "name": "friendlyFallbackAgent",
4770
+ "type": {
4771
+ "text": "FallbackAgentConfig"
4772
+ },
4773
+ "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}",
4774
+ "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."
4775
+ },
4776
+ {
4777
+ "kind": "variable",
4778
+ "name": "strictFallbackAgent",
4779
+ "type": {
4780
+ "text": "FallbackAgentConfig"
4781
+ },
4782
+ "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}",
4783
+ "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."
4784
+ }
4785
+ ],
4786
+ "exports": [
4787
+ {
4788
+ "kind": "js",
4789
+ "name": "friendlyFallbackAgent",
4790
+ "declaration": {
4791
+ "name": "friendlyFallbackAgent",
4792
+ "module": "src/config/fallback-agents.ts"
4793
+ }
4794
+ },
4795
+ {
4796
+ "kind": "js",
4797
+ "name": "strictFallbackAgent",
4798
+ "declaration": {
4799
+ "name": "strictFallbackAgent",
4800
+ "module": "src/config/fallback-agents.ts"
4801
+ }
4802
+ }
4803
+ ]
4804
+ },
4805
+ {
4806
+ "kind": "javascript-module",
4807
+ "path": "src/config/index.ts",
4808
+ "declarations": [],
4809
+ "exports": [
4810
+ {
4811
+ "kind": "js",
4812
+ "name": "*",
4813
+ "declaration": {
4814
+ "name": "*",
4815
+ "package": "./config"
4816
+ }
4817
+ },
4818
+ {
4819
+ "kind": "js",
4820
+ "name": "*",
4821
+ "declaration": {
4822
+ "name": "*",
4823
+ "package": "./fallback-agents"
4824
+ }
4825
+ }
4826
+ ]
4827
+ },
4828
+ {
4829
+ "kind": "javascript-module",
4830
+ "path": "src/config/validate-providers.ts",
4831
+ "declarations": [],
4832
+ "exports": []
4833
+ },
4834
4834
  {
4835
4835
  "kind": "javascript-module",
4836
4836
  "path": "src/genesis/calendar.ts",