@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.
@@ -870,6 +870,10 @@ declare const DollarSign = "$";
870
870
 
871
871
  declare const Dot = ".";
872
872
 
873
+ declare type DriverAction<T> = T extends unknown ? {
874
+ readonly [Key in keyof T]: ReadonlyContract<Exclude<T[Key], undefined>>;
875
+ } : never;
876
+
873
877
  declare type DurationUnit = "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years";
874
878
 
875
879
  declare const Element: (input: string) => [unknown, string] | [];
@@ -1347,80 +1351,248 @@ declare interface InteractionActed {
1347
1351
  }
1348
1352
 
1349
1353
  /**
1350
- * One action over a candidate from the latest observation of the same target. `fill` replaces the
1351
- * field's contents unless `append` is set, and presses Enter afterwards when `submit` is set.
1352
- */
1353
- declare type InteractionAction = {
1354
- readonly kind: "click";
1355
- readonly element: InteractionCandidate;
1356
- } | {
1357
- readonly kind: "fill";
1358
- readonly element: InteractionCandidate;
1359
- readonly text: string;
1360
- readonly submit?: boolean;
1361
- readonly append?: boolean;
1362
- } | {
1363
- readonly kind: "select";
1364
- readonly element: InteractionCandidate;
1365
- } | {
1366
- readonly kind: "activate";
1367
- readonly element: InteractionCandidate;
1368
- } | {
1369
- readonly kind: "press";
1370
- readonly element: InteractionCandidate;
1371
- }
1372
- /**
1373
- * Scroll by `delta` px (positive is down). With `element` (a `scroll` candidate that names a
1374
- * node), the scroll container that candidate scrolls; without, the whole page or window.
1375
- */
1376
- | {
1377
- readonly kind: "scroll";
1378
- readonly delta: number;
1379
- readonly element?: InteractionCandidate;
1380
- } | {
1381
- readonly kind: "wait";
1382
- };
1383
-
1384
- /**
1385
- * One element (or control) an observation offers, with the kind of action it supports. `id` is
1386
- * the driver's per-observation id; the engine mints its own session-unique ids over it. Extra
1387
- * fields are the driver's native identity (a page node number, an accessibility token), returned
1388
- * to the driver untouched in {@link InteractionAction}.
1354
+ * One action over a candidate from the latest observation of the same target. `element` is that
1355
+ * candidate, returned whole so the driver resolves its own native identity immediately before
1356
+ * input. `fill` replaces the field's contents unless `append` is set, and presses Enter (Return)
1357
+ * afterwards when `submit` is set.
1389
1358
  */
1390
- declare interface InteractionCandidate {
1391
- readonly id: string;
1392
- readonly kind: InteractionCandidateKind;
1393
- readonly label: string;
1394
- readonly node?: number | undefined;
1395
- readonly role?: string | undefined;
1396
- readonly value?: string | undefined;
1397
- readonly current_value?: string | undefined;
1398
- readonly checked?: string | undefined;
1399
- readonly selected?: string | undefined;
1400
- readonly expanded?: string | undefined;
1401
- /**
1402
- * What a page driver found the element to be in the DOM, not what the page calls it: `link` is an
1403
- * anchor that navigates to another http(s) page; `widget` is an element that is no form control.
1404
- * Absent means unknown, and the engine then treats the element as any other.
1405
- */
1406
- readonly look?: "link" | "widget" | undefined;
1407
- readonly delta?: number | undefined;
1408
- /** Where an element outside the visible area sits; absent means on screen. */
1409
- readonly position?: "above" | "below" | "beside" | undefined;
1410
- /** A `press` candidate's key (`return`, `escape`, `tab`); its id is `press_<key>` by convention. */
1411
- readonly key?: string | undefined;
1412
- /** The region the element sits in; see {@link InteractionRegion}. */
1413
- readonly region?: InteractionRegion | undefined;
1414
- /**
1415
- * The `node` of the scroll container (a list or pane that scrolls on its own) the element sits
1416
- * in, matching that container's `scroll` candidates; absent when it sits in none.
1417
- */
1418
- readonly scroller?: number | undefined;
1419
- readonly [native: string]: unknown;
1420
- }
1421
-
1422
- /** The candidate kinds a driver may offer. */
1423
- declare type InteractionCandidateKind = "click" | "fill" | "select" | "scroll" | "wait" | "activate" | "press";
1359
+ declare const InteractionAction: z.ZodDiscriminatedUnion<[z.ZodObject<{
1360
+ kind: z.ZodLiteral<"click">;
1361
+ element: z.ZodObject<{
1362
+ id: z.ZodString;
1363
+ kind: z.ZodEnum<{
1364
+ fill: "fill";
1365
+ activate: "activate";
1366
+ click: "click";
1367
+ select: "select";
1368
+ scroll: "scroll";
1369
+ wait: "wait";
1370
+ press: "press";
1371
+ }>;
1372
+ label: z.ZodString;
1373
+ node: z.ZodOptional<z.ZodNumber>;
1374
+ role: z.ZodOptional<z.ZodString>;
1375
+ value: z.ZodOptional<z.ZodString>;
1376
+ current_value: z.ZodOptional<z.ZodString>;
1377
+ checked: z.ZodOptional<z.ZodString>;
1378
+ selected: z.ZodOptional<z.ZodString>;
1379
+ expanded: z.ZodOptional<z.ZodString>;
1380
+ look: z.ZodOptional<z.ZodEnum<{
1381
+ link: "link";
1382
+ widget: "widget";
1383
+ }>>;
1384
+ delta: z.ZodOptional<z.ZodNumber>;
1385
+ position: z.ZodOptional<z.ZodEnum<{
1386
+ above: "above";
1387
+ below: "below";
1388
+ beside: "beside";
1389
+ }>>;
1390
+ region: z.ZodOptional<z.ZodObject<{
1391
+ role: z.ZodString;
1392
+ name: z.ZodString;
1393
+ front: z.ZodOptional<z.ZodBoolean>;
1394
+ }, z.core.$loose>>;
1395
+ scroller: z.ZodOptional<z.ZodNumber>;
1396
+ }, z.core.$loose>;
1397
+ }, z.core.$strict>, z.ZodObject<{
1398
+ kind: z.ZodLiteral<"fill">;
1399
+ element: z.ZodObject<{
1400
+ id: z.ZodString;
1401
+ kind: z.ZodEnum<{
1402
+ fill: "fill";
1403
+ activate: "activate";
1404
+ click: "click";
1405
+ select: "select";
1406
+ scroll: "scroll";
1407
+ wait: "wait";
1408
+ press: "press";
1409
+ }>;
1410
+ label: z.ZodString;
1411
+ node: z.ZodOptional<z.ZodNumber>;
1412
+ role: z.ZodOptional<z.ZodString>;
1413
+ value: z.ZodOptional<z.ZodString>;
1414
+ current_value: z.ZodOptional<z.ZodString>;
1415
+ checked: z.ZodOptional<z.ZodString>;
1416
+ selected: z.ZodOptional<z.ZodString>;
1417
+ expanded: z.ZodOptional<z.ZodString>;
1418
+ look: z.ZodOptional<z.ZodEnum<{
1419
+ link: "link";
1420
+ widget: "widget";
1421
+ }>>;
1422
+ delta: z.ZodOptional<z.ZodNumber>;
1423
+ position: z.ZodOptional<z.ZodEnum<{
1424
+ above: "above";
1425
+ below: "below";
1426
+ beside: "beside";
1427
+ }>>;
1428
+ region: z.ZodOptional<z.ZodObject<{
1429
+ role: z.ZodString;
1430
+ name: z.ZodString;
1431
+ front: z.ZodOptional<z.ZodBoolean>;
1432
+ }, z.core.$loose>>;
1433
+ scroller: z.ZodOptional<z.ZodNumber>;
1434
+ }, z.core.$loose>;
1435
+ text: z.ZodString;
1436
+ submit: z.ZodOptional<z.ZodBoolean>;
1437
+ append: z.ZodOptional<z.ZodBoolean>;
1438
+ }, z.core.$strict>, z.ZodObject<{
1439
+ kind: z.ZodLiteral<"select">;
1440
+ element: z.ZodObject<{
1441
+ id: z.ZodString;
1442
+ kind: z.ZodEnum<{
1443
+ fill: "fill";
1444
+ activate: "activate";
1445
+ click: "click";
1446
+ select: "select";
1447
+ scroll: "scroll";
1448
+ wait: "wait";
1449
+ press: "press";
1450
+ }>;
1451
+ label: z.ZodString;
1452
+ node: z.ZodOptional<z.ZodNumber>;
1453
+ role: z.ZodOptional<z.ZodString>;
1454
+ value: z.ZodOptional<z.ZodString>;
1455
+ current_value: z.ZodOptional<z.ZodString>;
1456
+ checked: z.ZodOptional<z.ZodString>;
1457
+ selected: z.ZodOptional<z.ZodString>;
1458
+ expanded: z.ZodOptional<z.ZodString>;
1459
+ look: z.ZodOptional<z.ZodEnum<{
1460
+ link: "link";
1461
+ widget: "widget";
1462
+ }>>;
1463
+ delta: z.ZodOptional<z.ZodNumber>;
1464
+ position: z.ZodOptional<z.ZodEnum<{
1465
+ above: "above";
1466
+ below: "below";
1467
+ beside: "beside";
1468
+ }>>;
1469
+ region: z.ZodOptional<z.ZodObject<{
1470
+ role: z.ZodString;
1471
+ name: z.ZodString;
1472
+ front: z.ZodOptional<z.ZodBoolean>;
1473
+ }, z.core.$loose>>;
1474
+ scroller: z.ZodOptional<z.ZodNumber>;
1475
+ }, z.core.$loose>;
1476
+ }, z.core.$strict>, z.ZodObject<{
1477
+ kind: z.ZodLiteral<"activate">;
1478
+ element: z.ZodObject<{
1479
+ id: z.ZodString;
1480
+ kind: z.ZodEnum<{
1481
+ fill: "fill";
1482
+ activate: "activate";
1483
+ click: "click";
1484
+ select: "select";
1485
+ scroll: "scroll";
1486
+ wait: "wait";
1487
+ press: "press";
1488
+ }>;
1489
+ label: z.ZodString;
1490
+ node: z.ZodOptional<z.ZodNumber>;
1491
+ role: z.ZodOptional<z.ZodString>;
1492
+ value: z.ZodOptional<z.ZodString>;
1493
+ current_value: z.ZodOptional<z.ZodString>;
1494
+ checked: z.ZodOptional<z.ZodString>;
1495
+ selected: z.ZodOptional<z.ZodString>;
1496
+ expanded: z.ZodOptional<z.ZodString>;
1497
+ look: z.ZodOptional<z.ZodEnum<{
1498
+ link: "link";
1499
+ widget: "widget";
1500
+ }>>;
1501
+ delta: z.ZodOptional<z.ZodNumber>;
1502
+ position: z.ZodOptional<z.ZodEnum<{
1503
+ above: "above";
1504
+ below: "below";
1505
+ beside: "beside";
1506
+ }>>;
1507
+ region: z.ZodOptional<z.ZodObject<{
1508
+ role: z.ZodString;
1509
+ name: z.ZodString;
1510
+ front: z.ZodOptional<z.ZodBoolean>;
1511
+ }, z.core.$loose>>;
1512
+ scroller: z.ZodOptional<z.ZodNumber>;
1513
+ }, z.core.$loose>;
1514
+ }, z.core.$strict>, z.ZodObject<{
1515
+ kind: z.ZodLiteral<"press">;
1516
+ element: z.ZodObject<{
1517
+ id: z.ZodString;
1518
+ kind: z.ZodEnum<{
1519
+ fill: "fill";
1520
+ activate: "activate";
1521
+ click: "click";
1522
+ select: "select";
1523
+ scroll: "scroll";
1524
+ wait: "wait";
1525
+ press: "press";
1526
+ }>;
1527
+ label: z.ZodString;
1528
+ node: z.ZodOptional<z.ZodNumber>;
1529
+ role: z.ZodOptional<z.ZodString>;
1530
+ value: z.ZodOptional<z.ZodString>;
1531
+ current_value: z.ZodOptional<z.ZodString>;
1532
+ checked: z.ZodOptional<z.ZodString>;
1533
+ selected: z.ZodOptional<z.ZodString>;
1534
+ expanded: z.ZodOptional<z.ZodString>;
1535
+ look: z.ZodOptional<z.ZodEnum<{
1536
+ link: "link";
1537
+ widget: "widget";
1538
+ }>>;
1539
+ delta: z.ZodOptional<z.ZodNumber>;
1540
+ position: z.ZodOptional<z.ZodEnum<{
1541
+ above: "above";
1542
+ below: "below";
1543
+ beside: "beside";
1544
+ }>>;
1545
+ region: z.ZodOptional<z.ZodObject<{
1546
+ role: z.ZodString;
1547
+ name: z.ZodString;
1548
+ front: z.ZodOptional<z.ZodBoolean>;
1549
+ }, z.core.$loose>>;
1550
+ scroller: z.ZodOptional<z.ZodNumber>;
1551
+ }, z.core.$loose>;
1552
+ }, z.core.$strict>, z.ZodObject<{
1553
+ kind: z.ZodLiteral<"scroll">;
1554
+ delta: z.ZodNumber;
1555
+ element: z.ZodOptional<z.ZodObject<{
1556
+ id: z.ZodString;
1557
+ kind: z.ZodEnum<{
1558
+ fill: "fill";
1559
+ activate: "activate";
1560
+ click: "click";
1561
+ select: "select";
1562
+ scroll: "scroll";
1563
+ wait: "wait";
1564
+ press: "press";
1565
+ }>;
1566
+ label: z.ZodString;
1567
+ node: z.ZodOptional<z.ZodNumber>;
1568
+ role: z.ZodOptional<z.ZodString>;
1569
+ value: z.ZodOptional<z.ZodString>;
1570
+ current_value: z.ZodOptional<z.ZodString>;
1571
+ checked: z.ZodOptional<z.ZodString>;
1572
+ selected: z.ZodOptional<z.ZodString>;
1573
+ expanded: z.ZodOptional<z.ZodString>;
1574
+ look: z.ZodOptional<z.ZodEnum<{
1575
+ link: "link";
1576
+ widget: "widget";
1577
+ }>>;
1578
+ delta: z.ZodOptional<z.ZodNumber>;
1579
+ position: z.ZodOptional<z.ZodEnum<{
1580
+ above: "above";
1581
+ below: "below";
1582
+ beside: "beside";
1583
+ }>>;
1584
+ region: z.ZodOptional<z.ZodObject<{
1585
+ role: z.ZodString;
1586
+ name: z.ZodString;
1587
+ front: z.ZodOptional<z.ZodBoolean>;
1588
+ }, z.core.$loose>>;
1589
+ scroller: z.ZodOptional<z.ZodNumber>;
1590
+ }, z.core.$loose>>;
1591
+ }, z.core.$strict>, z.ZodObject<{
1592
+ kind: z.ZodLiteral<"wait">;
1593
+ }, z.core.$strict>], "kind">;
1594
+
1595
+ declare type InteractionAction = z.infer<typeof InteractionAction>;
1424
1596
 
1425
1597
  declare interface InteractionDriver {
1426
1598
  /** Unique in the session. `builtin:` is reserved for Bonsai's own drivers. */
@@ -1433,12 +1605,12 @@ declare interface InteractionDriver {
1433
1605
  /** Whether the driver can act at all right now (platform, grants, a live connection). */
1434
1606
  isAvailable(): Promise<boolean>;
1435
1607
  targets(): Promise<InteractionOutcome<{
1436
- readonly targets: readonly InteractionTarget[];
1608
+ readonly targets: readonly ReadonlyInteractionTarget[];
1437
1609
  }>>;
1438
1610
  observe(target: string | undefined, options?: {
1439
1611
  readonly fullText?: boolean;
1440
1612
  }): Promise<InteractionOutcome<InteractionObserved>>;
1441
- act(target: string | undefined, action: InteractionAction): Promise<InteractionOutcome<InteractionActed>>;
1613
+ act(target: string | undefined, action: ReadonlyInteractionAction): Promise<InteractionOutcome<InteractionActed>>;
1442
1614
  screenshot(target: string | undefined): Promise<InteractionOutcome<{
1443
1615
  readonly png: Uint8Array;
1444
1616
  }>>;
@@ -1471,21 +1643,56 @@ declare interface InteractionFailure {
1471
1643
  readonly message: string;
1472
1644
  }
1473
1645
 
1474
- /** What a driver sees on one target. */
1475
- declare interface InteractionObservation {
1476
- readonly url: string;
1477
- readonly title: string;
1478
- /** Visible text, or the whole page's text when the observe asked for `fullText`; capped. */
1479
- readonly text: string;
1480
- readonly actions: readonly InteractionCandidate[];
1481
- /** Candidates the driver dropped to stay within its cap. */
1482
- readonly omitted_actions: number;
1483
- }
1646
+ /** What a driver sees on one target: its address, title, text, and actionable candidates. */
1647
+ declare const InteractionObservation: z.ZodObject<{
1648
+ url: z.ZodString;
1649
+ title: z.ZodString;
1650
+ text: z.ZodString;
1651
+ actions: z.ZodArray<z.ZodObject<{
1652
+ id: z.ZodString;
1653
+ kind: z.ZodEnum<{
1654
+ fill: "fill";
1655
+ activate: "activate";
1656
+ click: "click";
1657
+ select: "select";
1658
+ scroll: "scroll";
1659
+ wait: "wait";
1660
+ press: "press";
1661
+ }>;
1662
+ label: z.ZodString;
1663
+ node: z.ZodOptional<z.ZodNumber>;
1664
+ role: z.ZodOptional<z.ZodString>;
1665
+ value: z.ZodOptional<z.ZodString>;
1666
+ current_value: z.ZodOptional<z.ZodString>;
1667
+ checked: z.ZodOptional<z.ZodString>;
1668
+ selected: z.ZodOptional<z.ZodString>;
1669
+ expanded: z.ZodOptional<z.ZodString>;
1670
+ look: z.ZodOptional<z.ZodEnum<{
1671
+ link: "link";
1672
+ widget: "widget";
1673
+ }>>;
1674
+ delta: z.ZodOptional<z.ZodNumber>;
1675
+ position: z.ZodOptional<z.ZodEnum<{
1676
+ above: "above";
1677
+ below: "below";
1678
+ beside: "beside";
1679
+ }>>;
1680
+ region: z.ZodOptional<z.ZodObject<{
1681
+ role: z.ZodString;
1682
+ name: z.ZodString;
1683
+ front: z.ZodOptional<z.ZodBoolean>;
1684
+ }, z.core.$loose>>;
1685
+ scroller: z.ZodOptional<z.ZodNumber>;
1686
+ }, z.core.$loose>>;
1687
+ omitted_actions: z.ZodNumber;
1688
+ }, z.core.$strict>;
1689
+
1690
+ declare type InteractionObservation = z.infer<typeof InteractionObservation>;
1484
1691
 
1485
1692
  declare interface InteractionObserved {
1486
1693
  /** The address of the target observed; absent when the default target has no address. */
1487
1694
  readonly target?: string;
1488
- readonly observation: InteractionObservation;
1695
+ readonly observation: ReadonlyInteractionObservation;
1489
1696
  /** Lines the engine shows the agent under the observation (where the target sits, siblings). */
1490
1697
  readonly notes?: readonly string[];
1491
1698
  }
@@ -1503,20 +1710,6 @@ declare type InteractionOutcome<T> = ({
1503
1710
  readonly ok: true;
1504
1711
  } & T) | InteractionFailure;
1505
1712
 
1506
- /**
1507
- * The part of a page or window an element sits in: the open dialog, menu, or sheet it belongs to,
1508
- * else its landmark (navigation, main, a window). `front` marks the overlay covering the rest: a
1509
- * modal dialog (or one held by a full-screen overlay), a sheet, or a floating menu, the last such
1510
- * in the document; elements outside it
1511
- * usually cannot be clicked while it is open. A docked or always-visible dialog or menu is a
1512
- * region but never in front.
1513
- */
1514
- declare interface InteractionRegion {
1515
- readonly role: string;
1516
- readonly name: string;
1517
- readonly front?: boolean | undefined;
1518
- }
1519
-
1520
1713
  /**
1521
1714
  * One surface Bonsai ships, in the driver contract's own shape, so a plugin's driver is the surface
1522
1715
  * plus an identity: `{ id, label, kind, ...api.interaction.desktop }`. Each call is checked
@@ -1529,16 +1722,18 @@ declare interface InteractionRegion {
1529
1722
  declare type InteractionSurface = Pick<InteractionDriver, "isAvailable" | "targets" | "observe" | "act" | "screenshot" | "open">;
1530
1723
 
1531
1724
  /**
1532
- * One thing a driver can be pointed at. `id` is a driver-owned address, unique across every
1533
- * driver in the session (prefix it with your scheme), that the agent passes back as `target`.
1534
- * `active` marks the driver's default target.
1725
+ * One thing a driver can be pointed at: a browser page, a running app. `id` is the driver-owned
1726
+ * address the agent passes back as `target` (`kay://tabs/.../items/<item>`, `app://<bundle id>`).
1727
+ * `active` marks the default target (the page the user is looking at, the front app).
1535
1728
  */
1536
- declare interface InteractionTarget {
1537
- readonly id: string;
1538
- readonly title: string;
1539
- readonly url?: string;
1540
- readonly active: boolean;
1541
- }
1729
+ declare const InteractionTarget: z.ZodObject<{
1730
+ id: z.ZodString;
1731
+ title: z.ZodString;
1732
+ url: z.ZodOptional<z.ZodString>;
1733
+ active: z.ZodBoolean;
1734
+ }, z.core.$strict>;
1735
+
1736
+ declare type InteractionTarget = z.infer<typeof InteractionTarget>;
1542
1737
 
1543
1738
  /** Creates an Interface using the given heritage and properties. */
1544
1739
  declare function Interface<Heritage extends TSchema[], Properties extends TProperties>(heritage: [...Heritage], properties: Properties, options?: TSchemaOptions): TInterface<Heritage, Properties>;
@@ -2466,8 +2661,15 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2466
2661
  * 0.53.0 adds declared working-content layouts, family-root authority, draft projection discovery
2467
2662
  * and session-bound page references. Older customized Whiteboard copies must accept the plugin
2468
2663
  * update before using these interfaces.
2664
+ *
2665
+ * 0.54.0 adds named UI host grants for shared configuration/auth/account reads, retained connection
2666
+ * progress/dismissal and support. Built-in-only page capability scopes are removed; executable
2667
+ * pages declare capabilities on apps[].
2668
+ *
2669
+ * 0.54.1 adds manifest-declared plugin workers on both backend targets and exposes the canonical
2670
+ * transcript placement and answer-stretch rules through the SDK.
2469
2671
  */
2470
- declare const KAY_PLUGIN_SDK_VERSION: "0.53.0";
2672
+ declare const KAY_PLUGIN_SDK_VERSION: "0.54.1";
2471
2673
 
2472
2674
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2473
2675
 
@@ -2726,6 +2928,8 @@ declare interface KayAgentPluginApi {
2726
2928
  * {@link KayAppUserFiles}.
2727
2929
  */
2728
2930
  readonly userFiles: KayAppUserFiles;
2931
+ /** Always present; only modules declared by this plugin may run. SDK 0.54.1. */
2932
+ readonly workers: KayPluginWorkers;
2729
2933
  /**
2730
2934
  * Publish the plugin's declared events, for example so a default notification rule can tell the
2731
2935
  * user what the agent just did. Always present, like {@link systemOne}: there is nothing to
@@ -3350,6 +3554,15 @@ declare const KayPluginProtocolVersion: z.ZodLiteral<"kay.plugin.v1">;
3350
3554
 
3351
3555
  declare type KayPluginProtocolVersion = z.infer<typeof KayPluginProtocolVersion>;
3352
3556
 
3557
+ /** Run only this plugin's declared modules in a fresh child owned by its hosting process. */
3558
+ declare interface KayPluginWorkers {
3559
+ /** The host terminates the child on deadline, caller abort or plugin disposal. */
3560
+ run<T = unknown>(workerId: string, input: unknown, options: {
3561
+ readonly timeoutMs: number;
3562
+ readonly signal?: AbortSignal;
3563
+ }): Promise<T>;
3564
+ }
3565
+
3353
3566
  /** Applies a KeyOf action to the given type. */
3354
3567
  declare function KeyOf<Type extends TSchema>(type: Type, options?: TSchemaOptions): TKeyOf_2<Type>;
3355
3568
 
@@ -4675,6 +4888,16 @@ declare function Readonly_2<Type extends TSchema>(type: Type): TAddReadonly<Type
4675
4888
 
4676
4889
  declare const Readonly_3: (input: string) => [unknown, string] | [];
4677
4890
 
4891
+ declare type ReadonlyContract<T> = T extends readonly (infer Item)[] ? readonly ReadonlyContract<Item>[] : T extends object ? {
4892
+ readonly [Key in keyof T]: ReadonlyContract<T[Key]>;
4893
+ } : T;
4894
+
4895
+ declare type ReadonlyInteractionAction = DriverAction<InteractionAction>;
4896
+
4897
+ declare type ReadonlyInteractionObservation = ReadonlyContract<InteractionObservation>;
4898
+
4899
+ declare type ReadonlyInteractionTarget = ReadonlyContract<InteractionTarget>;
4900
+
4678
4901
  declare type ReadonlyKeys<Properties extends TProperties, Result extends PropertyKey = {
4679
4902
  [Key in keyof Properties]: Properties[Key] extends TReadonly<TSchema> ? (Properties[Key] extends TOptional<Properties[Key]> ? never : Key) : never;
4680
4903
  }[keyof Properties]> = Result;
@@ -737,6 +737,31 @@ function createUnavailableUriCaller(message) {
737
737
  };
738
738
  }
739
739
 
740
+ // packages/plugin-protocol/dist/project-directories.js
741
+ import { z as z5 } from "zod";
742
+ var PluginProjectDirectories = z5.strictObject({
743
+ /** An endpoint this plugin's app target declares; called with a {@link ProjectDirectoryRequest}. */
744
+ endpoint: z5.string().min(1),
745
+ /** A scheme this plugin's URI modules serve; a project is addressed as `<scheme>://<id>`. */
746
+ scheme: z5.string().min(1)
747
+ });
748
+ var ProjectDirectoryRequest = z5.strictObject({
749
+ /** The project's stable id. */
750
+ id: z5.string().min(1)
751
+ });
752
+ var ProjectDirectory = z5.strictObject({
753
+ id: z5.string().min(1),
754
+ /** Absolute path of the project's folder. */
755
+ path: z5.string().min(1),
756
+ /** Absolute path a new session in this project starts in. */
757
+ defaultCwd: z5.string().min(1),
758
+ /** Ancestor project ids, root first. */
759
+ ancestorIds: z5.array(z5.string().min(1))
760
+ });
761
+ var ProjectDirectoryResponse = z5.strictObject({
762
+ project: ProjectDirectory.nullable()
763
+ });
764
+
740
765
  // packages/plugin-sdk/dist/endpoints.js
741
766
  function createUnavailablePluginEndpointCaller(message) {
742
767
  return {
@@ -895,6 +920,7 @@ function createKayAgentProbeCapabilityHandles() {
895
920
  network: INERT_NETWORK,
896
921
  webSession: INERT_WEB_SESSION,
897
922
  process: INERT_PROCESS,
923
+ workers: { run: inertResult },
898
924
  compiler: { bundleBrowser: inertResult },
899
925
  whiteboard: INERT_WHITEBOARD,
900
926
  // Answers `unavailable` at once: a probe must never reach the user's browser or desktop.
@@ -1,3 +1,5 @@
1
+ import { z } from 'zod';
2
+
1
3
  export declare function createUnavailablePluginEndpointCaller(message: string): PluginEndpointCaller;
2
4
 
3
5
  /** Sessionless JSON calls to another plugin's declared, publicly reachable endpoint. */
@@ -22,4 +24,31 @@ export declare type PluginEndpointOutcome = {
22
24
  readonly message: string;
23
25
  };
24
26
 
27
+ export declare const ProjectDirectory: z.ZodObject<{
28
+ id: z.ZodString;
29
+ path: z.ZodString;
30
+ defaultCwd: z.ZodString;
31
+ ancestorIds: z.ZodArray<z.ZodString>;
32
+ }, z.core.$strict>;
33
+
34
+ export declare type ProjectDirectory = z.infer<typeof ProjectDirectory>;
35
+
36
+ export declare const ProjectDirectoryRequest: z.ZodObject<{
37
+ id: z.ZodString;
38
+ }, z.core.$strict>;
39
+
40
+ export declare type ProjectDirectoryRequest = z.infer<typeof ProjectDirectoryRequest>;
41
+
42
+ /** `project` is null when no project has the requested id. */
43
+ export declare const ProjectDirectoryResponse: z.ZodObject<{
44
+ project: z.ZodNullable<z.ZodObject<{
45
+ id: z.ZodString;
46
+ path: z.ZodString;
47
+ defaultCwd: z.ZodString;
48
+ ancestorIds: z.ZodArray<z.ZodString>;
49
+ }, z.core.$strict>>;
50
+ }, z.core.$strict>;
51
+
52
+ export declare type ProjectDirectoryResponse = z.infer<typeof ProjectDirectoryResponse>;
53
+
25
54
  export { }
package/dist/endpoints.js CHANGED
@@ -1,3 +1,28 @@
1
+ // packages/plugin-protocol/dist/project-directories.js
2
+ import { z } from "zod";
3
+ var PluginProjectDirectories = z.strictObject({
4
+ /** An endpoint this plugin's app target declares; called with a {@link ProjectDirectoryRequest}. */
5
+ endpoint: z.string().min(1),
6
+ /** A scheme this plugin's URI modules serve; a project is addressed as `<scheme>://<id>`. */
7
+ scheme: z.string().min(1)
8
+ });
9
+ var ProjectDirectoryRequest = z.strictObject({
10
+ /** The project's stable id. */
11
+ id: z.string().min(1)
12
+ });
13
+ var ProjectDirectory = z.strictObject({
14
+ id: z.string().min(1),
15
+ /** Absolute path of the project's folder. */
16
+ path: z.string().min(1),
17
+ /** Absolute path a new session in this project starts in. */
18
+ defaultCwd: z.string().min(1),
19
+ /** Ancestor project ids, root first. */
20
+ ancestorIds: z.array(z.string().min(1))
21
+ });
22
+ var ProjectDirectoryResponse = z.strictObject({
23
+ project: ProjectDirectory.nullable()
24
+ });
25
+
1
26
  // packages/plugin-sdk/dist/endpoints.js
2
27
  function createUnavailablePluginEndpointCaller(message) {
3
28
  return {
@@ -5,5 +30,8 @@ function createUnavailablePluginEndpointCaller(message) {
5
30
  };
6
31
  }
7
32
  export {
33
+ ProjectDirectory,
34
+ ProjectDirectoryRequest,
35
+ ProjectDirectoryResponse,
8
36
  createUnavailablePluginEndpointCaller
9
37
  };