@ramme-io/shared 3.1.1 → 3.1.2
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 +2 -2
- package/dist/index.cjs +434 -82
- package/dist/index.d.cts +1238 -12
- package/dist/index.d.ts +1238 -12
- package/dist/index.js +397 -82
- package/package.json +6 -5
package/dist/index.d.cts
CHANGED
|
@@ -1667,6 +1667,665 @@ declare namespace schema {
|
|
|
1667
1667
|
export { type schema_BodewellCommand as BodewellCommand, schema_BodewellCommandSchema as BodewellCommandSchema, schema_BodewellDeviceID as BodewellDeviceID, type schema_BodewellTelemetry as BodewellTelemetry, schema_BodewellTelemetrySchema as BodewellTelemetrySchema };
|
|
1668
1668
|
}
|
|
1669
1669
|
|
|
1670
|
+
/**
|
|
1671
|
+
* @file schema.ts
|
|
1672
|
+
* @package @ramme-io/shared
|
|
1673
|
+
* @description Device configuration contract — the agreement between a local
|
|
1674
|
+
* configuration portal and a Ramme display device.
|
|
1675
|
+
*
|
|
1676
|
+
* ARCHITECTURAL ROLE:
|
|
1677
|
+
* The Signal contract (../signals/schema.ts) carries data *up* from a device.
|
|
1678
|
+
* This file carries configuration *down* to one. Together they are the whole
|
|
1679
|
+
* device conversation; nothing else should invent its own shape for either.
|
|
1680
|
+
*
|
|
1681
|
+
* Deliberately generic — this is not Bodewell-specific. A Bodewell rig, a
|
|
1682
|
+
* workshop display and any future device all speak this.
|
|
1683
|
+
*
|
|
1684
|
+
* ─── DESIGN CONSTRAINTS ──────────────────────────────────────────────────────
|
|
1685
|
+
*
|
|
1686
|
+
* 1. The device applies config and persists it, then runs standalone. The
|
|
1687
|
+
* portal is a local project on someone's laptop and will be closed most of
|
|
1688
|
+
* the time. A device that only works while a laptop is open is not a device.
|
|
1689
|
+
*
|
|
1690
|
+
* 2. Payloads stay small. This is parsed on a microcontroller, not a server.
|
|
1691
|
+
* Notably the theme is a preset name plus a handful of overrides rather than
|
|
1692
|
+
* the full web token set — an embedded renderer needs five colours, not
|
|
1693
|
+
* thirty CSS variables.
|
|
1694
|
+
*
|
|
1695
|
+
* 3. `revision` is the sync mechanism. The portal increments it on every write;
|
|
1696
|
+
* the device reports the revision it is actually running. Equal means caught
|
|
1697
|
+
* up. This is how the UI can honestly say "applied" instead of "sent".
|
|
1698
|
+
*
|
|
1699
|
+
* ─── IRON LAW — Logic = 0 ────────────────────────────────────────────────────
|
|
1700
|
+
* Zod schemas, inferred types and const registries only. No functions.
|
|
1701
|
+
*/
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* Hardware model. Determines screen size, available pins and which apps can
|
|
1705
|
+
* run — so it is the device's declaration of capability, not decoration.
|
|
1706
|
+
*/
|
|
1707
|
+
declare const DeviceKindSchema: z.ZodEnum<["esp32-touch-28", "esp32-headless", "simulator"]>;
|
|
1708
|
+
type DeviceKind = z.infer<typeof DeviceKindSchema>;
|
|
1709
|
+
/**
|
|
1710
|
+
* All apps ship inside one firmware image and are switched by config.
|
|
1711
|
+
* Reflashing to change screens would put a cable and a driver back in the
|
|
1712
|
+
* user's way, which is the thing the whole design avoids.
|
|
1713
|
+
*/
|
|
1714
|
+
declare const DeviceAppIdSchema: z.ZodEnum<["weather", "clock", "aircraft", "sensor", "blank"]>;
|
|
1715
|
+
type DeviceAppId = z.infer<typeof DeviceAppIdSchema>;
|
|
1716
|
+
declare const WeatherAppConfigSchema: z.ZodObject<{
|
|
1717
|
+
/** Postal code is what a person knows; the portal resolves it to coordinates. */
|
|
1718
|
+
postalCode: z.ZodString;
|
|
1719
|
+
latitude: z.ZodOptional<z.ZodNumber>;
|
|
1720
|
+
longitude: z.ZodOptional<z.ZodNumber>;
|
|
1721
|
+
units: z.ZodDefault<z.ZodEnum<["imperial", "metric"]>>;
|
|
1722
|
+
showForecast: z.ZodDefault<z.ZodBoolean>;
|
|
1723
|
+
refreshSeconds: z.ZodDefault<z.ZodNumber>;
|
|
1724
|
+
}, "strip", z.ZodTypeAny, {
|
|
1725
|
+
postalCode: string;
|
|
1726
|
+
units: "metric" | "imperial";
|
|
1727
|
+
showForecast: boolean;
|
|
1728
|
+
refreshSeconds: number;
|
|
1729
|
+
latitude?: number | undefined;
|
|
1730
|
+
longitude?: number | undefined;
|
|
1731
|
+
}, {
|
|
1732
|
+
postalCode: string;
|
|
1733
|
+
latitude?: number | undefined;
|
|
1734
|
+
longitude?: number | undefined;
|
|
1735
|
+
units?: "metric" | "imperial" | undefined;
|
|
1736
|
+
showForecast?: boolean | undefined;
|
|
1737
|
+
refreshSeconds?: number | undefined;
|
|
1738
|
+
}>;
|
|
1739
|
+
declare const ClockAppConfigSchema: z.ZodObject<{
|
|
1740
|
+
/** IANA zone, e.g. "America/New_York". */
|
|
1741
|
+
timezone: z.ZodDefault<z.ZodString>;
|
|
1742
|
+
twentyFourHour: z.ZodDefault<z.ZodBoolean>;
|
|
1743
|
+
showSeconds: z.ZodDefault<z.ZodBoolean>;
|
|
1744
|
+
showDate: z.ZodDefault<z.ZodBoolean>;
|
|
1745
|
+
}, "strip", z.ZodTypeAny, {
|
|
1746
|
+
timezone: string;
|
|
1747
|
+
twentyFourHour: boolean;
|
|
1748
|
+
showSeconds: boolean;
|
|
1749
|
+
showDate: boolean;
|
|
1750
|
+
}, {
|
|
1751
|
+
timezone?: string | undefined;
|
|
1752
|
+
twentyFourHour?: boolean | undefined;
|
|
1753
|
+
showSeconds?: boolean | undefined;
|
|
1754
|
+
showDate?: boolean | undefined;
|
|
1755
|
+
}>;
|
|
1756
|
+
declare const AircraftAppConfigSchema: z.ZodObject<{
|
|
1757
|
+
latitude: z.ZodNumber;
|
|
1758
|
+
longitude: z.ZodNumber;
|
|
1759
|
+
radiusKm: z.ZodDefault<z.ZodNumber>;
|
|
1760
|
+
/** Rows the list view can show before the screen runs out. */
|
|
1761
|
+
maxRows: z.ZodDefault<z.ZodNumber>;
|
|
1762
|
+
refreshSeconds: z.ZodDefault<z.ZodNumber>;
|
|
1763
|
+
}, "strip", z.ZodTypeAny, {
|
|
1764
|
+
latitude: number;
|
|
1765
|
+
longitude: number;
|
|
1766
|
+
refreshSeconds: number;
|
|
1767
|
+
radiusKm: number;
|
|
1768
|
+
maxRows: number;
|
|
1769
|
+
}, {
|
|
1770
|
+
latitude: number;
|
|
1771
|
+
longitude: number;
|
|
1772
|
+
refreshSeconds?: number | undefined;
|
|
1773
|
+
radiusKm?: number | undefined;
|
|
1774
|
+
maxRows?: number | undefined;
|
|
1775
|
+
}>;
|
|
1776
|
+
declare const SensorAppConfigSchema: z.ZodObject<{
|
|
1777
|
+
/** Signal keys to display, in order. Abstract keys per the Signal contract. */
|
|
1778
|
+
keys: z.ZodArray<z.ZodString, "many">;
|
|
1779
|
+
refreshSeconds: z.ZodDefault<z.ZodNumber>;
|
|
1780
|
+
}, "strip", z.ZodTypeAny, {
|
|
1781
|
+
keys: string[];
|
|
1782
|
+
refreshSeconds: number;
|
|
1783
|
+
}, {
|
|
1784
|
+
keys: string[];
|
|
1785
|
+
refreshSeconds?: number | undefined;
|
|
1786
|
+
}>;
|
|
1787
|
+
/**
|
|
1788
|
+
* Every app's settings are carried, not just the active one — so switching
|
|
1789
|
+
* apps is instant and does not lose what you configured last time.
|
|
1790
|
+
*/
|
|
1791
|
+
declare const DeviceAppsSchema: z.ZodObject<{
|
|
1792
|
+
weather: z.ZodOptional<z.ZodObject<{
|
|
1793
|
+
/** Postal code is what a person knows; the portal resolves it to coordinates. */
|
|
1794
|
+
postalCode: z.ZodString;
|
|
1795
|
+
latitude: z.ZodOptional<z.ZodNumber>;
|
|
1796
|
+
longitude: z.ZodOptional<z.ZodNumber>;
|
|
1797
|
+
units: z.ZodDefault<z.ZodEnum<["imperial", "metric"]>>;
|
|
1798
|
+
showForecast: z.ZodDefault<z.ZodBoolean>;
|
|
1799
|
+
refreshSeconds: z.ZodDefault<z.ZodNumber>;
|
|
1800
|
+
}, "strip", z.ZodTypeAny, {
|
|
1801
|
+
postalCode: string;
|
|
1802
|
+
units: "metric" | "imperial";
|
|
1803
|
+
showForecast: boolean;
|
|
1804
|
+
refreshSeconds: number;
|
|
1805
|
+
latitude?: number | undefined;
|
|
1806
|
+
longitude?: number | undefined;
|
|
1807
|
+
}, {
|
|
1808
|
+
postalCode: string;
|
|
1809
|
+
latitude?: number | undefined;
|
|
1810
|
+
longitude?: number | undefined;
|
|
1811
|
+
units?: "metric" | "imperial" | undefined;
|
|
1812
|
+
showForecast?: boolean | undefined;
|
|
1813
|
+
refreshSeconds?: number | undefined;
|
|
1814
|
+
}>>;
|
|
1815
|
+
clock: z.ZodOptional<z.ZodObject<{
|
|
1816
|
+
/** IANA zone, e.g. "America/New_York". */
|
|
1817
|
+
timezone: z.ZodDefault<z.ZodString>;
|
|
1818
|
+
twentyFourHour: z.ZodDefault<z.ZodBoolean>;
|
|
1819
|
+
showSeconds: z.ZodDefault<z.ZodBoolean>;
|
|
1820
|
+
showDate: z.ZodDefault<z.ZodBoolean>;
|
|
1821
|
+
}, "strip", z.ZodTypeAny, {
|
|
1822
|
+
timezone: string;
|
|
1823
|
+
twentyFourHour: boolean;
|
|
1824
|
+
showSeconds: boolean;
|
|
1825
|
+
showDate: boolean;
|
|
1826
|
+
}, {
|
|
1827
|
+
timezone?: string | undefined;
|
|
1828
|
+
twentyFourHour?: boolean | undefined;
|
|
1829
|
+
showSeconds?: boolean | undefined;
|
|
1830
|
+
showDate?: boolean | undefined;
|
|
1831
|
+
}>>;
|
|
1832
|
+
aircraft: z.ZodOptional<z.ZodObject<{
|
|
1833
|
+
latitude: z.ZodNumber;
|
|
1834
|
+
longitude: z.ZodNumber;
|
|
1835
|
+
radiusKm: z.ZodDefault<z.ZodNumber>;
|
|
1836
|
+
/** Rows the list view can show before the screen runs out. */
|
|
1837
|
+
maxRows: z.ZodDefault<z.ZodNumber>;
|
|
1838
|
+
refreshSeconds: z.ZodDefault<z.ZodNumber>;
|
|
1839
|
+
}, "strip", z.ZodTypeAny, {
|
|
1840
|
+
latitude: number;
|
|
1841
|
+
longitude: number;
|
|
1842
|
+
refreshSeconds: number;
|
|
1843
|
+
radiusKm: number;
|
|
1844
|
+
maxRows: number;
|
|
1845
|
+
}, {
|
|
1846
|
+
latitude: number;
|
|
1847
|
+
longitude: number;
|
|
1848
|
+
refreshSeconds?: number | undefined;
|
|
1849
|
+
radiusKm?: number | undefined;
|
|
1850
|
+
maxRows?: number | undefined;
|
|
1851
|
+
}>>;
|
|
1852
|
+
sensor: z.ZodOptional<z.ZodObject<{
|
|
1853
|
+
/** Signal keys to display, in order. Abstract keys per the Signal contract. */
|
|
1854
|
+
keys: z.ZodArray<z.ZodString, "many">;
|
|
1855
|
+
refreshSeconds: z.ZodDefault<z.ZodNumber>;
|
|
1856
|
+
}, "strip", z.ZodTypeAny, {
|
|
1857
|
+
keys: string[];
|
|
1858
|
+
refreshSeconds: number;
|
|
1859
|
+
}, {
|
|
1860
|
+
keys: string[];
|
|
1861
|
+
refreshSeconds?: number | undefined;
|
|
1862
|
+
}>>;
|
|
1863
|
+
}, "strip", z.ZodTypeAny, {
|
|
1864
|
+
sensor?: {
|
|
1865
|
+
keys: string[];
|
|
1866
|
+
refreshSeconds: number;
|
|
1867
|
+
} | undefined;
|
|
1868
|
+
weather?: {
|
|
1869
|
+
postalCode: string;
|
|
1870
|
+
units: "metric" | "imperial";
|
|
1871
|
+
showForecast: boolean;
|
|
1872
|
+
refreshSeconds: number;
|
|
1873
|
+
latitude?: number | undefined;
|
|
1874
|
+
longitude?: number | undefined;
|
|
1875
|
+
} | undefined;
|
|
1876
|
+
clock?: {
|
|
1877
|
+
timezone: string;
|
|
1878
|
+
twentyFourHour: boolean;
|
|
1879
|
+
showSeconds: boolean;
|
|
1880
|
+
showDate: boolean;
|
|
1881
|
+
} | undefined;
|
|
1882
|
+
aircraft?: {
|
|
1883
|
+
latitude: number;
|
|
1884
|
+
longitude: number;
|
|
1885
|
+
refreshSeconds: number;
|
|
1886
|
+
radiusKm: number;
|
|
1887
|
+
maxRows: number;
|
|
1888
|
+
} | undefined;
|
|
1889
|
+
}, {
|
|
1890
|
+
sensor?: {
|
|
1891
|
+
keys: string[];
|
|
1892
|
+
refreshSeconds?: number | undefined;
|
|
1893
|
+
} | undefined;
|
|
1894
|
+
weather?: {
|
|
1895
|
+
postalCode: string;
|
|
1896
|
+
latitude?: number | undefined;
|
|
1897
|
+
longitude?: number | undefined;
|
|
1898
|
+
units?: "metric" | "imperial" | undefined;
|
|
1899
|
+
showForecast?: boolean | undefined;
|
|
1900
|
+
refreshSeconds?: number | undefined;
|
|
1901
|
+
} | undefined;
|
|
1902
|
+
clock?: {
|
|
1903
|
+
timezone?: string | undefined;
|
|
1904
|
+
twentyFourHour?: boolean | undefined;
|
|
1905
|
+
showSeconds?: boolean | undefined;
|
|
1906
|
+
showDate?: boolean | undefined;
|
|
1907
|
+
} | undefined;
|
|
1908
|
+
aircraft?: {
|
|
1909
|
+
latitude: number;
|
|
1910
|
+
longitude: number;
|
|
1911
|
+
refreshSeconds?: number | undefined;
|
|
1912
|
+
radiusKm?: number | undefined;
|
|
1913
|
+
maxRows?: number | undefined;
|
|
1914
|
+
} | undefined;
|
|
1915
|
+
}>;
|
|
1916
|
+
declare const DeviceDisplayConfigSchema: z.ZodObject<{
|
|
1917
|
+
brightness: z.ZodDefault<z.ZodNumber>;
|
|
1918
|
+
/** Degrees clockwise. The board can sit either way up in a case. */
|
|
1919
|
+
rotation: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<90>, z.ZodLiteral<180>, z.ZodLiteral<270>]>>;
|
|
1920
|
+
/** Dim rather than sleep — a desk display that blanks looks broken. */
|
|
1921
|
+
dimAfterSeconds: z.ZodDefault<z.ZodNumber>;
|
|
1922
|
+
dimBrightness: z.ZodDefault<z.ZodNumber>;
|
|
1923
|
+
/** Local 24h times, e.g. "22:30". Empty disables night dimming. */
|
|
1924
|
+
nightStart: z.ZodOptional<z.ZodString>;
|
|
1925
|
+
nightEnd: z.ZodOptional<z.ZodString>;
|
|
1926
|
+
}, "strip", z.ZodTypeAny, {
|
|
1927
|
+
brightness: number;
|
|
1928
|
+
rotation: 0 | 90 | 180 | 270;
|
|
1929
|
+
dimAfterSeconds: number;
|
|
1930
|
+
dimBrightness: number;
|
|
1931
|
+
nightStart?: string | undefined;
|
|
1932
|
+
nightEnd?: string | undefined;
|
|
1933
|
+
}, {
|
|
1934
|
+
brightness?: number | undefined;
|
|
1935
|
+
rotation?: 0 | 90 | 180 | 270 | undefined;
|
|
1936
|
+
dimAfterSeconds?: number | undefined;
|
|
1937
|
+
dimBrightness?: number | undefined;
|
|
1938
|
+
nightStart?: string | undefined;
|
|
1939
|
+
nightEnd?: string | undefined;
|
|
1940
|
+
}>;
|
|
1941
|
+
/**
|
|
1942
|
+
* A deliberate subset of the web token set. An LVGL screen needs a ground, a
|
|
1943
|
+
* foreground, an accent and two supporting tones — shipping thirty CSS
|
|
1944
|
+
* variables to a microcontroller would be waste with no visible benefit.
|
|
1945
|
+
*/
|
|
1946
|
+
declare const DeviceThemeSchema: z.ZodObject<{
|
|
1947
|
+
preset: z.ZodDefault<z.ZodEnum<["light", "dark", "corporate", "midnight", "blueprint", "custom"]>>;
|
|
1948
|
+
background: z.ZodOptional<z.ZodString>;
|
|
1949
|
+
foreground: z.ZodOptional<z.ZodString>;
|
|
1950
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
1951
|
+
muted: z.ZodOptional<z.ZodString>;
|
|
1952
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
1953
|
+
}, "strip", z.ZodTypeAny, {
|
|
1954
|
+
preset: "custom" | "light" | "dark" | "corporate" | "midnight" | "blueprint";
|
|
1955
|
+
background?: string | undefined;
|
|
1956
|
+
foreground?: string | undefined;
|
|
1957
|
+
accent?: string | undefined;
|
|
1958
|
+
muted?: string | undefined;
|
|
1959
|
+
warning?: string | undefined;
|
|
1960
|
+
}, {
|
|
1961
|
+
preset?: "custom" | "light" | "dark" | "corporate" | "midnight" | "blueprint" | undefined;
|
|
1962
|
+
background?: string | undefined;
|
|
1963
|
+
foreground?: string | undefined;
|
|
1964
|
+
accent?: string | undefined;
|
|
1965
|
+
muted?: string | undefined;
|
|
1966
|
+
warning?: string | undefined;
|
|
1967
|
+
}>;
|
|
1968
|
+
declare const DeviceConfigSchema: z.ZodObject<{
|
|
1969
|
+
/** Bumped only on breaking shape changes, so old firmware can refuse safely. */
|
|
1970
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
1971
|
+
deviceId: z.ZodString;
|
|
1972
|
+
/** Monotonic. Portal increments on write; device echoes what it is running. */
|
|
1973
|
+
revision: z.ZodNumber;
|
|
1974
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
1975
|
+
activeApp: z.ZodEnum<["weather", "clock", "aircraft", "sensor", "blank"]>;
|
|
1976
|
+
apps: z.ZodObject<{
|
|
1977
|
+
weather: z.ZodOptional<z.ZodObject<{
|
|
1978
|
+
/** Postal code is what a person knows; the portal resolves it to coordinates. */
|
|
1979
|
+
postalCode: z.ZodString;
|
|
1980
|
+
latitude: z.ZodOptional<z.ZodNumber>;
|
|
1981
|
+
longitude: z.ZodOptional<z.ZodNumber>;
|
|
1982
|
+
units: z.ZodDefault<z.ZodEnum<["imperial", "metric"]>>;
|
|
1983
|
+
showForecast: z.ZodDefault<z.ZodBoolean>;
|
|
1984
|
+
refreshSeconds: z.ZodDefault<z.ZodNumber>;
|
|
1985
|
+
}, "strip", z.ZodTypeAny, {
|
|
1986
|
+
postalCode: string;
|
|
1987
|
+
units: "metric" | "imperial";
|
|
1988
|
+
showForecast: boolean;
|
|
1989
|
+
refreshSeconds: number;
|
|
1990
|
+
latitude?: number | undefined;
|
|
1991
|
+
longitude?: number | undefined;
|
|
1992
|
+
}, {
|
|
1993
|
+
postalCode: string;
|
|
1994
|
+
latitude?: number | undefined;
|
|
1995
|
+
longitude?: number | undefined;
|
|
1996
|
+
units?: "metric" | "imperial" | undefined;
|
|
1997
|
+
showForecast?: boolean | undefined;
|
|
1998
|
+
refreshSeconds?: number | undefined;
|
|
1999
|
+
}>>;
|
|
2000
|
+
clock: z.ZodOptional<z.ZodObject<{
|
|
2001
|
+
/** IANA zone, e.g. "America/New_York". */
|
|
2002
|
+
timezone: z.ZodDefault<z.ZodString>;
|
|
2003
|
+
twentyFourHour: z.ZodDefault<z.ZodBoolean>;
|
|
2004
|
+
showSeconds: z.ZodDefault<z.ZodBoolean>;
|
|
2005
|
+
showDate: z.ZodDefault<z.ZodBoolean>;
|
|
2006
|
+
}, "strip", z.ZodTypeAny, {
|
|
2007
|
+
timezone: string;
|
|
2008
|
+
twentyFourHour: boolean;
|
|
2009
|
+
showSeconds: boolean;
|
|
2010
|
+
showDate: boolean;
|
|
2011
|
+
}, {
|
|
2012
|
+
timezone?: string | undefined;
|
|
2013
|
+
twentyFourHour?: boolean | undefined;
|
|
2014
|
+
showSeconds?: boolean | undefined;
|
|
2015
|
+
showDate?: boolean | undefined;
|
|
2016
|
+
}>>;
|
|
2017
|
+
aircraft: z.ZodOptional<z.ZodObject<{
|
|
2018
|
+
latitude: z.ZodNumber;
|
|
2019
|
+
longitude: z.ZodNumber;
|
|
2020
|
+
radiusKm: z.ZodDefault<z.ZodNumber>;
|
|
2021
|
+
/** Rows the list view can show before the screen runs out. */
|
|
2022
|
+
maxRows: z.ZodDefault<z.ZodNumber>;
|
|
2023
|
+
refreshSeconds: z.ZodDefault<z.ZodNumber>;
|
|
2024
|
+
}, "strip", z.ZodTypeAny, {
|
|
2025
|
+
latitude: number;
|
|
2026
|
+
longitude: number;
|
|
2027
|
+
refreshSeconds: number;
|
|
2028
|
+
radiusKm: number;
|
|
2029
|
+
maxRows: number;
|
|
2030
|
+
}, {
|
|
2031
|
+
latitude: number;
|
|
2032
|
+
longitude: number;
|
|
2033
|
+
refreshSeconds?: number | undefined;
|
|
2034
|
+
radiusKm?: number | undefined;
|
|
2035
|
+
maxRows?: number | undefined;
|
|
2036
|
+
}>>;
|
|
2037
|
+
sensor: z.ZodOptional<z.ZodObject<{
|
|
2038
|
+
/** Signal keys to display, in order. Abstract keys per the Signal contract. */
|
|
2039
|
+
keys: z.ZodArray<z.ZodString, "many">;
|
|
2040
|
+
refreshSeconds: z.ZodDefault<z.ZodNumber>;
|
|
2041
|
+
}, "strip", z.ZodTypeAny, {
|
|
2042
|
+
keys: string[];
|
|
2043
|
+
refreshSeconds: number;
|
|
2044
|
+
}, {
|
|
2045
|
+
keys: string[];
|
|
2046
|
+
refreshSeconds?: number | undefined;
|
|
2047
|
+
}>>;
|
|
2048
|
+
}, "strip", z.ZodTypeAny, {
|
|
2049
|
+
sensor?: {
|
|
2050
|
+
keys: string[];
|
|
2051
|
+
refreshSeconds: number;
|
|
2052
|
+
} | undefined;
|
|
2053
|
+
weather?: {
|
|
2054
|
+
postalCode: string;
|
|
2055
|
+
units: "metric" | "imperial";
|
|
2056
|
+
showForecast: boolean;
|
|
2057
|
+
refreshSeconds: number;
|
|
2058
|
+
latitude?: number | undefined;
|
|
2059
|
+
longitude?: number | undefined;
|
|
2060
|
+
} | undefined;
|
|
2061
|
+
clock?: {
|
|
2062
|
+
timezone: string;
|
|
2063
|
+
twentyFourHour: boolean;
|
|
2064
|
+
showSeconds: boolean;
|
|
2065
|
+
showDate: boolean;
|
|
2066
|
+
} | undefined;
|
|
2067
|
+
aircraft?: {
|
|
2068
|
+
latitude: number;
|
|
2069
|
+
longitude: number;
|
|
2070
|
+
refreshSeconds: number;
|
|
2071
|
+
radiusKm: number;
|
|
2072
|
+
maxRows: number;
|
|
2073
|
+
} | undefined;
|
|
2074
|
+
}, {
|
|
2075
|
+
sensor?: {
|
|
2076
|
+
keys: string[];
|
|
2077
|
+
refreshSeconds?: number | undefined;
|
|
2078
|
+
} | undefined;
|
|
2079
|
+
weather?: {
|
|
2080
|
+
postalCode: string;
|
|
2081
|
+
latitude?: number | undefined;
|
|
2082
|
+
longitude?: number | undefined;
|
|
2083
|
+
units?: "metric" | "imperial" | undefined;
|
|
2084
|
+
showForecast?: boolean | undefined;
|
|
2085
|
+
refreshSeconds?: number | undefined;
|
|
2086
|
+
} | undefined;
|
|
2087
|
+
clock?: {
|
|
2088
|
+
timezone?: string | undefined;
|
|
2089
|
+
twentyFourHour?: boolean | undefined;
|
|
2090
|
+
showSeconds?: boolean | undefined;
|
|
2091
|
+
showDate?: boolean | undefined;
|
|
2092
|
+
} | undefined;
|
|
2093
|
+
aircraft?: {
|
|
2094
|
+
latitude: number;
|
|
2095
|
+
longitude: number;
|
|
2096
|
+
refreshSeconds?: number | undefined;
|
|
2097
|
+
radiusKm?: number | undefined;
|
|
2098
|
+
maxRows?: number | undefined;
|
|
2099
|
+
} | undefined;
|
|
2100
|
+
}>;
|
|
2101
|
+
display: z.ZodObject<{
|
|
2102
|
+
brightness: z.ZodDefault<z.ZodNumber>;
|
|
2103
|
+
/** Degrees clockwise. The board can sit either way up in a case. */
|
|
2104
|
+
rotation: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<90>, z.ZodLiteral<180>, z.ZodLiteral<270>]>>;
|
|
2105
|
+
/** Dim rather than sleep — a desk display that blanks looks broken. */
|
|
2106
|
+
dimAfterSeconds: z.ZodDefault<z.ZodNumber>;
|
|
2107
|
+
dimBrightness: z.ZodDefault<z.ZodNumber>;
|
|
2108
|
+
/** Local 24h times, e.g. "22:30". Empty disables night dimming. */
|
|
2109
|
+
nightStart: z.ZodOptional<z.ZodString>;
|
|
2110
|
+
nightEnd: z.ZodOptional<z.ZodString>;
|
|
2111
|
+
}, "strip", z.ZodTypeAny, {
|
|
2112
|
+
brightness: number;
|
|
2113
|
+
rotation: 0 | 90 | 180 | 270;
|
|
2114
|
+
dimAfterSeconds: number;
|
|
2115
|
+
dimBrightness: number;
|
|
2116
|
+
nightStart?: string | undefined;
|
|
2117
|
+
nightEnd?: string | undefined;
|
|
2118
|
+
}, {
|
|
2119
|
+
brightness?: number | undefined;
|
|
2120
|
+
rotation?: 0 | 90 | 180 | 270 | undefined;
|
|
2121
|
+
dimAfterSeconds?: number | undefined;
|
|
2122
|
+
dimBrightness?: number | undefined;
|
|
2123
|
+
nightStart?: string | undefined;
|
|
2124
|
+
nightEnd?: string | undefined;
|
|
2125
|
+
}>;
|
|
2126
|
+
theme: z.ZodObject<{
|
|
2127
|
+
preset: z.ZodDefault<z.ZodEnum<["light", "dark", "corporate", "midnight", "blueprint", "custom"]>>;
|
|
2128
|
+
background: z.ZodOptional<z.ZodString>;
|
|
2129
|
+
foreground: z.ZodOptional<z.ZodString>;
|
|
2130
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
2131
|
+
muted: z.ZodOptional<z.ZodString>;
|
|
2132
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
2133
|
+
}, "strip", z.ZodTypeAny, {
|
|
2134
|
+
preset: "custom" | "light" | "dark" | "corporate" | "midnight" | "blueprint";
|
|
2135
|
+
background?: string | undefined;
|
|
2136
|
+
foreground?: string | undefined;
|
|
2137
|
+
accent?: string | undefined;
|
|
2138
|
+
muted?: string | undefined;
|
|
2139
|
+
warning?: string | undefined;
|
|
2140
|
+
}, {
|
|
2141
|
+
preset?: "custom" | "light" | "dark" | "corporate" | "midnight" | "blueprint" | undefined;
|
|
2142
|
+
background?: string | undefined;
|
|
2143
|
+
foreground?: string | undefined;
|
|
2144
|
+
accent?: string | undefined;
|
|
2145
|
+
muted?: string | undefined;
|
|
2146
|
+
warning?: string | undefined;
|
|
2147
|
+
}>;
|
|
2148
|
+
}, "strip", z.ZodTypeAny, {
|
|
2149
|
+
theme: {
|
|
2150
|
+
preset: "custom" | "light" | "dark" | "corporate" | "midnight" | "blueprint";
|
|
2151
|
+
background?: string | undefined;
|
|
2152
|
+
foreground?: string | undefined;
|
|
2153
|
+
accent?: string | undefined;
|
|
2154
|
+
muted?: string | undefined;
|
|
2155
|
+
warning?: string | undefined;
|
|
2156
|
+
};
|
|
2157
|
+
schemaVersion: 1;
|
|
2158
|
+
deviceId: string;
|
|
2159
|
+
revision: number;
|
|
2160
|
+
activeApp: "sensor" | "weather" | "clock" | "aircraft" | "blank";
|
|
2161
|
+
apps: {
|
|
2162
|
+
sensor?: {
|
|
2163
|
+
keys: string[];
|
|
2164
|
+
refreshSeconds: number;
|
|
2165
|
+
} | undefined;
|
|
2166
|
+
weather?: {
|
|
2167
|
+
postalCode: string;
|
|
2168
|
+
units: "metric" | "imperial";
|
|
2169
|
+
showForecast: boolean;
|
|
2170
|
+
refreshSeconds: number;
|
|
2171
|
+
latitude?: number | undefined;
|
|
2172
|
+
longitude?: number | undefined;
|
|
2173
|
+
} | undefined;
|
|
2174
|
+
clock?: {
|
|
2175
|
+
timezone: string;
|
|
2176
|
+
twentyFourHour: boolean;
|
|
2177
|
+
showSeconds: boolean;
|
|
2178
|
+
showDate: boolean;
|
|
2179
|
+
} | undefined;
|
|
2180
|
+
aircraft?: {
|
|
2181
|
+
latitude: number;
|
|
2182
|
+
longitude: number;
|
|
2183
|
+
refreshSeconds: number;
|
|
2184
|
+
radiusKm: number;
|
|
2185
|
+
maxRows: number;
|
|
2186
|
+
} | undefined;
|
|
2187
|
+
};
|
|
2188
|
+
display: {
|
|
2189
|
+
brightness: number;
|
|
2190
|
+
rotation: 0 | 90 | 180 | 270;
|
|
2191
|
+
dimAfterSeconds: number;
|
|
2192
|
+
dimBrightness: number;
|
|
2193
|
+
nightStart?: string | undefined;
|
|
2194
|
+
nightEnd?: string | undefined;
|
|
2195
|
+
};
|
|
2196
|
+
updatedAt?: string | undefined;
|
|
2197
|
+
}, {
|
|
2198
|
+
theme: {
|
|
2199
|
+
preset?: "custom" | "light" | "dark" | "corporate" | "midnight" | "blueprint" | undefined;
|
|
2200
|
+
background?: string | undefined;
|
|
2201
|
+
foreground?: string | undefined;
|
|
2202
|
+
accent?: string | undefined;
|
|
2203
|
+
muted?: string | undefined;
|
|
2204
|
+
warning?: string | undefined;
|
|
2205
|
+
};
|
|
2206
|
+
schemaVersion: 1;
|
|
2207
|
+
deviceId: string;
|
|
2208
|
+
revision: number;
|
|
2209
|
+
activeApp: "sensor" | "weather" | "clock" | "aircraft" | "blank";
|
|
2210
|
+
apps: {
|
|
2211
|
+
sensor?: {
|
|
2212
|
+
keys: string[];
|
|
2213
|
+
refreshSeconds?: number | undefined;
|
|
2214
|
+
} | undefined;
|
|
2215
|
+
weather?: {
|
|
2216
|
+
postalCode: string;
|
|
2217
|
+
latitude?: number | undefined;
|
|
2218
|
+
longitude?: number | undefined;
|
|
2219
|
+
units?: "metric" | "imperial" | undefined;
|
|
2220
|
+
showForecast?: boolean | undefined;
|
|
2221
|
+
refreshSeconds?: number | undefined;
|
|
2222
|
+
} | undefined;
|
|
2223
|
+
clock?: {
|
|
2224
|
+
timezone?: string | undefined;
|
|
2225
|
+
twentyFourHour?: boolean | undefined;
|
|
2226
|
+
showSeconds?: boolean | undefined;
|
|
2227
|
+
showDate?: boolean | undefined;
|
|
2228
|
+
} | undefined;
|
|
2229
|
+
aircraft?: {
|
|
2230
|
+
latitude: number;
|
|
2231
|
+
longitude: number;
|
|
2232
|
+
refreshSeconds?: number | undefined;
|
|
2233
|
+
radiusKm?: number | undefined;
|
|
2234
|
+
maxRows?: number | undefined;
|
|
2235
|
+
} | undefined;
|
|
2236
|
+
};
|
|
2237
|
+
display: {
|
|
2238
|
+
brightness?: number | undefined;
|
|
2239
|
+
rotation?: 0 | 90 | 180 | 270 | undefined;
|
|
2240
|
+
dimAfterSeconds?: number | undefined;
|
|
2241
|
+
dimBrightness?: number | undefined;
|
|
2242
|
+
nightStart?: string | undefined;
|
|
2243
|
+
nightEnd?: string | undefined;
|
|
2244
|
+
};
|
|
2245
|
+
updatedAt?: string | undefined;
|
|
2246
|
+
}>;
|
|
2247
|
+
type DeviceConfig = z.infer<typeof DeviceConfigSchema>;
|
|
2248
|
+
/**
|
|
2249
|
+
* Network credentials never travel in DeviceConfig. They are entered once,
|
|
2250
|
+
* directly to the device, while it is serving its own access point — so they
|
|
2251
|
+
* are not sitting in a config file on a laptop or in a git repository.
|
|
2252
|
+
*
|
|
2253
|
+
* State machine:
|
|
2254
|
+
*
|
|
2255
|
+
* unprovisioned ──(creds entered via AP)──► connecting
|
|
2256
|
+
* connecting ──(success)──► online
|
|
2257
|
+
* connecting ──(failure)──► failed ──(retry/timeout)──► unprovisioned
|
|
2258
|
+
* online ──(network lost)──► offline ──(reconnect)──► online
|
|
2259
|
+
*
|
|
2260
|
+
* `unprovisioned` and `failed` both mean the device is serving its own AP and
|
|
2261
|
+
* showing join instructions on screen. Reaching a dead end silently is the one
|
|
2262
|
+
* outcome the machine must never allow — a device that gets home and cannot
|
|
2263
|
+
* connect, with nothing on screen explaining how to fix it, ends up in a drawer.
|
|
2264
|
+
*/
|
|
2265
|
+
declare const ProvisioningStateSchema: z.ZodEnum<["unprovisioned", "connecting", "online", "offline", "failed"]>;
|
|
2266
|
+
type ProvisioningState = z.infer<typeof ProvisioningStateSchema>;
|
|
2267
|
+
/**
|
|
2268
|
+
* What the device reports about itself. Chiefly this exists so the portal can
|
|
2269
|
+
* distinguish "config sent" from "config applied" by comparing
|
|
2270
|
+
* `configRevision` against what it last wrote.
|
|
2271
|
+
*/
|
|
2272
|
+
declare const DeviceStatusSchema: z.ZodObject<{
|
|
2273
|
+
deviceId: z.ZodString;
|
|
2274
|
+
kind: z.ZodEnum<["esp32-touch-28", "esp32-headless", "simulator"]>;
|
|
2275
|
+
firmwareVersion: z.ZodString;
|
|
2276
|
+
/** Shown on the device's own screen at boot — how the user finds it. */
|
|
2277
|
+
ipAddress: z.ZodOptional<z.ZodString>;
|
|
2278
|
+
provisioning: z.ZodEnum<["unprovisioned", "connecting", "online", "offline", "failed"]>;
|
|
2279
|
+
/** Revision the device is actually running, not the one it was sent. */
|
|
2280
|
+
configRevision: z.ZodNumber;
|
|
2281
|
+
activeApp: z.ZodEnum<["weather", "clock", "aircraft", "sensor", "blank"]>;
|
|
2282
|
+
rssi: z.ZodOptional<z.ZodNumber>;
|
|
2283
|
+
uptimeSeconds: z.ZodOptional<z.ZodNumber>;
|
|
2284
|
+
freeHeapBytes: z.ZodOptional<z.ZodNumber>;
|
|
2285
|
+
}, "strip", z.ZodTypeAny, {
|
|
2286
|
+
kind: "esp32-touch-28" | "esp32-headless" | "simulator";
|
|
2287
|
+
deviceId: string;
|
|
2288
|
+
activeApp: "sensor" | "weather" | "clock" | "aircraft" | "blank";
|
|
2289
|
+
firmwareVersion: string;
|
|
2290
|
+
provisioning: "unprovisioned" | "connecting" | "online" | "offline" | "failed";
|
|
2291
|
+
configRevision: number;
|
|
2292
|
+
ipAddress?: string | undefined;
|
|
2293
|
+
rssi?: number | undefined;
|
|
2294
|
+
uptimeSeconds?: number | undefined;
|
|
2295
|
+
freeHeapBytes?: number | undefined;
|
|
2296
|
+
}, {
|
|
2297
|
+
kind: "esp32-touch-28" | "esp32-headless" | "simulator";
|
|
2298
|
+
deviceId: string;
|
|
2299
|
+
activeApp: "sensor" | "weather" | "clock" | "aircraft" | "blank";
|
|
2300
|
+
firmwareVersion: string;
|
|
2301
|
+
provisioning: "unprovisioned" | "connecting" | "online" | "offline" | "failed";
|
|
2302
|
+
configRevision: number;
|
|
2303
|
+
ipAddress?: string | undefined;
|
|
2304
|
+
rssi?: number | undefined;
|
|
2305
|
+
uptimeSeconds?: number | undefined;
|
|
2306
|
+
freeHeapBytes?: number | undefined;
|
|
2307
|
+
}>;
|
|
2308
|
+
type DeviceStatus = z.infer<typeof DeviceStatusSchema>;
|
|
2309
|
+
/**
|
|
2310
|
+
* Endpoints the device exposes on the local network. Plain HTTP is deliberate:
|
|
2311
|
+
* the portal is served from localhost, so there is no mixed-content barrier,
|
|
2312
|
+
* and terminating TLS on a microcontroller for a LAN-only device buys nothing.
|
|
2313
|
+
*
|
|
2314
|
+
* A hosted portal would need a different transport — the device connecting
|
|
2315
|
+
* outward rather than being polled. That is a later decision and this contract
|
|
2316
|
+
* does not prejudge it.
|
|
2317
|
+
*/
|
|
2318
|
+
declare const DEVICE_ENDPOINTS: {
|
|
2319
|
+
/** GET → DeviceStatus */
|
|
2320
|
+
readonly status: "/api/status";
|
|
2321
|
+
/** GET → DeviceConfig · POST DeviceConfig → applied + persisted */
|
|
2322
|
+
readonly config: "/api/config";
|
|
2323
|
+
/** POST → clears stored credentials and returns to AP mode */
|
|
2324
|
+
readonly forget: "/api/forget";
|
|
2325
|
+
};
|
|
2326
|
+
declare const DEVICE_AP_SSID_PREFIX = "ramme-setup-";
|
|
2327
|
+
declare const DEFAULT_DEVICE_CONFIG: Omit<DeviceConfig, 'deviceId'>;
|
|
2328
|
+
|
|
1670
2329
|
/**
|
|
1671
2330
|
* @file tools.ts
|
|
1672
2331
|
* @package @ramme-io/shared
|
|
@@ -1738,6 +2397,39 @@ declare const companyProfileParameters: z.ZodObject<{
|
|
|
1738
2397
|
ticker: string;
|
|
1739
2398
|
}>;
|
|
1740
2399
|
type CompanyProfileParams = z.infer<typeof companyProfileParameters>;
|
|
2400
|
+
/**
|
|
2401
|
+
* Counterparty Graph / Divergence Metrics Tools
|
|
2402
|
+
* Surface Fleet-Brain-Deep's inferred counterparty graph and operational/
|
|
2403
|
+
* customer divergence scoring to the chat assistant — previously it had no
|
|
2404
|
+
* path to this data at all.
|
|
2405
|
+
*/
|
|
2406
|
+
declare const counterpartyGraphParameters: z.ZodObject<{
|
|
2407
|
+
ticker: z.ZodString;
|
|
2408
|
+
hops: z.ZodOptional<z.ZodNumber>;
|
|
2409
|
+
}, "strip", z.ZodTypeAny, {
|
|
2410
|
+
ticker: string;
|
|
2411
|
+
hops?: number | undefined;
|
|
2412
|
+
}, {
|
|
2413
|
+
ticker: string;
|
|
2414
|
+
hops?: number | undefined;
|
|
2415
|
+
}>;
|
|
2416
|
+
type CounterpartyGraphParams = z.infer<typeof counterpartyGraphParameters>;
|
|
2417
|
+
declare const divergenceMetricsParameters: z.ZodObject<{
|
|
2418
|
+
ticker: z.ZodString;
|
|
2419
|
+
}, "strip", z.ZodTypeAny, {
|
|
2420
|
+
ticker: string;
|
|
2421
|
+
}, {
|
|
2422
|
+
ticker: string;
|
|
2423
|
+
}>;
|
|
2424
|
+
type DivergenceMetricsParams = z.infer<typeof divergenceMetricsParameters>;
|
|
2425
|
+
/**
|
|
2426
|
+
* Architecture Reference Tool
|
|
2427
|
+
* Surfaces this platform's own data architecture (stack, schema, AI
|
|
2428
|
+
* pipelines, background workers) to the chat assistant. Takes no
|
|
2429
|
+
* parameters — it describes the system itself, not a company.
|
|
2430
|
+
*/
|
|
2431
|
+
declare const architectureReferenceParameters: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
2432
|
+
type ArchitectureReferenceParams = z.infer<typeof architectureReferenceParameters>;
|
|
1741
2433
|
/**
|
|
1742
2434
|
* Generic tool definition structure.
|
|
1743
2435
|
* Each tool must have a unique name, description, and Zod parameter schema.
|
|
@@ -2211,17 +2903,17 @@ declare const ThemeTokensSchema: z.ZodObject<{
|
|
|
2211
2903
|
destructive: z.ZodString;
|
|
2212
2904
|
radius: z.ZodEnum<["none", "sm", "md", "lg", "full"]>;
|
|
2213
2905
|
}, "strip", z.ZodTypeAny, {
|
|
2906
|
+
warning: string;
|
|
2214
2907
|
primary: string;
|
|
2215
2908
|
neutral: string;
|
|
2216
2909
|
success: string;
|
|
2217
|
-
warning: string;
|
|
2218
2910
|
destructive: string;
|
|
2219
2911
|
radius: "none" | "sm" | "md" | "lg" | "full";
|
|
2220
2912
|
}, {
|
|
2913
|
+
warning: string;
|
|
2221
2914
|
primary: string;
|
|
2222
2915
|
neutral: string;
|
|
2223
2916
|
success: string;
|
|
2224
|
-
warning: string;
|
|
2225
2917
|
destructive: string;
|
|
2226
2918
|
radius: "none" | "sm" | "md" | "lg" | "full";
|
|
2227
2919
|
}>;
|
|
@@ -2306,10 +2998,28 @@ type CounterpartyType = z.infer<typeof CounterpartyTypeSchema>;
|
|
|
2306
2998
|
* @field sourceSignalIds `signals.id` rows this node was derived from — provenance
|
|
2307
2999
|
* trail back to the raw alternative signals.
|
|
2308
3000
|
*/
|
|
3001
|
+
/**
|
|
3002
|
+
* How much identity a counterparty actually has. Measured on the live graph:
|
|
3003
|
+
* 175 public, 70 private, 107 unresolved, 4 public-but-uncovered.
|
|
3004
|
+
*
|
|
3005
|
+
* - `public` covered here — has a profile, so it links to its entity page
|
|
3006
|
+
* - `public_uncovered` has a ticker we do not cover (foreign listings such as
|
|
3007
|
+
* ADS.DE, LCTX.TA). Show the symbol; never link, because the
|
|
3008
|
+
* entity page would come back empty.
|
|
3009
|
+
* - `private` a GLEIF LEI but no ticker — lives in non_public_entities
|
|
3010
|
+
* - `unresolved` a name only, pending lookup
|
|
3011
|
+
*/
|
|
3012
|
+
declare const CounterpartyResolutionSchema: z.ZodEnum<["public", "public_uncovered", "private", "unresolved"]>;
|
|
3013
|
+
type CounterpartyResolution = z.infer<typeof CounterpartyResolutionSchema>;
|
|
2309
3014
|
declare const CounterpartyNodeSchema: z.ZodObject<{
|
|
2310
3015
|
id: z.ZodString;
|
|
2311
3016
|
ticker: z.ZodNullable<z.ZodString>;
|
|
3017
|
+
/** Name as it appeared in the source signal — e.g. "Nike". Not the registered name. */
|
|
2312
3018
|
name: z.ZodString;
|
|
3019
|
+
/** Registered legal name from `profiles` — e.g. "NIKE, Inc.". Null unless `public`. */
|
|
3020
|
+
publicName: z.ZodNullable<z.ZodString>;
|
|
3021
|
+
lei: z.ZodNullable<z.ZodString>;
|
|
3022
|
+
resolution: z.ZodEnum<["public", "public_uncovered", "private", "unresolved"]>;
|
|
2313
3023
|
type: z.ZodEnum<["supplier", "customer", "partner", "competitor", "regulator", "unknown"]>;
|
|
2314
3024
|
confidence: z.ZodNumber;
|
|
2315
3025
|
sourceSignalIds: z.ZodArray<z.ZodNumber, "many">;
|
|
@@ -2320,6 +3030,9 @@ declare const CounterpartyNodeSchema: z.ZodObject<{
|
|
|
2320
3030
|
id: string;
|
|
2321
3031
|
name: string;
|
|
2322
3032
|
ticker: string | null;
|
|
3033
|
+
publicName: string | null;
|
|
3034
|
+
lei: string | null;
|
|
3035
|
+
resolution: "public" | "public_uncovered" | "private" | "unresolved";
|
|
2323
3036
|
confidence: number;
|
|
2324
3037
|
sourceSignalIds: number[];
|
|
2325
3038
|
firstSeenAt: string;
|
|
@@ -2329,43 +3042,63 @@ declare const CounterpartyNodeSchema: z.ZodObject<{
|
|
|
2329
3042
|
id: string;
|
|
2330
3043
|
name: string;
|
|
2331
3044
|
ticker: string | null;
|
|
3045
|
+
publicName: string | null;
|
|
3046
|
+
lei: string | null;
|
|
3047
|
+
resolution: "public" | "public_uncovered" | "private" | "unresolved";
|
|
2332
3048
|
confidence: number;
|
|
2333
3049
|
sourceSignalIds: number[];
|
|
2334
3050
|
firstSeenAt: string;
|
|
2335
3051
|
lastSeenAt: string;
|
|
2336
3052
|
}>;
|
|
2337
3053
|
type CounterpartyNode = z.infer<typeof CounterpartyNodeSchema>;
|
|
2338
|
-
declare const RelationshipEdgeTypeSchema: z.ZodEnum<["supplies_to", "purchases_from", "partners_with", "competes_with", "regulated_by"]>;
|
|
3054
|
+
declare const RelationshipEdgeTypeSchema: z.ZodEnum<["supplies_to", "purchases_from", "partners_with", "competes_with", "regulated_by", "invests_in", "acquires", "same_as"]>;
|
|
2339
3055
|
type RelationshipEdgeType = z.infer<typeof RelationshipEdgeTypeSchema>;
|
|
2340
3056
|
/**
|
|
2341
3057
|
* A directed, weighted edge between two CounterpartyNode ids (or a node id and
|
|
2342
3058
|
* a subject ticker). `weight` is the inferred strength/confidence of the edge
|
|
2343
3059
|
* itself, distinct from the confidence on either endpoint node.
|
|
3060
|
+
*
|
|
3061
|
+
* Bitemporal: `validFrom`/`validTo` track when this edge was actually true
|
|
3062
|
+
* (event time), not just when the row was last written. `validTo: null` means
|
|
3063
|
+
* currently valid. When a later extraction reports a DIFFERENT edge_type for
|
|
3064
|
+
* the same (sourceId, targetId) pair, the old edge is expired (`validTo` set)
|
|
3065
|
+
* and a new edge row is inserted rather than overwritten in place — this is
|
|
3066
|
+
* what makes "what did this graph look like as of date X" and "what changed"
|
|
3067
|
+
* answerable instead of destroying history on every write. Reconfirmation of
|
|
3068
|
+
* the SAME edge_type updates the existing row in place (weight/evidence
|
|
3069
|
+
* refresh) without touching validFrom/validTo.
|
|
2344
3070
|
*/
|
|
2345
3071
|
declare const RelationshipEdgeSchema: z.ZodObject<{
|
|
2346
3072
|
id: z.ZodString;
|
|
2347
3073
|
sourceId: z.ZodString;
|
|
2348
3074
|
targetId: z.ZodString;
|
|
2349
|
-
edgeType: z.ZodEnum<["supplies_to", "purchases_from", "partners_with", "competes_with", "regulated_by"]>;
|
|
3075
|
+
edgeType: z.ZodEnum<["supplies_to", "purchases_from", "partners_with", "competes_with", "regulated_by", "invests_in", "acquires", "same_as"]>;
|
|
2350
3076
|
weight: z.ZodNumber;
|
|
2351
3077
|
evidenceSignalIds: z.ZodArray<z.ZodNumber, "many">;
|
|
2352
3078
|
updatedAt: z.ZodString;
|
|
3079
|
+
validFrom: z.ZodString;
|
|
3080
|
+
/** null = currently valid. Set when a differently-typed edge supersedes this one. */
|
|
3081
|
+
validTo: z.ZodNullable<z.ZodString>;
|
|
2353
3082
|
}, "strip", z.ZodTypeAny, {
|
|
2354
3083
|
id: string;
|
|
3084
|
+
updatedAt: string;
|
|
2355
3085
|
sourceId: string;
|
|
2356
3086
|
targetId: string;
|
|
2357
|
-
edgeType: "supplies_to" | "purchases_from" | "partners_with" | "competes_with" | "regulated_by";
|
|
3087
|
+
edgeType: "supplies_to" | "purchases_from" | "partners_with" | "competes_with" | "regulated_by" | "invests_in" | "acquires" | "same_as";
|
|
2358
3088
|
weight: number;
|
|
2359
3089
|
evidenceSignalIds: number[];
|
|
2360
|
-
|
|
3090
|
+
validFrom: string;
|
|
3091
|
+
validTo: string | null;
|
|
2361
3092
|
}, {
|
|
2362
3093
|
id: string;
|
|
3094
|
+
updatedAt: string;
|
|
2363
3095
|
sourceId: string;
|
|
2364
3096
|
targetId: string;
|
|
2365
|
-
edgeType: "supplies_to" | "purchases_from" | "partners_with" | "competes_with" | "regulated_by";
|
|
3097
|
+
edgeType: "supplies_to" | "purchases_from" | "partners_with" | "competes_with" | "regulated_by" | "invests_in" | "acquires" | "same_as";
|
|
2366
3098
|
weight: number;
|
|
2367
3099
|
evidenceSignalIds: number[];
|
|
2368
|
-
|
|
3100
|
+
validFrom: string;
|
|
3101
|
+
validTo: string | null;
|
|
2369
3102
|
}>;
|
|
2370
3103
|
type RelationshipEdge = z.infer<typeof RelationshipEdgeSchema>;
|
|
2371
3104
|
/**
|
|
@@ -2395,7 +3128,7 @@ type SignalWeight = z.infer<typeof SignalWeightSchema>;
|
|
|
2395
3128
|
*/
|
|
2396
3129
|
declare const DivergenceMetricSchema: z.ZodObject<{
|
|
2397
3130
|
ticker: z.ZodString;
|
|
2398
|
-
metric: z.ZodEnum<["operational", "ux"]>;
|
|
3131
|
+
metric: z.ZodEnum<["operations", "customer", "operational", "ux"]>;
|
|
2399
3132
|
score: z.ZodNumber;
|
|
2400
3133
|
baseline: z.ZodNumber;
|
|
2401
3134
|
observed: z.ZodNumber;
|
|
@@ -2414,7 +3147,7 @@ declare const DivergenceMetricSchema: z.ZodObject<{
|
|
|
2414
3147
|
reason: string;
|
|
2415
3148
|
}>, "many">;
|
|
2416
3149
|
}, "strip", z.ZodTypeAny, {
|
|
2417
|
-
metric: "operational" | "ux";
|
|
3150
|
+
metric: "customer" | "operations" | "operational" | "ux";
|
|
2418
3151
|
ticker: string;
|
|
2419
3152
|
score: number;
|
|
2420
3153
|
baseline: number;
|
|
@@ -2426,7 +3159,7 @@ declare const DivergenceMetricSchema: z.ZodObject<{
|
|
|
2426
3159
|
reason: string;
|
|
2427
3160
|
}[];
|
|
2428
3161
|
}, {
|
|
2429
|
-
metric: "operational" | "ux";
|
|
3162
|
+
metric: "customer" | "operations" | "operational" | "ux";
|
|
2430
3163
|
ticker: string;
|
|
2431
3164
|
score: number;
|
|
2432
3165
|
baseline: number;
|
|
@@ -2499,4 +3232,497 @@ declare const NonPublicEntitySchema: z.ZodObject<{
|
|
|
2499
3232
|
}>;
|
|
2500
3233
|
type NonPublicEntity = z.infer<typeof NonPublicEntitySchema>;
|
|
2501
3234
|
|
|
2502
|
-
|
|
3235
|
+
/**
|
|
3236
|
+
* @file schema.ts
|
|
3237
|
+
* @package @ramme-io/shared
|
|
3238
|
+
* @description The Entity Event Contract — one shape for every time-stamped
|
|
3239
|
+
* thing that happens to a company, regardless of which table it came from.
|
|
3240
|
+
*
|
|
3241
|
+
* News, filings and analyst reports arrive from three different sources with
|
|
3242
|
+
* three different timestamp formats, three different notions of "impact" and
|
|
3243
|
+
* one usable notion of sentiment. This contract normalises all of that ONCE so
|
|
3244
|
+
* that no visualization has to know where an event came from — and, more
|
|
3245
|
+
* importantly, so that no visualization can accidentally lie about it.
|
|
3246
|
+
*
|
|
3247
|
+
* Two fields exist purely to encode data-quality facts that would otherwise be
|
|
3248
|
+
* rediscovered (or missed) by every consumer:
|
|
3249
|
+
*
|
|
3250
|
+
* `impactScale` — `impact` is NOT one scale. Filings are 99% 1-or-2,
|
|
3251
|
+
* on-demand news is hardcoded to 5 or 9, and only
|
|
3252
|
+
* sentinel news carries a real 1–9 spread. A
|
|
3253
|
+
* consumer that sizes marks by `impact` without
|
|
3254
|
+
* checking this renders every filing invisible.
|
|
3255
|
+
* `sentimentIsMeaningful` — sentiment is a news channel. Measured against the
|
|
3256
|
+
* live table, news is 14.7% neutral (avg 64.0, full
|
|
3257
|
+
* 0–100 range) while filings are 85.8% neutral (avg
|
|
3258
|
+
* 52.8). Colouring filings by sentiment renders 86%
|
|
3259
|
+
* of them identically.
|
|
3260
|
+
*
|
|
3261
|
+
* `occurredAt` is ALWAYS `YYYY-MM-DDTHH:MM:SSZ`. Because that form is
|
|
3262
|
+
* fixed-width, lexical order equals chronological order — which is what makes
|
|
3263
|
+
* a cross-source union sortable at all. The underlying tables are not
|
|
3264
|
+
* consistent (`signals` is space-separated, `insights` and `divergence_metrics`
|
|
3265
|
+
* are ISO-T), so producers must normalise before emitting.
|
|
3266
|
+
*
|
|
3267
|
+
* NOTE: `engines/data-factory-api` (Python) has no codegen bridge to this
|
|
3268
|
+
* package. `api/event_models.py` hand-mirrors these shapes in Pydantic — keep
|
|
3269
|
+
* both in sync manually, same as the existing Counterparty/Signal models.
|
|
3270
|
+
*
|
|
3271
|
+
* Import from @ramme-io/shared:
|
|
3272
|
+
* import { EntityEventSchema, EntityEvent } from '@ramme-io/shared';
|
|
3273
|
+
*
|
|
3274
|
+
* ─── IRON LAW — Logic = 0 ────────────────────────────────────────────────────
|
|
3275
|
+
* This file contains ONLY Zod schemas, inferred types and const registries.
|
|
3276
|
+
* No functions. No class instances. No side effects. No imports from kernel.
|
|
3277
|
+
* The mock generator that produces these shapes lives in @ramme-io/kernel.
|
|
3278
|
+
*/
|
|
3279
|
+
|
|
3280
|
+
/**
|
|
3281
|
+
* Where an event came from. `mock` is first-class and deliberate, matching the
|
|
3282
|
+
* Signal contract's own `source` discriminator — prototyping against generated
|
|
3283
|
+
* data is a supported mode, not a testing hack, and the UI must be able to say
|
|
3284
|
+
* out loud when it is showing synthetic data.
|
|
3285
|
+
*/
|
|
3286
|
+
declare const EventSourceSchema: z.ZodEnum<["db", "mock"]>;
|
|
3287
|
+
type EventSource = z.infer<typeof EventSourceSchema>;
|
|
3288
|
+
/** The three streams that survive de-duplication. See EXCLUDED_SOURCES below. */
|
|
3289
|
+
declare const EntityEventKindSchema: z.ZodEnum<["news", "filing", "report"]>;
|
|
3290
|
+
type EntityEventKind = z.infer<typeof EntityEventKindSchema>;
|
|
3291
|
+
/**
|
|
3292
|
+
* What `impact` actually means for a given event.
|
|
3293
|
+
* - `graded` — a real 1–9 spread (sentinel news). Safe to compare.
|
|
3294
|
+
* - `binary` — only two values ever emitted (on-demand news: 5 or 9).
|
|
3295
|
+
* - `default` — effectively constant (filings: 99% are 1 or 2).
|
|
3296
|
+
* - `none` — no impact value at all.
|
|
3297
|
+
*/
|
|
3298
|
+
declare const ImpactScaleSchema: z.ZodEnum<["graded", "binary", "default", "none"]>;
|
|
3299
|
+
type ImpactScale = z.infer<typeof ImpactScaleSchema>;
|
|
3300
|
+
/**
|
|
3301
|
+
* Filings carry a date but no meaningful time-of-day. Rendering them at
|
|
3302
|
+
* midnight alongside second-precision news implies precision that isn't there.
|
|
3303
|
+
*/
|
|
3304
|
+
declare const TimestampPrecisionSchema: z.ZodEnum<["second", "day"]>;
|
|
3305
|
+
type TimestampPrecision = z.infer<typeof TimestampPrecisionSchema>;
|
|
3306
|
+
declare const EntityEventSchema: z.ZodObject<{
|
|
3307
|
+
/** Namespaced so ids never collide across sources: `news:1234`, `filing:AAPL:2026-07-31`. */
|
|
3308
|
+
id: z.ZodString;
|
|
3309
|
+
kind: z.ZodEnum<["news", "filing", "report"]>;
|
|
3310
|
+
/**
|
|
3311
|
+
* The producer's own type string, unmodified — `NEWS_YAHOO FINANCE_YAHOO RSS`,
|
|
3312
|
+
* `ANNUAL`, `SNAPSHOT`. There are 31 distinct NEWS variants in the live table,
|
|
3313
|
+
* so this is for filtering and debugging: never render it raw to a user.
|
|
3314
|
+
*/
|
|
3315
|
+
subtype: z.ZodNullable<z.ZodString>;
|
|
3316
|
+
ticker: z.ZodString;
|
|
3317
|
+
/** Always `YYYY-MM-DDTHH:MM:SSZ`. Fixed-width, so lexical order == chronological order. */
|
|
3318
|
+
occurredAt: z.ZodString;
|
|
3319
|
+
precision: z.ZodEnum<["second", "day"]>;
|
|
3320
|
+
title: z.ZodString;
|
|
3321
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
3322
|
+
url: z.ZodNullable<z.ZodString>;
|
|
3323
|
+
impact: z.ZodNullable<z.ZodNumber>;
|
|
3324
|
+
impactScale: z.ZodEnum<["graded", "binary", "default", "none"]>;
|
|
3325
|
+
/** 0 bearish … 50 neutral … 100 bullish. */
|
|
3326
|
+
sentiment: z.ZodNullable<z.ZodNumber>;
|
|
3327
|
+
/** False for filings, and for any event sitting at exactly neutral. */
|
|
3328
|
+
sentimentIsMeaningful: z.ZodBoolean;
|
|
3329
|
+
source: z.ZodEnum<["db", "mock"]>;
|
|
3330
|
+
meta: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3331
|
+
}, "strip", z.ZodTypeAny, {
|
|
3332
|
+
id: string;
|
|
3333
|
+
kind: "news" | "filing" | "report";
|
|
3334
|
+
source: "mock" | "db";
|
|
3335
|
+
title: string;
|
|
3336
|
+
meta: Record<string, unknown> | null;
|
|
3337
|
+
ticker: string;
|
|
3338
|
+
subtype: string | null;
|
|
3339
|
+
occurredAt: string;
|
|
3340
|
+
precision: "second" | "day";
|
|
3341
|
+
summary: string | null;
|
|
3342
|
+
url: string | null;
|
|
3343
|
+
impact: number | null;
|
|
3344
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3345
|
+
sentiment: number | null;
|
|
3346
|
+
sentimentIsMeaningful: boolean;
|
|
3347
|
+
}, {
|
|
3348
|
+
id: string;
|
|
3349
|
+
kind: "news" | "filing" | "report";
|
|
3350
|
+
source: "mock" | "db";
|
|
3351
|
+
title: string;
|
|
3352
|
+
meta: Record<string, unknown> | null;
|
|
3353
|
+
ticker: string;
|
|
3354
|
+
subtype: string | null;
|
|
3355
|
+
occurredAt: string;
|
|
3356
|
+
precision: "second" | "day";
|
|
3357
|
+
summary: string | null;
|
|
3358
|
+
url: string | null;
|
|
3359
|
+
impact: number | null;
|
|
3360
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3361
|
+
sentiment: number | null;
|
|
3362
|
+
sentimentIsMeaningful: boolean;
|
|
3363
|
+
}>;
|
|
3364
|
+
type EntityEvent = z.infer<typeof EntityEventSchema>;
|
|
3365
|
+
/** Matches the repo-wide browse envelope: `{total, page, page_size, data}`. */
|
|
3366
|
+
declare const PaginatedEntityEventsSchema: z.ZodObject<{
|
|
3367
|
+
total: z.ZodNumber;
|
|
3368
|
+
page: z.ZodNumber;
|
|
3369
|
+
page_size: z.ZodNumber;
|
|
3370
|
+
data: z.ZodArray<z.ZodObject<{
|
|
3371
|
+
/** Namespaced so ids never collide across sources: `news:1234`, `filing:AAPL:2026-07-31`. */
|
|
3372
|
+
id: z.ZodString;
|
|
3373
|
+
kind: z.ZodEnum<["news", "filing", "report"]>;
|
|
3374
|
+
/**
|
|
3375
|
+
* The producer's own type string, unmodified — `NEWS_YAHOO FINANCE_YAHOO RSS`,
|
|
3376
|
+
* `ANNUAL`, `SNAPSHOT`. There are 31 distinct NEWS variants in the live table,
|
|
3377
|
+
* so this is for filtering and debugging: never render it raw to a user.
|
|
3378
|
+
*/
|
|
3379
|
+
subtype: z.ZodNullable<z.ZodString>;
|
|
3380
|
+
ticker: z.ZodString;
|
|
3381
|
+
/** Always `YYYY-MM-DDTHH:MM:SSZ`. Fixed-width, so lexical order == chronological order. */
|
|
3382
|
+
occurredAt: z.ZodString;
|
|
3383
|
+
precision: z.ZodEnum<["second", "day"]>;
|
|
3384
|
+
title: z.ZodString;
|
|
3385
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
3386
|
+
url: z.ZodNullable<z.ZodString>;
|
|
3387
|
+
impact: z.ZodNullable<z.ZodNumber>;
|
|
3388
|
+
impactScale: z.ZodEnum<["graded", "binary", "default", "none"]>;
|
|
3389
|
+
/** 0 bearish … 50 neutral … 100 bullish. */
|
|
3390
|
+
sentiment: z.ZodNullable<z.ZodNumber>;
|
|
3391
|
+
/** False for filings, and for any event sitting at exactly neutral. */
|
|
3392
|
+
sentimentIsMeaningful: z.ZodBoolean;
|
|
3393
|
+
source: z.ZodEnum<["db", "mock"]>;
|
|
3394
|
+
meta: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3395
|
+
}, "strip", z.ZodTypeAny, {
|
|
3396
|
+
id: string;
|
|
3397
|
+
kind: "news" | "filing" | "report";
|
|
3398
|
+
source: "mock" | "db";
|
|
3399
|
+
title: string;
|
|
3400
|
+
meta: Record<string, unknown> | null;
|
|
3401
|
+
ticker: string;
|
|
3402
|
+
subtype: string | null;
|
|
3403
|
+
occurredAt: string;
|
|
3404
|
+
precision: "second" | "day";
|
|
3405
|
+
summary: string | null;
|
|
3406
|
+
url: string | null;
|
|
3407
|
+
impact: number | null;
|
|
3408
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3409
|
+
sentiment: number | null;
|
|
3410
|
+
sentimentIsMeaningful: boolean;
|
|
3411
|
+
}, {
|
|
3412
|
+
id: string;
|
|
3413
|
+
kind: "news" | "filing" | "report";
|
|
3414
|
+
source: "mock" | "db";
|
|
3415
|
+
title: string;
|
|
3416
|
+
meta: Record<string, unknown> | null;
|
|
3417
|
+
ticker: string;
|
|
3418
|
+
subtype: string | null;
|
|
3419
|
+
occurredAt: string;
|
|
3420
|
+
precision: "second" | "day";
|
|
3421
|
+
summary: string | null;
|
|
3422
|
+
url: string | null;
|
|
3423
|
+
impact: number | null;
|
|
3424
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3425
|
+
sentiment: number | null;
|
|
3426
|
+
sentimentIsMeaningful: boolean;
|
|
3427
|
+
}>, "many">;
|
|
3428
|
+
}, "strip", z.ZodTypeAny, {
|
|
3429
|
+
total: number;
|
|
3430
|
+
page: number;
|
|
3431
|
+
page_size: number;
|
|
3432
|
+
data: {
|
|
3433
|
+
id: string;
|
|
3434
|
+
kind: "news" | "filing" | "report";
|
|
3435
|
+
source: "mock" | "db";
|
|
3436
|
+
title: string;
|
|
3437
|
+
meta: Record<string, unknown> | null;
|
|
3438
|
+
ticker: string;
|
|
3439
|
+
subtype: string | null;
|
|
3440
|
+
occurredAt: string;
|
|
3441
|
+
precision: "second" | "day";
|
|
3442
|
+
summary: string | null;
|
|
3443
|
+
url: string | null;
|
|
3444
|
+
impact: number | null;
|
|
3445
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3446
|
+
sentiment: number | null;
|
|
3447
|
+
sentimentIsMeaningful: boolean;
|
|
3448
|
+
}[];
|
|
3449
|
+
}, {
|
|
3450
|
+
total: number;
|
|
3451
|
+
page: number;
|
|
3452
|
+
page_size: number;
|
|
3453
|
+
data: {
|
|
3454
|
+
id: string;
|
|
3455
|
+
kind: "news" | "filing" | "report";
|
|
3456
|
+
source: "mock" | "db";
|
|
3457
|
+
title: string;
|
|
3458
|
+
meta: Record<string, unknown> | null;
|
|
3459
|
+
ticker: string;
|
|
3460
|
+
subtype: string | null;
|
|
3461
|
+
occurredAt: string;
|
|
3462
|
+
precision: "second" | "day";
|
|
3463
|
+
summary: string | null;
|
|
3464
|
+
url: string | null;
|
|
3465
|
+
impact: number | null;
|
|
3466
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3467
|
+
sentiment: number | null;
|
|
3468
|
+
sentimentIsMeaningful: boolean;
|
|
3469
|
+
}[];
|
|
3470
|
+
}>;
|
|
3471
|
+
type PaginatedEntityEvents = z.infer<typeof PaginatedEntityEventsSchema>;
|
|
3472
|
+
declare const EventBucketSizeSchema: z.ZodEnum<["day", "week", "month"]>;
|
|
3473
|
+
type EventBucketSize = z.infer<typeof EventBucketSizeSchema>;
|
|
3474
|
+
/**
|
|
3475
|
+
* One bucket of the density strip. Returned sparse — empty buckets are omitted
|
|
3476
|
+
* and the client fills gaps, so a quiet ticker costs almost nothing to fetch.
|
|
3477
|
+
*/
|
|
3478
|
+
declare const EntityEventDensityBucketSchema: z.ZodObject<{
|
|
3479
|
+
bucketStart: z.ZodString;
|
|
3480
|
+
kind: z.ZodEnum<["news", "filing", "report"]>;
|
|
3481
|
+
count: z.ZodNumber;
|
|
3482
|
+
/** Null when no event in the bucket had meaningful sentiment. */
|
|
3483
|
+
avgSentiment: z.ZodNullable<z.ZodNumber>;
|
|
3484
|
+
maxImpact: z.ZodNullable<z.ZodNumber>;
|
|
3485
|
+
}, "strip", z.ZodTypeAny, {
|
|
3486
|
+
kind: "news" | "filing" | "report";
|
|
3487
|
+
bucketStart: string;
|
|
3488
|
+
count: number;
|
|
3489
|
+
avgSentiment: number | null;
|
|
3490
|
+
maxImpact: number | null;
|
|
3491
|
+
}, {
|
|
3492
|
+
kind: "news" | "filing" | "report";
|
|
3493
|
+
bucketStart: string;
|
|
3494
|
+
count: number;
|
|
3495
|
+
avgSentiment: number | null;
|
|
3496
|
+
maxImpact: number | null;
|
|
3497
|
+
}>;
|
|
3498
|
+
type EntityEventDensityBucket = z.infer<typeof EntityEventDensityBucketSchema>;
|
|
3499
|
+
declare const EntityEventDensitySchema: z.ZodObject<{
|
|
3500
|
+
ticker: z.ZodString;
|
|
3501
|
+
bucket: z.ZodEnum<["day", "week", "month"]>;
|
|
3502
|
+
buckets: z.ZodArray<z.ZodObject<{
|
|
3503
|
+
bucketStart: z.ZodString;
|
|
3504
|
+
kind: z.ZodEnum<["news", "filing", "report"]>;
|
|
3505
|
+
count: z.ZodNumber;
|
|
3506
|
+
/** Null when no event in the bucket had meaningful sentiment. */
|
|
3507
|
+
avgSentiment: z.ZodNullable<z.ZodNumber>;
|
|
3508
|
+
maxImpact: z.ZodNullable<z.ZodNumber>;
|
|
3509
|
+
}, "strip", z.ZodTypeAny, {
|
|
3510
|
+
kind: "news" | "filing" | "report";
|
|
3511
|
+
bucketStart: string;
|
|
3512
|
+
count: number;
|
|
3513
|
+
avgSentiment: number | null;
|
|
3514
|
+
maxImpact: number | null;
|
|
3515
|
+
}, {
|
|
3516
|
+
kind: "news" | "filing" | "report";
|
|
3517
|
+
bucketStart: string;
|
|
3518
|
+
count: number;
|
|
3519
|
+
avgSentiment: number | null;
|
|
3520
|
+
maxImpact: number | null;
|
|
3521
|
+
}>, "many">;
|
|
3522
|
+
/** So the client can set its time domain without a second request. */
|
|
3523
|
+
range: z.ZodObject<{
|
|
3524
|
+
min: z.ZodString;
|
|
3525
|
+
max: z.ZodString;
|
|
3526
|
+
}, "strip", z.ZodTypeAny, {
|
|
3527
|
+
min: string;
|
|
3528
|
+
max: string;
|
|
3529
|
+
}, {
|
|
3530
|
+
min: string;
|
|
3531
|
+
max: string;
|
|
3532
|
+
}>;
|
|
3533
|
+
source: z.ZodEnum<["db", "mock"]>;
|
|
3534
|
+
}, "strip", z.ZodTypeAny, {
|
|
3535
|
+
source: "mock" | "db";
|
|
3536
|
+
ticker: string;
|
|
3537
|
+
bucket: "day" | "week" | "month";
|
|
3538
|
+
buckets: {
|
|
3539
|
+
kind: "news" | "filing" | "report";
|
|
3540
|
+
bucketStart: string;
|
|
3541
|
+
count: number;
|
|
3542
|
+
avgSentiment: number | null;
|
|
3543
|
+
maxImpact: number | null;
|
|
3544
|
+
}[];
|
|
3545
|
+
range: {
|
|
3546
|
+
min: string;
|
|
3547
|
+
max: string;
|
|
3548
|
+
};
|
|
3549
|
+
}, {
|
|
3550
|
+
source: "mock" | "db";
|
|
3551
|
+
ticker: string;
|
|
3552
|
+
bucket: "day" | "week" | "month";
|
|
3553
|
+
buckets: {
|
|
3554
|
+
kind: "news" | "filing" | "report";
|
|
3555
|
+
bucketStart: string;
|
|
3556
|
+
count: number;
|
|
3557
|
+
avgSentiment: number | null;
|
|
3558
|
+
maxImpact: number | null;
|
|
3559
|
+
}[];
|
|
3560
|
+
range: {
|
|
3561
|
+
min: string;
|
|
3562
|
+
max: string;
|
|
3563
|
+
};
|
|
3564
|
+
}>;
|
|
3565
|
+
type EntityEventDensity = z.infer<typeof EntityEventDensitySchema>;
|
|
3566
|
+
declare const EntityEventFacetSchema: z.ZodObject<{
|
|
3567
|
+
kind: z.ZodEnum<["news", "filing", "report"]>;
|
|
3568
|
+
count: z.ZodNumber;
|
|
3569
|
+
earliest: z.ZodNullable<z.ZodString>;
|
|
3570
|
+
latest: z.ZodNullable<z.ZodString>;
|
|
3571
|
+
impactScale: z.ZodEnum<["graded", "binary", "default", "none"]>;
|
|
3572
|
+
sentimentUsable: z.ZodBoolean;
|
|
3573
|
+
}, "strip", z.ZodTypeAny, {
|
|
3574
|
+
kind: "news" | "filing" | "report";
|
|
3575
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3576
|
+
count: number;
|
|
3577
|
+
earliest: string | null;
|
|
3578
|
+
latest: string | null;
|
|
3579
|
+
sentimentUsable: boolean;
|
|
3580
|
+
}, {
|
|
3581
|
+
kind: "news" | "filing" | "report";
|
|
3582
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3583
|
+
count: number;
|
|
3584
|
+
earliest: string | null;
|
|
3585
|
+
latest: string | null;
|
|
3586
|
+
sentimentUsable: boolean;
|
|
3587
|
+
}>;
|
|
3588
|
+
type EntityEventFacet = z.infer<typeof EntityEventFacetSchema>;
|
|
3589
|
+
declare const EntityEventFacetsSchema: z.ZodObject<{
|
|
3590
|
+
ticker: z.ZodString;
|
|
3591
|
+
facets: z.ZodArray<z.ZodObject<{
|
|
3592
|
+
kind: z.ZodEnum<["news", "filing", "report"]>;
|
|
3593
|
+
count: z.ZodNumber;
|
|
3594
|
+
earliest: z.ZodNullable<z.ZodString>;
|
|
3595
|
+
latest: z.ZodNullable<z.ZodString>;
|
|
3596
|
+
impactScale: z.ZodEnum<["graded", "binary", "default", "none"]>;
|
|
3597
|
+
sentimentUsable: z.ZodBoolean;
|
|
3598
|
+
}, "strip", z.ZodTypeAny, {
|
|
3599
|
+
kind: "news" | "filing" | "report";
|
|
3600
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3601
|
+
count: number;
|
|
3602
|
+
earliest: string | null;
|
|
3603
|
+
latest: string | null;
|
|
3604
|
+
sentimentUsable: boolean;
|
|
3605
|
+
}, {
|
|
3606
|
+
kind: "news" | "filing" | "report";
|
|
3607
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3608
|
+
count: number;
|
|
3609
|
+
earliest: string | null;
|
|
3610
|
+
latest: string | null;
|
|
3611
|
+
sentimentUsable: boolean;
|
|
3612
|
+
}>, "many">;
|
|
3613
|
+
source: z.ZodEnum<["db", "mock"]>;
|
|
3614
|
+
}, "strip", z.ZodTypeAny, {
|
|
3615
|
+
source: "mock" | "db";
|
|
3616
|
+
ticker: string;
|
|
3617
|
+
facets: {
|
|
3618
|
+
kind: "news" | "filing" | "report";
|
|
3619
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3620
|
+
count: number;
|
|
3621
|
+
earliest: string | null;
|
|
3622
|
+
latest: string | null;
|
|
3623
|
+
sentimentUsable: boolean;
|
|
3624
|
+
}[];
|
|
3625
|
+
}, {
|
|
3626
|
+
source: "mock" | "db";
|
|
3627
|
+
ticker: string;
|
|
3628
|
+
facets: {
|
|
3629
|
+
kind: "news" | "filing" | "report";
|
|
3630
|
+
impactScale: "none" | "graded" | "binary" | "default";
|
|
3631
|
+
count: number;
|
|
3632
|
+
earliest: string | null;
|
|
3633
|
+
latest: string | null;
|
|
3634
|
+
sentimentUsable: boolean;
|
|
3635
|
+
}[];
|
|
3636
|
+
}>;
|
|
3637
|
+
type EntityEventFacets = z.infer<typeof EntityEventFacetsSchema>;
|
|
3638
|
+
/** One trading day. Carries OHLCV, which `live_quotes` never had. */
|
|
3639
|
+
declare const DailyPricePointSchema: z.ZodObject<{
|
|
3640
|
+
date: z.ZodString;
|
|
3641
|
+
open: z.ZodNullable<z.ZodNumber>;
|
|
3642
|
+
high: z.ZodNullable<z.ZodNumber>;
|
|
3643
|
+
low: z.ZodNullable<z.ZodNumber>;
|
|
3644
|
+
close: z.ZodNumber;
|
|
3645
|
+
volume: z.ZodNullable<z.ZodNumber>;
|
|
3646
|
+
}, "strip", z.ZodTypeAny, {
|
|
3647
|
+
date: string;
|
|
3648
|
+
volume: number | null;
|
|
3649
|
+
open: number | null;
|
|
3650
|
+
high: number | null;
|
|
3651
|
+
low: number | null;
|
|
3652
|
+
close: number;
|
|
3653
|
+
}, {
|
|
3654
|
+
date: string;
|
|
3655
|
+
volume: number | null;
|
|
3656
|
+
open: number | null;
|
|
3657
|
+
high: number | null;
|
|
3658
|
+
low: number | null;
|
|
3659
|
+
close: number;
|
|
3660
|
+
}>;
|
|
3661
|
+
type DailyPricePoint = z.infer<typeof DailyPricePointSchema>;
|
|
3662
|
+
declare const EntityPriceSeriesSchema: z.ZodObject<{
|
|
3663
|
+
ticker: z.ZodString;
|
|
3664
|
+
series: z.ZodArray<z.ZodObject<{
|
|
3665
|
+
date: z.ZodString;
|
|
3666
|
+
open: z.ZodNullable<z.ZodNumber>;
|
|
3667
|
+
high: z.ZodNullable<z.ZodNumber>;
|
|
3668
|
+
low: z.ZodNullable<z.ZodNumber>;
|
|
3669
|
+
close: z.ZodNumber;
|
|
3670
|
+
volume: z.ZodNullable<z.ZodNumber>;
|
|
3671
|
+
}, "strip", z.ZodTypeAny, {
|
|
3672
|
+
date: string;
|
|
3673
|
+
volume: number | null;
|
|
3674
|
+
open: number | null;
|
|
3675
|
+
high: number | null;
|
|
3676
|
+
low: number | null;
|
|
3677
|
+
close: number;
|
|
3678
|
+
}, {
|
|
3679
|
+
date: string;
|
|
3680
|
+
volume: number | null;
|
|
3681
|
+
open: number | null;
|
|
3682
|
+
high: number | null;
|
|
3683
|
+
low: number | null;
|
|
3684
|
+
close: number;
|
|
3685
|
+
}>, "many">;
|
|
3686
|
+
source: z.ZodEnum<["db", "mock"]>;
|
|
3687
|
+
}, "strip", z.ZodTypeAny, {
|
|
3688
|
+
source: "mock" | "db";
|
|
3689
|
+
ticker: string;
|
|
3690
|
+
series: {
|
|
3691
|
+
date: string;
|
|
3692
|
+
volume: number | null;
|
|
3693
|
+
open: number | null;
|
|
3694
|
+
high: number | null;
|
|
3695
|
+
low: number | null;
|
|
3696
|
+
close: number;
|
|
3697
|
+
}[];
|
|
3698
|
+
}, {
|
|
3699
|
+
source: "mock" | "db";
|
|
3700
|
+
ticker: string;
|
|
3701
|
+
series: {
|
|
3702
|
+
date: string;
|
|
3703
|
+
volume: number | null;
|
|
3704
|
+
open: number | null;
|
|
3705
|
+
high: number | null;
|
|
3706
|
+
low: number | null;
|
|
3707
|
+
close: number;
|
|
3708
|
+
}[];
|
|
3709
|
+
}>;
|
|
3710
|
+
type EntityPriceSeries = z.infer<typeof EntityPriceSeriesSchema>;
|
|
3711
|
+
declare const EVENT_KIND_LABELS: Record<EntityEventKind, string>;
|
|
3712
|
+
/**
|
|
3713
|
+
* Impact at or above this reads as "flagged". Used as a boolean ring rather
|
|
3714
|
+
* than a size ramp, because `impact` is not a single scale (see ImpactScale).
|
|
3715
|
+
*/
|
|
3716
|
+
declare const IMPACT_FLAG_THRESHOLD = 7;
|
|
3717
|
+
/** Exactly neutral. Renders transparent in the diverging sentiment band. */
|
|
3718
|
+
declare const SENTIMENT_NEUTRAL = 50;
|
|
3719
|
+
/** The launch horizon. Five quarters covers both event and filing cadence. */
|
|
3720
|
+
declare const DEFAULT_HORIZON_QUARTERS = 5;
|
|
3721
|
+
/**
|
|
3722
|
+
* Sources deliberately kept OUT of the event union, with the reason, so this
|
|
3723
|
+
* is not rediscovered and quietly re-added later. Every entry was verified
|
|
3724
|
+
* against the live database.
|
|
3725
|
+
*/
|
|
3726
|
+
declare const EXCLUDED_SOURCES: Record<string, string>;
|
|
3727
|
+
|
|
3728
|
+
export { type AIKeyManifest, AIKeyManifestSchema, type AITheme, AIThemeSchema, AI_ROSTER, AI_TOOLS, type ActionDefinition, ActionSchema, type AgentRoleConfig, type AgentRoleKey, AircraftAppConfigSchema, AppSignalSchema, type AppSpecification, AppSpecificationSchema, type ArchitectureReferenceParams, AuthStrategySchema, type Block, BlockSchema, schema as Bodewell, ClockAppConfigSchema, type CompanyNewsParams, type CompanyProfileParams, type CounterpartyGraphParams, type CounterpartyNode, CounterpartyNodeSchema, type CounterpartyResolution, CounterpartyResolutionSchema, type CounterpartyType, CounterpartyTypeSchema, DEFAULT_CHAT_MODEL, DEFAULT_DEVICE_CONFIG, DEFAULT_HORIZON_QUARTERS, DEFAULT_PRO_MODEL, DEFAULT_SCHEMA_MODEL, DEFAULT_THEME_TOKENS, DEVICE_AP_SSID_PREFIX, DEVICE_ENDPOINTS, type DailyPricePoint, DailyPricePointSchema, type DeviceAppId, DeviceAppIdSchema, DeviceAppsSchema, type DeviceConfig, DeviceConfigSchema, DeviceDisplayConfigSchema, type DeviceKind, DeviceKindSchema, type DeviceStatus, DeviceStatusSchema, DeviceThemeSchema, type DivergenceMetric, DivergenceMetricSchema, type DivergenceMetricsParams, EVENT_KIND_LABELS, EXCLUDED_SOURCES, type EntityDefinition, type EntityEvent, type EntityEventDensity, type EntityEventDensityBucket, EntityEventDensityBucketSchema, EntityEventDensitySchema, type EntityEventFacet, EntityEventFacetSchema, type EntityEventFacets, EntityEventFacetsSchema, type EntityEventKind, EntityEventKindSchema, EntityEventSchema, type EntityPriceSeries, EntityPriceSeriesSchema, EntitySchema, type EventBucketSize, EventBucketSizeSchema, type EventSource, EventSourceSchema, type FieldDefinition, FieldSchema, type FloraTelemetry, FloraTelemetrySchema, GENESIS_LIBRARY_CONTEXT, GENESIS_VALID_COMPONENTS, type GenesisComponentType, IMPACT_FLAG_THRESHOLD, type ImpactScale, ImpactScaleSchema, type LiveQuoteParams, type NonPublicEntity, NonPublicEntitySchema, type PageDefinition, PageSchema, type PageSection, PageSectionSchema, type PaginatedEntityEvents, PaginatedEntityEventsSchema, type ProvisioningState, ProvisioningStateSchema, type RelationshipEdge, RelationshipEdgeSchema, type RelationshipEdgeType, RelationshipEdgeTypeSchema, type ResourceDefinition, ResourceSchema, SENTIMENT_NEUTRAL, SIGNAL_DOMAINS, SIGNAL_KINDS, SIGNAL_KIND_LABELS, SIGNAL_SOURCES, SensorAppConfigSchema, type Signal, type SignalArray, SignalArraySchema, type SignalDefinition, type SignalDomain, type SignalKind, SignalKindSchema, type SignalPacket, SignalPacketSchema, SignalSchema, type SignalSource, SignalSourceSchema, type SignalWeight, SignalWeightSchema, type StockChartParams, THEME_PRESETS, THEME_SYSTEM_PROMPT, type TelemetryGraphParams, type ThemeFonts, ThemeFontsSchema, type ThemeOverrides, ThemeOverridesSchema, type ThemePreset, type ThemeTokens, ThemeTokensSchema, type TimestampPrecision, TimestampPrecisionSchema, type ToolCall, type ToolDefinition, TriggerSchema, type User, UserSchema, WeatherAppConfigSchema, type WorkflowDefinition, WorkflowSchema, architectureReferenceParameters, companyNewsParameters, companyProfileParameters, counterpartyGraphParameters, divergenceMetricsParameters, liveQuoteParameters, stockChartParameters, telemetryGraphParameters };
|