@chengxianglibra/dsh-data-analysis 0.3.0 → 0.3.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.
Files changed (53) hide show
  1. package/README.en.md +7 -2
  2. package/README.md +7 -2
  3. package/assets/logo-horizontal.svg +42 -0
  4. package/assets/logo-mark.svg +20 -0
  5. package/lib/bin/environment.js +99 -76
  6. package/lib/client/analysis-ui/offline-runtime.generated.js +1 -1
  7. package/lib/client/credentials/install.js +42 -38
  8. package/lib/client/credentials/model.js +9 -0
  9. package/lib/client/credentials/report-publishing.js +84 -0
  10. package/lib/client/credentials/styles.js +2 -0
  11. package/lib/client/i18n/credentials.js +18 -0
  12. package/lib/client/i18n/presentation.js +24 -0
  13. package/lib/client/right-tabs/install.js +9 -1
  14. package/lib/client/right-tabs/report-actions.js +30 -4
  15. package/lib/client/right-tabs/report-publishing.js +107 -0
  16. package/lib/client/right-tabs/styles.js +3 -0
  17. package/lib/client/ui/styles.generated.js +3 -0
  18. package/lib/client-composition.js +202 -191
  19. package/lib/client.js +205 -194
  20. package/lib/datasource/resolver-program.js +4 -4
  21. package/lib/environment/binding.js +16 -23
  22. package/lib/environment/doctor.js +8 -1
  23. package/lib/environment/identity.js +32 -0
  24. package/lib/environment/project-preparation.js +5 -5
  25. package/lib/environment/runtime.js +15 -16
  26. package/lib/plugin-agents.js +6 -1
  27. package/lib/plugin.js +18 -0
  28. package/lib/presentation/rpc.js +19 -0
  29. package/lib/report-publishing/adapters.js +136 -0
  30. package/lib/report-publishing/config.js +58 -0
  31. package/lib/report-publishing/credential-contract.js +25 -0
  32. package/lib/report-publishing/service.js +133 -0
  33. package/lib/skill-build.generated.js +2 -2
  34. package/lib/types/client/credentials/install.d.ts +2 -1
  35. package/lib/types/client/credentials/model.d.ts +30 -0
  36. package/lib/types/client/credentials/report-publishing.d.ts +5 -0
  37. package/lib/types/client/credentials/styles.d.ts +1 -1
  38. package/lib/types/client/i18n/copy.d.ts +21 -0
  39. package/lib/types/client/i18n/credentials.d.ts +18 -0
  40. package/lib/types/client/i18n/presentation.d.ts +24 -0
  41. package/lib/types/client/right-tabs/report-actions.d.ts +5 -1
  42. package/lib/types/client/right-tabs/report-publishing.d.ts +21 -0
  43. package/lib/types/client/right-tabs/styles.d.ts +1 -1
  44. package/lib/types/environment/identity.d.ts +6 -0
  45. package/lib/types/plugin-agents.d.ts +2 -0
  46. package/lib/types/plugin.d.ts +4 -0
  47. package/lib/types/presentation/rpc.d.ts +1358 -0
  48. package/lib/types/report-publishing/adapters.d.ts +6 -0
  49. package/lib/types/report-publishing/config.d.ts +23 -0
  50. package/lib/types/report-publishing/credential-contract.d.ts +61 -0
  51. package/lib/types/report-publishing/service.d.ts +31 -0
  52. package/package.json +4 -1
  53. package/skills/dsh-data-analysis-files/references/delivery.md +3 -1
@@ -1,4 +1,5 @@
1
1
  import type { HostConnectionHandle } from '@deepseek-ai/dsh-client-connection';
2
+ import { type SavedReportRef } from './contracts/report-ref.ts';
2
3
  import type { AnalysisDrafts } from './drafts.ts';
3
4
  export interface PresentationWorkspace {
4
5
  id: string;
@@ -1484,6 +1485,1363 @@ export declare class MarivoPresentationFileService {
1484
1485
  schemaVersion: "dsh.analysis-ui/v3";
1485
1486
  }>;
1486
1487
  resourceStream(payload: unknown, caller: AbortSignal): Promise<import("./contracts/resource-stream.ts").ResourceStreamResponse>;
1488
+ readSavedReport(scope: {
1489
+ sessionId: string;
1490
+ } | {
1491
+ workspaceId: string;
1492
+ }, ref: SavedReportRef, caller: AbortSignal): Promise<{
1493
+ workspaceId: string;
1494
+ reportId: string;
1495
+ buildId: string;
1496
+ recordId: string;
1497
+ title: string;
1498
+ locale: "zh-CN" | "en-US";
1499
+ generatedAt: string;
1500
+ catalog: {
1501
+ id: "dsh-data-analysis/analysis-ui/v1";
1502
+ build: string;
1503
+ };
1504
+ program: string;
1505
+ resources: Record<string, {
1506
+ kind: "snapshot";
1507
+ declaration: {
1508
+ kind: "analysis-frame";
1509
+ ref: {
1510
+ schema: "marivo.frame_ref/v2";
1511
+ store_id: string;
1512
+ session_id: string;
1513
+ artifact_id: string;
1514
+ };
1515
+ codeRef?: {
1516
+ executionId: string;
1517
+ sha256: string;
1518
+ } | undefined;
1519
+ } | {
1520
+ kind: "dataframe";
1521
+ ref: {
1522
+ schema: "marivo.dataframe_ref/v2";
1523
+ project_root: string;
1524
+ result_id: string;
1525
+ };
1526
+ codeRef?: {
1527
+ executionId: string;
1528
+ sha256: string;
1529
+ } | undefined;
1530
+ } | {
1531
+ kind: "dataset-snapshot";
1532
+ snapshotRef: string;
1533
+ } | {
1534
+ kind: "frame-snapshot";
1535
+ snapshotRef: string;
1536
+ } | {
1537
+ kind: "image-file";
1538
+ path: string;
1539
+ };
1540
+ snapshot: {
1541
+ kind: "dataset";
1542
+ source: {
1543
+ kind: "dataframe";
1544
+ details: "not-captured";
1545
+ };
1546
+ schemaVersion: 1;
1547
+ fetchedAt: string;
1548
+ data: import("./contracts/types.ts").TypedDataset;
1549
+ coverage: {
1550
+ start: 0;
1551
+ totalRows: number;
1552
+ capturedRows: number;
1553
+ complete: boolean;
1554
+ columns: string[];
1555
+ business: "unknown";
1556
+ };
1557
+ } | {
1558
+ schemaVersion: 2;
1559
+ kind: "frame";
1560
+ source: {
1561
+ kind: "frame";
1562
+ sessionId: string;
1563
+ artifactId: string | null;
1564
+ };
1565
+ frame: {
1566
+ inputId: string;
1567
+ description: string | null;
1568
+ fields: {
1569
+ id: string;
1570
+ role: "value" | "coordinate" | "presence";
1571
+ slotId?: string | undefined;
1572
+ axisToken?: string | undefined;
1573
+ }[];
1574
+ layout: ({
1575
+ kind: "field";
1576
+ name: string;
1577
+ slotId: string;
1578
+ } | {
1579
+ kind: "coordinate";
1580
+ name: string;
1581
+ axisToken: string;
1582
+ endpoint: "self" | "left" | "right";
1583
+ part: "key" | "end" | "label" | "start" | "nominal_start" | "nominal_end";
1584
+ })[];
1585
+ slots: {
1586
+ id: string;
1587
+ slotId: string;
1588
+ dtype: {
1589
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
1590
+ precision?: number | undefined;
1591
+ scale?: number | undefined;
1592
+ timeUnit?: "s" | "ms" | "us" | "ns" | undefined;
1593
+ timezone?: string | undefined;
1594
+ };
1595
+ nullable: boolean;
1596
+ unit: string | null;
1597
+ }[];
1598
+ axes: {
1599
+ token: string;
1600
+ name: string;
1601
+ role: string;
1602
+ keys: {
1603
+ id: string;
1604
+ slotId: string;
1605
+ dtype: {
1606
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
1607
+ precision?: number | undefined;
1608
+ scale?: number | undefined;
1609
+ timeUnit?: "s" | "ms" | "us" | "ns" | undefined;
1610
+ timezone?: string | undefined;
1611
+ };
1612
+ nullable: boolean;
1613
+ unit: string | null;
1614
+ }[];
1615
+ variant: {
1616
+ kind: "ordinary";
1617
+ } | {
1618
+ kind: "calendar";
1619
+ timezone: string;
1620
+ grain: {
1621
+ kind: "builtin";
1622
+ unit: "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
1623
+ step: number;
1624
+ } | {
1625
+ kind: "named";
1626
+ ref: {
1627
+ kind: string;
1628
+ path: string;
1629
+ definitionId: string;
1630
+ };
1631
+ level: string;
1632
+ };
1633
+ } | {
1634
+ kind: "interval";
1635
+ timezone: string;
1636
+ } | {
1637
+ kind: "paired";
1638
+ left: {
1639
+ kind: "calendar";
1640
+ name: string;
1641
+ at: string | null;
1642
+ timezone: string;
1643
+ grain: {
1644
+ kind: "builtin";
1645
+ unit: "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
1646
+ step: number;
1647
+ } | {
1648
+ kind: "named";
1649
+ ref: {
1650
+ kind: string;
1651
+ path: string;
1652
+ definitionId: string;
1653
+ };
1654
+ level: string;
1655
+ };
1656
+ } | {
1657
+ kind: "interval";
1658
+ name: string;
1659
+ at: string | null;
1660
+ timezone: string;
1661
+ };
1662
+ right: {
1663
+ kind: "calendar";
1664
+ name: string;
1665
+ at: string | null;
1666
+ timezone: string;
1667
+ grain: {
1668
+ kind: "builtin";
1669
+ unit: "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
1670
+ step: number;
1671
+ } | {
1672
+ kind: "named";
1673
+ ref: {
1674
+ kind: string;
1675
+ path: string;
1676
+ definitionId: string;
1677
+ };
1678
+ level: string;
1679
+ };
1680
+ } | {
1681
+ kind: "interval";
1682
+ name: string;
1683
+ at: string | null;
1684
+ timezone: string;
1685
+ };
1686
+ };
1687
+ }[];
1688
+ coordinates: Record<string, {
1689
+ column: {
1690
+ id: string;
1691
+ label: string;
1692
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
1693
+ nullable: boolean;
1694
+ unit?: string | undefined;
1695
+ };
1696
+ values: (string | number | boolean | null)[];
1697
+ }>;
1698
+ readStats: {
1699
+ dataRowsRead: number;
1700
+ coordinateRowsRead: number;
1701
+ receiptBytesHashed: number;
1702
+ };
1703
+ sections: {
1704
+ semantics: {
1705
+ status: "captured";
1706
+ columns: {
1707
+ role: "value" | "presence" | "axis";
1708
+ id: string;
1709
+ valueOrigins: {
1710
+ kind: string;
1711
+ path: string;
1712
+ definitionId: string;
1713
+ }[];
1714
+ contextOrigins: {
1715
+ kind: string;
1716
+ path: string;
1717
+ definitionId: string;
1718
+ }[];
1719
+ omittedOrigins: number;
1720
+ }[];
1721
+ } | {
1722
+ status: "unavailable";
1723
+ reason: "budget" | "runtime-incompatible" | "read-failed" | "identity-mismatch";
1724
+ };
1725
+ interpretation: {
1726
+ status: "captured";
1727
+ fixedAxes: {
1728
+ token: string;
1729
+ name: string;
1730
+ role: "field" | "identity";
1731
+ keys: {
1732
+ id: string;
1733
+ slotId: string;
1734
+ dtype: {
1735
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
1736
+ precision?: number | undefined;
1737
+ scale?: number | undefined;
1738
+ timeUnit?: "s" | "ms" | "us" | "ns" | undefined;
1739
+ timezone?: string | undefined;
1740
+ };
1741
+ nullable: boolean;
1742
+ unit: string | null;
1743
+ }[];
1744
+ key: (string | number | boolean | null)[];
1745
+ origins: {
1746
+ kind: string;
1747
+ path: string;
1748
+ definitionId: string;
1749
+ }[];
1750
+ }[];
1751
+ valueContexts: Record<string, {
1752
+ kind: "observation";
1753
+ subject: {
1754
+ kind: string;
1755
+ path: string;
1756
+ definitionId: string;
1757
+ } | null;
1758
+ time: {
1759
+ kind: "axis";
1760
+ axisToken: string;
1761
+ endpoint: "self" | "left" | "right";
1762
+ } | {
1763
+ kind: "compared";
1764
+ comparison: number;
1765
+ endpoint: "current" | "baseline";
1766
+ } | {
1767
+ kind: "fixed";
1768
+ start: string;
1769
+ end: string;
1770
+ timezone: string;
1771
+ } | null;
1772
+ window: {
1773
+ kind: "all_history";
1774
+ } | {
1775
+ kind: "since";
1776
+ start: string;
1777
+ } | {
1778
+ kind: "to_date";
1779
+ grain: {
1780
+ kind: "builtin";
1781
+ unit: "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
1782
+ step: number;
1783
+ } | {
1784
+ kind: "named";
1785
+ ref: {
1786
+ kind: string;
1787
+ path: string;
1788
+ definitionId: string;
1789
+ };
1790
+ level: string;
1791
+ };
1792
+ } | {
1793
+ kind: "trailing_duration";
1794
+ seconds: number;
1795
+ } | {
1796
+ kind: "trailing_periods";
1797
+ count: number;
1798
+ } | null;
1799
+ } | {
1800
+ kind: "statistic";
1801
+ statistic: "sum" | "mean" | "row_count";
1802
+ groups: ({
1803
+ kind: "axis";
1804
+ axisToken: string;
1805
+ } | {
1806
+ kind: "fixed";
1807
+ fixed: {
1808
+ token: string;
1809
+ name: string;
1810
+ role: "field" | "identity";
1811
+ keys: {
1812
+ id: string;
1813
+ slotId: string;
1814
+ dtype: {
1815
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
1816
+ precision?: number | undefined;
1817
+ scale?: number | undefined;
1818
+ timeUnit?: "s" | "ms" | "us" | "ns" | undefined;
1819
+ timezone?: string | undefined;
1820
+ };
1821
+ nullable: boolean;
1822
+ unit: string | null;
1823
+ }[];
1824
+ key: (string | number | boolean | null)[];
1825
+ origins: {
1826
+ kind: string;
1827
+ path: string;
1828
+ definitionId: string;
1829
+ }[];
1830
+ };
1831
+ })[];
1832
+ rowScope: "complete" | "restricted";
1833
+ } | {
1834
+ kind: "share";
1835
+ numerator: {
1836
+ kind: "named";
1837
+ name: string;
1838
+ subject: {
1839
+ kind: string;
1840
+ path: string;
1841
+ definitionId: string;
1842
+ } | null;
1843
+ } | {
1844
+ kind: "derived";
1845
+ origins: {
1846
+ kind: string;
1847
+ path: string;
1848
+ definitionId: string;
1849
+ }[];
1850
+ };
1851
+ groups: ({
1852
+ kind: "axis";
1853
+ axisToken: string;
1854
+ } | {
1855
+ kind: "fixed";
1856
+ fixed: {
1857
+ token: string;
1858
+ name: string;
1859
+ role: "field" | "identity";
1860
+ keys: {
1861
+ id: string;
1862
+ slotId: string;
1863
+ dtype: {
1864
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
1865
+ precision?: number | undefined;
1866
+ scale?: number | undefined;
1867
+ timeUnit?: "s" | "ms" | "us" | "ns" | undefined;
1868
+ timezone?: string | undefined;
1869
+ };
1870
+ nullable: boolean;
1871
+ unit: string | null;
1872
+ }[];
1873
+ key: (string | number | boolean | null)[];
1874
+ origins: {
1875
+ kind: string;
1876
+ path: string;
1877
+ definitionId: string;
1878
+ }[];
1879
+ };
1880
+ })[];
1881
+ along: ({
1882
+ kind: "axis";
1883
+ axisToken: string;
1884
+ } | {
1885
+ kind: "fixed";
1886
+ fixed: {
1887
+ token: string;
1888
+ name: string;
1889
+ role: "field" | "identity";
1890
+ keys: {
1891
+ id: string;
1892
+ slotId: string;
1893
+ dtype: {
1894
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
1895
+ precision?: number | undefined;
1896
+ scale?: number | undefined;
1897
+ timeUnit?: "s" | "ms" | "us" | "ns" | undefined;
1898
+ timezone?: string | undefined;
1899
+ };
1900
+ nullable: boolean;
1901
+ unit: string | null;
1902
+ }[];
1903
+ key: (string | number | boolean | null)[];
1904
+ origins: {
1905
+ kind: string;
1906
+ path: string;
1907
+ definitionId: string;
1908
+ }[];
1909
+ };
1910
+ })[];
1911
+ rowScope: "complete" | "restricted";
1912
+ } | {
1913
+ kind: "pair_statistic";
1914
+ statistic: "pearson" | "spearman" | "pair_count";
1915
+ x: {
1916
+ kind: "named";
1917
+ name: string;
1918
+ subject: {
1919
+ kind: string;
1920
+ path: string;
1921
+ definitionId: string;
1922
+ } | null;
1923
+ } | {
1924
+ kind: "derived";
1925
+ origins: {
1926
+ kind: string;
1927
+ path: string;
1928
+ definitionId: string;
1929
+ }[];
1930
+ };
1931
+ y: {
1932
+ kind: "named";
1933
+ name: string;
1934
+ subject: {
1935
+ kind: string;
1936
+ path: string;
1937
+ definitionId: string;
1938
+ } | null;
1939
+ } | {
1940
+ kind: "derived";
1941
+ origins: {
1942
+ kind: string;
1943
+ path: string;
1944
+ definitionId: string;
1945
+ }[];
1946
+ };
1947
+ groups: ({
1948
+ kind: "axis";
1949
+ axisToken: string;
1950
+ } | {
1951
+ kind: "fixed";
1952
+ fixed: {
1953
+ token: string;
1954
+ name: string;
1955
+ role: "field" | "identity";
1956
+ keys: {
1957
+ id: string;
1958
+ slotId: string;
1959
+ dtype: {
1960
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
1961
+ precision?: number | undefined;
1962
+ scale?: number | undefined;
1963
+ timeUnit?: "s" | "ms" | "us" | "ns" | undefined;
1964
+ timezone?: string | undefined;
1965
+ };
1966
+ nullable: boolean;
1967
+ unit: string | null;
1968
+ }[];
1969
+ key: (string | number | boolean | null)[];
1970
+ origins: {
1971
+ kind: string;
1972
+ path: string;
1973
+ definitionId: string;
1974
+ }[];
1975
+ };
1976
+ })[];
1977
+ rowScope: "complete" | "restricted";
1978
+ }>;
1979
+ comparisons: {
1980
+ alias: string | null;
1981
+ groups: {
1982
+ name: string;
1983
+ values: {
1984
+ role: "current" | "baseline" | "absolute" | "relative";
1985
+ name: string;
1986
+ }[];
1987
+ currentContext: {
1988
+ kind: "observation";
1989
+ subject: {
1990
+ kind: string;
1991
+ path: string;
1992
+ definitionId: string;
1993
+ } | null;
1994
+ time: {
1995
+ kind: "axis";
1996
+ axisToken: string;
1997
+ endpoint: "self" | "left" | "right";
1998
+ } | {
1999
+ kind: "compared";
2000
+ comparison: number;
2001
+ endpoint: "current" | "baseline";
2002
+ } | {
2003
+ kind: "fixed";
2004
+ start: string;
2005
+ end: string;
2006
+ timezone: string;
2007
+ } | null;
2008
+ window: {
2009
+ kind: "all_history";
2010
+ } | {
2011
+ kind: "since";
2012
+ start: string;
2013
+ } | {
2014
+ kind: "to_date";
2015
+ grain: {
2016
+ kind: "builtin";
2017
+ unit: "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
2018
+ step: number;
2019
+ } | {
2020
+ kind: "named";
2021
+ ref: /*elided*/ any;
2022
+ level: string;
2023
+ };
2024
+ } | {
2025
+ kind: "trailing_duration";
2026
+ seconds: number;
2027
+ } | {
2028
+ kind: "trailing_periods";
2029
+ count: number;
2030
+ } | null;
2031
+ } | {
2032
+ kind: "statistic";
2033
+ statistic: "sum" | "mean" | "row_count";
2034
+ groups: ({
2035
+ kind: "axis";
2036
+ axisToken: string;
2037
+ } | {
2038
+ kind: "fixed";
2039
+ fixed: {
2040
+ token: string;
2041
+ name: string;
2042
+ role: "field" | "identity";
2043
+ keys: /*elided*/ any[];
2044
+ key: (string | number | boolean | null)[];
2045
+ origins: /*elided*/ any[];
2046
+ };
2047
+ })[];
2048
+ rowScope: "complete" | "restricted";
2049
+ } | {
2050
+ kind: "share";
2051
+ numerator: {
2052
+ kind: "named";
2053
+ name: string;
2054
+ subject: {
2055
+ kind: string;
2056
+ path: string;
2057
+ definitionId: string;
2058
+ } | null;
2059
+ } | {
2060
+ kind: "derived";
2061
+ origins: {
2062
+ kind: string;
2063
+ path: string;
2064
+ definitionId: string;
2065
+ }[];
2066
+ };
2067
+ groups: ({
2068
+ kind: "axis";
2069
+ axisToken: string;
2070
+ } | {
2071
+ kind: "fixed";
2072
+ fixed: {
2073
+ token: string;
2074
+ name: string;
2075
+ role: "field" | "identity";
2076
+ keys: /*elided*/ any[];
2077
+ key: (string | number | boolean | null)[];
2078
+ origins: /*elided*/ any[];
2079
+ };
2080
+ })[];
2081
+ along: ({
2082
+ kind: "axis";
2083
+ axisToken: string;
2084
+ } | {
2085
+ kind: "fixed";
2086
+ fixed: {
2087
+ token: string;
2088
+ name: string;
2089
+ role: "field" | "identity";
2090
+ keys: /*elided*/ any[];
2091
+ key: (string | number | boolean | null)[];
2092
+ origins: /*elided*/ any[];
2093
+ };
2094
+ })[];
2095
+ rowScope: "complete" | "restricted";
2096
+ } | {
2097
+ kind: "pair_statistic";
2098
+ statistic: "pearson" | "spearman" | "pair_count";
2099
+ x: {
2100
+ kind: "named";
2101
+ name: string;
2102
+ subject: {
2103
+ kind: string;
2104
+ path: string;
2105
+ definitionId: string;
2106
+ } | null;
2107
+ } | {
2108
+ kind: "derived";
2109
+ origins: {
2110
+ kind: string;
2111
+ path: string;
2112
+ definitionId: string;
2113
+ }[];
2114
+ };
2115
+ y: {
2116
+ kind: "named";
2117
+ name: string;
2118
+ subject: {
2119
+ kind: string;
2120
+ path: string;
2121
+ definitionId: string;
2122
+ } | null;
2123
+ } | {
2124
+ kind: "derived";
2125
+ origins: {
2126
+ kind: string;
2127
+ path: string;
2128
+ definitionId: string;
2129
+ }[];
2130
+ };
2131
+ groups: ({
2132
+ kind: "axis";
2133
+ axisToken: string;
2134
+ } | {
2135
+ kind: "fixed";
2136
+ fixed: {
2137
+ token: string;
2138
+ name: string;
2139
+ role: "field" | "identity";
2140
+ keys: /*elided*/ any[];
2141
+ key: (string | number | boolean | null)[];
2142
+ origins: /*elided*/ any[];
2143
+ };
2144
+ })[];
2145
+ rowScope: "complete" | "restricted";
2146
+ } | null;
2147
+ baselineContext: {
2148
+ kind: "observation";
2149
+ subject: {
2150
+ kind: string;
2151
+ path: string;
2152
+ definitionId: string;
2153
+ } | null;
2154
+ time: {
2155
+ kind: "axis";
2156
+ axisToken: string;
2157
+ endpoint: "self" | "left" | "right";
2158
+ } | {
2159
+ kind: "compared";
2160
+ comparison: number;
2161
+ endpoint: "current" | "baseline";
2162
+ } | {
2163
+ kind: "fixed";
2164
+ start: string;
2165
+ end: string;
2166
+ timezone: string;
2167
+ } | null;
2168
+ window: {
2169
+ kind: "all_history";
2170
+ } | {
2171
+ kind: "since";
2172
+ start: string;
2173
+ } | {
2174
+ kind: "to_date";
2175
+ grain: {
2176
+ kind: "builtin";
2177
+ unit: "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
2178
+ step: number;
2179
+ } | {
2180
+ kind: "named";
2181
+ ref: /*elided*/ any;
2182
+ level: string;
2183
+ };
2184
+ } | {
2185
+ kind: "trailing_duration";
2186
+ seconds: number;
2187
+ } | {
2188
+ kind: "trailing_periods";
2189
+ count: number;
2190
+ } | null;
2191
+ } | {
2192
+ kind: "statistic";
2193
+ statistic: "sum" | "mean" | "row_count";
2194
+ groups: ({
2195
+ kind: "axis";
2196
+ axisToken: string;
2197
+ } | {
2198
+ kind: "fixed";
2199
+ fixed: {
2200
+ token: string;
2201
+ name: string;
2202
+ role: "field" | "identity";
2203
+ keys: /*elided*/ any[];
2204
+ key: (string | number | boolean | null)[];
2205
+ origins: /*elided*/ any[];
2206
+ };
2207
+ })[];
2208
+ rowScope: "complete" | "restricted";
2209
+ } | {
2210
+ kind: "share";
2211
+ numerator: {
2212
+ kind: "named";
2213
+ name: string;
2214
+ subject: {
2215
+ kind: string;
2216
+ path: string;
2217
+ definitionId: string;
2218
+ } | null;
2219
+ } | {
2220
+ kind: "derived";
2221
+ origins: {
2222
+ kind: string;
2223
+ path: string;
2224
+ definitionId: string;
2225
+ }[];
2226
+ };
2227
+ groups: ({
2228
+ kind: "axis";
2229
+ axisToken: string;
2230
+ } | {
2231
+ kind: "fixed";
2232
+ fixed: {
2233
+ token: string;
2234
+ name: string;
2235
+ role: "field" | "identity";
2236
+ keys: /*elided*/ any[];
2237
+ key: (string | number | boolean | null)[];
2238
+ origins: /*elided*/ any[];
2239
+ };
2240
+ })[];
2241
+ along: ({
2242
+ kind: "axis";
2243
+ axisToken: string;
2244
+ } | {
2245
+ kind: "fixed";
2246
+ fixed: {
2247
+ token: string;
2248
+ name: string;
2249
+ role: "field" | "identity";
2250
+ keys: /*elided*/ any[];
2251
+ key: (string | number | boolean | null)[];
2252
+ origins: /*elided*/ any[];
2253
+ };
2254
+ })[];
2255
+ rowScope: "complete" | "restricted";
2256
+ } | {
2257
+ kind: "pair_statistic";
2258
+ statistic: "pearson" | "spearman" | "pair_count";
2259
+ x: {
2260
+ kind: "named";
2261
+ name: string;
2262
+ subject: {
2263
+ kind: string;
2264
+ path: string;
2265
+ definitionId: string;
2266
+ } | null;
2267
+ } | {
2268
+ kind: "derived";
2269
+ origins: {
2270
+ kind: string;
2271
+ path: string;
2272
+ definitionId: string;
2273
+ }[];
2274
+ };
2275
+ y: {
2276
+ kind: "named";
2277
+ name: string;
2278
+ subject: {
2279
+ kind: string;
2280
+ path: string;
2281
+ definitionId: string;
2282
+ } | null;
2283
+ } | {
2284
+ kind: "derived";
2285
+ origins: {
2286
+ kind: string;
2287
+ path: string;
2288
+ definitionId: string;
2289
+ }[];
2290
+ };
2291
+ groups: ({
2292
+ kind: "axis";
2293
+ axisToken: string;
2294
+ } | {
2295
+ kind: "fixed";
2296
+ fixed: {
2297
+ token: string;
2298
+ name: string;
2299
+ role: "field" | "identity";
2300
+ keys: /*elided*/ any[];
2301
+ key: (string | number | boolean | null)[];
2302
+ origins: /*elided*/ any[];
2303
+ };
2304
+ })[];
2305
+ rowScope: "complete" | "restricted";
2306
+ } | null;
2307
+ }[];
2308
+ binding: {
2309
+ kind: "ordinary";
2310
+ } | {
2311
+ kind: "calendar";
2312
+ axisToken: string;
2313
+ endpoint: "self" | "left" | "right";
2314
+ baseline: {
2315
+ kind: "calendar";
2316
+ name: string;
2317
+ at: string | null;
2318
+ timezone: string;
2319
+ grain: {
2320
+ kind: "builtin";
2321
+ unit: "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
2322
+ step: number;
2323
+ } | {
2324
+ kind: "named";
2325
+ ref: {
2326
+ kind: string;
2327
+ path: string;
2328
+ definitionId: string;
2329
+ };
2330
+ level: string;
2331
+ };
2332
+ };
2333
+ } | {
2334
+ kind: "interval";
2335
+ axisToken: string;
2336
+ endpoint: "self" | "left" | "right";
2337
+ baseline: {
2338
+ kind: "interval";
2339
+ name: string;
2340
+ at: string | null;
2341
+ timezone: string;
2342
+ };
2343
+ };
2344
+ presence: {
2345
+ current: string;
2346
+ baseline: string;
2347
+ enclosing: string[];
2348
+ } | null;
2349
+ currentFixedAxes: {
2350
+ token: string;
2351
+ name: string;
2352
+ role: "field" | "identity";
2353
+ keys: {
2354
+ id: string;
2355
+ slotId: string;
2356
+ dtype: {
2357
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
2358
+ precision?: number | undefined;
2359
+ scale?: number | undefined;
2360
+ timeUnit?: "s" | "ms" | "us" | "ns" | undefined;
2361
+ timezone?: string | undefined;
2362
+ };
2363
+ nullable: boolean;
2364
+ unit: string | null;
2365
+ }[];
2366
+ key: (string | number | boolean | null)[];
2367
+ origins: {
2368
+ kind: string;
2369
+ path: string;
2370
+ definitionId: string;
2371
+ }[];
2372
+ }[];
2373
+ baselineFixedAxes: {
2374
+ token: string;
2375
+ name: string;
2376
+ role: "field" | "identity";
2377
+ keys: {
2378
+ id: string;
2379
+ slotId: string;
2380
+ dtype: {
2381
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
2382
+ precision?: number | undefined;
2383
+ scale?: number | undefined;
2384
+ timeUnit?: "s" | "ms" | "us" | "ns" | undefined;
2385
+ timezone?: string | undefined;
2386
+ };
2387
+ nullable: boolean;
2388
+ unit: string | null;
2389
+ }[];
2390
+ key: (string | number | boolean | null)[];
2391
+ origins: {
2392
+ kind: string;
2393
+ path: string;
2394
+ definitionId: string;
2395
+ }[];
2396
+ }[];
2397
+ }[];
2398
+ decompositions: {
2399
+ target: {
2400
+ kind: "level";
2401
+ name: string;
2402
+ context: {
2403
+ kind: "observation";
2404
+ subject: {
2405
+ kind: string;
2406
+ path: string;
2407
+ definitionId: string;
2408
+ } | null;
2409
+ time: {
2410
+ kind: "axis";
2411
+ axisToken: string;
2412
+ endpoint: "self" | "left" | "right";
2413
+ } | {
2414
+ kind: "compared";
2415
+ comparison: number;
2416
+ endpoint: "current" | "baseline";
2417
+ } | {
2418
+ kind: "fixed";
2419
+ start: string;
2420
+ end: string;
2421
+ timezone: string;
2422
+ } | null;
2423
+ window: {
2424
+ kind: "all_history";
2425
+ } | {
2426
+ kind: "since";
2427
+ start: string;
2428
+ } | {
2429
+ kind: "to_date";
2430
+ grain: {
2431
+ kind: "builtin";
2432
+ unit: "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
2433
+ step: number;
2434
+ } | {
2435
+ kind: "named";
2436
+ ref: /*elided*/ any;
2437
+ level: string;
2438
+ };
2439
+ } | {
2440
+ kind: "trailing_duration";
2441
+ seconds: number;
2442
+ } | {
2443
+ kind: "trailing_periods";
2444
+ count: number;
2445
+ } | null;
2446
+ } | {
2447
+ kind: "statistic";
2448
+ statistic: "sum" | "mean" | "row_count";
2449
+ groups: ({
2450
+ kind: "axis";
2451
+ axisToken: string;
2452
+ } | {
2453
+ kind: "fixed";
2454
+ fixed: {
2455
+ token: string;
2456
+ name: string;
2457
+ role: "field" | "identity";
2458
+ keys: /*elided*/ any[];
2459
+ key: (string | number | boolean | null)[];
2460
+ origins: /*elided*/ any[];
2461
+ };
2462
+ })[];
2463
+ rowScope: "complete" | "restricted";
2464
+ } | {
2465
+ kind: "share";
2466
+ numerator: {
2467
+ kind: "named";
2468
+ name: string;
2469
+ subject: {
2470
+ kind: string;
2471
+ path: string;
2472
+ definitionId: string;
2473
+ } | null;
2474
+ } | {
2475
+ kind: "derived";
2476
+ origins: {
2477
+ kind: string;
2478
+ path: string;
2479
+ definitionId: string;
2480
+ }[];
2481
+ };
2482
+ groups: ({
2483
+ kind: "axis";
2484
+ axisToken: string;
2485
+ } | {
2486
+ kind: "fixed";
2487
+ fixed: {
2488
+ token: string;
2489
+ name: string;
2490
+ role: "field" | "identity";
2491
+ keys: /*elided*/ any[];
2492
+ key: (string | number | boolean | null)[];
2493
+ origins: /*elided*/ any[];
2494
+ };
2495
+ })[];
2496
+ along: ({
2497
+ kind: "axis";
2498
+ axisToken: string;
2499
+ } | {
2500
+ kind: "fixed";
2501
+ fixed: {
2502
+ token: string;
2503
+ name: string;
2504
+ role: "field" | "identity";
2505
+ keys: /*elided*/ any[];
2506
+ key: (string | number | boolean | null)[];
2507
+ origins: /*elided*/ any[];
2508
+ };
2509
+ })[];
2510
+ rowScope: "complete" | "restricted";
2511
+ } | {
2512
+ kind: "pair_statistic";
2513
+ statistic: "pearson" | "spearman" | "pair_count";
2514
+ x: {
2515
+ kind: "named";
2516
+ name: string;
2517
+ subject: {
2518
+ kind: string;
2519
+ path: string;
2520
+ definitionId: string;
2521
+ } | null;
2522
+ } | {
2523
+ kind: "derived";
2524
+ origins: {
2525
+ kind: string;
2526
+ path: string;
2527
+ definitionId: string;
2528
+ }[];
2529
+ };
2530
+ y: {
2531
+ kind: "named";
2532
+ name: string;
2533
+ subject: {
2534
+ kind: string;
2535
+ path: string;
2536
+ definitionId: string;
2537
+ } | null;
2538
+ } | {
2539
+ kind: "derived";
2540
+ origins: {
2541
+ kind: string;
2542
+ path: string;
2543
+ definitionId: string;
2544
+ }[];
2545
+ };
2546
+ groups: ({
2547
+ kind: "axis";
2548
+ axisToken: string;
2549
+ } | {
2550
+ kind: "fixed";
2551
+ fixed: {
2552
+ token: string;
2553
+ name: string;
2554
+ role: "field" | "identity";
2555
+ keys: /*elided*/ any[];
2556
+ key: (string | number | boolean | null)[];
2557
+ origins: /*elided*/ any[];
2558
+ };
2559
+ })[];
2560
+ rowScope: "complete" | "restricted";
2561
+ } | null;
2562
+ } | {
2563
+ kind: "absolute";
2564
+ comparison: number;
2565
+ group: string;
2566
+ } | {
2567
+ kind: "relative";
2568
+ comparison: number;
2569
+ group: string;
2570
+ };
2571
+ groups: ({
2572
+ kind: "axis";
2573
+ axisToken: string;
2574
+ } | {
2575
+ kind: "fixed";
2576
+ fixed: {
2577
+ token: string;
2578
+ name: string;
2579
+ role: "field" | "identity";
2580
+ keys: {
2581
+ id: string;
2582
+ slotId: string;
2583
+ dtype: {
2584
+ type: "string" | "boolean" | "date" | "float64" | "int64" | "decimal" | "datetime";
2585
+ precision?: number | undefined;
2586
+ scale?: number | undefined;
2587
+ timeUnit?: "s" | "ms" | "us" | "ns" | undefined;
2588
+ timezone?: string | undefined;
2589
+ };
2590
+ nullable: boolean;
2591
+ unit: string | null;
2592
+ }[];
2593
+ key: (string | number | boolean | null)[];
2594
+ origins: {
2595
+ kind: string;
2596
+ path: string;
2597
+ definitionId: string;
2598
+ }[];
2599
+ };
2600
+ })[];
2601
+ rowScope: "complete" | "restricted";
2602
+ outputs: {
2603
+ fieldKind: "value" | "presence";
2604
+ role: "value" | "current" | "baseline" | "share" | "numerator" | "absolute" | "contribution" | "total" | "observed_total" | "denominator" | "valid_count" | "current_present" | "baseline_present" | "value_present" | "numerator_current" | "numerator_baseline" | "denominator_current" | "denominator_baseline" | "valid_count_current" | "valid_count_baseline" | "effect_within" | "effect_mix" | "effect_entry_exit" | "effect_additive" | "contribution_std_error";
2605
+ name: string;
2606
+ }[];
2607
+ }[];
2608
+ alignments: {
2609
+ left: {
2610
+ values: string[];
2611
+ presence: string[];
2612
+ coordinates: ({
2613
+ kind: "axis";
2614
+ axisToken: string;
2615
+ endpoint: "self" | "left" | "right";
2616
+ } | {
2617
+ kind: "fixed";
2618
+ fixed: {
2619
+ token: string;
2620
+ name: string;
2621
+ role: "field" | "identity";
2622
+ keys: {
2623
+ id: string;
2624
+ slotId: string;
2625
+ dtype: /*elided*/ any;
2626
+ nullable: boolean;
2627
+ unit: string | null;
2628
+ }[];
2629
+ key: (string | number | boolean | null)[];
2630
+ origins: {
2631
+ kind: string;
2632
+ path: string;
2633
+ definitionId: string;
2634
+ }[];
2635
+ };
2636
+ })[];
2637
+ };
2638
+ right: {
2639
+ values: string[];
2640
+ presence: string[];
2641
+ coordinates: ({
2642
+ kind: "axis";
2643
+ axisToken: string;
2644
+ endpoint: "self" | "left" | "right";
2645
+ } | {
2646
+ kind: "fixed";
2647
+ fixed: {
2648
+ token: string;
2649
+ name: string;
2650
+ role: "field" | "identity";
2651
+ keys: {
2652
+ id: string;
2653
+ slotId: string;
2654
+ dtype: /*elided*/ any;
2655
+ nullable: boolean;
2656
+ unit: string | null;
2657
+ }[];
2658
+ key: (string | number | boolean | null)[];
2659
+ origins: {
2660
+ kind: string;
2661
+ path: string;
2662
+ definitionId: string;
2663
+ }[];
2664
+ };
2665
+ })[];
2666
+ };
2667
+ }[];
2668
+ } | {
2669
+ status: "unavailable";
2670
+ reason: "budget" | "runtime-incompatible" | "read-failed" | "identity-mismatch";
2671
+ };
2672
+ periods: {
2673
+ status: "captured";
2674
+ pages: {
2675
+ target: {
2676
+ kind: "axis";
2677
+ axisToken: string;
2678
+ } | {
2679
+ kind: "comparison";
2680
+ comparison: number;
2681
+ };
2682
+ totalCount: number;
2683
+ hasMore: boolean;
2684
+ items: ({
2685
+ kind: "calendar";
2686
+ key: (string | number | boolean | null)[];
2687
+ timezone: string;
2688
+ start: string;
2689
+ end: string;
2690
+ label: string | number | boolean | null;
2691
+ nominalStart: string;
2692
+ nominalEnd: string;
2693
+ } | {
2694
+ kind: "calendar";
2695
+ key: (string | number | boolean | null)[];
2696
+ timezone: string;
2697
+ label: string | number | boolean | null;
2698
+ selection: "unavailable" | "full" | "prefix" | "partial";
2699
+ cutoff: string | null;
2700
+ } | {
2701
+ kind: "interval";
2702
+ key: (string | number | boolean | null)[];
2703
+ timezone: string;
2704
+ start: string;
2705
+ end: string;
2706
+ } | {
2707
+ kind: "paired";
2708
+ key: (string | number | boolean | null)[];
2709
+ left: {
2710
+ kind: "calendar";
2711
+ key: (string | number | boolean | null)[];
2712
+ timezone: string;
2713
+ start: string;
2714
+ end: string;
2715
+ label: string | number | boolean | null;
2716
+ nominalStart: string;
2717
+ nominalEnd: string;
2718
+ } | {
2719
+ kind: "calendar";
2720
+ key: (string | number | boolean | null)[];
2721
+ timezone: string;
2722
+ label: string | number | boolean | null;
2723
+ selection: "unavailable" | "full" | "prefix" | "partial";
2724
+ cutoff: string | null;
2725
+ } | {
2726
+ kind: "interval";
2727
+ key: (string | number | boolean | null)[];
2728
+ timezone: string;
2729
+ start: string;
2730
+ end: string;
2731
+ } | null;
2732
+ right: {
2733
+ kind: "calendar";
2734
+ key: (string | number | boolean | null)[];
2735
+ timezone: string;
2736
+ start: string;
2737
+ end: string;
2738
+ label: string | number | boolean | null;
2739
+ nominalStart: string;
2740
+ nominalEnd: string;
2741
+ } | {
2742
+ kind: "calendar";
2743
+ key: (string | number | boolean | null)[];
2744
+ timezone: string;
2745
+ label: string | number | boolean | null;
2746
+ selection: "unavailable" | "full" | "prefix" | "partial";
2747
+ cutoff: string | null;
2748
+ } | {
2749
+ kind: "interval";
2750
+ key: (string | number | boolean | null)[];
2751
+ timezone: string;
2752
+ start: string;
2753
+ end: string;
2754
+ } | null;
2755
+ } | {
2756
+ kind: "comparison";
2757
+ key: (string | number | boolean | null)[];
2758
+ current: {
2759
+ kind: "calendar";
2760
+ key: (string | number | boolean | null)[];
2761
+ timezone: string;
2762
+ start: string;
2763
+ end: string;
2764
+ label: string | number | boolean | null;
2765
+ nominalStart: string;
2766
+ nominalEnd: string;
2767
+ } | {
2768
+ kind: "calendar";
2769
+ key: (string | number | boolean | null)[];
2770
+ timezone: string;
2771
+ label: string | number | boolean | null;
2772
+ selection: "unavailable" | "full" | "prefix" | "partial";
2773
+ cutoff: string | null;
2774
+ } | {
2775
+ kind: "interval";
2776
+ key: (string | number | boolean | null)[];
2777
+ timezone: string;
2778
+ start: string;
2779
+ end: string;
2780
+ };
2781
+ baseline: {
2782
+ kind: "calendar";
2783
+ key: (string | number | boolean | null)[];
2784
+ timezone: string;
2785
+ start: string;
2786
+ end: string;
2787
+ label: string | number | boolean | null;
2788
+ nominalStart: string;
2789
+ nominalEnd: string;
2790
+ } | {
2791
+ kind: "calendar";
2792
+ key: (string | number | boolean | null)[];
2793
+ timezone: string;
2794
+ label: string | number | boolean | null;
2795
+ selection: "unavailable" | "full" | "prefix" | "partial";
2796
+ cutoff: string | null;
2797
+ } | {
2798
+ kind: "interval";
2799
+ key: (string | number | boolean | null)[];
2800
+ timezone: string;
2801
+ start: string;
2802
+ end: string;
2803
+ } | null;
2804
+ absentReason: "period_absent" | "cutoff_absent" | "unmatched" | null;
2805
+ })[];
2806
+ }[];
2807
+ } | {
2808
+ status: "unavailable";
2809
+ reason: "budget" | "runtime-incompatible" | "read-failed" | "identity-mismatch";
2810
+ };
2811
+ };
2812
+ };
2813
+ fetchedAt: string;
2814
+ data: import("./contracts/types.ts").TypedDataset;
2815
+ coverage: {
2816
+ start: 0;
2817
+ totalRows: number;
2818
+ capturedRows: number;
2819
+ complete: boolean;
2820
+ columns: string[];
2821
+ business: "unknown";
2822
+ };
2823
+ };
2824
+ binding: {
2825
+ workspaceId: string;
2826
+ codeRef?: {
2827
+ executionId: string;
2828
+ sha256: string;
2829
+ } | undefined;
2830
+ sessionId?: string | undefined;
2831
+ callId?: string | undefined;
2832
+ };
2833
+ } | {
2834
+ kind: "image";
2835
+ declaration: {
2836
+ kind: "image-file";
2837
+ path: string;
2838
+ };
2839
+ mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
2840
+ dataUrl: string;
2841
+ sha256: string;
2842
+ }>;
2843
+ schemaVersion: "dsh.analysis-ui/v3";
2844
+ }>;
1487
2845
  read(payload: unknown, caller?: AbortSignal): Promise<{
1488
2846
  workspaceId: string;
1489
2847
  reportId: string;