@yaklabs-ai/plugin-sdk 0.54.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.
- package/README.md +16 -5
- package/THIRD-PARTY-INVENTORY.json +1 -1
- package/dist/canonical-transcript.d.ts +66 -0
- package/dist/canonical-transcript.js +567 -3
- package/dist/disclosure.d.ts +329 -110
- package/dist/disclosure.js +1 -0
- package/dist/kay-agent-testing.d.ts +334 -111
- package/dist/kay-agent-testing.js +1 -0
- package/dist/kay-agent.d.ts +389 -87
- package/dist/kay-agent.js +19 -0
- package/dist/kay-app-session-summary.d.ts +267 -128
- package/dist/kay-app.d.ts +1527 -212
- package/dist/kay-app.js +19 -0
- package/dist/workers.d.ts +27 -0
- package/dist/workers.js +20 -0
- package/package.json +5 -1
package/dist/kay-agent.d.ts
CHANGED
|
@@ -815,6 +815,9 @@ export declare function createUnavailableEndpoints(message: string): KayAgentEnd
|
|
|
815
815
|
|
|
816
816
|
export declare function createUnavailablePluginEndpointCaller(message: string): PluginEndpointCaller;
|
|
817
817
|
|
|
818
|
+
/** A refusal handle for hosts that have not composed plugin worker execution. */
|
|
819
|
+
export declare function createUnavailablePluginWorkers(): KayPluginWorkers;
|
|
820
|
+
|
|
818
821
|
export declare function createUnavailableUriCaller(message: string): PluginUriCaller;
|
|
819
822
|
|
|
820
823
|
/** What the module holds at mutation time: a provider revision, the current content, or both. */
|
|
@@ -1073,6 +1076,10 @@ declare const DollarSign = "$";
|
|
|
1073
1076
|
|
|
1074
1077
|
declare const Dot = ".";
|
|
1075
1078
|
|
|
1079
|
+
declare type DriverAction<T> = T extends unknown ? {
|
|
1080
|
+
readonly [Key in keyof T]: ReadonlyContract<Exclude<T[Key], undefined>>;
|
|
1081
|
+
} : never;
|
|
1082
|
+
|
|
1076
1083
|
declare type DurationUnit = "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years";
|
|
1077
1084
|
|
|
1078
1085
|
declare const Element: (input: string) => [unknown, string] | [];
|
|
@@ -1652,78 +1659,300 @@ export declare interface InteractionActed {
|
|
|
1652
1659
|
};
|
|
1653
1660
|
}
|
|
1654
1661
|
|
|
1662
|
+
export declare type InteractionAction = DriverAction<InteractionAction_2>;
|
|
1663
|
+
|
|
1655
1664
|
/**
|
|
1656
|
-
* One action over a candidate from the latest observation of the same target. `
|
|
1657
|
-
*
|
|
1665
|
+
* One action over a candidate from the latest observation of the same target. `element` is that
|
|
1666
|
+
* candidate, returned whole so the driver resolves its own native identity immediately before
|
|
1667
|
+
* input. `fill` replaces the field's contents unless `append` is set, and presses Enter (Return)
|
|
1668
|
+
* afterwards when `submit` is set.
|
|
1658
1669
|
*/
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1670
|
+
declare const InteractionAction_2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1671
|
+
kind: z.ZodLiteral<"click">;
|
|
1672
|
+
element: z.ZodObject<{
|
|
1673
|
+
id: z.ZodString;
|
|
1674
|
+
kind: z.ZodEnum<{
|
|
1675
|
+
fill: "fill";
|
|
1676
|
+
activate: "activate";
|
|
1677
|
+
click: "click";
|
|
1678
|
+
select: "select";
|
|
1679
|
+
scroll: "scroll";
|
|
1680
|
+
wait: "wait";
|
|
1681
|
+
press: "press";
|
|
1682
|
+
}>;
|
|
1683
|
+
label: z.ZodString;
|
|
1684
|
+
node: z.ZodOptional<z.ZodNumber>;
|
|
1685
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1686
|
+
value: z.ZodOptional<z.ZodString>;
|
|
1687
|
+
current_value: z.ZodOptional<z.ZodString>;
|
|
1688
|
+
checked: z.ZodOptional<z.ZodString>;
|
|
1689
|
+
selected: z.ZodOptional<z.ZodString>;
|
|
1690
|
+
expanded: z.ZodOptional<z.ZodString>;
|
|
1691
|
+
look: z.ZodOptional<z.ZodEnum<{
|
|
1692
|
+
link: "link";
|
|
1693
|
+
widget: "widget";
|
|
1694
|
+
}>>;
|
|
1695
|
+
delta: z.ZodOptional<z.ZodNumber>;
|
|
1696
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
1697
|
+
above: "above";
|
|
1698
|
+
below: "below";
|
|
1699
|
+
beside: "beside";
|
|
1700
|
+
}>>;
|
|
1701
|
+
region: z.ZodOptional<z.ZodObject<{
|
|
1702
|
+
role: z.ZodString;
|
|
1703
|
+
name: z.ZodString;
|
|
1704
|
+
front: z.ZodOptional<z.ZodBoolean>;
|
|
1705
|
+
}, z.core.$loose>>;
|
|
1706
|
+
scroller: z.ZodOptional<z.ZodNumber>;
|
|
1707
|
+
}, z.core.$loose>;
|
|
1708
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1709
|
+
kind: z.ZodLiteral<"fill">;
|
|
1710
|
+
element: z.ZodObject<{
|
|
1711
|
+
id: z.ZodString;
|
|
1712
|
+
kind: z.ZodEnum<{
|
|
1713
|
+
fill: "fill";
|
|
1714
|
+
activate: "activate";
|
|
1715
|
+
click: "click";
|
|
1716
|
+
select: "select";
|
|
1717
|
+
scroll: "scroll";
|
|
1718
|
+
wait: "wait";
|
|
1719
|
+
press: "press";
|
|
1720
|
+
}>;
|
|
1721
|
+
label: z.ZodString;
|
|
1722
|
+
node: z.ZodOptional<z.ZodNumber>;
|
|
1723
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1724
|
+
value: z.ZodOptional<z.ZodString>;
|
|
1725
|
+
current_value: z.ZodOptional<z.ZodString>;
|
|
1726
|
+
checked: z.ZodOptional<z.ZodString>;
|
|
1727
|
+
selected: z.ZodOptional<z.ZodString>;
|
|
1728
|
+
expanded: z.ZodOptional<z.ZodString>;
|
|
1729
|
+
look: z.ZodOptional<z.ZodEnum<{
|
|
1730
|
+
link: "link";
|
|
1731
|
+
widget: "widget";
|
|
1732
|
+
}>>;
|
|
1733
|
+
delta: z.ZodOptional<z.ZodNumber>;
|
|
1734
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
1735
|
+
above: "above";
|
|
1736
|
+
below: "below";
|
|
1737
|
+
beside: "beside";
|
|
1738
|
+
}>>;
|
|
1739
|
+
region: z.ZodOptional<z.ZodObject<{
|
|
1740
|
+
role: z.ZodString;
|
|
1741
|
+
name: z.ZodString;
|
|
1742
|
+
front: z.ZodOptional<z.ZodBoolean>;
|
|
1743
|
+
}, z.core.$loose>>;
|
|
1744
|
+
scroller: z.ZodOptional<z.ZodNumber>;
|
|
1745
|
+
}, z.core.$loose>;
|
|
1746
|
+
text: z.ZodString;
|
|
1747
|
+
submit: z.ZodOptional<z.ZodBoolean>;
|
|
1748
|
+
append: z.ZodOptional<z.ZodBoolean>;
|
|
1749
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1750
|
+
kind: z.ZodLiteral<"select">;
|
|
1751
|
+
element: z.ZodObject<{
|
|
1752
|
+
id: z.ZodString;
|
|
1753
|
+
kind: z.ZodEnum<{
|
|
1754
|
+
fill: "fill";
|
|
1755
|
+
activate: "activate";
|
|
1756
|
+
click: "click";
|
|
1757
|
+
select: "select";
|
|
1758
|
+
scroll: "scroll";
|
|
1759
|
+
wait: "wait";
|
|
1760
|
+
press: "press";
|
|
1761
|
+
}>;
|
|
1762
|
+
label: z.ZodString;
|
|
1763
|
+
node: z.ZodOptional<z.ZodNumber>;
|
|
1764
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1765
|
+
value: z.ZodOptional<z.ZodString>;
|
|
1766
|
+
current_value: z.ZodOptional<z.ZodString>;
|
|
1767
|
+
checked: z.ZodOptional<z.ZodString>;
|
|
1768
|
+
selected: z.ZodOptional<z.ZodString>;
|
|
1769
|
+
expanded: z.ZodOptional<z.ZodString>;
|
|
1770
|
+
look: z.ZodOptional<z.ZodEnum<{
|
|
1771
|
+
link: "link";
|
|
1772
|
+
widget: "widget";
|
|
1773
|
+
}>>;
|
|
1774
|
+
delta: z.ZodOptional<z.ZodNumber>;
|
|
1775
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
1776
|
+
above: "above";
|
|
1777
|
+
below: "below";
|
|
1778
|
+
beside: "beside";
|
|
1779
|
+
}>>;
|
|
1780
|
+
region: z.ZodOptional<z.ZodObject<{
|
|
1781
|
+
role: z.ZodString;
|
|
1782
|
+
name: z.ZodString;
|
|
1783
|
+
front: z.ZodOptional<z.ZodBoolean>;
|
|
1784
|
+
}, z.core.$loose>>;
|
|
1785
|
+
scroller: z.ZodOptional<z.ZodNumber>;
|
|
1786
|
+
}, z.core.$loose>;
|
|
1787
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1788
|
+
kind: z.ZodLiteral<"activate">;
|
|
1789
|
+
element: z.ZodObject<{
|
|
1790
|
+
id: z.ZodString;
|
|
1791
|
+
kind: z.ZodEnum<{
|
|
1792
|
+
fill: "fill";
|
|
1793
|
+
activate: "activate";
|
|
1794
|
+
click: "click";
|
|
1795
|
+
select: "select";
|
|
1796
|
+
scroll: "scroll";
|
|
1797
|
+
wait: "wait";
|
|
1798
|
+
press: "press";
|
|
1799
|
+
}>;
|
|
1800
|
+
label: z.ZodString;
|
|
1801
|
+
node: z.ZodOptional<z.ZodNumber>;
|
|
1802
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1803
|
+
value: z.ZodOptional<z.ZodString>;
|
|
1804
|
+
current_value: z.ZodOptional<z.ZodString>;
|
|
1805
|
+
checked: z.ZodOptional<z.ZodString>;
|
|
1806
|
+
selected: z.ZodOptional<z.ZodString>;
|
|
1807
|
+
expanded: z.ZodOptional<z.ZodString>;
|
|
1808
|
+
look: z.ZodOptional<z.ZodEnum<{
|
|
1809
|
+
link: "link";
|
|
1810
|
+
widget: "widget";
|
|
1811
|
+
}>>;
|
|
1812
|
+
delta: z.ZodOptional<z.ZodNumber>;
|
|
1813
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
1814
|
+
above: "above";
|
|
1815
|
+
below: "below";
|
|
1816
|
+
beside: "beside";
|
|
1817
|
+
}>>;
|
|
1818
|
+
region: z.ZodOptional<z.ZodObject<{
|
|
1819
|
+
role: z.ZodString;
|
|
1820
|
+
name: z.ZodString;
|
|
1821
|
+
front: z.ZodOptional<z.ZodBoolean>;
|
|
1822
|
+
}, z.core.$loose>>;
|
|
1823
|
+
scroller: z.ZodOptional<z.ZodNumber>;
|
|
1824
|
+
}, z.core.$loose>;
|
|
1825
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1826
|
+
kind: z.ZodLiteral<"press">;
|
|
1827
|
+
element: z.ZodObject<{
|
|
1828
|
+
id: z.ZodString;
|
|
1829
|
+
kind: z.ZodEnum<{
|
|
1830
|
+
fill: "fill";
|
|
1831
|
+
activate: "activate";
|
|
1832
|
+
click: "click";
|
|
1833
|
+
select: "select";
|
|
1834
|
+
scroll: "scroll";
|
|
1835
|
+
wait: "wait";
|
|
1836
|
+
press: "press";
|
|
1837
|
+
}>;
|
|
1838
|
+
label: z.ZodString;
|
|
1839
|
+
node: z.ZodOptional<z.ZodNumber>;
|
|
1840
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1841
|
+
value: z.ZodOptional<z.ZodString>;
|
|
1842
|
+
current_value: z.ZodOptional<z.ZodString>;
|
|
1843
|
+
checked: z.ZodOptional<z.ZodString>;
|
|
1844
|
+
selected: z.ZodOptional<z.ZodString>;
|
|
1845
|
+
expanded: z.ZodOptional<z.ZodString>;
|
|
1846
|
+
look: z.ZodOptional<z.ZodEnum<{
|
|
1847
|
+
link: "link";
|
|
1848
|
+
widget: "widget";
|
|
1849
|
+
}>>;
|
|
1850
|
+
delta: z.ZodOptional<z.ZodNumber>;
|
|
1851
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
1852
|
+
above: "above";
|
|
1853
|
+
below: "below";
|
|
1854
|
+
beside: "beside";
|
|
1855
|
+
}>>;
|
|
1856
|
+
region: z.ZodOptional<z.ZodObject<{
|
|
1857
|
+
role: z.ZodString;
|
|
1858
|
+
name: z.ZodString;
|
|
1859
|
+
front: z.ZodOptional<z.ZodBoolean>;
|
|
1860
|
+
}, z.core.$loose>>;
|
|
1861
|
+
scroller: z.ZodOptional<z.ZodNumber>;
|
|
1862
|
+
}, z.core.$loose>;
|
|
1863
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1864
|
+
kind: z.ZodLiteral<"scroll">;
|
|
1865
|
+
delta: z.ZodNumber;
|
|
1866
|
+
element: z.ZodOptional<z.ZodObject<{
|
|
1867
|
+
id: z.ZodString;
|
|
1868
|
+
kind: z.ZodEnum<{
|
|
1869
|
+
fill: "fill";
|
|
1870
|
+
activate: "activate";
|
|
1871
|
+
click: "click";
|
|
1872
|
+
select: "select";
|
|
1873
|
+
scroll: "scroll";
|
|
1874
|
+
wait: "wait";
|
|
1875
|
+
press: "press";
|
|
1876
|
+
}>;
|
|
1877
|
+
label: z.ZodString;
|
|
1878
|
+
node: z.ZodOptional<z.ZodNumber>;
|
|
1879
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1880
|
+
value: z.ZodOptional<z.ZodString>;
|
|
1881
|
+
current_value: z.ZodOptional<z.ZodString>;
|
|
1882
|
+
checked: z.ZodOptional<z.ZodString>;
|
|
1883
|
+
selected: z.ZodOptional<z.ZodString>;
|
|
1884
|
+
expanded: z.ZodOptional<z.ZodString>;
|
|
1885
|
+
look: z.ZodOptional<z.ZodEnum<{
|
|
1886
|
+
link: "link";
|
|
1887
|
+
widget: "widget";
|
|
1888
|
+
}>>;
|
|
1889
|
+
delta: z.ZodOptional<z.ZodNumber>;
|
|
1890
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
1891
|
+
above: "above";
|
|
1892
|
+
below: "below";
|
|
1893
|
+
beside: "beside";
|
|
1894
|
+
}>>;
|
|
1895
|
+
region: z.ZodOptional<z.ZodObject<{
|
|
1896
|
+
role: z.ZodString;
|
|
1897
|
+
name: z.ZodString;
|
|
1898
|
+
front: z.ZodOptional<z.ZodBoolean>;
|
|
1899
|
+
}, z.core.$loose>>;
|
|
1900
|
+
scroller: z.ZodOptional<z.ZodNumber>;
|
|
1901
|
+
}, z.core.$loose>>;
|
|
1902
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1903
|
+
kind: z.ZodLiteral<"wait">;
|
|
1904
|
+
}, z.core.$strict>], "kind">;
|
|
1905
|
+
|
|
1906
|
+
declare type InteractionAction_2 = z.infer<typeof InteractionAction_2>;
|
|
1907
|
+
|
|
1908
|
+
export declare type InteractionCandidate = ReadonlyContract<InteractionCandidate_2>;
|
|
1689
1909
|
|
|
1690
1910
|
/**
|
|
1691
|
-
* One element (or control)
|
|
1692
|
-
* the
|
|
1693
|
-
*
|
|
1694
|
-
*
|
|
1911
|
+
* One element (or control) a driver offers in an {@link InteractionObservation}: a role, a label,
|
|
1912
|
+
* a value, and the kind of action it supports. `id` is the driver's per-observation candidate id
|
|
1913
|
+
* (`e1`, `scroll_down`, `wait`); the Interaction engine mints its own session-unique ids over it.
|
|
1914
|
+
* The driver-native identity rides along as passthrough fields the driver alone reads back in
|
|
1915
|
+
* {@link InteractionAction}: `node` (a page element), `target`/`app` (accessibility tokens),
|
|
1916
|
+
* `key` (a key to press). Nothing here is a selector the model wrote.
|
|
1695
1917
|
*/
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1918
|
+
declare const InteractionCandidate_2: z.ZodObject<{
|
|
1919
|
+
id: z.ZodString;
|
|
1920
|
+
kind: z.ZodEnum<{
|
|
1921
|
+
fill: "fill";
|
|
1922
|
+
activate: "activate";
|
|
1923
|
+
click: "click";
|
|
1924
|
+
select: "select";
|
|
1925
|
+
scroll: "scroll";
|
|
1926
|
+
wait: "wait";
|
|
1927
|
+
press: "press";
|
|
1928
|
+
}>;
|
|
1929
|
+
label: z.ZodString;
|
|
1930
|
+
node: z.ZodOptional<z.ZodNumber>;
|
|
1931
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1932
|
+
value: z.ZodOptional<z.ZodString>;
|
|
1933
|
+
current_value: z.ZodOptional<z.ZodString>;
|
|
1934
|
+
checked: z.ZodOptional<z.ZodString>;
|
|
1935
|
+
selected: z.ZodOptional<z.ZodString>;
|
|
1936
|
+
expanded: z.ZodOptional<z.ZodString>;
|
|
1937
|
+
look: z.ZodOptional<z.ZodEnum<{
|
|
1938
|
+
link: "link";
|
|
1939
|
+
widget: "widget";
|
|
1940
|
+
}>>;
|
|
1941
|
+
delta: z.ZodOptional<z.ZodNumber>;
|
|
1942
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
1943
|
+
above: "above";
|
|
1944
|
+
below: "below";
|
|
1945
|
+
beside: "beside";
|
|
1946
|
+
}>>;
|
|
1947
|
+
region: z.ZodOptional<z.ZodObject<{
|
|
1948
|
+
role: z.ZodString;
|
|
1949
|
+
name: z.ZodString;
|
|
1950
|
+
front: z.ZodOptional<z.ZodBoolean>;
|
|
1951
|
+
}, z.core.$loose>>;
|
|
1952
|
+
scroller: z.ZodOptional<z.ZodNumber>;
|
|
1953
|
+
}, z.core.$loose>;
|
|
1954
|
+
|
|
1955
|
+
declare type InteractionCandidate_2 = z.infer<typeof InteractionCandidate_2>;
|
|
1727
1956
|
|
|
1728
1957
|
/** The candidate kinds a driver may offer. */
|
|
1729
1958
|
export declare type InteractionCandidateKind = "click" | "fill" | "select" | "scroll" | "wait" | "activate" | "press";
|
|
@@ -1777,16 +2006,53 @@ export declare interface InteractionFailure {
|
|
|
1777
2006
|
readonly message: string;
|
|
1778
2007
|
}
|
|
1779
2008
|
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
2009
|
+
export declare type InteractionObservation = ReadonlyContract<InteractionObservation_2>;
|
|
2010
|
+
|
|
2011
|
+
/** What a driver sees on one target: its address, title, text, and actionable candidates. */
|
|
2012
|
+
declare const InteractionObservation_2: z.ZodObject<{
|
|
2013
|
+
url: z.ZodString;
|
|
2014
|
+
title: z.ZodString;
|
|
2015
|
+
text: z.ZodString;
|
|
2016
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
2017
|
+
id: z.ZodString;
|
|
2018
|
+
kind: z.ZodEnum<{
|
|
2019
|
+
fill: "fill";
|
|
2020
|
+
activate: "activate";
|
|
2021
|
+
click: "click";
|
|
2022
|
+
select: "select";
|
|
2023
|
+
scroll: "scroll";
|
|
2024
|
+
wait: "wait";
|
|
2025
|
+
press: "press";
|
|
2026
|
+
}>;
|
|
2027
|
+
label: z.ZodString;
|
|
2028
|
+
node: z.ZodOptional<z.ZodNumber>;
|
|
2029
|
+
role: z.ZodOptional<z.ZodString>;
|
|
2030
|
+
value: z.ZodOptional<z.ZodString>;
|
|
2031
|
+
current_value: z.ZodOptional<z.ZodString>;
|
|
2032
|
+
checked: z.ZodOptional<z.ZodString>;
|
|
2033
|
+
selected: z.ZodOptional<z.ZodString>;
|
|
2034
|
+
expanded: z.ZodOptional<z.ZodString>;
|
|
2035
|
+
look: z.ZodOptional<z.ZodEnum<{
|
|
2036
|
+
link: "link";
|
|
2037
|
+
widget: "widget";
|
|
2038
|
+
}>>;
|
|
2039
|
+
delta: z.ZodOptional<z.ZodNumber>;
|
|
2040
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
2041
|
+
above: "above";
|
|
2042
|
+
below: "below";
|
|
2043
|
+
beside: "beside";
|
|
2044
|
+
}>>;
|
|
2045
|
+
region: z.ZodOptional<z.ZodObject<{
|
|
2046
|
+
role: z.ZodString;
|
|
2047
|
+
name: z.ZodString;
|
|
2048
|
+
front: z.ZodOptional<z.ZodBoolean>;
|
|
2049
|
+
}, z.core.$loose>>;
|
|
2050
|
+
scroller: z.ZodOptional<z.ZodNumber>;
|
|
2051
|
+
}, z.core.$loose>>;
|
|
2052
|
+
omitted_actions: z.ZodNumber;
|
|
2053
|
+
}, z.core.$strict>;
|
|
2054
|
+
|
|
2055
|
+
declare type InteractionObservation_2 = z.infer<typeof InteractionObservation_2>;
|
|
1790
2056
|
|
|
1791
2057
|
export declare interface InteractionObserved {
|
|
1792
2058
|
/** The address of the target observed; absent when the default target has no address. */
|
|
@@ -1837,17 +2103,21 @@ export declare type InteractionSurface = Pick<InteractionDriver, "isAvailable" |
|
|
|
1837
2103
|
/** The interaction surfaces Bonsai itself ships, which plugins drive through `api.interaction`. */
|
|
1838
2104
|
export declare type InteractionSurfaceName = "browser-pane" | "desktop";
|
|
1839
2105
|
|
|
2106
|
+
export declare type InteractionTarget = ReadonlyContract<InteractionTarget_2>;
|
|
2107
|
+
|
|
1840
2108
|
/**
|
|
1841
|
-
* One thing a driver can be pointed at. `id` is
|
|
1842
|
-
*
|
|
1843
|
-
* `active` marks the
|
|
2109
|
+
* One thing a driver can be pointed at: a browser page, a running app. `id` is the driver-owned
|
|
2110
|
+
* address the agent passes back as `target` (`kay://tabs/.../items/<item>`, `app://<bundle id>`).
|
|
2111
|
+
* `active` marks the default target (the page the user is looking at, the front app).
|
|
1844
2112
|
*/
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
}
|
|
2113
|
+
declare const InteractionTarget_2: z.ZodObject<{
|
|
2114
|
+
id: z.ZodString;
|
|
2115
|
+
title: z.ZodString;
|
|
2116
|
+
url: z.ZodOptional<z.ZodString>;
|
|
2117
|
+
active: z.ZodBoolean;
|
|
2118
|
+
}, z.core.$strict>;
|
|
2119
|
+
|
|
2120
|
+
declare type InteractionTarget_2 = z.infer<typeof InteractionTarget_2>;
|
|
1851
2121
|
|
|
1852
2122
|
/** Creates an Interface using the given heritage and properties. */
|
|
1853
2123
|
declare function Interface<Heritage extends TSchema[], Properties extends TProperties>(heritage: [...Heritage], properties: Properties, options?: TSchemaOptions): TInterface<Heritage, Properties>;
|
|
@@ -2803,8 +3073,11 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
|
|
|
2803
3073
|
* 0.54.0 adds named UI host grants for shared configuration/auth/account reads, retained connection
|
|
2804
3074
|
* progress/dismissal and support. Built-in-only page capability scopes are removed; executable
|
|
2805
3075
|
* pages declare capabilities on apps[].
|
|
3076
|
+
*
|
|
3077
|
+
* 0.54.1 adds manifest-declared plugin workers on both backend targets and exposes the canonical
|
|
3078
|
+
* transcript placement and answer-stretch rules through the SDK.
|
|
2806
3079
|
*/
|
|
2807
|
-
declare const KAY_PLUGIN_SDK_VERSION: "0.54.
|
|
3080
|
+
declare const KAY_PLUGIN_SDK_VERSION: "0.54.1";
|
|
2808
3081
|
|
|
2809
3082
|
declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
|
|
2810
3083
|
|
|
@@ -3094,6 +3367,8 @@ export declare interface KayAgentPluginApi {
|
|
|
3094
3367
|
* {@link KayAppUserFiles}.
|
|
3095
3368
|
*/
|
|
3096
3369
|
readonly userFiles: KayAppUserFiles;
|
|
3370
|
+
/** Always present; only modules declared by this plugin may run. SDK 0.54.1. */
|
|
3371
|
+
readonly workers: KayPluginWorkers;
|
|
3097
3372
|
/**
|
|
3098
3373
|
* Publish the plugin's declared events, for example so a default notification rule can tell the
|
|
3099
3374
|
* user what the agent just did. Always present, like {@link systemOne}: there is nothing to
|
|
@@ -3752,6 +4027,20 @@ export declare interface KayPluginSimulatorOptions {
|
|
|
3752
4027
|
readonly stateRoot: string;
|
|
3753
4028
|
}
|
|
3754
4029
|
|
|
4030
|
+
/** A declared module exports this function; input and output must be JSON values. */
|
|
4031
|
+
export declare interface KayPluginWorkerModule {
|
|
4032
|
+
run(input: unknown): unknown | Promise<unknown>;
|
|
4033
|
+
}
|
|
4034
|
+
|
|
4035
|
+
/** Run only this plugin's declared modules in a fresh child owned by its hosting process. */
|
|
4036
|
+
export declare interface KayPluginWorkers {
|
|
4037
|
+
/** The host terminates the child on deadline, caller abort or plugin disposal. */
|
|
4038
|
+
run<T = unknown>(workerId: string, input: unknown, options: {
|
|
4039
|
+
readonly timeoutMs: number;
|
|
4040
|
+
readonly signal?: AbortSignal;
|
|
4041
|
+
}): Promise<T>;
|
|
4042
|
+
}
|
|
4043
|
+
|
|
3755
4044
|
/** Applies a KeyOf action to the given type. */
|
|
3756
4045
|
declare function KeyOf<Type extends TSchema>(type: Type, options?: TSchemaOptions): TKeyOf_2<Type>;
|
|
3757
4046
|
|
|
@@ -5681,6 +5970,15 @@ export declare interface PluginUriWriteOptions extends PluginUriMutationOptions
|
|
|
5681
5970
|
readonly writeSource?: UriSourceDescriptor;
|
|
5682
5971
|
}
|
|
5683
5972
|
|
|
5973
|
+
/** A worker refusal or failure; the code is safe to record without its input or output. */
|
|
5974
|
+
export declare class PluginWorkerError extends Error {
|
|
5975
|
+
readonly code: PluginWorkerErrorCode;
|
|
5976
|
+
constructor(code: PluginWorkerErrorCode, message?: string);
|
|
5977
|
+
}
|
|
5978
|
+
|
|
5979
|
+
/** Stable, content-free failure classes for a plugin worker request. */
|
|
5980
|
+
export declare type PluginWorkerErrorCode = "undeclared" | "invalid_module" | "invalid_input" | "input_too_large" | "output_too_large" | "timeout" | "aborted" | "spawn_failed" | "child_failed" | "invalid_output";
|
|
5981
|
+
|
|
5684
5982
|
/**
|
|
5685
5983
|
* What a run did to a URI. The words match the automation run wire's artifact actions. When one
|
|
5686
5984
|
* run both creates and updates a URI, the reader reports `created`.
|
|
@@ -5877,6 +6175,10 @@ declare function Readonly_2<Type extends TSchema>(type: Type): TAddReadonly<Type
|
|
|
5877
6175
|
|
|
5878
6176
|
declare const Readonly_3: (input: string) => [unknown, string] | [];
|
|
5879
6177
|
|
|
6178
|
+
declare type ReadonlyContract<T> = T extends readonly (infer Item)[] ? readonly ReadonlyContract<Item>[] : T extends object ? {
|
|
6179
|
+
readonly [Key in keyof T]: ReadonlyContract<T[Key]>;
|
|
6180
|
+
} : T;
|
|
6181
|
+
|
|
5880
6182
|
declare type ReadonlyKeys<Properties extends TProperties, Result extends PropertyKey = {
|
|
5881
6183
|
[Key in keyof Properties]: Properties[Key] extends TReadonly<TSchema> ? (Properties[Key] extends TOptional<Properties[Key]> ? never : Key) : never;
|
|
5882
6184
|
}[keyof Properties]> = Result;
|
package/dist/kay-agent.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
// packages/plugin-sdk/dist/workers.js
|
|
2
|
+
var PluginWorkerError = class extends Error {
|
|
3
|
+
code;
|
|
4
|
+
constructor(code, message = `Plugin worker request failed: ${code}`) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.code = code;
|
|
7
|
+
this.name = "PluginWorkerError";
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
function createUnavailablePluginWorkers() {
|
|
11
|
+
return {
|
|
12
|
+
async run() {
|
|
13
|
+
throw new PluginWorkerError("spawn_failed", "Plugin workers are not available on this host.");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
1
18
|
// packages/herd-uri/dist/claims.js
|
|
2
19
|
var SCHEME_RE = /^([a-z][a-z0-9+.-]*):\/\//i;
|
|
3
20
|
var CAPTURE_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
@@ -1742,6 +1759,7 @@ export {
|
|
|
1742
1759
|
OSASCRIPT_ENVELOPE_JXA,
|
|
1743
1760
|
OSASCRIPT_TIMEOUT_MS,
|
|
1744
1761
|
PluginApiError,
|
|
1762
|
+
PluginWorkerError,
|
|
1745
1763
|
ProjectDirectory,
|
|
1746
1764
|
ProjectDirectoryRequest,
|
|
1747
1765
|
ProjectDirectoryResponse,
|
|
@@ -1770,6 +1788,7 @@ export {
|
|
|
1770
1788
|
createUnavailableCompiler,
|
|
1771
1789
|
createUnavailableEndpoints,
|
|
1772
1790
|
createUnavailablePluginEndpointCaller,
|
|
1791
|
+
createUnavailablePluginWorkers,
|
|
1773
1792
|
createUnavailableUriCaller,
|
|
1774
1793
|
declareProducedResources,
|
|
1775
1794
|
defineAuthedTool,
|