@yaklabs-ai/plugin-sdk 0.53.0 → 0.54.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.
@@ -828,6 +828,10 @@ declare const DollarSign = "$";
828
828
 
829
829
  declare const Dot = ".";
830
830
 
831
+ declare type DriverAction<T> = T extends unknown ? {
832
+ readonly [Key in keyof T]: ReadonlyContract<Exclude<T[Key], undefined>>;
833
+ } : never;
834
+
831
835
  declare type DurationUnit = "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years";
832
836
 
833
837
  declare const Element: (input: string) => [unknown, string] | [];
@@ -1196,7 +1200,7 @@ declare function FactorMapping(input: [unknown, unknown, unknown, unknown, unkno
1196
1200
  export declare function fauxAuthContext(overrides?: Partial<ExtensionAuthContext>): ExtensionAuthContext;
1197
1201
 
1198
1202
  /** The capability handles a `KayAgentPluginApi` always carries - authority is decided per call. */
1199
- export declare type FauxKayAgentCapabilities = Pick<KayAgentPluginApi, "uri" | "network" | "webSession" | "process" | "whiteboard" | "interaction" | "interceptToolCall" | "implementTool" | "systemOne" | "events" | "featureFlags" | "time" | "log" | "userFiles" | "familyFolder" | "vendoredMcp" | "endpoints" | "compiler">;
1203
+ export declare type FauxKayAgentCapabilities = Pick<KayAgentPluginApi, "uri" | "network" | "webSession" | "process" | "whiteboard" | "interaction" | "interceptToolCall" | "implementTool" | "systemOne" | "events" | "featureFlags" | "time" | "log" | "userFiles" | "workers" | "familyFolder" | "vendoredMcp" | "endpoints" | "compiler">;
1200
1204
 
1201
1205
  export declare function fauxKayAgentCapabilities(): FauxKayAgentCapabilities;
1202
1206
 
@@ -1383,80 +1387,248 @@ declare interface InteractionActed {
1383
1387
  }
1384
1388
 
1385
1389
  /**
1386
- * One action over a candidate from the latest observation of the same target. `fill` replaces the
1387
- * field's contents unless `append` is set, and presses Enter afterwards when `submit` is set.
1390
+ * One action over a candidate from the latest observation of the same target. `element` is that
1391
+ * candidate, returned whole so the driver resolves its own native identity immediately before
1392
+ * input. `fill` replaces the field's contents unless `append` is set, and presses Enter (Return)
1393
+ * afterwards when `submit` is set.
1388
1394
  */
1389
- declare type InteractionAction = {
1390
- readonly kind: "click";
1391
- readonly element: InteractionCandidate;
1392
- } | {
1393
- readonly kind: "fill";
1394
- readonly element: InteractionCandidate;
1395
- readonly text: string;
1396
- readonly submit?: boolean;
1397
- readonly append?: boolean;
1398
- } | {
1399
- readonly kind: "select";
1400
- readonly element: InteractionCandidate;
1401
- } | {
1402
- readonly kind: "activate";
1403
- readonly element: InteractionCandidate;
1404
- } | {
1405
- readonly kind: "press";
1406
- readonly element: InteractionCandidate;
1407
- }
1408
- /**
1409
- * Scroll by `delta` px (positive is down). With `element` (a `scroll` candidate that names a
1410
- * node), the scroll container that candidate scrolls; without, the whole page or window.
1411
- */
1412
- | {
1413
- readonly kind: "scroll";
1414
- readonly delta: number;
1415
- readonly element?: InteractionCandidate;
1416
- } | {
1417
- readonly kind: "wait";
1418
- };
1419
-
1420
- /**
1421
- * One element (or control) an observation offers, with the kind of action it supports. `id` is
1422
- * the driver's per-observation id; the engine mints its own session-unique ids over it. Extra
1423
- * fields are the driver's native identity (a page node number, an accessibility token), returned
1424
- * to the driver untouched in {@link InteractionAction}.
1425
- */
1426
- declare interface InteractionCandidate {
1427
- readonly id: string;
1428
- readonly kind: InteractionCandidateKind;
1429
- readonly label: string;
1430
- readonly node?: number | undefined;
1431
- readonly role?: string | undefined;
1432
- readonly value?: string | undefined;
1433
- readonly current_value?: string | undefined;
1434
- readonly checked?: string | undefined;
1435
- readonly selected?: string | undefined;
1436
- readonly expanded?: string | undefined;
1437
- /**
1438
- * What a page driver found the element to be in the DOM, not what the page calls it: `link` is an
1439
- * anchor that navigates to another http(s) page; `widget` is an element that is no form control.
1440
- * Absent means unknown, and the engine then treats the element as any other.
1441
- */
1442
- readonly look?: "link" | "widget" | undefined;
1443
- readonly delta?: number | undefined;
1444
- /** Where an element outside the visible area sits; absent means on screen. */
1445
- readonly position?: "above" | "below" | "beside" | undefined;
1446
- /** A `press` candidate's key (`return`, `escape`, `tab`); its id is `press_<key>` by convention. */
1447
- readonly key?: string | undefined;
1448
- /** The region the element sits in; see {@link InteractionRegion}. */
1449
- readonly region?: InteractionRegion | undefined;
1450
- /**
1451
- * The `node` of the scroll container (a list or pane that scrolls on its own) the element sits
1452
- * in, matching that container's `scroll` candidates; absent when it sits in none.
1453
- */
1454
- readonly scroller?: number | undefined;
1455
- readonly [native: string]: unknown;
1456
- }
1457
-
1458
- /** The candidate kinds a driver may offer. */
1459
- declare type InteractionCandidateKind = "click" | "fill" | "select" | "scroll" | "wait" | "activate" | "press";
1395
+ declare const InteractionAction: z.ZodDiscriminatedUnion<[z.ZodObject<{
1396
+ kind: z.ZodLiteral<"click">;
1397
+ element: z.ZodObject<{
1398
+ id: z.ZodString;
1399
+ kind: z.ZodEnum<{
1400
+ fill: "fill";
1401
+ activate: "activate";
1402
+ click: "click";
1403
+ select: "select";
1404
+ scroll: "scroll";
1405
+ wait: "wait";
1406
+ press: "press";
1407
+ }>;
1408
+ label: z.ZodString;
1409
+ node: z.ZodOptional<z.ZodNumber>;
1410
+ role: z.ZodOptional<z.ZodString>;
1411
+ value: z.ZodOptional<z.ZodString>;
1412
+ current_value: z.ZodOptional<z.ZodString>;
1413
+ checked: z.ZodOptional<z.ZodString>;
1414
+ selected: z.ZodOptional<z.ZodString>;
1415
+ expanded: z.ZodOptional<z.ZodString>;
1416
+ look: z.ZodOptional<z.ZodEnum<{
1417
+ link: "link";
1418
+ widget: "widget";
1419
+ }>>;
1420
+ delta: z.ZodOptional<z.ZodNumber>;
1421
+ position: z.ZodOptional<z.ZodEnum<{
1422
+ above: "above";
1423
+ below: "below";
1424
+ beside: "beside";
1425
+ }>>;
1426
+ region: z.ZodOptional<z.ZodObject<{
1427
+ role: z.ZodString;
1428
+ name: z.ZodString;
1429
+ front: z.ZodOptional<z.ZodBoolean>;
1430
+ }, z.core.$loose>>;
1431
+ scroller: z.ZodOptional<z.ZodNumber>;
1432
+ }, z.core.$loose>;
1433
+ }, z.core.$strict>, z.ZodObject<{
1434
+ kind: z.ZodLiteral<"fill">;
1435
+ element: z.ZodObject<{
1436
+ id: z.ZodString;
1437
+ kind: z.ZodEnum<{
1438
+ fill: "fill";
1439
+ activate: "activate";
1440
+ click: "click";
1441
+ select: "select";
1442
+ scroll: "scroll";
1443
+ wait: "wait";
1444
+ press: "press";
1445
+ }>;
1446
+ label: z.ZodString;
1447
+ node: z.ZodOptional<z.ZodNumber>;
1448
+ role: z.ZodOptional<z.ZodString>;
1449
+ value: z.ZodOptional<z.ZodString>;
1450
+ current_value: z.ZodOptional<z.ZodString>;
1451
+ checked: z.ZodOptional<z.ZodString>;
1452
+ selected: z.ZodOptional<z.ZodString>;
1453
+ expanded: z.ZodOptional<z.ZodString>;
1454
+ look: z.ZodOptional<z.ZodEnum<{
1455
+ link: "link";
1456
+ widget: "widget";
1457
+ }>>;
1458
+ delta: z.ZodOptional<z.ZodNumber>;
1459
+ position: z.ZodOptional<z.ZodEnum<{
1460
+ above: "above";
1461
+ below: "below";
1462
+ beside: "beside";
1463
+ }>>;
1464
+ region: z.ZodOptional<z.ZodObject<{
1465
+ role: z.ZodString;
1466
+ name: z.ZodString;
1467
+ front: z.ZodOptional<z.ZodBoolean>;
1468
+ }, z.core.$loose>>;
1469
+ scroller: z.ZodOptional<z.ZodNumber>;
1470
+ }, z.core.$loose>;
1471
+ text: z.ZodString;
1472
+ submit: z.ZodOptional<z.ZodBoolean>;
1473
+ append: z.ZodOptional<z.ZodBoolean>;
1474
+ }, z.core.$strict>, z.ZodObject<{
1475
+ kind: z.ZodLiteral<"select">;
1476
+ element: z.ZodObject<{
1477
+ id: z.ZodString;
1478
+ kind: z.ZodEnum<{
1479
+ fill: "fill";
1480
+ activate: "activate";
1481
+ click: "click";
1482
+ select: "select";
1483
+ scroll: "scroll";
1484
+ wait: "wait";
1485
+ press: "press";
1486
+ }>;
1487
+ label: z.ZodString;
1488
+ node: z.ZodOptional<z.ZodNumber>;
1489
+ role: z.ZodOptional<z.ZodString>;
1490
+ value: z.ZodOptional<z.ZodString>;
1491
+ current_value: z.ZodOptional<z.ZodString>;
1492
+ checked: z.ZodOptional<z.ZodString>;
1493
+ selected: z.ZodOptional<z.ZodString>;
1494
+ expanded: z.ZodOptional<z.ZodString>;
1495
+ look: z.ZodOptional<z.ZodEnum<{
1496
+ link: "link";
1497
+ widget: "widget";
1498
+ }>>;
1499
+ delta: z.ZodOptional<z.ZodNumber>;
1500
+ position: z.ZodOptional<z.ZodEnum<{
1501
+ above: "above";
1502
+ below: "below";
1503
+ beside: "beside";
1504
+ }>>;
1505
+ region: z.ZodOptional<z.ZodObject<{
1506
+ role: z.ZodString;
1507
+ name: z.ZodString;
1508
+ front: z.ZodOptional<z.ZodBoolean>;
1509
+ }, z.core.$loose>>;
1510
+ scroller: z.ZodOptional<z.ZodNumber>;
1511
+ }, z.core.$loose>;
1512
+ }, z.core.$strict>, z.ZodObject<{
1513
+ kind: z.ZodLiteral<"activate">;
1514
+ element: z.ZodObject<{
1515
+ id: z.ZodString;
1516
+ kind: z.ZodEnum<{
1517
+ fill: "fill";
1518
+ activate: "activate";
1519
+ click: "click";
1520
+ select: "select";
1521
+ scroll: "scroll";
1522
+ wait: "wait";
1523
+ press: "press";
1524
+ }>;
1525
+ label: z.ZodString;
1526
+ node: z.ZodOptional<z.ZodNumber>;
1527
+ role: z.ZodOptional<z.ZodString>;
1528
+ value: z.ZodOptional<z.ZodString>;
1529
+ current_value: z.ZodOptional<z.ZodString>;
1530
+ checked: z.ZodOptional<z.ZodString>;
1531
+ selected: z.ZodOptional<z.ZodString>;
1532
+ expanded: z.ZodOptional<z.ZodString>;
1533
+ look: z.ZodOptional<z.ZodEnum<{
1534
+ link: "link";
1535
+ widget: "widget";
1536
+ }>>;
1537
+ delta: z.ZodOptional<z.ZodNumber>;
1538
+ position: z.ZodOptional<z.ZodEnum<{
1539
+ above: "above";
1540
+ below: "below";
1541
+ beside: "beside";
1542
+ }>>;
1543
+ region: z.ZodOptional<z.ZodObject<{
1544
+ role: z.ZodString;
1545
+ name: z.ZodString;
1546
+ front: z.ZodOptional<z.ZodBoolean>;
1547
+ }, z.core.$loose>>;
1548
+ scroller: z.ZodOptional<z.ZodNumber>;
1549
+ }, z.core.$loose>;
1550
+ }, z.core.$strict>, z.ZodObject<{
1551
+ kind: z.ZodLiteral<"press">;
1552
+ element: z.ZodObject<{
1553
+ id: z.ZodString;
1554
+ kind: z.ZodEnum<{
1555
+ fill: "fill";
1556
+ activate: "activate";
1557
+ click: "click";
1558
+ select: "select";
1559
+ scroll: "scroll";
1560
+ wait: "wait";
1561
+ press: "press";
1562
+ }>;
1563
+ label: z.ZodString;
1564
+ node: z.ZodOptional<z.ZodNumber>;
1565
+ role: z.ZodOptional<z.ZodString>;
1566
+ value: z.ZodOptional<z.ZodString>;
1567
+ current_value: z.ZodOptional<z.ZodString>;
1568
+ checked: z.ZodOptional<z.ZodString>;
1569
+ selected: z.ZodOptional<z.ZodString>;
1570
+ expanded: z.ZodOptional<z.ZodString>;
1571
+ look: z.ZodOptional<z.ZodEnum<{
1572
+ link: "link";
1573
+ widget: "widget";
1574
+ }>>;
1575
+ delta: z.ZodOptional<z.ZodNumber>;
1576
+ position: z.ZodOptional<z.ZodEnum<{
1577
+ above: "above";
1578
+ below: "below";
1579
+ beside: "beside";
1580
+ }>>;
1581
+ region: z.ZodOptional<z.ZodObject<{
1582
+ role: z.ZodString;
1583
+ name: z.ZodString;
1584
+ front: z.ZodOptional<z.ZodBoolean>;
1585
+ }, z.core.$loose>>;
1586
+ scroller: z.ZodOptional<z.ZodNumber>;
1587
+ }, z.core.$loose>;
1588
+ }, z.core.$strict>, z.ZodObject<{
1589
+ kind: z.ZodLiteral<"scroll">;
1590
+ delta: z.ZodNumber;
1591
+ element: z.ZodOptional<z.ZodObject<{
1592
+ id: z.ZodString;
1593
+ kind: z.ZodEnum<{
1594
+ fill: "fill";
1595
+ activate: "activate";
1596
+ click: "click";
1597
+ select: "select";
1598
+ scroll: "scroll";
1599
+ wait: "wait";
1600
+ press: "press";
1601
+ }>;
1602
+ label: z.ZodString;
1603
+ node: z.ZodOptional<z.ZodNumber>;
1604
+ role: z.ZodOptional<z.ZodString>;
1605
+ value: z.ZodOptional<z.ZodString>;
1606
+ current_value: z.ZodOptional<z.ZodString>;
1607
+ checked: z.ZodOptional<z.ZodString>;
1608
+ selected: z.ZodOptional<z.ZodString>;
1609
+ expanded: z.ZodOptional<z.ZodString>;
1610
+ look: z.ZodOptional<z.ZodEnum<{
1611
+ link: "link";
1612
+ widget: "widget";
1613
+ }>>;
1614
+ delta: z.ZodOptional<z.ZodNumber>;
1615
+ position: z.ZodOptional<z.ZodEnum<{
1616
+ above: "above";
1617
+ below: "below";
1618
+ beside: "beside";
1619
+ }>>;
1620
+ region: z.ZodOptional<z.ZodObject<{
1621
+ role: z.ZodString;
1622
+ name: z.ZodString;
1623
+ front: z.ZodOptional<z.ZodBoolean>;
1624
+ }, z.core.$loose>>;
1625
+ scroller: z.ZodOptional<z.ZodNumber>;
1626
+ }, z.core.$loose>>;
1627
+ }, z.core.$strict>, z.ZodObject<{
1628
+ kind: z.ZodLiteral<"wait">;
1629
+ }, z.core.$strict>], "kind">;
1630
+
1631
+ declare type InteractionAction = z.infer<typeof InteractionAction>;
1460
1632
 
1461
1633
  declare interface InteractionDriver {
1462
1634
  /** Unique in the session. `builtin:` is reserved for Bonsai's own drivers. */
@@ -1469,12 +1641,12 @@ declare interface InteractionDriver {
1469
1641
  /** Whether the driver can act at all right now (platform, grants, a live connection). */
1470
1642
  isAvailable(): Promise<boolean>;
1471
1643
  targets(): Promise<InteractionOutcome<{
1472
- readonly targets: readonly InteractionTarget[];
1644
+ readonly targets: readonly ReadonlyInteractionTarget[];
1473
1645
  }>>;
1474
1646
  observe(target: string | undefined, options?: {
1475
1647
  readonly fullText?: boolean;
1476
1648
  }): Promise<InteractionOutcome<InteractionObserved>>;
1477
- act(target: string | undefined, action: InteractionAction): Promise<InteractionOutcome<InteractionActed>>;
1649
+ act(target: string | undefined, action: ReadonlyInteractionAction): Promise<InteractionOutcome<InteractionActed>>;
1478
1650
  screenshot(target: string | undefined): Promise<InteractionOutcome<{
1479
1651
  readonly png: Uint8Array;
1480
1652
  }>>;
@@ -1507,21 +1679,56 @@ declare interface InteractionFailure {
1507
1679
  readonly message: string;
1508
1680
  }
1509
1681
 
1510
- /** What a driver sees on one target. */
1511
- declare interface InteractionObservation {
1512
- readonly url: string;
1513
- readonly title: string;
1514
- /** Visible text, or the whole page's text when the observe asked for `fullText`; capped. */
1515
- readonly text: string;
1516
- readonly actions: readonly InteractionCandidate[];
1517
- /** Candidates the driver dropped to stay within its cap. */
1518
- readonly omitted_actions: number;
1519
- }
1682
+ /** What a driver sees on one target: its address, title, text, and actionable candidates. */
1683
+ declare const InteractionObservation: z.ZodObject<{
1684
+ url: z.ZodString;
1685
+ title: z.ZodString;
1686
+ text: z.ZodString;
1687
+ actions: z.ZodArray<z.ZodObject<{
1688
+ id: z.ZodString;
1689
+ kind: z.ZodEnum<{
1690
+ fill: "fill";
1691
+ activate: "activate";
1692
+ click: "click";
1693
+ select: "select";
1694
+ scroll: "scroll";
1695
+ wait: "wait";
1696
+ press: "press";
1697
+ }>;
1698
+ label: z.ZodString;
1699
+ node: z.ZodOptional<z.ZodNumber>;
1700
+ role: z.ZodOptional<z.ZodString>;
1701
+ value: z.ZodOptional<z.ZodString>;
1702
+ current_value: z.ZodOptional<z.ZodString>;
1703
+ checked: z.ZodOptional<z.ZodString>;
1704
+ selected: z.ZodOptional<z.ZodString>;
1705
+ expanded: z.ZodOptional<z.ZodString>;
1706
+ look: z.ZodOptional<z.ZodEnum<{
1707
+ link: "link";
1708
+ widget: "widget";
1709
+ }>>;
1710
+ delta: z.ZodOptional<z.ZodNumber>;
1711
+ position: z.ZodOptional<z.ZodEnum<{
1712
+ above: "above";
1713
+ below: "below";
1714
+ beside: "beside";
1715
+ }>>;
1716
+ region: z.ZodOptional<z.ZodObject<{
1717
+ role: z.ZodString;
1718
+ name: z.ZodString;
1719
+ front: z.ZodOptional<z.ZodBoolean>;
1720
+ }, z.core.$loose>>;
1721
+ scroller: z.ZodOptional<z.ZodNumber>;
1722
+ }, z.core.$loose>>;
1723
+ omitted_actions: z.ZodNumber;
1724
+ }, z.core.$strict>;
1725
+
1726
+ declare type InteractionObservation = z.infer<typeof InteractionObservation>;
1520
1727
 
1521
1728
  declare interface InteractionObserved {
1522
1729
  /** The address of the target observed; absent when the default target has no address. */
1523
1730
  readonly target?: string;
1524
- readonly observation: InteractionObservation;
1731
+ readonly observation: ReadonlyInteractionObservation;
1525
1732
  /** Lines the engine shows the agent under the observation (where the target sits, siblings). */
1526
1733
  readonly notes?: readonly string[];
1527
1734
  }
@@ -1539,20 +1746,6 @@ declare type InteractionOutcome<T> = ({
1539
1746
  readonly ok: true;
1540
1747
  } & T) | InteractionFailure;
1541
1748
 
1542
- /**
1543
- * The part of a page or window an element sits in: the open dialog, menu, or sheet it belongs to,
1544
- * else its landmark (navigation, main, a window). `front` marks the overlay covering the rest: a
1545
- * modal dialog (or one held by a full-screen overlay), a sheet, or a floating menu, the last such
1546
- * in the document; elements outside it
1547
- * usually cannot be clicked while it is open. A docked or always-visible dialog or menu is a
1548
- * region but never in front.
1549
- */
1550
- declare interface InteractionRegion {
1551
- readonly role: string;
1552
- readonly name: string;
1553
- readonly front?: boolean | undefined;
1554
- }
1555
-
1556
1749
  /**
1557
1750
  * One surface Bonsai ships, in the driver contract's own shape, so a plugin's driver is the surface
1558
1751
  * plus an identity: `{ id, label, kind, ...api.interaction.desktop }`. Each call is checked
@@ -1565,16 +1758,18 @@ declare interface InteractionRegion {
1565
1758
  declare type InteractionSurface = Pick<InteractionDriver, "isAvailable" | "targets" | "observe" | "act" | "screenshot" | "open">;
1566
1759
 
1567
1760
  /**
1568
- * One thing a driver can be pointed at. `id` is a driver-owned address, unique across every
1569
- * driver in the session (prefix it with your scheme), that the agent passes back as `target`.
1570
- * `active` marks the driver's default target.
1761
+ * One thing a driver can be pointed at: a browser page, a running app. `id` is the driver-owned
1762
+ * address the agent passes back as `target` (`kay://tabs/.../items/<item>`, `app://<bundle id>`).
1763
+ * `active` marks the default target (the page the user is looking at, the front app).
1571
1764
  */
1572
- declare interface InteractionTarget {
1573
- readonly id: string;
1574
- readonly title: string;
1575
- readonly url?: string;
1576
- readonly active: boolean;
1577
- }
1765
+ declare const InteractionTarget: z.ZodObject<{
1766
+ id: z.ZodString;
1767
+ title: z.ZodString;
1768
+ url: z.ZodOptional<z.ZodString>;
1769
+ active: z.ZodBoolean;
1770
+ }, z.core.$strict>;
1771
+
1772
+ declare type InteractionTarget = z.infer<typeof InteractionTarget>;
1578
1773
 
1579
1774
  /** Creates an Interface using the given heritage and properties. */
1580
1775
  declare function Interface<Heritage extends TSchema[], Properties extends TProperties>(heritage: [...Heritage], properties: Properties, options?: TSchemaOptions): TInterface<Heritage, Properties>;
@@ -2520,8 +2715,15 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2520
2715
  * 0.53.0 adds declared working-content layouts, family-root authority, draft projection discovery
2521
2716
  * and session-bound page references. Older customized Whiteboard copies must accept the plugin
2522
2717
  * update before using these interfaces.
2718
+ *
2719
+ * 0.54.0 adds named UI host grants for shared configuration/auth/account reads, retained connection
2720
+ * progress/dismissal and support. Built-in-only page capability scopes are removed; executable
2721
+ * pages declare capabilities on apps[].
2722
+ *
2723
+ * 0.54.1 adds manifest-declared plugin workers on both backend targets and exposes the canonical
2724
+ * transcript placement and answer-stretch rules through the SDK.
2523
2725
  */
2524
- declare const KAY_PLUGIN_SDK_VERSION: "0.53.0";
2726
+ declare const KAY_PLUGIN_SDK_VERSION: "0.54.1";
2525
2727
 
2526
2728
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2527
2729
 
@@ -2777,6 +2979,8 @@ declare interface KayAgentPluginApi {
2777
2979
  * {@link KayAppUserFiles}.
2778
2980
  */
2779
2981
  readonly userFiles: KayAppUserFiles;
2982
+ /** Always present; only modules declared by this plugin may run. SDK 0.54.1. */
2983
+ readonly workers: KayPluginWorkers;
2780
2984
  /**
2781
2985
  * Publish the plugin's declared events, for example so a default notification rule can tell the
2782
2986
  * user what the agent just did. Always present, like {@link systemOne}: there is nothing to
@@ -3401,6 +3605,15 @@ declare const KayPluginProtocolVersion: z.ZodLiteral<"kay.plugin.v1">;
3401
3605
 
3402
3606
  declare type KayPluginProtocolVersion = z.infer<typeof KayPluginProtocolVersion>;
3403
3607
 
3608
+ /** Run only this plugin's declared modules in a fresh child owned by its hosting process. */
3609
+ declare interface KayPluginWorkers {
3610
+ /** The host terminates the child on deadline, caller abort or plugin disposal. */
3611
+ run<T = unknown>(workerId: string, input: unknown, options: {
3612
+ readonly timeoutMs: number;
3613
+ readonly signal?: AbortSignal;
3614
+ }): Promise<T>;
3615
+ }
3616
+
3404
3617
  /** Applies a KeyOf action to the given type. */
3405
3618
  declare function KeyOf<Type extends TSchema>(type: Type, options?: TSchemaOptions): TKeyOf_2<Type>;
3406
3619
 
@@ -4723,6 +4936,16 @@ declare function Readonly_2<Type extends TSchema>(type: Type): TAddReadonly<Type
4723
4936
 
4724
4937
  declare const Readonly_3: (input: string) => [unknown, string] | [];
4725
4938
 
4939
+ declare type ReadonlyContract<T> = T extends readonly (infer Item)[] ? readonly ReadonlyContract<Item>[] : T extends object ? {
4940
+ readonly [Key in keyof T]: ReadonlyContract<T[Key]>;
4941
+ } : T;
4942
+
4943
+ declare type ReadonlyInteractionAction = DriverAction<InteractionAction>;
4944
+
4945
+ declare type ReadonlyInteractionObservation = ReadonlyContract<InteractionObservation>;
4946
+
4947
+ declare type ReadonlyInteractionTarget = ReadonlyContract<InteractionTarget>;
4948
+
4726
4949
  declare type ReadonlyKeys<Properties extends TProperties, Result extends PropertyKey = {
4727
4950
  [Key in keyof Properties]: Properties[Key] extends TReadonly<TSchema> ? (Properties[Key] extends TOptional<Properties[Key]> ? never : Key) : never;
4728
4951
  }[keyof Properties]> = Result;
@@ -4946,6 +5169,10 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
4946
5169
  consumesAuthServices: z.ZodArray<z.ZodString>;
4947
5170
  explicitDependencies: z.ZodArray<z.ZodString>;
4948
5171
  dataDirSharedWith: z.ZodOptional<z.ZodString>;
5172
+ workers: z.ZodOptional<z.ZodArray<z.ZodObject<{
5173
+ localId: z.ZodString;
5174
+ module: z.ZodString;
5175
+ }, z.core.$strict>>>;
4949
5176
  workloadPurposes: z.ZodOptional<z.ZodArray<z.ZodObject<{
4950
5177
  purpose: z.ZodString;
4951
5178
  workloadClass: z.ZodEnum<{
@@ -4959,6 +5186,10 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
4959
5186
  usage: z.ZodString;
4960
5187
  endpointId: z.ZodString;
4961
5188
  }, z.core.$strict>>>;
5189
+ projectDirectories: z.ZodOptional<z.ZodObject<{
5190
+ scheme: z.ZodString;
5191
+ endpointId: z.ZodString;
5192
+ }, z.core.$strict>>;
4962
5193
  authServices: z.ZodArray<z.ZodObject<{
4963
5194
  localId: z.ZodString;
4964
5195
  globalId: z.ZodString;
@@ -5001,9 +5232,11 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5001
5232
  globalId: z.ZodString;
5002
5233
  kind: z.ZodLiteral<"oauth2">;
5003
5234
  scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
5235
+ connectScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
5004
5236
  authorizationUrl: z.ZodURL;
5005
5237
  tokenUrl: z.ZodURL;
5006
5238
  extraAuthorizeParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5239
+ extraAuthorizeParamsWhenAccountHeld: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5007
5240
  displayName: z.ZodOptional<z.ZodString>;
5008
5241
  agentHint: z.ZodOptional<z.ZodString>;
5009
5242
  summary: z.ZodOptional<z.ZodString>;
@@ -5032,9 +5265,11 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5032
5265
  globalId: z.ZodString;
5033
5266
  kind: z.ZodLiteral<"oauth2">;
5034
5267
  scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
5268
+ connectScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
5035
5269
  authorizationUrl: z.ZodURL;
5036
5270
  tokenUrl: z.ZodURL;
5037
5271
  extraAuthorizeParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5272
+ extraAuthorizeParamsWhenAccountHeld: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
5038
5273
  displayName: z.ZodOptional<z.ZodString>;
5039
5274
  agentHint: z.ZodOptional<z.ZodString>;
5040
5275
  summary: z.ZodOptional<z.ZodString>;
@@ -5668,6 +5903,7 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5668
5903
  skills: z.ZodExactOptional<z.ZodArray<z.ZodString>>;
5669
5904
  }, z.core.$strict>>;
5670
5905
  localId: z.ZodString;
5906
+ adapterId: z.ZodOptional<z.ZodString>;
5671
5907
  globalId: z.ZodString;
5672
5908
  schemes: z.ZodArray<z.ZodString>;
5673
5909
  displayName: z.ZodOptional<z.ZodString>;
@@ -6140,6 +6376,13 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
6140
6376
  }, z.core.$strict>]>>>;
6141
6377
  host: z.ZodOptional<z.ZodArray<z.ZodEnum<{
6142
6378
  "navigation.open-session": "navigation.open-session";
6379
+ "navigation.open-external": "navigation.open-external";
6380
+ "configuration.read": "configuration.read";
6381
+ "auth-services.read": "auth-services.read";
6382
+ "connect-flows.read": "connect-flows.read";
6383
+ "connect-flows.dismiss": "connect-flows.dismiss";
6384
+ "support.report": "support.report";
6385
+ "navigation.open-page": "navigation.open-page";
6143
6386
  "sessions.create": "sessions.create";
6144
6387
  "models.complete": "models.complete";
6145
6388
  "artifacts.read": "artifacts.read";
@@ -6147,6 +6390,10 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
6147
6390
  "markdown.document-view": "markdown.document-view";
6148
6391
  "references.open": "references.open";
6149
6392
  "billing.read": "billing.read";
6393
+ "account.read": "account.read";
6394
+ "plugins.read": "plugins.read";
6395
+ "plugins.settings": "plugins.settings";
6396
+ "permissions.manage": "permissions.manage";
6150
6397
  "automations.read": "automations.read";
6151
6398
  "automations.run": "automations.run";
6152
6399
  "shared-artifacts.read": "shared-artifacts.read";
@@ -320,6 +320,7 @@ function fauxKayAgentCapabilities() {
320
320
  // Throws `not-served`, so the plugin's own `catch` runs. A test that wants answers overrides
321
321
  // this handle after the spread.
322
322
  systemOne: createUnavailableSystemOneClient(),
323
+ workers: { run: unwired("workers.run") },
323
324
  // Accepts and drops, like the registrations above: the real `publish` never throws, so a
324
325
  // rejecting double would fail tests for a reason production never has. A test asserting what
325
326
  // its plugin publishes overrides this handle after the spread.