@hewel/zgui-build 0.1.3 → 0.1.4

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 CHANGED
@@ -72,10 +72,10 @@ All four application APIs accept `extraCapabilities` and `capabilitiesFile`. The
72
72
 
73
73
  Each source is validated independently. `shellSurfaces` and `controlChannel` are ORed; `imagePrefixes`, `unixSockets`, `namedSockets`, and `commands` are merged by exact string and sorted. Duplicates within one source are errors. Host path templates, such as `$XDG_RUNTIME_DIR/host-${WAYLAND_DISPLAY}.sock`, are sealed verbatim. False flags and empty arrays are omitted from the manifest. Use only trusted overlays: their merged grants are sealed into the build ID.
74
74
 
75
- **Only the app's base `package.json` can declare `sessionLock: true`.** Either overlay source specifying it as `true` rejects the build even if the base already grants it. `false` or omission neither grants nor revokes the base declaration.
75
+ **Only the app's base `package.json` can declare `sessionLock: true` or `singleInstance: true`.** Either build-time overlay specifying either flag as `true` rejects the build even if the base already enables it. `false` or omission neither enables nor revokes the base declaration.
76
76
 
77
77
  Build-time overlays may grant `shellSurfaces: true`. The runtime `--extensions-overlay`
78
- is stricter: it cannot add either `shellSurfaces` or `sessionLock` authority.
78
+ is stricter: it cannot add `shellSurfaces`, `sessionLock`, or `singleInstance`.
79
79
 
80
80
  `buildApplication(app, { bytecode: true })` resolves a compatible host through the
81
81
  same prebuilt/Cargo lookup as `devApplication`. `packageApplication` compiles with
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hewel/zgui-build",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Programmatic compiler, Lightning CSS Modules pipeline, tsrs typechecker, host resolver, and app packager for zgui-js",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/sdk/Cargo.lock CHANGED
@@ -586,6 +586,16 @@ version = "1.12.1"
586
586
  source = "registry+https://github.com/rust-lang/crates.io-index"
587
587
  checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
588
588
 
589
+ [[package]]
590
+ name = "calendrical_calculations"
591
+ version = "0.2.4"
592
+ source = "registry+https://github.com/rust-lang/crates.io-index"
593
+ checksum = "5abbd6eeda6885048d357edc66748eea6e0268e3dd11f326fff5bd248d779c26"
594
+ dependencies = [
595
+ "core_maths",
596
+ "displaydoc",
597
+ ]
598
+
589
599
  [[package]]
590
600
  name = "calloop"
591
601
  version = "0.13.0"
@@ -1188,6 +1198,17 @@ version = "0.1.15"
1188
1198
  source = "registry+https://github.com/rust-lang/crates.io-index"
1189
1199
  checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48"
1190
1200
 
1201
+ [[package]]
1202
+ name = "fixed_decimal"
1203
+ version = "0.7.3"
1204
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1205
+ checksum = "2214fb00f669ee96bee5bb29dfb1ddabe058b2bc426817efc79afa03c9bc55ae"
1206
+ dependencies = [
1207
+ "displaydoc",
1208
+ "smallvec",
1209
+ "writeable",
1210
+ ]
1211
+
1191
1212
  [[package]]
1192
1213
  name = "flate2"
1193
1214
  version = "1.1.11"
@@ -1646,7 +1667,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
1646
1667
 
1647
1668
  [[package]]
1648
1669
  name = "host-services"
1649
- version = "0.1.3"
1670
+ version = "0.1.4"
1650
1671
  dependencies = [
1651
1672
  "bytes",
1652
1673
  "flate2",
@@ -1655,11 +1676,20 @@ dependencies = [
1655
1676
  "http-body-util",
1656
1677
  "hyper",
1657
1678
  "hyper-util",
1679
+ "icu_calendar",
1680
+ "icu_collator",
1681
+ "icu_datetime",
1682
+ "icu_locale",
1683
+ "icu_locale_core",
1684
+ "icu_time",
1685
+ "jiff",
1686
+ "jiff-icu",
1658
1687
  "js-runtime",
1659
1688
  "libc",
1660
1689
  "notify",
1661
1690
  "rquickjs",
1662
1691
  "rusqlite",
1692
+ "rustix 1.1.6",
1663
1693
  "rustls",
1664
1694
  "serde",
1665
1695
  "serde_json",
@@ -1669,6 +1699,7 @@ dependencies = [
1669
1699
  "tokio-tungstenite",
1670
1700
  "url",
1671
1701
  "webpki-roots",
1702
+ "writeable",
1672
1703
  "zbus",
1673
1704
  ]
1674
1705
 
@@ -1746,6 +1777,55 @@ dependencies = [
1746
1777
  "tokio",
1747
1778
  ]
1748
1779
 
1780
+ [[package]]
1781
+ name = "icu_calendar"
1782
+ version = "2.4.0"
1783
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1784
+ checksum = "a68ffb801cc7acb8dcae62da7c692c47934698d2dd4f479ddee1eb442763dea1"
1785
+ dependencies = [
1786
+ "calendrical_calculations",
1787
+ "displaydoc",
1788
+ "icu_calendar_data",
1789
+ "icu_locale_core",
1790
+ "icu_locale_fallback",
1791
+ "icu_provider",
1792
+ "ixdtf",
1793
+ "serde",
1794
+ "tinystr",
1795
+ "zerovec",
1796
+ ]
1797
+
1798
+ [[package]]
1799
+ name = "icu_calendar_data"
1800
+ version = "2.4.0"
1801
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1802
+ checksum = "514da54e79efa36b5976232d5b3d1d8ee1b47b19ab658f1b1ebe39221696c2d8"
1803
+
1804
+ [[package]]
1805
+ name = "icu_collator"
1806
+ version = "2.4.0"
1807
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1808
+ checksum = "24cb0205c419b2036da3f9082964905d6849b3f2130dd4a517940c45899a544b"
1809
+ dependencies = [
1810
+ "icu_collator_data",
1811
+ "icu_collections",
1812
+ "icu_locale_core",
1813
+ "icu_locale_fallback",
1814
+ "icu_normalizer",
1815
+ "icu_properties",
1816
+ "icu_provider",
1817
+ "smallvec",
1818
+ "utf16_iter",
1819
+ "utf8_iter",
1820
+ "zerovec",
1821
+ ]
1822
+
1823
+ [[package]]
1824
+ name = "icu_collator_data"
1825
+ version = "2.4.0"
1826
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1827
+ checksum = "183f47e821a327661c1ebe152f61d5b6c2000010d228cadbbf226e0e2b8c2634"
1828
+
1749
1829
  [[package]]
1750
1830
  name = "icu_collections"
1751
1831
  version = "2.4.0"
@@ -1760,6 +1840,73 @@ dependencies = [
1760
1840
  "zerovec",
1761
1841
  ]
1762
1842
 
1843
+ [[package]]
1844
+ name = "icu_datetime"
1845
+ version = "2.4.0"
1846
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1847
+ checksum = "3c338aa7ebff734470e216a4196fa84b123a366cc786c445741b6f5647412c3c"
1848
+ dependencies = [
1849
+ "displaydoc",
1850
+ "fixed_decimal",
1851
+ "icu_calendar",
1852
+ "icu_datetime_data",
1853
+ "icu_decimal",
1854
+ "icu_locale_core",
1855
+ "icu_locale_fallback",
1856
+ "icu_pattern",
1857
+ "icu_plurals",
1858
+ "icu_provider",
1859
+ "icu_time",
1860
+ "potential_utf",
1861
+ "tinystr",
1862
+ "writeable",
1863
+ "zerovec",
1864
+ ]
1865
+
1866
+ [[package]]
1867
+ name = "icu_datetime_data"
1868
+ version = "2.4.0"
1869
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1870
+ checksum = "4bddb757c2df1635453c4e8cb2d4ba7ad026e904893f29699315826c0951bbd9"
1871
+
1872
+ [[package]]
1873
+ name = "icu_decimal"
1874
+ version = "2.4.0"
1875
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1876
+ checksum = "1150ad5e272740670464934ee76facda43ef2e11f85c27b7ba76ccb33edf2d05"
1877
+ dependencies = [
1878
+ "displaydoc",
1879
+ "fixed_decimal",
1880
+ "icu_decimal_data",
1881
+ "icu_locale_core",
1882
+ "icu_locale_fallback",
1883
+ "icu_plurals",
1884
+ "icu_provider",
1885
+ "writeable",
1886
+ "zerovec",
1887
+ ]
1888
+
1889
+ [[package]]
1890
+ name = "icu_decimal_data"
1891
+ version = "2.4.0"
1892
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1893
+ checksum = "5595ab78370d48abd24a062f3db115d5108dd0b65634352036cae532aebb0df8"
1894
+
1895
+ [[package]]
1896
+ name = "icu_locale"
1897
+ version = "2.4.0"
1898
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1899
+ checksum = "fe8fa57bcddc15cb921582ee5259c5b77da39f946f188ca5213fad24d9241236"
1900
+ dependencies = [
1901
+ "icu_collections",
1902
+ "icu_locale_core",
1903
+ "icu_locale_data",
1904
+ "icu_locale_fallback",
1905
+ "icu_provider",
1906
+ "tinystr",
1907
+ "zerovec",
1908
+ ]
1909
+
1763
1910
  [[package]]
1764
1911
  name = "icu_locale_core"
1765
1912
  version = "2.4.0"
@@ -1774,6 +1921,12 @@ dependencies = [
1774
1921
  "zerovec",
1775
1922
  ]
1776
1923
 
1924
+ [[package]]
1925
+ name = "icu_locale_data"
1926
+ version = "2.4.0"
1927
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1928
+ checksum = "a64014dac577a11d8d2cee48517c73c1984bd72ab11031e934269bd3cefb2ad9"
1929
+
1777
1930
  [[package]]
1778
1931
  name = "icu_locale_fallback"
1779
1932
  version = "2.4.0"
@@ -1805,6 +1958,9 @@ dependencies = [
1805
1958
  "icu_properties",
1806
1959
  "icu_provider",
1807
1960
  "smallvec",
1961
+ "utf16_iter",
1962
+ "utf8_iter",
1963
+ "write16",
1808
1964
  "zerovec",
1809
1965
  ]
1810
1966
 
@@ -1814,6 +1970,38 @@ version = "2.4.0"
1814
1970
  source = "registry+https://github.com/rust-lang/crates.io-index"
1815
1971
  checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"
1816
1972
 
1973
+ [[package]]
1974
+ name = "icu_pattern"
1975
+ version = "0.5.1"
1976
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1977
+ checksum = "bc43ce0e76ee8cb0482dc6e2dbb9b76278e8038f45daabf2a2877577e2ceb18f"
1978
+ dependencies = [
1979
+ "displaydoc",
1980
+ "either",
1981
+ "serde",
1982
+ "writeable",
1983
+ "zerovec",
1984
+ ]
1985
+
1986
+ [[package]]
1987
+ name = "icu_plurals"
1988
+ version = "2.4.0"
1989
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1990
+ checksum = "2ef046647b445acf95ce0f8083fa292467d3df649959fa9a20f3f8abfd957c5d"
1991
+ dependencies = [
1992
+ "fixed_decimal",
1993
+ "icu_locale_fallback",
1994
+ "icu_plurals_data",
1995
+ "icu_provider",
1996
+ "zerovec",
1997
+ ]
1998
+
1999
+ [[package]]
2000
+ name = "icu_plurals_data"
2001
+ version = "2.4.0"
2002
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2003
+ checksum = "d43ff7df2c1a1d41588a6ddcba354d513d4a3e10eec22c06fe56d13c12a848ea"
2004
+
1817
2005
  [[package]]
1818
2006
  name = "icu_properties"
1819
2007
  version = "2.4.0"
@@ -1876,6 +2064,31 @@ version = "2.4.0"
1876
2064
  source = "registry+https://github.com/rust-lang/crates.io-index"
1877
2065
  checksum = "913a7d294ad056474749152107309fdee3ec17d2482d1ab70fdc61a81c64b9a3"
1878
2066
 
2067
+ [[package]]
2068
+ name = "icu_time"
2069
+ version = "2.4.0"
2070
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2071
+ checksum = "17d45ee651f21433b1c6352311f2ad9b5253c26be0e25d9a0869cb8247b8cfde"
2072
+ dependencies = [
2073
+ "calendrical_calculations",
2074
+ "displaydoc",
2075
+ "icu_calendar",
2076
+ "icu_locale_core",
2077
+ "icu_provider",
2078
+ "icu_time_data",
2079
+ "ixdtf",
2080
+ "serde",
2081
+ "writeable",
2082
+ "zerotrie",
2083
+ "zerovec",
2084
+ ]
2085
+
2086
+ [[package]]
2087
+ name = "icu_time_data"
2088
+ version = "2.4.0"
2089
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2090
+ checksum = "a6d7d711f44237fa9300406ab6e521148594056862343370b5df265a0d15c088"
2091
+
1879
2092
  [[package]]
1880
2093
  name = "ident_case"
1881
2094
  version = "1.0.1"
@@ -1990,6 +2203,66 @@ version = "1.0.19"
1990
2203
  source = "registry+https://github.com/rust-lang/crates.io-index"
1991
2204
  checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
1992
2205
 
2206
+ [[package]]
2207
+ name = "ixdtf"
2208
+ version = "0.6.7"
2209
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2210
+ checksum = "4754a1731458af0443709c9667302793d3f63cc90ec4ba4c8259f2b9515478e5"
2211
+
2212
+ [[package]]
2213
+ name = "jiff"
2214
+ version = "1.0.3"
2215
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2216
+ checksum = "107f2e89536b6818514025f6787b0d94d819e54fe3b40365275fc753de485b3f"
2217
+ dependencies = [
2218
+ "jiff-core",
2219
+ "jiff-static",
2220
+ "jiff-tzdb",
2221
+ "log",
2222
+ "portable-atomic",
2223
+ "portable-atomic-util",
2224
+ "serde_core",
2225
+ "windows-link",
2226
+ ]
2227
+
2228
+ [[package]]
2229
+ name = "jiff-core"
2230
+ version = "1.0.2"
2231
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2232
+ checksum = "d44c923edf2bf456a982253f1a9ee1f6e89e421dffd0065d9b9a581da0def58f"
2233
+ dependencies = [
2234
+ "log",
2235
+ ]
2236
+
2237
+ [[package]]
2238
+ name = "jiff-icu"
2239
+ version = "1.0.0"
2240
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2241
+ checksum = "e23fad13729c57bfbf770e467e92ed700cd80941ee4c6ecbbae5dfbc38d9143f"
2242
+ dependencies = [
2243
+ "icu_calendar",
2244
+ "icu_time",
2245
+ "jiff",
2246
+ ]
2247
+
2248
+ [[package]]
2249
+ name = "jiff-static"
2250
+ version = "1.0.3"
2251
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2252
+ checksum = "4996f71e569e3a3e32b925c28ef8f0027dc30bb1d594b33eeda409eea185f5c8"
2253
+ dependencies = [
2254
+ "jiff-core",
2255
+ "proc-macro2",
2256
+ "quote",
2257
+ "syn 3.0.10",
2258
+ ]
2259
+
2260
+ [[package]]
2261
+ name = "jiff-tzdb"
2262
+ version = "1.0.0"
2263
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2264
+ checksum = "12e71a1b68a875a44a33bb7a1dd84392cb77145a3367a552a3cfe6a4f5cf3afc"
2265
+
1993
2266
  [[package]]
1994
2267
  name = "jni"
1995
2268
  version = "0.22.4"
@@ -2060,9 +2333,10 @@ dependencies = [
2060
2333
 
2061
2334
  [[package]]
2062
2335
  name = "js-runtime"
2063
- version = "0.1.3"
2336
+ version = "0.1.4"
2064
2337
  dependencies = [
2065
2338
  "rquickjs",
2339
+ "url",
2066
2340
  ]
2067
2341
 
2068
2342
  [[package]]
@@ -4623,7 +4897,7 @@ dependencies = [
4623
4897
 
4624
4898
  [[package]]
4625
4899
  name = "ui-bridge"
4626
- version = "0.1.3"
4900
+ version = "0.1.4"
4627
4901
  dependencies = [
4628
4902
  "js-runtime",
4629
4903
  "roxmltree 0.21.2",
@@ -4760,6 +5034,15 @@ version = "0.7.6"
4760
5034
  source = "registry+https://github.com/rust-lang/crates.io-index"
4761
5035
  checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
4762
5036
 
5037
+ [[package]]
5038
+ name = "utf16_iter"
5039
+ version = "1.1.0"
5040
+ source = "registry+https://github.com/rust-lang/crates.io-index"
5041
+ checksum = "1c7de35d9d8757dbc1f5125dc8b51438c68b4430546a735c3a9b91aaaaf9a18a"
5042
+ dependencies = [
5043
+ "utf_types",
5044
+ ]
5045
+
4763
5046
  [[package]]
4764
5047
  name = "utf8_iter"
4765
5048
  version = "1.1.0"
@@ -5586,11 +5869,20 @@ version = "0.57.1"
5586
5869
  source = "registry+https://github.com/rust-lang/crates.io-index"
5587
5870
  checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
5588
5871
 
5872
+ [[package]]
5873
+ name = "write16"
5874
+ version = "1.0.0"
5875
+ source = "registry+https://github.com/rust-lang/crates.io-index"
5876
+ checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936"
5877
+
5589
5878
  [[package]]
5590
5879
  name = "writeable"
5591
5880
  version = "0.6.4"
5592
5881
  source = "registry+https://github.com/rust-lang/crates.io-index"
5593
5882
  checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
5883
+ dependencies = [
5884
+ "either",
5885
+ ]
5594
5886
 
5595
5887
  [[package]]
5596
5888
  name = "wyz"
@@ -6119,11 +6411,18 @@ dependencies = [
6119
6411
 
6120
6412
  [[package]]
6121
6413
  name = "zgui-host"
6122
- version = "0.1.3"
6414
+ version = "0.1.4"
6123
6415
  dependencies = [
6124
6416
  "accesskit",
6125
6417
  "accesskit_consumer",
6126
6418
  "host-services",
6419
+ "icu_calendar",
6420
+ "icu_collator",
6421
+ "icu_datetime",
6422
+ "icu_locale_core",
6423
+ "icu_time",
6424
+ "jiff",
6425
+ "jiff-icu",
6127
6426
  "js-runtime",
6128
6427
  "libc",
6129
6428
  "parley",
@@ -6406,7 +6705,6 @@ dependencies = [
6406
6705
  [[package]]
6407
6706
  name = "zgui-render-wgpu"
6408
6707
  version = "0.1.0"
6409
- source = "git+https://github.com/zortax/zgui?rev=ee29c7dc66206eb04ba7bcf514058a278c9070ba#ee29c7dc66206eb04ba7bcf514058a278c9070ba"
6410
6708
  dependencies = [
6411
6709
  "ash",
6412
6710
  "bincode",
@@ -6414,6 +6712,7 @@ dependencies = [
6414
6712
  "futures",
6415
6713
  "naga",
6416
6714
  "rustc-hash 2.1.3",
6715
+ "rustix 1.1.6",
6417
6716
  "tracing",
6418
6717
  "web-time",
6419
6718
  "wgpu",
package/sdk/bun.lock CHANGED
@@ -161,7 +161,7 @@
161
161
  },
162
162
  "packages/build": {
163
163
  "name": "@hewel/zgui-build",
164
- "version": "0.1.3",
164
+ "version": "0.1.4",
165
165
  "dependencies": {
166
166
  "@solidjs/compiler": "2.0.1",
167
167
  "lightningcss": "1.33.0",
@@ -176,7 +176,7 @@
176
176
  },
177
177
  "packages/cli": {
178
178
  "name": "@hewel/zgui-cli",
179
- "version": "0.1.3",
179
+ "version": "0.1.4",
180
180
  "bin": {
181
181
  "zgui-js": "./src/cli.ts",
182
182
  },
@@ -192,7 +192,7 @@
192
192
  },
193
193
  "packages/create-zgui-js": {
194
194
  "name": "create-zgui-js",
195
- "version": "0.1.3",
195
+ "version": "0.1.4",
196
196
  "bin": {
197
197
  "create-zgui-js": "./src/cli.ts",
198
198
  },
@@ -205,22 +205,23 @@
205
205
  },
206
206
  "packages/host-linux-arm64": {
207
207
  "name": "@hewel/zgui-host-linux-arm64",
208
- "version": "0.1.3",
208
+ "version": "0.1.4",
209
209
  },
210
210
  "packages/host-linux-x64": {
211
211
  "name": "@hewel/zgui-host-linux-x64",
212
- "version": "0.1.3",
212
+ "version": "0.1.4",
213
213
  },
214
214
  "packages/services": {
215
215
  "name": "@hewel/zgui-services",
216
- "version": "0.1.3",
216
+ "version": "0.1.4",
217
217
  "dependencies": {
218
+ "@hewel/zgui": "workspace:*",
218
219
  "solid-js": "2.0.1",
219
220
  },
220
221
  },
221
222
  "packages/ui": {
222
223
  "name": "@hewel/zgui",
223
- "version": "0.1.3",
224
+ "version": "0.1.4",
224
225
  "dependencies": {
225
226
  "@solidjs/signals": "2.0.1",
226
227
  "@solidjs/universal": "2.0.1",
package/sdk/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zgui-js",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "license": "Apache-2.0",
5
5
  "private": true,
6
6
  "type": "module",
package/src/dev.ts CHANGED
@@ -30,6 +30,7 @@ export async function devApplication(
30
30
  root = workspaceRoot,
31
31
  appDirectory = path.join(root, "apps/examples", app),
32
32
  hostArgs = [],
33
+ hostCwd,
33
34
  hostRoot,
34
35
  hostExecutable,
35
36
  hostSearchFrom,
@@ -137,7 +138,7 @@ export async function devApplication(
137
138
  mode === "preview"
138
139
  ? ["preview", "watch", "--bundle", dist!, ...hostArgs]
139
140
  : ["--bundle", dist!, "--watch", ...hostArgs];
140
- stop(await run(executable, args, { root: runRoot, signal: controller.signal }));
141
+ stop(await run(executable, args, { root: hostCwd ?? runRoot, signal: controller.signal }));
141
142
  } catch (error) {
142
143
  fail(error);
143
144
  }
@@ -225,6 +225,39 @@ function parseNetworkOrigin(
225
225
  return { canonical, insecure: scheme === "http" || scheme === "ws", host };
226
226
  }
227
227
 
228
+ const systemFileFlags = [
229
+ "read",
230
+ "write",
231
+ "trash",
232
+ "volumes",
233
+ "thumbnails",
234
+ "openExternal",
235
+ ] as const;
236
+
237
+ function parseDirectoryGrants(
238
+ value: unknown,
239
+ field: string,
240
+ ): NonNullable<NonNullable<Capabilities["files"]>["directories"]> {
241
+ if (!Array.isArray(value)) throw new Error(`${field} must be an array`);
242
+ const seen = new Set<string>();
243
+ return (value as unknown[]).map(item => {
244
+ if (!item || typeof item !== "object" || Array.isArray(item))
245
+ throw new Error(`${field} entries must be objects`);
246
+ const record = item as Record<string, unknown>;
247
+ if (!Object.keys(record).every(key => key === "path" || key === "mode"))
248
+ throw new Error(`${field} entry contains unknown keys`);
249
+ if (
250
+ !capabilityString(record.path) ||
251
+ !capabilityPath(record.path, "directory") ||
252
+ (record.mode !== "read" && record.mode !== "readwrite")
253
+ )
254
+ throw new Error(`${field} contains invalid entries`);
255
+ if (seen.has(record.path)) throw new Error(`${field} contains duplicate path ${record.path}`);
256
+ seen.add(record.path);
257
+ return { path: record.path, mode: record.mode };
258
+ });
259
+ }
260
+
228
261
  /** Validate each source before any of its grants can enter the union. */
229
262
  function parseCapabilities(input: unknown, source: string): Capabilities {
230
263
  if (input !== undefined && (input === null || typeof input !== "object" || Array.isArray(input)))
@@ -237,6 +270,7 @@ function parseCapabilities(input: unknown, source: string): Capabilities {
237
270
  case "shellSurfaces":
238
271
  case "sessionLock":
239
272
  case "controlChannel":
273
+ case "singleInstance":
240
274
  if (typeof value !== "boolean") throw new Error(`${field} must be a boolean`);
241
275
  if (value) capabilities[key] = true;
242
276
  break;
@@ -270,31 +304,38 @@ function parseCapabilities(input: unknown, source: string): Capabilities {
270
304
  case "files": {
271
305
  if (!value || typeof value !== "object" || Array.isArray(value))
272
306
  throw new Error(`${field} must be an object`);
307
+ const files: NonNullable<Capabilities["files"]> = {};
273
308
  for (const [subKey, subVal] of Object.entries(value as Record<string, unknown>)) {
309
+ if (subKey === "allowBookmarks" || subKey === "readOnlyGrants") {
310
+ if (typeof subVal !== "boolean")
311
+ throw new Error(`${field}.${subKey} must be a boolean`);
312
+ if (subKey === "allowBookmarks" && !subVal) files.allowBookmarks = false;
313
+ if (subKey === "readOnlyGrants" && subVal) files.readOnlyGrants = true;
314
+ continue;
315
+ }
274
316
  if (subKey !== "directories") throw new Error(`Unknown capability: ${field}.${subKey}`);
275
- if (!Array.isArray(subVal)) throw new Error(`${field}.directories must be an array`);
276
- const seen = new Set<string>();
277
- const dirs: { path: string; mode: "read" | "readwrite" }[] = [];
278
- for (const item of subVal as unknown[]) {
279
- if (!item || typeof item !== "object" || Array.isArray(item))
280
- throw new Error(`${field}.directories entries must be objects`);
281
- const record = item as Record<string, unknown>;
282
- const keys = Object.keys(record);
283
- if (!keys.every(k => k === "path" || k === "mode"))
284
- throw new Error(`${field}.directories entry contains unknown keys`);
285
- if (
286
- !capabilityString(record.path) ||
287
- !capabilityPath(record.path, "directory") ||
288
- (record.mode !== "read" && record.mode !== "readwrite")
289
- )
290
- throw new Error(`${field}.directories contains invalid entries`);
291
- if (seen.has(record.path))
292
- throw new Error(`${field}.directories contains duplicate path ${record.path}`);
293
- seen.add(record.path);
294
- dirs.push({ path: record.path, mode: record.mode });
317
+ const dirs = parseDirectoryGrants(subVal, `${field}.directories`);
318
+ if (dirs.length) files.directories = dirs;
319
+ }
320
+ if (Object.keys(files).length) capabilities.files = files;
321
+ break;
322
+ }
323
+ case "systemFiles": {
324
+ if (!value || typeof value !== "object" || Array.isArray(value))
325
+ throw new Error(`${field} must be an object`);
326
+ const systemFiles: NonNullable<Capabilities["systemFiles"]> = {};
327
+ for (const [subKey, subVal] of Object.entries(value as Record<string, unknown>)) {
328
+ if (subKey === "directories") {
329
+ const dirs = parseDirectoryGrants(subVal, `${field}.directories`);
330
+ if (dirs.length) systemFiles.directories = dirs;
331
+ } else {
332
+ const flag = systemFileFlags.find(candidate => candidate === subKey);
333
+ if (!flag) throw new Error(`Unknown capability: ${field}.${subKey}`);
334
+ if (typeof subVal !== "boolean") throw new Error(`${field}.${flag} must be a boolean`);
335
+ if (subVal) systemFiles[flag] = true;
295
336
  }
296
- if (dirs.length) capabilities.files = { directories: dirs };
297
337
  }
338
+ if (Object.keys(systemFiles).length) capabilities.systemFiles = systemFiles;
298
339
  break;
299
340
  }
300
341
  case "network": {
@@ -434,18 +475,16 @@ function parseCapabilities(input: unknown, source: string): Capabilities {
434
475
 
435
476
  /**
436
477
  * Build-time overlays may grant `shellSurfaces: true`, sealing that grant into the package.
437
- * Only the base package may grant `sessionLock: true`. Runtime `--extensions-overlay` is
438
- * intentionally stricter: it may escalate neither shell surfaces nor session lock.
478
+ * Only the base package may enable `sessionLock` or `singleInstance`. A runtime
479
+ * `--extensions-overlay` cannot add those flags or shell surface authority.
439
480
  */
440
481
  function capabilityOverlay(input: unknown, source: string): Capabilities {
441
- if (
442
- input !== null &&
443
- typeof input === "object" &&
444
- "sessionLock" in input &&
445
- input.sessionLock === true
446
- )
447
- throw new Error(`${source}.sessionLock: true may only be declared in base package.json`);
448
- return parseCapabilities(input, source);
482
+ const capabilities = parseCapabilities(input, source);
483
+ for (const key of ["sessionLock", "singleInstance"] as const) {
484
+ if (capabilities[key])
485
+ throw new Error(`${source}.${key}: true may only be declared in base package.json`);
486
+ }
487
+ return capabilities;
449
488
  }
450
489
 
451
490
  async function mergeCapabilities(
@@ -470,6 +509,7 @@ async function mergeCapabilities(
470
509
  for (const key of ["shellSurfaces", "controlChannel"] as const)
471
510
  if (sources.some(source => source[key])) merged[key] = true;
472
511
  if (base.sessionLock) merged.sessionLock = true;
512
+ if (base.singleInstance) merged.singleInstance = true;
473
513
  for (const key of ["imagePrefixes", "unixSockets", "namedSockets", "commands"] as const) {
474
514
  const union = new Set(sources.flatMap(source => source[key] ?? []));
475
515
  if (union.size) merged[key] = [...union].sort();
@@ -477,18 +517,29 @@ async function mergeCapabilities(
477
517
  if (sources.some(source => source.clipboard?.read)) merged.clipboard = { read: true };
478
518
  const sqliteDatabases = new Set(sources.flatMap(source => source.sqlite?.databases ?? []));
479
519
  if (sqliteDatabases.size) merged.sqlite = { databases: [...sqliteDatabases].sort() };
480
- const fileDirs = new Map<string, "read" | "readwrite">();
481
- for (const grant of sources.flatMap(source => source.files?.directories ?? [])) {
482
- const existing = fileDirs.get(grant.path);
483
- if (!existing || grant.mode === "readwrite") fileDirs.set(grant.path, grant.mode);
484
- }
485
- if (fileDirs.size) {
486
- merged.files = {
487
- directories: [...fileDirs.entries()]
488
- .sort(([a], [b]) => a.localeCompare(b))
489
- .map(([dirPath, mode]) => ({ path: dirPath, mode })),
490
- };
491
- }
520
+ const mergeDirs = (key: "files" | "systemFiles") => {
521
+ const dirs = new Map<string, "read" | "readwrite">();
522
+ for (const { path: dirPath, mode } of sources.flatMap(
523
+ source => source[key]?.directories ?? [],
524
+ )) {
525
+ if (!dirs.has(dirPath) || mode === "readwrite") dirs.set(dirPath, mode);
526
+ }
527
+ return [...dirs.entries()]
528
+ .sort(([a], [b]) => a.localeCompare(b))
529
+ .map(([dirPath, mode]) => ({ path: dirPath, mode }));
530
+ };
531
+ const files: NonNullable<Capabilities["files"]> = {};
532
+ const fileDirs = mergeDirs("files");
533
+ if (fileDirs.length) files.directories = fileDirs;
534
+ if (sources.some(source => source.files?.allowBookmarks === false)) files.allowBookmarks = false;
535
+ if (sources.some(source => source.files?.readOnlyGrants)) files.readOnlyGrants = true;
536
+ if (Object.keys(files).length) merged.files = files;
537
+ const systemFiles: NonNullable<Capabilities["systemFiles"]> = {};
538
+ const systemDirs = mergeDirs("systemFiles");
539
+ if (systemDirs.length) systemFiles.directories = systemDirs;
540
+ for (const flag of systemFileFlags)
541
+ if (sources.some(source => source.systemFiles?.[flag])) systemFiles[flag] = true;
542
+ if (Object.keys(systemFiles).length) merged.systemFiles = systemFiles;
492
543
  const networkSources = sources
493
544
  .map(source => source.network)
494
545
  .filter((net): net is NonNullable<Capabilities["network"]> => net !== undefined);
@@ -23,12 +23,22 @@ function sanitizeDesktopField(value: string): string {
23
23
  return value.replace(/[\r\n]+/g, " ").trim();
24
24
  }
25
25
 
26
- function buildLauncherScript(app: string, { pureShell = false }: { pureShell?: boolean }): string {
26
+ function buildLauncherScript({ pureShell = false }: { pureShell?: boolean }): string {
27
27
  const extraFlags = pureShell ? " --pure-shell" : "";
28
28
  return `#!/usr/bin/env sh
29
29
  set -eu
30
30
  DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
31
- exec "$DIR/bin/zgui-host" --bundle "$DIR/bundle"${extraFlags} "$@"
31
+ # Preserve the launcher diagnostics. A leading -- forces literal app arguments.
32
+ case "\${1-}:$#" in
33
+ --help:1|-h:1|--version:1|-V:1)
34
+ exec "$DIR/bin/zgui-host" "$@" ;;
35
+ --version:2|-V:2)
36
+ if [ "$2" = --json ]; then exec "$DIR/bin/zgui-host" "$@"; fi ;;
37
+ --exit-after-ms:2)
38
+ exec "$DIR/bin/zgui-host" --bundle "$DIR/bundle"${extraFlags} "$@" ;;
39
+ --:*) shift ;;
40
+ esac
41
+ exec "$DIR/bin/zgui-host" --bundle "$DIR/bundle"${extraFlags} -- "$@"
32
42
  `;
33
43
  }
34
44
 
@@ -41,11 +51,19 @@ function buildDesktopEntry({
41
51
  id: string;
42
52
  execPath: string;
43
53
  }): string {
54
+ // Desktop Entry escaping precedes Exec's quoted-argument escaping.
55
+ const executable = execPath
56
+ .replaceAll("%", "%%")
57
+ .replace(/["`$\\]/g, "\\$&")
58
+ .replaceAll("\\", "\\\\")
59
+ .replaceAll("\n", "\\n")
60
+ .replaceAll("\r", "\\r")
61
+ .replaceAll("\t", "\\t");
44
62
  return `[Desktop Entry]
45
63
  Type=Application
46
64
  Version=1.0
47
65
  Name=${sanitizeDesktopField(name)}
48
- Exec=${sanitizeDesktopField(execPath)}
66
+ Exec="${executable}" -- %F
49
67
  Terminal=false
50
68
  Categories=Utility;
51
69
  StartupWMClass=${sanitizeDesktopField(id)}
@@ -121,7 +139,7 @@ export async function packageApplication(
121
139
  await copyFile(source, path.join(licensesDir, filename));
122
140
  licensePaths.push(`licenses/${filename}`);
123
141
  }
124
- await writeFile(launcherPath, buildLauncherScript(app, { pureShell }), "utf8");
142
+ await writeFile(launcherPath, buildLauncherScript({ pureShell }), "utf8");
125
143
  await chmod(launcherPath, 0o755);
126
144
 
127
145
  if (desktopEntry) {
@@ -13,6 +13,20 @@ export type FileDirectoryGrant = {
13
13
 
14
14
  export type FilesCapabilities = {
15
15
  directories?: FileDirectoryGrant[];
16
+ /** Defaults to true for legacy gesture-authorized bookmarks. */
17
+ allowBookmarks?: boolean;
18
+ /** Prevent the persistence or restoration of readwrite workspace grants. */
19
+ readOnlyGrants?: boolean;
20
+ };
21
+
22
+ export type SystemFilesCapabilities = {
23
+ read?: boolean;
24
+ write?: boolean;
25
+ trash?: boolean;
26
+ volumes?: boolean;
27
+ thumbnails?: boolean;
28
+ openExternal?: boolean;
29
+ directories?: FileDirectoryGrant[];
16
30
  };
17
31
 
18
32
  export type NetworkOriginRule = {
@@ -36,9 +50,12 @@ export type Capabilities = {
36
50
  namedSockets?: string[];
37
51
  commands?: string[];
38
52
  controlChannel?: boolean;
53
+ /** Base package launch policy; overlays cannot enable this. */
54
+ singleInstance?: boolean;
39
55
  clipboard?: ClipboardCapabilities;
40
56
  sqlite?: SqliteCapabilities;
41
57
  files?: FilesCapabilities;
58
+ systemFiles?: SystemFilesCapabilities;
42
59
  network?: NetworkCapabilities;
43
60
  };
44
61
 
@@ -151,6 +168,8 @@ export type DevMode = "desktop" | "preview";
151
168
  export interface DevApplicationOptions extends Omit<BuildApplicationOptions, "development"> {
152
169
  strictTypecheck?: boolean | undefined;
153
170
  hostArgs?: string[];
171
+ /** Working directory for the native process, independent of bundle and Cargo paths. */
172
+ hostCwd?: string;
154
173
  hostRoot?: string;
155
174
  hostExecutable?: string;
156
175
  mode?: DevMode;
@@ -96,6 +96,56 @@ export function adaptUpstreamCss(name: string, className: string, css: string):
96
96
  );
97
97
  case "CollapsibleStyle":
98
98
  return `${css}\n.zui-collapsible__content[data-collapsed] { visibility: hidden; }`;
99
+ case "TableStyle":
100
+ return css
101
+ .replace(
102
+ `.${className}[data-sticky-header="true"] .zui-table__head`,
103
+ '.zui-table__head[data-sticky="true"]',
104
+ )
105
+ .replace(
106
+ `.${className} .zui-table__row[data-selected="true"] .zui-table__cell`,
107
+ '.zui-table__cell[data-selected="true"]',
108
+ )
109
+ .replace(
110
+ ".zui-table__row:hover .zui-table__cell",
111
+ ".zui-table__row:hover > .zui-table__cell",
112
+ )
113
+ .replace(
114
+ ".zui-table__footer .zui-table__cell",
115
+ ".zui-table__footer > .zui-table__row > .zui-table__cell",
116
+ )
117
+ .replaceAll(
118
+ /(\.zui-table__(?:body|footer)) (\.zui-table__row:(?:first|last)-child)/g,
119
+ "$1 > $2",
120
+ )
121
+ .replaceAll(
122
+ /(\.zui-table__row:(?:first|last)-child) \.zui-table__cell/g,
123
+ "$1 > .zui-table__cell",
124
+ );
125
+ case "DataTableStyle":
126
+ return `${css
127
+ .replace(
128
+ "border: 1px solid var(--zui-color-border);\n border-radius: var(--zui-radius-md);\n max-height:",
129
+ "border: none;\n --zgui-scrollbar-mode: overlay;\n max-height:",
130
+ )
131
+ .replace(
132
+ '.zui-data-table__grid[data-virtualized="true"] .zui-table__body .zui-table__cell',
133
+ '.zui-data-table__layout-row[data-fixed="true"] > .zui-table__row > .zui-table__cell',
134
+ )}
135
+ .zui-data-table__layout-row { flex-shrink: 0; }
136
+ .zui-data-table__frame {
137
+ width: 100%;
138
+ min-width: 0;
139
+ overflow-x: auto;
140
+ overflow-y: hidden;
141
+ border: 1px solid var(--zui-color-border);
142
+ border-radius: var(--zui-radius-md);
143
+ }`;
144
+ case "DatePickerStyle":
145
+ return css.replace(
146
+ ".zui-date-picker__surface {\n width: auto;",
147
+ ".zui-popover.zui-date-picker__surface {\n width: max-content;",
148
+ );
99
149
  default:
100
150
  return css;
101
151
  }
package/src/validate.ts CHANGED
@@ -53,6 +53,10 @@ const globals = new Set([
53
53
  "ArrayBuffer",
54
54
  "SharedArrayBuffer",
55
55
  "DataView",
56
+ "URL",
57
+ "URLSearchParams",
58
+ "TextEncoder",
59
+ "TextDecoder",
56
60
  "Atomics",
57
61
  "JSON",
58
62
  "Promise",