@genesislcap/ai-assistant 15.85.0 → 15.85.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.
@@ -1410,75 +1410,265 @@
1410
1410
  },
1411
1411
  {
1412
1412
  "kind": "javascript-module",
1413
- "path": "src/channel/ai-activity-bus.ts",
1413
+ "path": "src/autopilot/autopilot-driver.ts",
1414
1414
  "declarations": [
1415
1415
  {
1416
1416
  "kind": "variable",
1417
- "name": "NOOP_ACTIVITY_BUS",
1417
+ "name": "AUTOPILOT_CLAIMANT",
1418
1418
  "type": {
1419
- "text": "ActivityBus"
1419
+ "text": "string"
1420
1420
  },
1421
- "default": "{ publish: () => {} }",
1422
- "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."
1421
+ "default": "'autopilot'",
1422
+ "description": "The holder id the autopilot claims interactions as."
1423
1423
  },
1424
1424
  {
1425
1425
  "kind": "class",
1426
- "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.",
1427
- "name": "AgenticActivityBus",
1426
+ "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`.",
1427
+ "name": "AutopilotDriver",
1428
1428
  "members": [
1429
1429
  {
1430
1430
  "kind": "field",
1431
- "name": "subscribers",
1431
+ "name": "agents",
1432
+ "type": {
1433
+ "text": "readonly AgentConfig[]"
1434
+ },
1432
1435
  "privacy": "private",
1433
- "readonly": true,
1434
- "default": "new Map<string, Set<AnyHandler>>()"
1436
+ "readonly": true
1435
1437
  },
1436
1438
  {
1437
1439
  "kind": "field",
1438
- "name": "crossTabEvents",
1440
+ "name": "providerRegistry",
1439
1441
  "type": {
1440
- "text": "Set<string>"
1442
+ "text": "AIProviderRegistry"
1441
1443
  },
1442
1444
  "privacy": "private",
1443
- "readonly": true,
1444
- "default": "new Set(config?.crossTabEvents ?? [])"
1445
+ "readonly": true
1445
1446
  },
1446
1447
  {
1447
1448
  "kind": "field",
1448
- "name": "channelNameFactory",
1449
+ "name": "sessionKey",
1449
1450
  "type": {
1450
- "text": "() => string | undefined"
1451
+ "text": "string"
1451
1452
  },
1452
1453
  "privacy": "private",
1453
1454
  "readonly": true
1454
1455
  },
1455
1456
  {
1456
1457
  "kind": "field",
1457
- "name": "channel",
1458
+ "name": "activityBus",
1458
1459
  "type": {
1459
- "text": "BroadcastChannel | undefined"
1460
+ "text": "ActivityBus"
1461
+ },
1462
+ "privacy": "private",
1463
+ "readonly": true
1464
+ },
1465
+ {
1466
+ "kind": "field",
1467
+ "name": "listeners",
1468
+ "privacy": "private",
1469
+ "readonly": true,
1470
+ "default": "new Set<() => void>()"
1471
+ },
1472
+ {
1473
+ "kind": "field",
1474
+ "name": "sessions",
1475
+ "privacy": "private",
1476
+ "readonly": true,
1477
+ "default": "new Map<string, AutopilotSession>()"
1478
+ },
1479
+ {
1480
+ "kind": "field",
1481
+ "name": "onFor",
1482
+ "type": {
1483
+ "text": "string | null"
1484
+ },
1485
+ "privacy": "private",
1486
+ "default": "null",
1487
+ "description": "The flow the mode applies to: set when it is first switched, cleared when that flow ends."
1488
+ },
1489
+ {
1490
+ "kind": "field",
1491
+ "name": "mode",
1492
+ "type": {
1493
+ "text": "'paused' | 'running'"
1494
+ },
1495
+ "privacy": "private",
1496
+ "default": "'paused'"
1497
+ },
1498
+ {
1499
+ "kind": "field",
1500
+ "name": "pauseState",
1501
+ "type": {
1502
+ "text": "AutopilotHostState['pause'] | undefined"
1460
1503
  },
1461
1504
  "privacy": "private"
1462
1505
  },
1463
1506
  {
1464
1507
  "kind": "field",
1465
- "name": "channelInitialised",
1508
+ "name": "held",
1509
+ "type": {
1510
+ "text": "Held | undefined"
1511
+ },
1512
+ "privacy": "private"
1513
+ },
1514
+ {
1515
+ "kind": "field",
1516
+ "name": "open",
1517
+ "type": {
1518
+ "text": "InteractionOpened | undefined"
1519
+ },
1520
+ "privacy": "private",
1521
+ "description": "The interaction open right now, whoever holds it: claimed or not, it was offered here first.\n`held` covers only what the autopilot claimed, so this is how the status knows that the working\nagent is parked on a question left with the person (see `waitingOnUser`)."
1522
+ },
1523
+ {
1524
+ "kind": "field",
1525
+ "name": "declinedWhilePaused",
1526
+ "type": {
1527
+ "text": "InteractionOpened | undefined"
1528
+ },
1529
+ "privacy": "private",
1530
+ "description": "The open interaction, when the autopilot declined it only for being paused as it opened: a live\nResume may still take it (see `takeOpenOnResume`). Cleared when it is taken or settles."
1531
+ },
1532
+ {
1533
+ "kind": "field",
1534
+ "name": "refinements",
1535
+ "type": {
1536
+ "text": "{ key: string; count: number } | undefined"
1537
+ },
1538
+ "privacy": "private",
1539
+ "description": "Refining actions taken on the current step (written answers among them), for the limit."
1540
+ },
1541
+ {
1542
+ "kind": "field",
1543
+ "name": "watchdog",
1544
+ "type": {
1545
+ "text": "ReturnType<typeof setTimeout> | undefined"
1546
+ },
1547
+ "privacy": "private",
1548
+ "description": "The watchdog's next check, while a claimed interaction is pending."
1549
+ },
1550
+ {
1551
+ "kind": "field",
1552
+ "name": "endedDiagnostics",
1553
+ "type": {
1554
+ "text": "DiagnosticEntry[]"
1555
+ },
1556
+ "privacy": "private",
1557
+ "readonly": true,
1558
+ "default": "[]",
1559
+ "description": "What sessions that have ended did, kept for the debug log."
1560
+ },
1561
+ {
1562
+ "kind": "field",
1563
+ "name": "consecutiveReplies",
1564
+ "type": {
1565
+ "text": "number"
1566
+ },
1567
+ "privacy": "private",
1568
+ "default": "0",
1569
+ "description": "Written answers sent in a row; see `MAX_CONSECUTIVE_REPLIES`."
1570
+ },
1571
+ {
1572
+ "kind": "field",
1573
+ "name": "turnHandBack",
1574
+ "type": {
1575
+ "text": "{ why: string } | undefined"
1576
+ },
1577
+ "privacy": "private",
1578
+ "description": "Set while the turn-level hand-back waits on the person."
1579
+ },
1580
+ {
1581
+ "kind": "field",
1582
+ "name": "restored",
1583
+ "type": {
1584
+ "text": "PersistedAutopilotMode | undefined"
1585
+ },
1586
+ "privacy": "private",
1587
+ "description": "A mode restored with the session, waiting for its flow to become the owner again."
1588
+ },
1589
+ {
1590
+ "kind": "field",
1591
+ "name": "generation",
1592
+ "type": {
1593
+ "text": "number"
1594
+ },
1595
+ "privacy": "private",
1596
+ "default": "0",
1597
+ "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."
1598
+ },
1599
+ {
1600
+ "kind": "field",
1601
+ "name": "turnsInFlight",
1602
+ "type": {
1603
+ "text": "number"
1604
+ },
1605
+ "privacy": "private",
1606
+ "default": "0",
1607
+ "description": "Working turns this driver has started that have not ended yet; see `working`."
1608
+ },
1609
+ {
1610
+ "kind": "field",
1611
+ "name": "answersInFlight",
1612
+ "type": {
1613
+ "text": "number"
1614
+ },
1615
+ "privacy": "private",
1616
+ "default": "0",
1617
+ "description": "Written questions being answered right now; see `working`."
1618
+ },
1619
+ {
1620
+ "kind": "field",
1621
+ "name": "ranSinceStop",
1466
1622
  "type": {
1467
1623
  "text": "boolean"
1468
1624
  },
1469
1625
  "privacy": "private",
1470
- "default": "false"
1626
+ "default": "false",
1627
+ "description": "Whether the autopilot has been running, and working, since it last stopped or was paused: so\ngoing idle now is a stop to report. Outlives its flow ending, so a turn still running then is\nwaited out. See `watchForStop`."
1628
+ },
1629
+ {
1630
+ "kind": "field",
1631
+ "name": "stopCheck",
1632
+ "type": {
1633
+ "text": "ReturnType<typeof setTimeout> | undefined"
1634
+ },
1635
+ "privacy": "private",
1636
+ "description": "The check that confirms the autopilot stopped, once it looked like it had."
1637
+ },
1638
+ {
1639
+ "kind": "field",
1640
+ "name": "handBackWaits",
1641
+ "privacy": "private",
1642
+ "readonly": true,
1643
+ "default": "new Set<() => void>()",
1644
+ "description": "Stops each wait for a widget left with the person to ask them; see `reportHandBackWhenAsking`."
1645
+ },
1646
+ {
1647
+ "kind": "field",
1648
+ "name": "state",
1649
+ "type": {
1650
+ "text": "AutopilotHostState"
1651
+ },
1652
+ "readonly": true
1471
1653
  },
1472
1654
  {
1473
1655
  "kind": "method",
1474
- "name": "ensureChannel",
1656
+ "name": "waitingOnUser",
1475
1657
  "privacy": "private",
1476
1658
  "return": {
1477
1659
  "type": {
1478
- "text": "void"
1660
+ "text": "boolean"
1479
1661
  }
1480
1662
  },
1481
- "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."
1663
+ "description": "Whether the working agent is parked on a question the person holds, with the autopilot deciding\nnothing: one it never took — its policy keeps it for the person, it is `userOnly` (the turn-level\nhand-back among them), it has no controller, or it opened while paused and no Resume has taken\nit since (a restored mode takes nothing) — or one another interceptor took and then gave to the\nperson. One the autopilot handed back reads `selfPaused`, and one a pause handed over reads\n`paused`; `state` settles both before asking this.\n\nNever one that asks them nothing (see `asksThePerson`): the person holds it, but it is work\nrunning, which settles by itself, so \"waiting for your answer\" would be untrue. A hand-back is\nreported by the same rule (see `reportHandBackWhenAsking`)."
1664
+ },
1665
+ {
1666
+ "kind": "field",
1667
+ "name": "copy",
1668
+ "type": {
1669
+ "text": "AutopilotCopy"
1670
+ },
1671
+ "readonly": true
1482
1672
  },
1483
1673
  {
1484
1674
  "kind": "method",
@@ -1490,47 +1680,72 @@
1490
1680
  },
1491
1681
  "parameters": [
1492
1682
  {
1493
- "name": "type",
1494
- "type": {
1495
- "text": "K"
1496
- }
1497
- },
1498
- {
1499
- "name": "handler",
1683
+ "name": "listener",
1500
1684
  "type": {
1501
- "text": "(detail: AgenticActivityEvents[K]) => void"
1685
+ "text": "() => void"
1502
1686
  }
1503
1687
  }
1504
- ],
1505
- "description": "Subscribe to an event. Returns an unsubscribe function — call it in\n`disconnectedCallback` to avoid memory leaks."
1688
+ ]
1506
1689
  },
1507
1690
  {
1508
1691
  "kind": "method",
1509
- "name": "publish",
1692
+ "name": "pause",
1510
1693
  "return": {
1511
1694
  "type": {
1512
1695
  "text": "void"
1513
1696
  }
1514
- },
1515
- "parameters": [
1516
- {
1517
- "name": "type",
1518
- "type": {
1519
- "text": "K"
1520
- }
1521
- },
1697
+ }
1698
+ },
1699
+ {
1700
+ "kind": "method",
1701
+ "name": "resume",
1702
+ "return": {
1703
+ "type": {
1704
+ "text": "void"
1705
+ }
1706
+ }
1707
+ },
1708
+ {
1709
+ "kind": "method",
1710
+ "name": "stop",
1711
+ "return": {
1712
+ "type": {
1713
+ "text": "void"
1714
+ }
1715
+ }
1716
+ },
1717
+ {
1718
+ "kind": "method",
1719
+ "name": "getPersistedMode",
1720
+ "return": {
1721
+ "type": {
1722
+ "text": "PersistedAutopilotMode | undefined"
1723
+ }
1724
+ },
1725
+ "description": "The mode to save with the session, while it is set for the current flow."
1726
+ },
1727
+ {
1728
+ "kind": "method",
1729
+ "name": "restorePersistedMode",
1730
+ "return": {
1731
+ "type": {
1732
+ "text": "void"
1733
+ }
1734
+ },
1735
+ "parameters": [
1522
1736
  {
1523
- "name": "detail",
1737
+ "name": "saved",
1524
1738
  "type": {
1525
- "text": "AgenticActivityEvents[K]"
1739
+ "text": "PersistedAutopilotMode | undefined"
1526
1740
  }
1527
1741
  }
1528
1742
  ],
1529
- "description": "Publish an event to all local subscribers and, if configured, to other tabs\nvia BroadcastChannel."
1743
+ "description": "Bring back a saved mode. It applies once its flow is the owner again — at once if it already\nis, otherwise when the restored flow re-activates. Restoring starts nothing: the autopilot acts\nonly on live events, such as the working agent's own resume asking a question (§4.10, S3)."
1530
1744
  },
1531
1745
  {
1532
1746
  "kind": "method",
1533
- "name": "addCrossTabEvent",
1747
+ "name": "adoptRestored",
1748
+ "privacy": "private",
1534
1749
  "return": {
1535
1750
  "type": {
1536
1751
  "text": "void"
@@ -1538,589 +1753,93 @@
1538
1753
  },
1539
1754
  "parameters": [
1540
1755
  {
1541
- "name": "type",
1756
+ "name": "owner",
1542
1757
  "type": {
1543
- "text": "keyof AgenticActivityEvents"
1758
+ "text": "string"
1544
1759
  }
1545
1760
  }
1546
- ],
1547
- "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."
1761
+ ]
1548
1762
  },
1549
1763
  {
1550
1764
  "kind": "method",
1551
- "name": "close",
1765
+ "name": "keepPaused",
1552
1766
  "return": {
1553
1767
  "type": {
1554
1768
  "text": "void"
1555
1769
  }
1556
1770
  },
1557
- "description": "Close the underlying BroadcastChannel. Call once on application teardown if needed."
1771
+ "parameters": [
1772
+ {
1773
+ "name": "interactionId",
1774
+ "type": {
1775
+ "text": "string"
1776
+ }
1777
+ }
1778
+ ]
1558
1779
  },
1559
1780
  {
1560
1781
  "kind": "method",
1561
- "name": "notifyLocal",
1562
- "privacy": "private",
1782
+ "name": "sendMessage",
1563
1783
  "return": {
1564
1784
  "type": {
1565
- "text": "void"
1785
+ "text": "Promise<ChatDriverResult>"
1566
1786
  }
1567
1787
  },
1568
1788
  "parameters": [
1569
1789
  {
1570
- "name": "type",
1790
+ "name": "input",
1571
1791
  "type": {
1572
1792
  "text": "string"
1573
1793
  }
1574
1794
  },
1575
1795
  {
1576
- "name": "detail",
1796
+ "name": "attachments",
1797
+ "optional": true,
1577
1798
  "type": {
1578
- "text": "unknown"
1799
+ "text": "ChatAttachment[]"
1800
+ }
1801
+ },
1802
+ {
1803
+ "name": "options",
1804
+ "optional": true,
1805
+ "type": {
1806
+ "text": "SendMessageOptions"
1579
1807
  }
1580
1808
  }
1581
- ]
1582
- }
1583
- ]
1584
- },
1585
- {
1586
- "kind": "variable",
1587
- "name": "agenticActivityBus",
1588
- "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})",
1589
- "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."
1590
- }
1591
- ],
1592
- "exports": [
1593
- {
1594
- "kind": "js",
1595
- "name": "NOOP_ACTIVITY_BUS",
1596
- "declaration": {
1597
- "name": "NOOP_ACTIVITY_BUS",
1598
- "module": "src/channel/ai-activity-bus.ts"
1599
- }
1600
- },
1601
- {
1602
- "kind": "js",
1603
- "name": "AgenticActivityBus",
1604
- "declaration": {
1605
- "name": "AgenticActivityBus",
1606
- "module": "src/channel/ai-activity-bus.ts"
1607
- }
1608
- },
1609
- {
1610
- "kind": "js",
1611
- "name": "agenticActivityBus",
1612
- "declaration": {
1613
- "name": "agenticActivityBus",
1614
- "module": "src/channel/ai-activity-bus.ts"
1615
- }
1616
- }
1617
- ]
1618
- },
1619
- {
1620
- "kind": "javascript-module",
1621
- "path": "src/channel/ai-activity-channel.ts",
1622
- "declarations": [],
1623
- "exports": []
1624
- },
1625
- {
1626
- "kind": "javascript-module",
1627
- "path": "src/channel/autopilot-needs-user.ts",
1628
- "declarations": [
1629
- {
1630
- "kind": "function",
1631
- "name": "setAutopilotNeedsUser",
1632
- "return": {
1633
- "type": {
1634
- "text": "void"
1635
- }
1636
- },
1637
- "parameters": [
1638
- {
1639
- "name": "sessionKey",
1640
- "type": {
1641
- "text": "string"
1809
+ ],
1810
+ "inheritedFrom": {
1811
+ "name": "BaseDriverDecorator",
1812
+ "module": "src/components/ai-driver/base-driver-decorator.ts"
1642
1813
  }
1643
1814
  },
1644
1815
  {
1645
- "name": "needsUser",
1646
- "type": {
1647
- "text": "boolean"
1648
- }
1649
- }
1650
- ],
1651
- "description": "Set it for one session, announcing `autopilot-needs-user` when it changes."
1652
- },
1653
- {
1654
- "kind": "function",
1655
- "name": "autopilotNeedsUser",
1656
- "return": {
1657
- "type": {
1658
- "text": "boolean"
1659
- }
1660
- },
1661
- "parameters": [
1662
- {
1663
- "name": "sessionKey",
1664
- "optional": true,
1665
- "type": {
1666
- "text": "string"
1667
- }
1668
- }
1669
- ],
1670
- "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."
1671
- }
1672
- ],
1673
- "exports": [
1674
- {
1675
- "kind": "js",
1676
- "name": "setAutopilotNeedsUser",
1677
- "declaration": {
1678
- "name": "setAutopilotNeedsUser",
1679
- "module": "src/channel/autopilot-needs-user.ts"
1680
- }
1681
- },
1682
- {
1683
- "kind": "js",
1684
- "name": "autopilotNeedsUser",
1685
- "declaration": {
1686
- "name": "autopilotNeedsUser",
1687
- "module": "src/channel/autopilot-needs-user.ts"
1688
- }
1689
- }
1690
- ]
1691
- },
1692
- {
1693
- "kind": "javascript-module",
1694
- "path": "src/autopilot/autopilot-driver.ts",
1695
- "declarations": [
1696
- {
1697
- "kind": "variable",
1698
- "name": "AUTOPILOT_CLAIMANT",
1699
- "type": {
1700
- "text": "string"
1701
- },
1702
- "default": "'autopilot'",
1703
- "description": "The holder id the autopilot claims interactions as."
1704
- },
1705
- {
1706
- "kind": "class",
1707
- "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`.",
1708
- "name": "AutopilotDriver",
1709
- "members": [
1710
- {
1711
- "kind": "field",
1712
- "name": "agents",
1713
- "type": {
1714
- "text": "readonly AgentConfig[]"
1816
+ "kind": "method",
1817
+ "name": "continueFromHistory",
1818
+ "return": {
1819
+ "type": {
1820
+ "text": "Promise<ChatDriverResult>"
1821
+ }
1715
1822
  },
1716
- "privacy": "private",
1717
- "readonly": true
1718
- },
1719
- {
1720
- "kind": "field",
1721
- "name": "providerRegistry",
1722
- "type": {
1723
- "text": "AIProviderRegistry"
1724
- },
1725
- "privacy": "private",
1726
- "readonly": true
1727
- },
1728
- {
1729
- "kind": "field",
1730
- "name": "sessionKey",
1731
- "type": {
1732
- "text": "string"
1733
- },
1734
- "privacy": "private",
1735
- "readonly": true
1736
- },
1737
- {
1738
- "kind": "field",
1739
- "name": "activityBus",
1740
- "type": {
1741
- "text": "ActivityBus"
1742
- },
1743
- "privacy": "private",
1744
- "readonly": true
1745
- },
1746
- {
1747
- "kind": "field",
1748
- "name": "listeners",
1749
- "privacy": "private",
1750
- "readonly": true,
1751
- "default": "new Set<() => void>()"
1752
- },
1753
- {
1754
- "kind": "field",
1755
- "name": "sessions",
1756
- "privacy": "private",
1757
- "readonly": true,
1758
- "default": "new Map<string, AutopilotSession>()"
1759
- },
1760
- {
1761
- "kind": "field",
1762
- "name": "onFor",
1763
- "type": {
1764
- "text": "string | null"
1765
- },
1766
- "privacy": "private",
1767
- "default": "null",
1768
- "description": "The flow the mode applies to: set when it is first switched, cleared when that flow ends."
1769
- },
1770
- {
1771
- "kind": "field",
1772
- "name": "mode",
1773
- "type": {
1774
- "text": "'paused' | 'running'"
1775
- },
1776
- "privacy": "private",
1777
- "default": "'paused'"
1778
- },
1779
- {
1780
- "kind": "field",
1781
- "name": "pauseState",
1782
- "type": {
1783
- "text": "AutopilotHostState['pause'] | undefined"
1784
- },
1785
- "privacy": "private"
1786
- },
1787
- {
1788
- "kind": "field",
1789
- "name": "held",
1790
- "type": {
1791
- "text": "Held | undefined"
1792
- },
1793
- "privacy": "private"
1794
- },
1795
- {
1796
- "kind": "field",
1797
- "name": "open",
1798
- "type": {
1799
- "text": "InteractionOpened | undefined"
1800
- },
1801
- "privacy": "private",
1802
- "description": "The interaction open right now, whoever holds it: claimed or not, it was offered here first.\n`held` covers only what the autopilot claimed, so this is how the status knows that the working\nagent is parked on a question left with the person (see `waitingOnUser`)."
1803
- },
1804
- {
1805
- "kind": "field",
1806
- "name": "declinedWhilePaused",
1807
- "type": {
1808
- "text": "InteractionOpened | undefined"
1809
- },
1810
- "privacy": "private",
1811
- "description": "The open interaction, when the autopilot declined it only for being paused as it opened: a live\nResume may still take it (see `takeOpenOnResume`). Cleared when it is taken or settles."
1812
- },
1813
- {
1814
- "kind": "field",
1815
- "name": "refinements",
1816
- "type": {
1817
- "text": "{ key: string; count: number } | undefined"
1818
- },
1819
- "privacy": "private",
1820
- "description": "Refining actions taken on the current step (written answers among them), for the limit."
1821
- },
1822
- {
1823
- "kind": "field",
1824
- "name": "watchdog",
1825
- "type": {
1826
- "text": "ReturnType<typeof setTimeout> | undefined"
1827
- },
1828
- "privacy": "private",
1829
- "description": "The watchdog's next check, while a claimed interaction is pending."
1830
- },
1831
- {
1832
- "kind": "field",
1833
- "name": "endedDiagnostics",
1834
- "type": {
1835
- "text": "DiagnosticEntry[]"
1836
- },
1837
- "privacy": "private",
1838
- "readonly": true,
1839
- "default": "[]",
1840
- "description": "What sessions that have ended did, kept for the debug log."
1841
- },
1842
- {
1843
- "kind": "field",
1844
- "name": "consecutiveReplies",
1845
- "type": {
1846
- "text": "number"
1847
- },
1848
- "privacy": "private",
1849
- "default": "0",
1850
- "description": "Written answers sent in a row; see `MAX_CONSECUTIVE_REPLIES`."
1851
- },
1852
- {
1853
- "kind": "field",
1854
- "name": "turnHandBack",
1855
- "type": {
1856
- "text": "{ why: string } | undefined"
1857
- },
1858
- "privacy": "private",
1859
- "description": "Set while the turn-level hand-back waits on the person."
1860
- },
1861
- {
1862
- "kind": "field",
1863
- "name": "restored",
1864
- "type": {
1865
- "text": "PersistedAutopilotMode | undefined"
1866
- },
1867
- "privacy": "private",
1868
- "description": "A mode restored with the session, waiting for its flow to become the owner again."
1869
- },
1870
- {
1871
- "kind": "field",
1872
- "name": "generation",
1873
- "type": {
1874
- "text": "number"
1875
- },
1876
- "privacy": "private",
1877
- "default": "0",
1878
- "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."
1879
- },
1880
- {
1881
- "kind": "field",
1882
- "name": "turnsInFlight",
1883
- "type": {
1884
- "text": "number"
1885
- },
1886
- "privacy": "private",
1887
- "default": "0",
1888
- "description": "Working turns this driver has started that have not ended yet; see `working`."
1889
- },
1890
- {
1891
- "kind": "field",
1892
- "name": "answersInFlight",
1893
- "type": {
1894
- "text": "number"
1895
- },
1896
- "privacy": "private",
1897
- "default": "0",
1898
- "description": "Written questions being answered right now; see `working`."
1899
- },
1900
- {
1901
- "kind": "field",
1902
- "name": "ranSinceStop",
1903
- "type": {
1904
- "text": "boolean"
1905
- },
1906
- "privacy": "private",
1907
- "default": "false",
1908
- "description": "Whether the autopilot has been running, and working, since it last stopped or was paused: so\ngoing idle now is a stop to report. Outlives its flow ending, so a turn still running then is\nwaited out. See `watchForStop`."
1909
- },
1910
- {
1911
- "kind": "field",
1912
- "name": "stopCheck",
1913
- "type": {
1914
- "text": "ReturnType<typeof setTimeout> | undefined"
1915
- },
1916
- "privacy": "private",
1917
- "description": "The check that confirms the autopilot stopped, once it looked like it had."
1918
- },
1919
- {
1920
- "kind": "field",
1921
- "name": "handBackWaits",
1922
- "privacy": "private",
1923
- "readonly": true,
1924
- "default": "new Set<() => void>()",
1925
- "description": "Stops each wait for a widget left with the person to ask them; see `reportHandBackWhenAsking`."
1926
- },
1927
- {
1928
- "kind": "field",
1929
- "name": "state",
1930
- "type": {
1931
- "text": "AutopilotHostState"
1932
- },
1933
- "readonly": true
1934
- },
1935
- {
1936
- "kind": "method",
1937
- "name": "waitingOnUser",
1938
- "privacy": "private",
1939
- "return": {
1940
- "type": {
1941
- "text": "boolean"
1942
- }
1943
- },
1944
- "description": "Whether the working agent is parked on a question the person holds, with the autopilot deciding\nnothing: one it never took — its policy keeps it for the person, it is `userOnly` (the turn-level\nhand-back among them), it has no controller, or it opened while paused and no Resume has taken\nit since (a restored mode takes nothing) — or one another interceptor took and then gave to the\nperson. One the autopilot handed back reads `selfPaused`, and one a pause handed over reads\n`paused`; `state` settles both before asking this.\n\nNever one that asks them nothing (see `asksThePerson`): the person holds it, but it is work\nrunning, which settles by itself, so \"waiting for your answer\" would be untrue. A hand-back is\nreported by the same rule (see `reportHandBackWhenAsking`)."
1945
- },
1946
- {
1947
- "kind": "field",
1948
- "name": "copy",
1949
- "type": {
1950
- "text": "AutopilotCopy"
1951
- },
1952
- "readonly": true
1953
- },
1954
- {
1955
- "kind": "method",
1956
- "name": "subscribe",
1957
- "return": {
1958
- "type": {
1959
- "text": "() => void"
1960
- }
1961
- },
1962
- "parameters": [
1963
- {
1964
- "name": "listener",
1965
- "type": {
1966
- "text": "() => void"
1967
- }
1968
- }
1969
- ]
1970
- },
1971
- {
1972
- "kind": "method",
1973
- "name": "pause",
1974
- "return": {
1975
- "type": {
1976
- "text": "void"
1977
- }
1978
- }
1979
- },
1980
- {
1981
- "kind": "method",
1982
- "name": "resume",
1983
- "return": {
1984
- "type": {
1985
- "text": "void"
1986
- }
1987
- }
1988
- },
1989
- {
1990
- "kind": "method",
1991
- "name": "stop",
1992
- "return": {
1993
- "type": {
1994
- "text": "void"
1995
- }
1996
- }
1997
- },
1998
- {
1999
- "kind": "method",
2000
- "name": "getPersistedMode",
2001
- "return": {
2002
- "type": {
2003
- "text": "PersistedAutopilotMode | undefined"
2004
- }
2005
- },
2006
- "description": "The mode to save with the session, while it is set for the current flow."
2007
- },
2008
- {
2009
- "kind": "method",
2010
- "name": "restorePersistedMode",
2011
- "return": {
2012
- "type": {
2013
- "text": "void"
2014
- }
2015
- },
2016
- "parameters": [
2017
- {
2018
- "name": "saved",
2019
- "type": {
2020
- "text": "PersistedAutopilotMode | undefined"
2021
- }
2022
- }
2023
- ],
2024
- "description": "Bring back a saved mode. It applies once its flow is the owner again — at once if it already\nis, otherwise when the restored flow re-activates. Restoring starts nothing: the autopilot acts\nonly on live events, such as the working agent's own resume asking a question (§4.10, S3)."
2025
- },
2026
- {
2027
- "kind": "method",
2028
- "name": "adoptRestored",
2029
- "privacy": "private",
2030
- "return": {
2031
- "type": {
2032
- "text": "void"
2033
- }
2034
- },
2035
- "parameters": [
2036
- {
2037
- "name": "owner",
2038
- "type": {
2039
- "text": "string"
2040
- }
2041
- }
2042
- ]
2043
- },
2044
- {
2045
- "kind": "method",
2046
- "name": "keepPaused",
2047
- "return": {
2048
- "type": {
2049
- "text": "void"
2050
- }
2051
- },
2052
- "parameters": [
2053
- {
2054
- "name": "interactionId",
2055
- "type": {
2056
- "text": "string"
2057
- }
2058
- }
2059
- ]
2060
- },
2061
- {
2062
- "kind": "method",
2063
- "name": "sendMessage",
2064
- "return": {
2065
- "type": {
2066
- "text": "Promise<ChatDriverResult>"
2067
- }
2068
- },
2069
- "parameters": [
2070
- {
2071
- "name": "input",
2072
- "type": {
2073
- "text": "string"
2074
- }
2075
- },
2076
- {
2077
- "name": "attachments",
2078
- "optional": true,
2079
- "type": {
2080
- "text": "ChatAttachment[]"
2081
- }
2082
- },
2083
- {
2084
- "name": "options",
2085
- "optional": true,
2086
- "type": {
2087
- "text": "SendMessageOptions"
2088
- }
2089
- }
2090
- ],
2091
- "inheritedFrom": {
2092
- "name": "BaseDriverDecorator",
2093
- "module": "src/components/ai-driver/base-driver-decorator.ts"
2094
- }
2095
- },
2096
- {
2097
- "kind": "method",
2098
- "name": "continueFromHistory",
2099
- "return": {
2100
- "type": {
2101
- "text": "Promise<ChatDriverResult>"
2102
- }
2103
- },
2104
- "parameters": [
2105
- {
2106
- "name": "transientPrimer",
2107
- "optional": true,
2108
- "type": {
2109
- "text": "ChatMessage[]"
2110
- }
2111
- },
2112
- {
2113
- "name": "options",
2114
- "optional": true,
2115
- "type": {
2116
- "text": "ContinueFromHistoryOptions"
2117
- }
2118
- }
2119
- ],
2120
- "inheritedFrom": {
2121
- "name": "BaseDriverDecorator",
2122
- "module": "src/components/ai-driver/base-driver-decorator.ts"
2123
- }
1823
+ "parameters": [
1824
+ {
1825
+ "name": "transientPrimer",
1826
+ "optional": true,
1827
+ "type": {
1828
+ "text": "ChatMessage[]"
1829
+ }
1830
+ },
1831
+ {
1832
+ "name": "options",
1833
+ "optional": true,
1834
+ "type": {
1835
+ "text": "ContinueFromHistoryOptions"
1836
+ }
1837
+ }
1838
+ ],
1839
+ "inheritedFrom": {
1840
+ "name": "BaseDriverDecorator",
1841
+ "module": "src/components/ai-driver/base-driver-decorator.ts"
1842
+ }
2124
1843
  },
2125
1844
  {
2126
1845
  "kind": "method",
@@ -4861,83 +4580,364 @@
4861
4580
  }
4862
4581
  },
4863
4582
  {
4864
- "kind": "js",
4865
- "name": "type",
4866
- "declaration": {
4867
- "name": "type",
4868
- "module": "./widget-tools"
4869
- }
4583
+ "kind": "js",
4584
+ "name": "type",
4585
+ "declaration": {
4586
+ "name": "type",
4587
+ "module": "./widget-tools"
4588
+ }
4589
+ },
4590
+ {
4591
+ "kind": "js",
4592
+ "name": "WidgetTools",
4593
+ "declaration": {
4594
+ "name": "WidgetTools",
4595
+ "module": "./widget-tools"
4596
+ }
4597
+ },
4598
+ {
4599
+ "kind": "js",
4600
+ "name": "type",
4601
+ "declaration": {
4602
+ "name": "type",
4603
+ "module": "./widget-tools"
4604
+ }
4605
+ },
4606
+ {
4607
+ "kind": "js",
4608
+ "name": "WidgetToolSpec",
4609
+ "declaration": {
4610
+ "name": "WidgetToolSpec",
4611
+ "module": "./widget-tools"
4612
+ }
4613
+ },
4614
+ {
4615
+ "kind": "js",
4616
+ "name": "AutopilotHandBack",
4617
+ "declaration": {
4618
+ "name": "AutopilotHandBack",
4619
+ "module": "./hand-back/hand-back"
4620
+ }
4621
+ }
4622
+ ]
4623
+ },
4624
+ {
4625
+ "kind": "javascript-module",
4626
+ "path": "src/autopilot/widget-tools.ts",
4627
+ "declarations": [
4628
+ {
4629
+ "kind": "function",
4630
+ "name": "widgetTools",
4631
+ "return": {
4632
+ "type": {
4633
+ "text": "WidgetTools"
4634
+ }
4635
+ },
4636
+ "parameters": [
4637
+ {
4638
+ "name": "componentName",
4639
+ "type": {
4640
+ "text": "string"
4641
+ }
4642
+ },
4643
+ {
4644
+ "name": "tools",
4645
+ "type": {
4646
+ "text": "{ [K in keyof TArgs]: WidgetToolSpec<TController, TArgs[K]> }"
4647
+ }
4648
+ }
4649
+ ],
4650
+ "description": "Declare tools that read from one widget type (GENC-1660): parameterised reads that a view cannot\nexpress, such as one table's rows, or a page of them.\n\nPut them on the autopilot (`defineAutopilot({ widgetTools: [...] })`), never discovered from the\nregistration. Its tool list is fixed when its session starts, sorted by name, and identical for\nevery decision, so the cache never breaks. Each call is routed to the interaction of\n`componentName` the autopilot is deciding, and `run` gets its controller; with none open, it is\nrefused with a reason. While one is open, the autopilot's tail says which tools are usable now.\n\nReads only. Their results leave the autopilot's history at the end of the decision, as\n`widget_read`'s do."
4651
+ }
4652
+ ],
4653
+ "exports": [
4654
+ {
4655
+ "kind": "js",
4656
+ "name": "widgetTools",
4657
+ "declaration": {
4658
+ "name": "widgetTools",
4659
+ "module": "src/autopilot/widget-tools.ts"
4660
+ }
4661
+ }
4662
+ ]
4663
+ },
4664
+ {
4665
+ "kind": "javascript-module",
4666
+ "path": "src/channel/ai-activity-bus.ts",
4667
+ "declarations": [
4668
+ {
4669
+ "kind": "variable",
4670
+ "name": "NOOP_ACTIVITY_BUS",
4671
+ "type": {
4672
+ "text": "ActivityBus"
4673
+ },
4674
+ "default": "{ publish: () => {} }",
4675
+ "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."
4676
+ },
4677
+ {
4678
+ "kind": "class",
4679
+ "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.",
4680
+ "name": "AgenticActivityBus",
4681
+ "members": [
4682
+ {
4683
+ "kind": "field",
4684
+ "name": "subscribers",
4685
+ "privacy": "private",
4686
+ "readonly": true,
4687
+ "default": "new Map<string, Set<AnyHandler>>()"
4688
+ },
4689
+ {
4690
+ "kind": "field",
4691
+ "name": "crossTabEvents",
4692
+ "type": {
4693
+ "text": "Set<string>"
4694
+ },
4695
+ "privacy": "private",
4696
+ "readonly": true,
4697
+ "default": "new Set(config?.crossTabEvents ?? [])"
4698
+ },
4699
+ {
4700
+ "kind": "field",
4701
+ "name": "channelNameFactory",
4702
+ "type": {
4703
+ "text": "() => string | undefined"
4704
+ },
4705
+ "privacy": "private",
4706
+ "readonly": true
4707
+ },
4708
+ {
4709
+ "kind": "field",
4710
+ "name": "channel",
4711
+ "type": {
4712
+ "text": "BroadcastChannel | undefined"
4713
+ },
4714
+ "privacy": "private"
4715
+ },
4716
+ {
4717
+ "kind": "field",
4718
+ "name": "channelInitialised",
4719
+ "type": {
4720
+ "text": "boolean"
4721
+ },
4722
+ "privacy": "private",
4723
+ "default": "false"
4724
+ },
4725
+ {
4726
+ "kind": "method",
4727
+ "name": "ensureChannel",
4728
+ "privacy": "private",
4729
+ "return": {
4730
+ "type": {
4731
+ "text": "void"
4732
+ }
4733
+ },
4734
+ "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."
4735
+ },
4736
+ {
4737
+ "kind": "method",
4738
+ "name": "subscribe",
4739
+ "return": {
4740
+ "type": {
4741
+ "text": "() => void"
4742
+ }
4743
+ },
4744
+ "parameters": [
4745
+ {
4746
+ "name": "type",
4747
+ "type": {
4748
+ "text": "K"
4749
+ }
4750
+ },
4751
+ {
4752
+ "name": "handler",
4753
+ "type": {
4754
+ "text": "(detail: AgenticActivityEvents[K]) => void"
4755
+ }
4756
+ }
4757
+ ],
4758
+ "description": "Subscribe to an event. Returns an unsubscribe function — call it in\n`disconnectedCallback` to avoid memory leaks."
4759
+ },
4760
+ {
4761
+ "kind": "method",
4762
+ "name": "publish",
4763
+ "return": {
4764
+ "type": {
4765
+ "text": "void"
4766
+ }
4767
+ },
4768
+ "parameters": [
4769
+ {
4770
+ "name": "type",
4771
+ "type": {
4772
+ "text": "K"
4773
+ }
4774
+ },
4775
+ {
4776
+ "name": "detail",
4777
+ "type": {
4778
+ "text": "AgenticActivityEvents[K]"
4779
+ }
4780
+ }
4781
+ ],
4782
+ "description": "Publish an event to all local subscribers and, if configured, to other tabs\nvia BroadcastChannel."
4783
+ },
4784
+ {
4785
+ "kind": "method",
4786
+ "name": "addCrossTabEvent",
4787
+ "return": {
4788
+ "type": {
4789
+ "text": "void"
4790
+ }
4791
+ },
4792
+ "parameters": [
4793
+ {
4794
+ "name": "type",
4795
+ "type": {
4796
+ "text": "keyof AgenticActivityEvents"
4797
+ }
4798
+ }
4799
+ ],
4800
+ "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."
4801
+ },
4802
+ {
4803
+ "kind": "method",
4804
+ "name": "close",
4805
+ "return": {
4806
+ "type": {
4807
+ "text": "void"
4808
+ }
4809
+ },
4810
+ "description": "Close the underlying BroadcastChannel. Call once on application teardown if needed."
4811
+ },
4812
+ {
4813
+ "kind": "method",
4814
+ "name": "notifyLocal",
4815
+ "privacy": "private",
4816
+ "return": {
4817
+ "type": {
4818
+ "text": "void"
4819
+ }
4820
+ },
4821
+ "parameters": [
4822
+ {
4823
+ "name": "type",
4824
+ "type": {
4825
+ "text": "string"
4826
+ }
4827
+ },
4828
+ {
4829
+ "name": "detail",
4830
+ "type": {
4831
+ "text": "unknown"
4832
+ }
4833
+ }
4834
+ ]
4835
+ }
4836
+ ]
4870
4837
  },
4871
4838
  {
4872
- "kind": "js",
4873
- "name": "WidgetTools",
4874
- "declaration": {
4875
- "name": "WidgetTools",
4876
- "module": "./widget-tools"
4877
- }
4878
- },
4839
+ "kind": "variable",
4840
+ "name": "agenticActivityBus",
4841
+ "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})",
4842
+ "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."
4843
+ }
4844
+ ],
4845
+ "exports": [
4879
4846
  {
4880
4847
  "kind": "js",
4881
- "name": "type",
4848
+ "name": "NOOP_ACTIVITY_BUS",
4882
4849
  "declaration": {
4883
- "name": "type",
4884
- "module": "./widget-tools"
4850
+ "name": "NOOP_ACTIVITY_BUS",
4851
+ "module": "src/channel/ai-activity-bus.ts"
4885
4852
  }
4886
4853
  },
4887
4854
  {
4888
4855
  "kind": "js",
4889
- "name": "WidgetToolSpec",
4856
+ "name": "AgenticActivityBus",
4890
4857
  "declaration": {
4891
- "name": "WidgetToolSpec",
4892
- "module": "./widget-tools"
4858
+ "name": "AgenticActivityBus",
4859
+ "module": "src/channel/ai-activity-bus.ts"
4893
4860
  }
4894
4861
  },
4895
4862
  {
4896
4863
  "kind": "js",
4897
- "name": "AutopilotHandBack",
4864
+ "name": "agenticActivityBus",
4898
4865
  "declaration": {
4899
- "name": "AutopilotHandBack",
4900
- "module": "./hand-back/hand-back"
4866
+ "name": "agenticActivityBus",
4867
+ "module": "src/channel/ai-activity-bus.ts"
4901
4868
  }
4902
4869
  }
4903
4870
  ]
4904
4871
  },
4905
4872
  {
4906
4873
  "kind": "javascript-module",
4907
- "path": "src/autopilot/widget-tools.ts",
4874
+ "path": "src/channel/ai-activity-channel.ts",
4875
+ "declarations": [],
4876
+ "exports": []
4877
+ },
4878
+ {
4879
+ "kind": "javascript-module",
4880
+ "path": "src/channel/autopilot-needs-user.ts",
4908
4881
  "declarations": [
4909
4882
  {
4910
4883
  "kind": "function",
4911
- "name": "widgetTools",
4884
+ "name": "setAutopilotNeedsUser",
4912
4885
  "return": {
4913
4886
  "type": {
4914
- "text": "WidgetTools"
4887
+ "text": "void"
4915
4888
  }
4916
4889
  },
4917
4890
  "parameters": [
4918
4891
  {
4919
- "name": "componentName",
4892
+ "name": "sessionKey",
4920
4893
  "type": {
4921
4894
  "text": "string"
4922
4895
  }
4923
4896
  },
4924
4897
  {
4925
- "name": "tools",
4898
+ "name": "needsUser",
4926
4899
  "type": {
4927
- "text": "{ [K in keyof TArgs]: WidgetToolSpec<TController, TArgs[K]> }"
4900
+ "text": "boolean"
4928
4901
  }
4929
4902
  }
4930
4903
  ],
4931
- "description": "Declare tools that read from one widget type (GENC-1660): parameterised reads that a view cannot\nexpress, such as one table's rows, or a page of them.\n\nPut them on the autopilot (`defineAutopilot({ widgetTools: [...] })`), never discovered from the\nregistration. Its tool list is fixed when its session starts, sorted by name, and identical for\nevery decision, so the cache never breaks. Each call is routed to the interaction of\n`componentName` the autopilot is deciding, and `run` gets its controller; with none open, it is\nrefused with a reason. While one is open, the autopilot's tail says which tools are usable now.\n\nReads only. Their results leave the autopilot's history at the end of the decision, as\n`widget_read`'s do."
4904
+ "description": "Set it for one session, announcing `autopilot-needs-user` when it changes."
4905
+ },
4906
+ {
4907
+ "kind": "function",
4908
+ "name": "autopilotNeedsUser",
4909
+ "return": {
4910
+ "type": {
4911
+ "text": "boolean"
4912
+ }
4913
+ },
4914
+ "parameters": [
4915
+ {
4916
+ "name": "sessionKey",
4917
+ "optional": true,
4918
+ "type": {
4919
+ "text": "string"
4920
+ }
4921
+ }
4922
+ ],
4923
+ "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."
4932
4924
  }
4933
4925
  ],
4934
4926
  "exports": [
4935
4927
  {
4936
4928
  "kind": "js",
4937
- "name": "widgetTools",
4929
+ "name": "setAutopilotNeedsUser",
4938
4930
  "declaration": {
4939
- "name": "widgetTools",
4940
- "module": "src/autopilot/widget-tools.ts"
4931
+ "name": "setAutopilotNeedsUser",
4932
+ "module": "src/channel/autopilot-needs-user.ts"
4933
+ }
4934
+ },
4935
+ {
4936
+ "kind": "js",
4937
+ "name": "autopilotNeedsUser",
4938
+ "declaration": {
4939
+ "name": "autopilotNeedsUser",
4940
+ "module": "src/channel/autopilot-needs-user.ts"
4941
4941
  }
4942
4942
  }
4943
4943
  ]
@@ -23196,7 +23196,7 @@
23196
23196
  }
23197
23197
  }
23198
23198
  ],
23199
- "description": "Act on what the agent call that just ended asked for, and run the next agent in the same user\nturn while there is one (GENC-1737): a `handOff` runs its target with the brief, and a target\nthat releases hands back to its caller. Returns the last call's result.\n\nA failed call ends the turn there, as a Stop does: what it asked for still happens, and the\nnext agent runs on the next message. Running it now would meet the same wall (a budget, a\nrefused account, a full context window), or build on a reply that never came."
23199
+ "description": "Act on what the agent call that just ended asked for, and run the next agent in the same user\nturn while there is one (GENC-1737): a `handOff` runs its target with the brief, and a target\nthat releases hands back to its caller. Returns the last call's result.\n\nA failed call ends the turn there, as a Stop does: what it asked for still happens, and the\nnext agent runs on the next message. Running it now would meet the same wall (a budget, a\nrefused account, a full context window), or build on a reply that never came. The one thing a\nStop takes back is a hand-off that has not started (see `afterAgentCall`)."
23200
23200
  },
23201
23201
  {
23202
23202
  "kind": "method",
@@ -23207,7 +23207,7 @@
23207
23207
  "text": "Promise<string | undefined>"
23208
23208
  }
23209
23209
  },
23210
- "description": "After one agent call: start the hand-off it asked for, or release it and, when it was a\nhand-off's target, hand back. Returns the tail note for the agent to run next, or `undefined`\nwhen the turn ends here.\n\nA plain target hands back when its call ends, released or not, as a plain agent is done once\nit has answered. A stateful one holds the hand-off until it releases, as it holds its flow."
23210
+ "description": "After one agent call: start the hand-off it asked for, or release it and, when it was a\nhand-off's target, hand back. Returns the tail note for the agent to run next, or `undefined`\nwhen the turn ends here.\n\nA plain target hands back when its call ends, released or not, as a plain agent is done once\nit has answered. A stateful one holds the hand-off until it releases, as it holds its flow.\n\nA Stop cancels a hand-off that has not started: the user stopped the turn the caller asked for\nit in, often during the caller's closing call, so the target is not activated, and the call\nends as if it had never asked (a plain caller's turn ends as usual below). A hand-back is not\ntaken back: the target finished the work it was given."
23211
23211
  },
23212
23212
  {
23213
23213
  "kind": "method",