@genesislcap/ai-assistant 15.34.0 → 15.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1590,6 +1590,455 @@
1590
1590
  }
1591
1591
  ]
1592
1592
  },
1593
+ {
1594
+ "kind": "javascript-module",
1595
+ "path": "src/genesis/config.ts",
1596
+ "declarations": [
1597
+ {
1598
+ "kind": "variable",
1599
+ "name": "DEFAULT_MAX_ROWS",
1600
+ "type": {
1601
+ "text": "number"
1602
+ },
1603
+ "default": "50",
1604
+ "description": "The default read cap, and the ceiling the config may raise it to."
1605
+ },
1606
+ {
1607
+ "kind": "variable",
1608
+ "name": "MAX_ROWS_CEILING",
1609
+ "type": {
1610
+ "text": "number"
1611
+ },
1612
+ "default": "1000"
1613
+ },
1614
+ {
1615
+ "kind": "function",
1616
+ "name": "toolNameOf",
1617
+ "return": {
1618
+ "type": {
1619
+ "text": "string"
1620
+ }
1621
+ },
1622
+ "parameters": [
1623
+ {
1624
+ "name": "resourceName",
1625
+ "type": {
1626
+ "text": "string"
1627
+ }
1628
+ }
1629
+ ],
1630
+ "description": "The model-facing tool name for a resource. Deterministic and collision-free (resource names\nare unique), and trivially mapped back to the resource in a debug log. What the tool is FOR\nreaches the model through its description, not its name."
1631
+ }
1632
+ ],
1633
+ "exports": [
1634
+ {
1635
+ "kind": "js",
1636
+ "name": "DEFAULT_MAX_ROWS",
1637
+ "declaration": {
1638
+ "name": "DEFAULT_MAX_ROWS",
1639
+ "module": "src/genesis/config.ts"
1640
+ }
1641
+ },
1642
+ {
1643
+ "kind": "js",
1644
+ "name": "MAX_ROWS_CEILING",
1645
+ "declaration": {
1646
+ "name": "MAX_ROWS_CEILING",
1647
+ "module": "src/genesis/config.ts"
1648
+ }
1649
+ },
1650
+ {
1651
+ "kind": "js",
1652
+ "name": "toolNameOf",
1653
+ "declaration": {
1654
+ "name": "toolNameOf",
1655
+ "module": "src/genesis/config.ts"
1656
+ }
1657
+ }
1658
+ ]
1659
+ },
1660
+ {
1661
+ "kind": "javascript-module",
1662
+ "path": "src/genesis/criteria.ts",
1663
+ "declarations": [
1664
+ {
1665
+ "kind": "function",
1666
+ "name": "dateFragment",
1667
+ "return": {
1668
+ "type": {
1669
+ "text": "string | undefined"
1670
+ }
1671
+ },
1672
+ "parameters": [
1673
+ {
1674
+ "name": "field",
1675
+ "type": {
1676
+ "text": "string"
1677
+ }
1678
+ },
1679
+ {
1680
+ "name": "op",
1681
+ "type": {
1682
+ "text": "GenesisFilterOp"
1683
+ }
1684
+ },
1685
+ {
1686
+ "name": "date",
1687
+ "type": {
1688
+ "text": "string"
1689
+ }
1690
+ }
1691
+ ]
1692
+ },
1693
+ {
1694
+ "kind": "function",
1695
+ "name": "dateTimeFragment",
1696
+ "return": {
1697
+ "type": {
1698
+ "text": "string | undefined"
1699
+ }
1700
+ },
1701
+ "parameters": [
1702
+ {
1703
+ "name": "field",
1704
+ "type": {
1705
+ "text": "string"
1706
+ }
1707
+ },
1708
+ {
1709
+ "name": "op",
1710
+ "type": {
1711
+ "text": "GenesisFilterOp"
1712
+ }
1713
+ },
1714
+ {
1715
+ "name": "bound",
1716
+ "type": {
1717
+ "text": "string"
1718
+ }
1719
+ }
1720
+ ],
1721
+ "description": "Timestamp columns get the dateTime helpers, which take a `yyyyMMdd-HH:mm:ss` bound."
1722
+ }
1723
+ ],
1724
+ "exports": [
1725
+ {
1726
+ "kind": "js",
1727
+ "name": "dateFragment",
1728
+ "declaration": {
1729
+ "name": "dateFragment",
1730
+ "module": "src/genesis/criteria.ts"
1731
+ }
1732
+ },
1733
+ {
1734
+ "kind": "js",
1735
+ "name": "dateTimeFragment",
1736
+ "declaration": {
1737
+ "name": "dateTimeFragment",
1738
+ "module": "src/genesis/criteria.ts"
1739
+ }
1740
+ }
1741
+ ]
1742
+ },
1743
+ {
1744
+ "kind": "javascript-module",
1745
+ "path": "src/genesis/filter-fields.ts",
1746
+ "declarations": [],
1747
+ "exports": []
1748
+ },
1749
+ {
1750
+ "kind": "javascript-module",
1751
+ "path": "src/genesis/index.ts",
1752
+ "declarations": [],
1753
+ "exports": [
1754
+ {
1755
+ "kind": "js",
1756
+ "name": "GENESIS_AGENT_NAME",
1757
+ "declaration": {
1758
+ "name": "GENESIS_AGENT_NAME",
1759
+ "module": "./register-genesis-assistant"
1760
+ }
1761
+ },
1762
+ {
1763
+ "kind": "js",
1764
+ "name": "registerGenesisAssistant",
1765
+ "declaration": {
1766
+ "name": "registerGenesisAssistant",
1767
+ "module": "./register-genesis-assistant"
1768
+ }
1769
+ },
1770
+ {
1771
+ "kind": "js",
1772
+ "name": "GenesisFilter",
1773
+ "declaration": {
1774
+ "name": "GenesisFilter",
1775
+ "module": "./criteria"
1776
+ }
1777
+ },
1778
+ {
1779
+ "kind": "js",
1780
+ "name": "GenesisFilterField",
1781
+ "declaration": {
1782
+ "name": "GenesisFilterField",
1783
+ "module": "./criteria"
1784
+ }
1785
+ },
1786
+ {
1787
+ "kind": "js",
1788
+ "name": "GenesisFilterOp",
1789
+ "declaration": {
1790
+ "name": "GenesisFilterOp",
1791
+ "module": "./criteria"
1792
+ }
1793
+ },
1794
+ {
1795
+ "kind": "js",
1796
+ "name": "createGenesisResourceTools",
1797
+ "declaration": {
1798
+ "name": "createGenesisResourceTools",
1799
+ "module": "./resource-tools"
1800
+ }
1801
+ },
1802
+ {
1803
+ "kind": "js",
1804
+ "name": "GENESIS_DATA_SOURCE",
1805
+ "declaration": {
1806
+ "name": "GENESIS_DATA_SOURCE",
1807
+ "module": "./resource-tools"
1808
+ }
1809
+ },
1810
+ {
1811
+ "kind": "js",
1812
+ "name": "GenesisReadResult",
1813
+ "declaration": {
1814
+ "name": "GenesisReadResult",
1815
+ "module": "./resource-tools"
1816
+ }
1817
+ },
1818
+ {
1819
+ "kind": "js",
1820
+ "name": "GenesisResourceTools",
1821
+ "declaration": {
1822
+ "name": "GenesisResourceTools",
1823
+ "module": "./resource-tools"
1824
+ }
1825
+ },
1826
+ {
1827
+ "kind": "js",
1828
+ "name": "GenesisResourceToolsOptions",
1829
+ "declaration": {
1830
+ "name": "GenesisResourceToolsOptions",
1831
+ "module": "./resource-tools"
1832
+ }
1833
+ },
1834
+ {
1835
+ "kind": "js",
1836
+ "name": "GenesisToolError",
1837
+ "declaration": {
1838
+ "name": "GenesisToolError",
1839
+ "module": "./resource-tools"
1840
+ }
1841
+ },
1842
+ {
1843
+ "kind": "js",
1844
+ "name": "GENESIS_EVENT_OPS",
1845
+ "declaration": {
1846
+ "name": "GENESIS_EVENT_OPS",
1847
+ "module": "./types"
1848
+ }
1849
+ },
1850
+ {
1851
+ "kind": "js",
1852
+ "name": "GenesisAiConfig",
1853
+ "declaration": {
1854
+ "name": "GenesisAiConfig",
1855
+ "module": "./types"
1856
+ }
1857
+ },
1858
+ {
1859
+ "kind": "js",
1860
+ "name": "GenesisAiResource",
1861
+ "declaration": {
1862
+ "name": "GenesisAiResource",
1863
+ "module": "./types"
1864
+ }
1865
+ },
1866
+ {
1867
+ "kind": "js",
1868
+ "name": "GenesisAssistantExtensions",
1869
+ "declaration": {
1870
+ "name": "GenesisAssistantExtensions",
1871
+ "module": "./types"
1872
+ }
1873
+ },
1874
+ {
1875
+ "kind": "js",
1876
+ "name": "GenesisAssistantRegistration",
1877
+ "declaration": {
1878
+ "name": "GenesisAssistantRegistration",
1879
+ "module": "./types"
1880
+ }
1881
+ },
1882
+ {
1883
+ "kind": "js",
1884
+ "name": "GenesisEventOp",
1885
+ "declaration": {
1886
+ "name": "GenesisEventOp",
1887
+ "module": "./types"
1888
+ }
1889
+ },
1890
+ {
1891
+ "kind": "js",
1892
+ "name": "GenesisResourceKind",
1893
+ "declaration": {
1894
+ "name": "GenesisResourceKind",
1895
+ "module": "./types"
1896
+ }
1897
+ },
1898
+ {
1899
+ "kind": "js",
1900
+ "name": "RegisterGenesisAssistantOptions",
1901
+ "declaration": {
1902
+ "name": "RegisterGenesisAssistantOptions",
1903
+ "module": "./types"
1904
+ }
1905
+ }
1906
+ ]
1907
+ },
1908
+ {
1909
+ "kind": "javascript-module",
1910
+ "path": "src/genesis/register-genesis-assistant.ts",
1911
+ "declarations": [
1912
+ {
1913
+ "kind": "variable",
1914
+ "name": "GENESIS_AGENT_NAME",
1915
+ "type": {
1916
+ "text": "string"
1917
+ },
1918
+ "default": "'genesis-assistant'",
1919
+ "description": "The name of the agent registerGenesisAssistant builds."
1920
+ },
1921
+ {
1922
+ "kind": "function",
1923
+ "name": "registerGenesisAssistant",
1924
+ "return": {
1925
+ "type": {
1926
+ "text": "GenesisAssistantRegistration"
1927
+ }
1928
+ },
1929
+ "parameters": [
1930
+ {
1931
+ "name": "options",
1932
+ "type": {
1933
+ "text": "RegisterGenesisAssistantOptions"
1934
+ }
1935
+ }
1936
+ ],
1937
+ "description": "Sets up the AI assistant for a Genesis app from its generated AI config: providers by tier,\nand one agent whose tools read the app's resources."
1938
+ }
1939
+ ],
1940
+ "exports": [
1941
+ {
1942
+ "kind": "js",
1943
+ "name": "GENESIS_AGENT_NAME",
1944
+ "declaration": {
1945
+ "name": "GENESIS_AGENT_NAME",
1946
+ "module": "src/genesis/register-genesis-assistant.ts"
1947
+ }
1948
+ },
1949
+ {
1950
+ "kind": "js",
1951
+ "name": "registerGenesisAssistant",
1952
+ "declaration": {
1953
+ "name": "registerGenesisAssistant",
1954
+ "module": "src/genesis/register-genesis-assistant.ts"
1955
+ }
1956
+ }
1957
+ ]
1958
+ },
1959
+ {
1960
+ "kind": "javascript-module",
1961
+ "path": "src/genesis/resource-tools.ts",
1962
+ "declarations": [
1963
+ {
1964
+ "kind": "variable",
1965
+ "name": "GENESIS_DATA_SOURCE",
1966
+ "type": {
1967
+ "text": "string"
1968
+ },
1969
+ "default": "'app-database'",
1970
+ "description": "The provenance stamped on everything a tool returns from the app (ADR P9). Rows are written by\nthe app's other users, so the model must treat their text as data, never as instructions; the\nsystem prompt says the same thing in words."
1971
+ },
1972
+ {
1973
+ "kind": "function",
1974
+ "name": "createGenesisResourceTools",
1975
+ "return": {
1976
+ "type": {
1977
+ "text": "GenesisResourceTools"
1978
+ }
1979
+ },
1980
+ "parameters": [
1981
+ {
1982
+ "name": "resources",
1983
+ "type": {
1984
+ "text": "readonly GenesisAiResource[]"
1985
+ }
1986
+ },
1987
+ {
1988
+ "name": "options",
1989
+ "default": "{}",
1990
+ "type": {
1991
+ "text": "GenesisResourceToolsOptions"
1992
+ }
1993
+ }
1994
+ ],
1995
+ "description": "Builds the assistant's tools from an app's resources."
1996
+ }
1997
+ ],
1998
+ "exports": [
1999
+ {
2000
+ "kind": "js",
2001
+ "name": "GENESIS_DATA_SOURCE",
2002
+ "declaration": {
2003
+ "name": "GENESIS_DATA_SOURCE",
2004
+ "module": "src/genesis/resource-tools.ts"
2005
+ }
2006
+ },
2007
+ {
2008
+ "kind": "js",
2009
+ "name": "createGenesisResourceTools",
2010
+ "declaration": {
2011
+ "name": "createGenesisResourceTools",
2012
+ "module": "src/genesis/resource-tools.ts"
2013
+ }
2014
+ }
2015
+ ]
2016
+ },
2017
+ {
2018
+ "kind": "javascript-module",
2019
+ "path": "src/genesis/types.ts",
2020
+ "declarations": [
2021
+ {
2022
+ "kind": "variable",
2023
+ "name": "GENESIS_EVENT_OPS",
2024
+ "type": {
2025
+ "text": "['insert', 'modify', 'delete', 'custom']"
2026
+ },
2027
+ "default": "['insert', 'modify', 'delete', 'custom']",
2028
+ "description": "The wire vocabulary for an event resource's operation. Custom handlers keep their own name."
2029
+ }
2030
+ ],
2031
+ "exports": [
2032
+ {
2033
+ "kind": "js",
2034
+ "name": "GENESIS_EVENT_OPS",
2035
+ "declaration": {
2036
+ "name": "GENESIS_EVENT_OPS",
2037
+ "module": "src/genesis/types.ts"
2038
+ }
2039
+ }
2040
+ ]
2041
+ },
1593
2042
  {
1594
2043
  "kind": "javascript-module",
1595
2044
  "path": "src/config/config.ts",
@@ -0,0 +1,22 @@
1
+ /** The default read cap, and the ceiling the config may raise it to. */
2
+ export declare const DEFAULT_MAX_ROWS = 50;
3
+ export declare const MAX_ROWS_CEILING = 1000;
4
+ /**
5
+ * The model-facing tool name for a resource. Deterministic and collision-free (resource names
6
+ * are unique), and trivially mapped back to the resource in a debug log. What the tool is FOR
7
+ * reaches the model through its description, not its name.
8
+ */
9
+ export declare const toolNameOf: (resourceName: string) => string;
10
+ /**
11
+ * Checks a generated AI config before anything is registered, returning every problem found.
12
+ *
13
+ * @remarks
14
+ * The config is machine-generated and schema-checked upstream, so a violation here is a bug in
15
+ * that pipeline, not something to work around. The caller turns problems into a blocked
16
+ * assistant with the reason on screen — scoped to the assistant, never an exception that could
17
+ * take the app down at start-up — rather than running with part of the config quietly missing.
18
+ *
19
+ * @internal
20
+ */
21
+ export declare function validateGenesisAiConfig(config: unknown): string[];
22
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/genesis/config.ts"],"names":[],"mappings":"AAGA,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAMrC;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,cAAc,MAAM,KAAG,MAAoC,CAAC;AAEvF;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,CA2DjE"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Criteria composition for the Genesis read tools.
3
+ *
4
+ * @remarks
5
+ * **The model never writes a criteria expression, and this is the reason.** Criteria are parsed
6
+ * as Groovy on the server, and the platform composes an app's row-level restriction into the
7
+ * same string: `"($userCriteria) && ($criteriaTemplate)"`. A criteria string authored from model
8
+ * output could therefore `||` its way past the restriction that decides which rows a user is
9
+ * allowed to see. So the tool takes STRUCTURED filters — field, op, value — validated against
10
+ * the fields the platform itself reports as filterable, and this module builds the expression.
11
+ * Anything it cannot build is refused outright: never a partial expression, never a silent drop.
12
+ *
13
+ * Do not "simplify" this into a free-text criteria parameter.
14
+ *
15
+ * The grammar and escaping match the platform's other structured-filter caller, grid-pro's
16
+ * `filter.utils.ts`, so the bridge is not a second dialect of the same expression language.
17
+ */
18
+ /** What a filter can ask of a field. Deliberately small: every one maps to a proven expression. */
19
+ export type GenesisFilterOp = 'equals' | 'not_equals' | 'contains' | 'greater_than' | 'greater_or_equal' | 'less_than' | 'less_or_equal' | 'is_blank' | 'is_not_blank';
20
+ /** One structured filter, as the model supplies it. */
21
+ export interface GenesisFilter {
22
+ field: string;
23
+ op: GenesisFilterOp;
24
+ value?: unknown;
25
+ }
26
+ /** A field the platform reports as filterable, with what its type allows. */
27
+ export interface GenesisFilterField {
28
+ name: string;
29
+ /** The platform field type, e.g. STRING, ENUM, INT, DOUBLE, BOOLEAN, DATE, DATETIME. */
30
+ type: string;
31
+ /** For ENUM fields: the values the server will accept. */
32
+ validValues?: string[];
33
+ }
34
+ /** Composed criteria, or the reason the whole read is refused. */
35
+ export type CriteriaResult = {
36
+ status: 'ok';
37
+ criteria?: string;
38
+ } | {
39
+ status: 'rejected';
40
+ reason: string;
41
+ };
42
+ type FieldKind = 'string' | 'number' | 'boolean' | 'date' | 'datetime';
43
+ /** @internal */
44
+ export declare function fieldKindOf(type: string): FieldKind;
45
+ /**
46
+ * Each fragment builder answers only for the ops it knows, and `undefined` otherwise.
47
+ *
48
+ * @remarks
49
+ * These used to end in a `default:` that returned one operator — `containsIgnoreCase` for a
50
+ * string, `dateIsLessEqual` for a date — so an op added to {@link OPS_BY_KIND} without a fragment
51
+ * would have been composed silently as that one, filtering on something nobody asked for. The
52
+ * allow-list makes it unreachable today; this makes it impossible tomorrow, which is the same
53
+ * argument the operator Map is built on. Exported so that property can be tested at all — the
54
+ * allow-list is what stops `composeCriteria` reaching it.
55
+ *
56
+ * @internal
57
+ */
58
+ export declare function stringFragment(field: string, op: GenesisFilterOp, value: unknown): string | undefined;
59
+ export declare function dateFragment(field: string, op: GenesisFilterOp, date: string): string | undefined;
60
+ /**
61
+ * Timestamp columns get the dateTime helpers, which take a `yyyyMMdd-HH:mm:ss` bound.
62
+ *
63
+ * @remarks
64
+ * There is no strictly-before helper to reach for: `dateTimeIsBefore` maps to
65
+ * `dateTimeIsLessEqual` (foundation-ui's operator-map), and a negated
66
+ * `!Expr.dateTimeIsGreaterEqual(...)` would pull rows with a NULL timestamp INTO the match set,
67
+ * because the comparison is false for null. So the bound itself carries the inclusivity — see
68
+ * {@link toPlatformDateTime}.
69
+ */
70
+ export declare function dateTimeFragment(field: string, op: GenesisFilterOp, bound: string): string | undefined;
71
+ /**
72
+ * Builds one `CRITERIA_MATCH` expression from structured filters, or refuses.
73
+ *
74
+ * @remarks
75
+ * Fragments are parenthesised before they are joined with `&&`, because `&&` binds tighter than
76
+ * `||`: an unparenthesised `a == '' || a == null` fragment would otherwise let rows through that
77
+ * the following filters exclude.
78
+ *
79
+ * @internal
80
+ */
81
+ export declare function composeCriteria(filters: unknown, fields: ReadonlyMap<string, GenesisFilterField>): CriteriaResult;
82
+ export {};
83
+ //# sourceMappingURL=criteria.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criteria.d.ts","sourceRoot":"","sources":["../../../src/genesis/criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,mGAAmG;AACnG,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,cAAc,GACd,kBAAkB,GAClB,WAAW,GACX,eAAe,GACf,UAAU,GACV,cAAc,CAAC;AAEnB,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,eAAe,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,kEAAkE;AAClE,MAAM,MAAM,cAAc,GACtB;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,KAAK,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAyDvE,gBAAgB;AAChB,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAOnD;AAwFD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,eAAe,EACnB,KAAK,EAAE,OAAO,GACb,MAAM,GAAG,SAAS,CAWpB;AAcD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAejG;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,eAAe,EACnB,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,SAAS,CAGpB;AAkKD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAC9C,cAAc,CAmChB"}
@@ -0,0 +1,62 @@
1
+ import type { Connect, Metadata } from '@genesislcap/foundation-comms';
2
+ import type { GenesisFilterField } from './criteria';
3
+ /**
4
+ * What a resource can be filtered on, from the platform's own metadata reply.
5
+ *
6
+ * @remarks
7
+ * `CRITERIA_FIELDS` is the platform's answer to "which fields may a criteria reference", which
8
+ * is exactly the allow-list the read tools need — the reply schema, by contrast, says what comes
9
+ * back, which is not the same set. `FIELD`/`REPLY_FIELD` carry the types that decide how a value
10
+ * is written into the expression, and an ENUM's `VALID_VALUES`, which the model is shown so it
11
+ * does not guess.
12
+ *
13
+ * A resource that reports no criteria fields gets a read tool with no filters, rather than a
14
+ * tool whose filters the server would refuse.
15
+ *
16
+ * @internal
17
+ */
18
+ export type FilterFieldsResult = {
19
+ status: 'ok';
20
+ fields: Map<string, GenesisFilterField>;
21
+ published: boolean;
22
+ } | {
23
+ status: 'failed';
24
+ reason: string;
25
+ transient: boolean;
26
+ };
27
+ /**
28
+ * The metadata name of a resource: `REQ_TRADE` is read as `REQ_TRADE`, but its metadata and
29
+ * schema are published under `TRADE`. Asking for the prefixed name answers
30
+ * "Resource REQ_TRADE is not mapped to a service" (404), which would leave every tool
31
+ * unfilterable — verified against a live 8.15 router.
32
+ *
33
+ * @internal
34
+ */
35
+ export declare const metadataNameOf: (resourceName: string) => string;
36
+ /**
37
+ * The filterable fields, and the criteria fields the reply left undescribed.
38
+ *
39
+ * @internal
40
+ */
41
+ export interface FilterFieldsFrom {
42
+ fields: Map<string, GenesisFilterField>;
43
+ /**
44
+ * Criteria fields with no description anywhere in the reply, so their TYPE is unknown. Not
45
+ * offered to the model; named here so the log can say which, and an app can publish them.
46
+ */
47
+ undescribed: string[];
48
+ }
49
+ /** @internal */
50
+ export declare function filterFieldsFrom(metadata: Metadata): FilterFieldsFrom;
51
+ /**
52
+ * Fetches a resource's filterable fields. Never throws.
53
+ *
54
+ * @remarks
55
+ * `transient` says whether asking again can help: a request that failed while the app was
56
+ * disconnected can, but a reply that came back unusable cannot — Connect caches any non-empty
57
+ * metadata reply for the session, so the same answer would come back without reaching the server.
58
+ *
59
+ * @internal
60
+ */
61
+ export declare function loadFilterFields(connect: Connect, resourceName: string, timeoutMs?: number): Promise<FilterFieldsResult>;
62
+ //# sourceMappingURL=filter-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-fields.d.ts","sourceRoot":"","sources":["../../../src/genesis/filter-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,+BAA+B,CAAC;AAGvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAUrD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GAC7E;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAiB7D;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,cAAc,MAAM,KAAG,MAA2C,CAAC;AAElG;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACxC;;;OAGG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,gBAAgB;AAChB,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,CAoCrE;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM,EACpB,SAAS,GAAE,MAA4B,GACtC,OAAO,CAAC,kBAAkB,CAAC,CAwC7B"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The Genesis bridge for the AI assistant (`@genesislcap/ai-assistant/genesis`).
3
+ *
4
+ * Its own entry point, deliberately not re-exported from the package root: it depends on
5
+ * `@genesislcap/foundation-comms`, and this package declares no `sideEffects`, so anything
6
+ * exported from the root lands in every consumer's bundle — including hosts that are not
7
+ * Genesis apps. foundation-comms is an optional peer dependency, so the bridge always resolves
8
+ * the app's own `Connect` rather than a second copy with a different DI token.
9
+ *
10
+ * @packageDocumentation
11
+ * @beta
12
+ */
13
+ export { GENESIS_AGENT_NAME, registerGenesisAssistant } from './register-genesis-assistant';
14
+ export type { GenesisFilter, GenesisFilterField, GenesisFilterOp } from './criteria';
15
+ export { createGenesisResourceTools, GENESIS_DATA_SOURCE } from './resource-tools';
16
+ export type { GenesisReadResult, GenesisResourceTools, GenesisResourceToolsOptions, GenesisToolError, } from './resource-tools';
17
+ export { GENESIS_EVENT_OPS } from './types';
18
+ export type { GenesisAiConfig, GenesisAiResource, GenesisAssistantExtensions, GenesisAssistantRegistration, GenesisEventOp, GenesisResourceKind, RegisterGenesisAssistantOptions, } from './types';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/genesis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACnF,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,4BAA4B,EAC5B,cAAc,EACd,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,SAAS,CAAC"}