@skenion/contracts 0.36.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1487,6 +1487,788 @@ export const runtimeOperationV0Schema = {
1487
1487
  }
1488
1488
  }
1489
1489
  };
1490
+ export const runtimeSessionV0Schema = {
1491
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1492
+ "$id": "https://skenion.dev/schemas/runtime/v0/session.schema.json",
1493
+ "title": "Skenion Runtime Session Profile v0",
1494
+ "type": "object",
1495
+ "required": [
1496
+ "schema",
1497
+ "schemaVersion",
1498
+ "ok",
1499
+ "sessionId",
1500
+ "lifecycle",
1501
+ "snapshot",
1502
+ "profile",
1503
+ "capabilities",
1504
+ "eventReplay",
1505
+ "diagnostics"
1506
+ ],
1507
+ "properties": {
1508
+ "schema": {
1509
+ "const": "skenion.runtime.session.info"
1510
+ },
1511
+ "schemaVersion": {
1512
+ "const": "0.1.0"
1513
+ },
1514
+ "ok": {
1515
+ "type": "boolean"
1516
+ },
1517
+ "sessionId": {
1518
+ "type": "string",
1519
+ "minLength": 1
1520
+ },
1521
+ "lifecycle": {
1522
+ "$ref": "#/$defs/runtimeSessionLifecycleState"
1523
+ },
1524
+ "snapshot": {
1525
+ "$ref": "#/$defs/runtimeSessionSnapshot"
1526
+ },
1527
+ "profile": {
1528
+ "$ref": "#/$defs/runtimeConnectionProfile"
1529
+ },
1530
+ "capabilities": {
1531
+ "$ref": "#/$defs/runtimeSessionCapabilitySet"
1532
+ },
1533
+ "eventReplay": {
1534
+ "$ref": "#/$defs/runtimeEventReplayWindow"
1535
+ },
1536
+ "diagnostics": {
1537
+ "type": "array",
1538
+ "items": {
1539
+ "$ref": "#/$defs/runtimeDiagnostic"
1540
+ }
1541
+ }
1542
+ },
1543
+ "additionalProperties": false,
1544
+ "$defs": {
1545
+ "runtimeDiagnostic": {
1546
+ "type": "object",
1547
+ "required": [
1548
+ "severity",
1549
+ "message"
1550
+ ],
1551
+ "properties": {
1552
+ "severity": {
1553
+ "enum": [
1554
+ "error",
1555
+ "warning",
1556
+ "info"
1557
+ ]
1558
+ },
1559
+ "message": {
1560
+ "type": "string"
1561
+ }
1562
+ },
1563
+ "additionalProperties": false
1564
+ },
1565
+ "runtimeSessionLifecycleState": {
1566
+ "enum": [
1567
+ "initializing",
1568
+ "ready",
1569
+ "closing",
1570
+ "closed",
1571
+ "error"
1572
+ ]
1573
+ },
1574
+ "runtimeConnectionProfileMode": {
1575
+ "enum": [
1576
+ "local-managed",
1577
+ "local-shared",
1578
+ "remote"
1579
+ ]
1580
+ },
1581
+ "runtimeOwnershipMode": {
1582
+ "enum": [
1583
+ "owned-child",
1584
+ "external",
1585
+ "remote"
1586
+ ]
1587
+ },
1588
+ "runtimeEndpointMetadata": {
1589
+ "type": "object",
1590
+ "required": [
1591
+ "url",
1592
+ "protocol"
1593
+ ],
1594
+ "properties": {
1595
+ "url": {
1596
+ "type": "string",
1597
+ "minLength": 1
1598
+ },
1599
+ "canonicalUrl": {
1600
+ "type": "string",
1601
+ "minLength": 1
1602
+ },
1603
+ "protocol": {
1604
+ "enum": [
1605
+ "http",
1606
+ "https"
1607
+ ]
1608
+ },
1609
+ "host": {
1610
+ "type": "string",
1611
+ "minLength": 1
1612
+ },
1613
+ "port": {
1614
+ "type": "integer",
1615
+ "minimum": 0,
1616
+ "maximum": 65535
1617
+ },
1618
+ "tls": {
1619
+ "type": "boolean"
1620
+ }
1621
+ },
1622
+ "additionalProperties": false
1623
+ },
1624
+ "runtimeProcessMetadata": {
1625
+ "type": "object",
1626
+ "required": [
1627
+ "ownedByHost"
1628
+ ],
1629
+ "properties": {
1630
+ "ownedByHost": {
1631
+ "type": "boolean"
1632
+ },
1633
+ "pid": {
1634
+ "type": "integer",
1635
+ "minimum": 1
1636
+ },
1637
+ "executablePath": {
1638
+ "type": "string",
1639
+ "minLength": 1
1640
+ },
1641
+ "workingDirectory": {
1642
+ "type": "string",
1643
+ "minLength": 1
1644
+ },
1645
+ "startedAt": {
1646
+ "type": "string"
1647
+ },
1648
+ "ownerWindowId": {
1649
+ "type": "string",
1650
+ "minLength": 1
1651
+ },
1652
+ "platform": {
1653
+ "type": "string",
1654
+ "minLength": 1
1655
+ },
1656
+ "arch": {
1657
+ "type": "string",
1658
+ "minLength": 1
1659
+ }
1660
+ },
1661
+ "additionalProperties": false
1662
+ },
1663
+ "runtimeConnectionProfile": {
1664
+ "oneOf": [
1665
+ {
1666
+ "$ref": "#/$defs/runtimeLocalManagedConnectionProfile"
1667
+ },
1668
+ {
1669
+ "$ref": "#/$defs/runtimeLocalSharedConnectionProfile"
1670
+ },
1671
+ {
1672
+ "$ref": "#/$defs/runtimeRemoteConnectionProfile"
1673
+ }
1674
+ ]
1675
+ },
1676
+ "runtimeConnectionProfileBase": {
1677
+ "type": "object",
1678
+ "required": [
1679
+ "mode",
1680
+ "ownership",
1681
+ "endpoint"
1682
+ ],
1683
+ "properties": {
1684
+ "mode": {
1685
+ "$ref": "#/$defs/runtimeConnectionProfileMode"
1686
+ },
1687
+ "ownership": {
1688
+ "$ref": "#/$defs/runtimeOwnershipMode"
1689
+ },
1690
+ "displayName": {
1691
+ "type": "string"
1692
+ },
1693
+ "endpoint": {
1694
+ "$ref": "#/$defs/runtimeEndpointMetadata"
1695
+ },
1696
+ "process": {
1697
+ "oneOf": [
1698
+ {
1699
+ "$ref": "#/$defs/runtimeProcessMetadata"
1700
+ },
1701
+ {
1702
+ "type": "null"
1703
+ }
1704
+ ]
1705
+ }
1706
+ },
1707
+ "additionalProperties": false
1708
+ },
1709
+ "runtimeLocalManagedConnectionProfile": {
1710
+ "allOf": [
1711
+ {
1712
+ "$ref": "#/$defs/runtimeConnectionProfileBase"
1713
+ },
1714
+ {
1715
+ "type": "object",
1716
+ "properties": {
1717
+ "mode": {
1718
+ "const": "local-managed"
1719
+ },
1720
+ "ownership": {
1721
+ "const": "owned-child"
1722
+ }
1723
+ }
1724
+ }
1725
+ ]
1726
+ },
1727
+ "runtimeLocalSharedConnectionProfile": {
1728
+ "allOf": [
1729
+ {
1730
+ "$ref": "#/$defs/runtimeConnectionProfileBase"
1731
+ },
1732
+ {
1733
+ "type": "object",
1734
+ "properties": {
1735
+ "mode": {
1736
+ "const": "local-shared"
1737
+ },
1738
+ "ownership": {
1739
+ "const": "external"
1740
+ }
1741
+ }
1742
+ }
1743
+ ]
1744
+ },
1745
+ "runtimeRemoteConnectionProfile": {
1746
+ "allOf": [
1747
+ {
1748
+ "$ref": "#/$defs/runtimeConnectionProfileBase"
1749
+ },
1750
+ {
1751
+ "type": "object",
1752
+ "properties": {
1753
+ "mode": {
1754
+ "const": "remote"
1755
+ },
1756
+ "ownership": {
1757
+ "const": "remote"
1758
+ }
1759
+ }
1760
+ }
1761
+ ]
1762
+ },
1763
+ "runtimeProjectSnapshot": {
1764
+ "type": "object",
1765
+ "required": [
1766
+ "graph",
1767
+ "viewState",
1768
+ "nodes"
1769
+ ],
1770
+ "properties": {
1771
+ "graph": {
1772
+ "$ref": "https://skenion.dev/schemas/graph/v0.1/graph.schema.json"
1773
+ },
1774
+ "viewState": {
1775
+ "$ref": "https://skenion.dev/schemas/view/v0.1/view-state.schema.json"
1776
+ },
1777
+ "nodes": {
1778
+ "type": "array",
1779
+ "items": {
1780
+ "$ref": "https://skenion.dev/schemas/node/v0.1/node-definition.schema.json"
1781
+ }
1782
+ }
1783
+ },
1784
+ "additionalProperties": false
1785
+ },
1786
+ "runtimeSessionSnapshot": {
1787
+ "type": "object",
1788
+ "required": [
1789
+ "sessionRevision",
1790
+ "viewRevision",
1791
+ "controlRevision",
1792
+ "project",
1793
+ "diagnostics",
1794
+ "plan"
1795
+ ],
1796
+ "properties": {
1797
+ "sessionRevision": {
1798
+ "type": "integer",
1799
+ "minimum": 0
1800
+ },
1801
+ "viewRevision": {
1802
+ "type": "integer",
1803
+ "minimum": 0
1804
+ },
1805
+ "controlRevision": {
1806
+ "type": "integer",
1807
+ "minimum": 0
1808
+ },
1809
+ "project": {
1810
+ "oneOf": [
1811
+ {
1812
+ "$ref": "#/$defs/runtimeProjectSnapshot"
1813
+ },
1814
+ {
1815
+ "type": "null"
1816
+ }
1817
+ ]
1818
+ },
1819
+ "diagnostics": {
1820
+ "type": "array",
1821
+ "items": {
1822
+ "$ref": "#/$defs/runtimeDiagnostic"
1823
+ }
1824
+ },
1825
+ "plan": {
1826
+ "oneOf": [
1827
+ {
1828
+ "type": "object"
1829
+ },
1830
+ {
1831
+ "type": "null"
1832
+ }
1833
+ ]
1834
+ }
1835
+ },
1836
+ "additionalProperties": false
1837
+ },
1838
+ "runtimeMutationRequest": {
1839
+ "type": "object",
1840
+ "properties": {
1841
+ "graphPatch": {
1842
+ "$ref": "https://skenion.dev/schemas/graph/v0.1/patch.schema.json"
1843
+ },
1844
+ "viewPatch": {
1845
+ "$ref": "#/$defs/runtimeViewPatch"
1846
+ },
1847
+ "clientId": {
1848
+ "type": "string",
1849
+ "minLength": 1
1850
+ },
1851
+ "description": {
1852
+ "type": "string"
1853
+ }
1854
+ },
1855
+ "additionalProperties": false
1856
+ },
1857
+ "runtimeViewPatch": {
1858
+ "type": "object",
1859
+ "required": [
1860
+ "baseViewRevision",
1861
+ "ops"
1862
+ ],
1863
+ "properties": {
1864
+ "baseViewRevision": {
1865
+ "type": "integer",
1866
+ "minimum": 0
1867
+ },
1868
+ "ops": {
1869
+ "type": "array",
1870
+ "items": {
1871
+ "oneOf": [
1872
+ {
1873
+ "$ref": "#/$defs/runtimeSetNodeViewOperation"
1874
+ },
1875
+ {
1876
+ "$ref": "#/$defs/runtimeMoveNodeViewOperation"
1877
+ }
1878
+ ]
1879
+ }
1880
+ }
1881
+ },
1882
+ "additionalProperties": false
1883
+ },
1884
+ "runtimeSetNodeViewOperation": {
1885
+ "type": "object",
1886
+ "required": [
1887
+ "op",
1888
+ "nodeId",
1889
+ "view"
1890
+ ],
1891
+ "properties": {
1892
+ "op": {
1893
+ "const": "setNodeView"
1894
+ },
1895
+ "nodeId": {
1896
+ "type": "string",
1897
+ "minLength": 1
1898
+ },
1899
+ "view": {
1900
+ "$ref": "#/$defs/runtimeCanvasNodeView"
1901
+ }
1902
+ },
1903
+ "additionalProperties": false
1904
+ },
1905
+ "runtimeMoveNodeViewOperation": {
1906
+ "type": "object",
1907
+ "required": [
1908
+ "op",
1909
+ "nodeId",
1910
+ "to"
1911
+ ],
1912
+ "properties": {
1913
+ "op": {
1914
+ "const": "moveNodeView"
1915
+ },
1916
+ "nodeId": {
1917
+ "type": "string",
1918
+ "minLength": 1
1919
+ },
1920
+ "from": {
1921
+ "$ref": "#/$defs/runtimeCanvasNodeView"
1922
+ },
1923
+ "to": {
1924
+ "$ref": "#/$defs/runtimeCanvasNodeView"
1925
+ }
1926
+ },
1927
+ "additionalProperties": false
1928
+ },
1929
+ "runtimeCanvasNodeView": {
1930
+ "type": "object",
1931
+ "required": [
1932
+ "x",
1933
+ "y"
1934
+ ],
1935
+ "properties": {
1936
+ "x": {
1937
+ "type": "number"
1938
+ },
1939
+ "y": {
1940
+ "type": "number"
1941
+ },
1942
+ "width": {
1943
+ "type": "number"
1944
+ },
1945
+ "height": {
1946
+ "type": "number"
1947
+ },
1948
+ "collapsed": {
1949
+ "type": "boolean"
1950
+ }
1951
+ },
1952
+ "additionalProperties": false
1953
+ },
1954
+ "runtimeHistoryEntry": {
1955
+ "type": "object",
1956
+ "required": [
1957
+ "id",
1958
+ "sequence",
1959
+ "kind",
1960
+ "mutation",
1961
+ "inverseMutation",
1962
+ "createdAt"
1963
+ ],
1964
+ "properties": {
1965
+ "id": {
1966
+ "type": "string",
1967
+ "minLength": 1
1968
+ },
1969
+ "sequence": {
1970
+ "type": "integer",
1971
+ "minimum": 1
1972
+ },
1973
+ "kind": {
1974
+ "enum": [
1975
+ "apply",
1976
+ "undo",
1977
+ "redo"
1978
+ ]
1979
+ },
1980
+ "mutation": {
1981
+ "$ref": "#/$defs/runtimeMutationRequest"
1982
+ },
1983
+ "inverseMutation": {
1984
+ "$ref": "#/$defs/runtimeMutationRequest"
1985
+ },
1986
+ "subjectEventId": {
1987
+ "type": "string",
1988
+ "minLength": 1
1989
+ },
1990
+ "clientId": {
1991
+ "type": "string",
1992
+ "minLength": 1
1993
+ },
1994
+ "description": {
1995
+ "type": "string"
1996
+ },
1997
+ "createdAt": {
1998
+ "type": "string",
1999
+ "minLength": 1
2000
+ }
2001
+ },
2002
+ "additionalProperties": false
2003
+ },
2004
+ "runtimeHistory": {
2005
+ "type": "object",
2006
+ "required": [
2007
+ "schema",
2008
+ "schemaVersion",
2009
+ "entries",
2010
+ "canUndo",
2011
+ "canRedo",
2012
+ "undoDepth",
2013
+ "redoDepth"
2014
+ ],
2015
+ "properties": {
2016
+ "schema": {
2017
+ "const": "skenion.runtime.history"
2018
+ },
2019
+ "schemaVersion": {
2020
+ "const": "0.1.0"
2021
+ },
2022
+ "entries": {
2023
+ "type": "array",
2024
+ "items": {
2025
+ "$ref": "#/$defs/runtimeHistoryEntry"
2026
+ }
2027
+ },
2028
+ "canUndo": {
2029
+ "type": "boolean"
2030
+ },
2031
+ "canRedo": {
2032
+ "type": "boolean"
2033
+ },
2034
+ "undoDepth": {
2035
+ "type": "integer",
2036
+ "minimum": 0
2037
+ },
2038
+ "redoDepth": {
2039
+ "type": "integer",
2040
+ "minimum": 0
2041
+ }
2042
+ },
2043
+ "additionalProperties": false
2044
+ },
2045
+ "runtimeEventReplayWindow": {
2046
+ "type": "object",
2047
+ "required": [
2048
+ "cursorKind",
2049
+ "currentCursor",
2050
+ "earliestSequence",
2051
+ "latestSequence",
2052
+ "replayLimit"
2053
+ ],
2054
+ "properties": {
2055
+ "cursorKind": {
2056
+ "const": "sequence"
2057
+ },
2058
+ "currentCursor": {
2059
+ "type": "string",
2060
+ "minLength": 1
2061
+ },
2062
+ "earliestSequence": {
2063
+ "type": "integer",
2064
+ "minimum": 1
2065
+ },
2066
+ "latestSequence": {
2067
+ "type": "integer",
2068
+ "minimum": 0
2069
+ },
2070
+ "replayLimit": {
2071
+ "oneOf": [
2072
+ {
2073
+ "type": "integer",
2074
+ "minimum": 0
2075
+ },
2076
+ {
2077
+ "type": "null"
2078
+ }
2079
+ ]
2080
+ },
2081
+ "overflow": {
2082
+ "type": "boolean"
2083
+ }
2084
+ },
2085
+ "additionalProperties": false
2086
+ },
2087
+ "runtimeSessionCapabilitySet": {
2088
+ "type": "object",
2089
+ "required": [
2090
+ "sessionAddressing",
2091
+ "defaultSessionAlias",
2092
+ "eventReplay",
2093
+ "multiWindow",
2094
+ "profiles",
2095
+ "authPolicy"
2096
+ ],
2097
+ "properties": {
2098
+ "sessionAddressing": {
2099
+ "type": "boolean"
2100
+ },
2101
+ "defaultSessionAlias": {
2102
+ "type": "boolean"
2103
+ },
2104
+ "eventReplay": {
2105
+ "type": "boolean"
2106
+ },
2107
+ "multiWindow": {
2108
+ "type": "boolean"
2109
+ },
2110
+ "profiles": {
2111
+ "type": "array",
2112
+ "items": {
2113
+ "$ref": "#/$defs/runtimeConnectionProfileMode"
2114
+ }
2115
+ },
2116
+ "authPolicy": {
2117
+ "const": "deferred"
2118
+ }
2119
+ },
2120
+ "additionalProperties": false
2121
+ },
2122
+ "runtimeEventReplayGap": {
2123
+ "type": "object",
2124
+ "description": "Gap metadata reports a missed retained range. expectedSequence must be less than actualSequence.",
2125
+ "required": [
2126
+ "expectedSequence",
2127
+ "actualSequence",
2128
+ "reason"
2129
+ ],
2130
+ "properties": {
2131
+ "expectedSequence": {
2132
+ "type": "integer",
2133
+ "minimum": 1
2134
+ },
2135
+ "actualSequence": {
2136
+ "type": "integer",
2137
+ "minimum": 1
2138
+ },
2139
+ "reason": {
2140
+ "enum": [
2141
+ "retention-overflow",
2142
+ "stream-reset",
2143
+ "unknown"
2144
+ ]
2145
+ }
2146
+ },
2147
+ "additionalProperties": false
2148
+ },
2149
+ "runtimeEventReplayMetadata": {
2150
+ "type": "object",
2151
+ "required": [
2152
+ "cursor",
2153
+ "previousCursor",
2154
+ "replayed",
2155
+ "gap",
2156
+ "overflow"
2157
+ ],
2158
+ "properties": {
2159
+ "cursor": {
2160
+ "type": "string",
2161
+ "minLength": 1
2162
+ },
2163
+ "previousCursor": {
2164
+ "oneOf": [
2165
+ {
2166
+ "type": "string",
2167
+ "minLength": 1
2168
+ },
2169
+ {
2170
+ "type": "null"
2171
+ }
2172
+ ]
2173
+ },
2174
+ "replayed": {
2175
+ "type": "boolean"
2176
+ },
2177
+ "gap": {
2178
+ "oneOf": [
2179
+ {
2180
+ "$ref": "#/$defs/runtimeEventReplayGap"
2181
+ },
2182
+ {
2183
+ "type": "null"
2184
+ }
2185
+ ]
2186
+ },
2187
+ "overflow": {
2188
+ "type": "boolean"
2189
+ }
2190
+ },
2191
+ "additionalProperties": false
2192
+ },
2193
+ "runtimeSessionEventKind": {
2194
+ "enum": [
2195
+ "snapshot",
2196
+ "load",
2197
+ "clear",
2198
+ "mutate",
2199
+ "undo",
2200
+ "redo"
2201
+ ]
2202
+ },
2203
+ "runtimeSessionEvent": {
2204
+ "type": "object",
2205
+ "required": [
2206
+ "schema",
2207
+ "schemaVersion",
2208
+ "id",
2209
+ "sessionId",
2210
+ "sequence",
2211
+ "sessionRevision",
2212
+ "kind",
2213
+ "snapshot",
2214
+ "history",
2215
+ "replay",
2216
+ "diagnostics",
2217
+ "createdAt"
2218
+ ],
2219
+ "properties": {
2220
+ "schema": {
2221
+ "const": "skenion.runtime.session.event"
2222
+ },
2223
+ "schemaVersion": {
2224
+ "const": "0.1.0"
2225
+ },
2226
+ "id": {
2227
+ "type": "string",
2228
+ "minLength": 1
2229
+ },
2230
+ "sessionId": {
2231
+ "type": "string",
2232
+ "minLength": 1
2233
+ },
2234
+ "sequence": {
2235
+ "type": "integer",
2236
+ "minimum": 1
2237
+ },
2238
+ "sessionRevision": {
2239
+ "type": "integer",
2240
+ "minimum": 0
2241
+ },
2242
+ "kind": {
2243
+ "$ref": "#/$defs/runtimeSessionEventKind"
2244
+ },
2245
+ "snapshot": {
2246
+ "$ref": "#/$defs/runtimeSessionSnapshot"
2247
+ },
2248
+ "history": {
2249
+ "$ref": "#/$defs/runtimeHistory"
2250
+ },
2251
+ "mutation": {
2252
+ "$ref": "#/$defs/runtimeHistoryEntry"
2253
+ },
2254
+ "replay": {
2255
+ "$ref": "#/$defs/runtimeEventReplayMetadata"
2256
+ },
2257
+ "diagnostics": {
2258
+ "type": "array",
2259
+ "items": {
2260
+ "$ref": "#/$defs/runtimeDiagnostic"
2261
+ }
2262
+ },
2263
+ "createdAt": {
2264
+ "type": "string",
2265
+ "minLength": 1
2266
+ }
2267
+ },
2268
+ "additionalProperties": false
2269
+ }
2270
+ }
2271
+ };
1490
2272
  export const graphPatchV01Schema = {
1491
2273
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1492
2274
  "$id": "https://skenion.dev/schemas/graph/v0.1/patch.schema.json",