@native-sdk/cli 0.4.2 → 0.4.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.
Files changed (46) hide show
  1. package/build/app.zig +121 -66
  2. package/build.zig +123 -6
  3. package/package.json +9 -9
  4. package/skill-data/core/SKILL.md +3 -0
  5. package/skill-data/native-ui/SKILL.md +16 -0
  6. package/skill-data/zig/SKILL.md +198 -0
  7. package/skills/native-sdk/SKILL.md +1 -1
  8. package/src/app_runner/root.zig +51 -9
  9. package/src/platform/linux/gtk_host.c +226 -21
  10. package/src/platform/windows/webview2_host.cpp +16 -10
  11. package/src/primitives/app_manifest/root.zig +8 -0
  12. package/src/primitives/app_manifest/types.zig +14 -0
  13. package/src/primitives/app_manifest/validation.zig +18 -0
  14. package/src/primitives/app_manifest/web_layer.zig +366 -0
  15. package/src/primitives/canvas/chart_tests.zig +2 -2
  16. package/src/primitives/canvas/markdown_tests.zig +1 -1
  17. package/src/primitives/canvas/reference.zig +135 -6
  18. package/src/primitives/canvas/reference_tests.zig +171 -6
  19. package/src/primitives/canvas/root.zig +3 -0
  20. package/src/primitives/canvas/test_support.zig +3 -0
  21. package/src/primitives/canvas/widget_builtin_tests.zig +249 -4
  22. package/src/primitives/canvas/widget_render_controls.zig +18 -1
  23. package/src/primitives/canvas/widget_runtime.zig +3 -0
  24. package/src/primitives/canvas/widget_text_input.zig +104 -1
  25. package/src/runtime/api.zig +7 -0
  26. package/src/runtime/bridge_responses.zig +2 -0
  27. package/src/runtime/builtin_bridge.zig +6 -0
  28. package/src/runtime/canvas_widget_runtime.zig +23 -3
  29. package/src/runtime/canvas_widget_text_tests.zig +101 -0
  30. package/src/runtime/flow.zig +8 -0
  31. package/src/runtime/platform_bridge_tests.zig +1 -0
  32. package/src/runtime/session_tests.zig +35 -8
  33. package/src/runtime/view.zig +1 -1
  34. package/src/runtime/view_widget_scroll.zig +12 -1
  35. package/src/runtime/view_widget_text.zig +6 -2
  36. package/src/runtime/web_layer_gate_tests.zig +242 -0
  37. package/src/runtime/window_storage.zig +5 -0
  38. package/src/runtime/window_view_runtime.zig +1 -0
  39. package/src/tooling/buildgraph.zig +119 -3
  40. package/src/tooling/junction.zig +247 -0
  41. package/src/tooling/manifest.zig +267 -1
  42. package/src/tooling/package.zig +598 -6
  43. package/src/tooling/raw_manifest.zig +1 -0
  44. package/src/tooling/root.zig +1 -0
  45. package/src/tooling/templates.zig +288 -61
  46. package/src/tooling/verbs.zig +5 -0
@@ -0,0 +1,198 @@
1
+ ---
2
+ name: zig
3
+ description: Zig 0.16 idioms for Native SDK code, indexed by compile error. Load when `zig build` fails on std APIs with errors like "struct 'fs' has no member named 'cwd'", "struct 'array_list.Aligned(u8,null)' has no member named 'init'", "struct 'std' has no member named 'io'", "no member named 'GeneralPurposeAllocator'", "no member named 'getEnvMap'", or "invalid format string" - the signature of code written for Zig 0.15 or earlier. Covers main(std.process.Init), std.Io file IO and writers, ArrayList, process spawning, environment, clocks and sleep, sockets, custom formatting, and build.zig module shapes, each as this SDK writes them.
4
+ ---
5
+
6
+ # Zig 0.16 for Native SDK code
7
+
8
+ The Native SDK requires Zig 0.16.0 (`minimum_zig_version` in `build.zig.zon`; the CLI pins the same version and offers a checksum-verified download into `~/.native/toolchains/` when the `zig` on PATH does not match). Training data and older guides teach Zig 0.15 idioms, and 0.16 moved everything that touches the outside world — files, stdout, clocks, sleeping, process spawning, sockets — behind an explicit `std.Io` value, while containers became allocator-per-call. Each section below is headed by the exact compile error the old idiom produces, so search this file by error text.
9
+
10
+ Two rules resolve most failures:
11
+
12
+ - Operations on the outside world take a `std.Io` first (or right after the receiver). Get one from `init.io` in `main(init: std.process.Init)`, from `std.testing.io` in tests, or from `std.Io.Threaded` in code with no `Init` to thread through.
13
+ - Containers are unmanaged: initialize with `.empty` and pass the allocator to every mutating call.
14
+
15
+ In a UiApp, `update` never sees an `Io` — persistence, subprocesses, HTTP, clocks, and timers go through the typed effects channel (`fx.readFile`, `fx.spawn`, `fx.fetch`, `fx.wallMs`, `fx.startTimer`; see `native skills get native-ui`). Raw `std.Io` belongs in `main`, tests, and standalone tools. And because Zig analyzes lazily, a 0.15-ism can hide in code only one build path references: run BOTH `zig build` and `zig build test` before calling a change done.
16
+
17
+ ## error: struct 'heap' has no member named 'GeneralPurposeAllocator' — allocators come from `main(init: std.process.Init)`
18
+
19
+ Zig 0.15 and earlier:
20
+
21
+ ```zig
22
+ pub fn main() !void {
23
+ var gpa = std.heap.GeneralPurposeAllocator(.{}){};
24
+ defer _ = gpa.deinit();
25
+ const allocator = gpa.allocator();
26
+ }
27
+ ```
28
+
29
+ Zig 0.16: `main` takes `std.process.Init`, which carries the process-wide allocators, the `Io`, the environment, and the args — nothing to construct or deinit:
30
+
31
+ ```zig
32
+ pub fn main(init: std.process.Init) !void {
33
+ const gpa = init.gpa; // general purpose, leak-checked in Debug
34
+ const arena = init.arena.allocator(); // process-lifetime arena, freed on exit
35
+ const io = init.io; // the Io every std call below wants
36
+ const args = try init.minimal.args.toSlice(arena);
37
+ if (init.environ_map.get("HOME")) |home| { ... }
38
+ }
39
+ ```
40
+
41
+ The CLI's own entry point is the live reference: `tools/native-sdk/main.zig`. Generated apps already have this shape — `main(init: std.process.Init)` passes `init` through to `runner.runWithOptions(app, options, init)` and `init.io` to the markup hot-reload watcher (see any `examples/*/src/main.zig`). `std.heap.page_allocator` still exists for allocations that live for the whole process. Library code that cannot take an `Init` builds its own `Io`: `var threaded = std.Io.Threaded.init(allocator, .{});` then `threaded.io()` (`src/platform/macos/root.zig`).
42
+
43
+ ## error: struct 'fs' has no member named 'cwd' — file IO moved to `std.Io.Dir`
44
+
45
+ `std.fs.cwd()`, `std.fs.File`, and `std.fs.selfExePath` are gone (`std.fs` retains only `path` helpers and deprecated aliases). The directory handle is `std.Io.Dir`, and every operation takes `io` right after the receiver:
46
+
47
+ ```zig
48
+ const cwd = std.Io.Dir.cwd();
49
+ const content = try cwd.readFileAlloc(io, "app.zon", allocator, .limited(1024 * 1024));
50
+ defer allocator.free(content);
51
+ try cwd.writeFile(io, .{ .sub_path = "out.txt", .data = bytes });
52
+ var file = try cwd.openFile(io, path, .{});
53
+ defer file.close(io);
54
+ try cwd.deleteTree(io, "zig-out/tmp");
55
+ ```
56
+
57
+ Note the `readFileAlloc` argument order (`io`, path, allocator, limit) and the size limit as `std.Io.Limit` — `.limited(n)` or `.unlimited`. Live references: `tools/native-sdk/skills.zig` (readFileAlloc), `src/tooling/manifest.zig` (openFile), `src/tooling/cef.zig` tests (writeFile with `std.testing.io`). Path buffers size with `std.Io.Dir.max_path_bytes`. For the executable's own path, `std.fs.selfExePath(&buf)` became `std.process.executablePath(io, &buf)`, returning the length (`tools/native-sdk/skills.zig`).
58
+
59
+ ## error: struct 'std' has no member named 'io' — writers are `std.Io.Writer`, stdout is `std.Io.File.stdout()`
60
+
61
+ `std.io.getStdOut().writer()` and `std.io.fixedBufferStream` are gone. Stdout takes `io` plus a caller-owned buffer, and the printable interface lives one field deep:
62
+
63
+ ```zig
64
+ var stdout_buffer: [4096]u8 = undefined;
65
+ var stdout_writer = std.Io.File.stdout().writer(io, &stdout_buffer);
66
+ const stdout = &stdout_writer.interface;
67
+ defer stdout.flush() catch {};
68
+ try stdout.print("{s}\n", .{message});
69
+ ```
70
+
71
+ Forgetting `flush()` means no output — the buffer is yours. `std.debug.print` is unchanged and needs no `io`; prefer it for diagnostics. The `fixedBufferStream` replacement is a fixed writer over a stack buffer, and the written bytes come back from `buffered()`:
72
+
73
+ ```zig
74
+ var buf: [256]u8 = undefined;
75
+ var writer = std.Io.Writer.fixed(&buf);
76
+ try writer.print("n={d}", .{42});
77
+ const written = writer.buffered();
78
+ ```
79
+
80
+ For building a string of unknown size, use an allocating writer instead of an ArrayList writer: `var w = std.Io.Writer.Allocating.init(allocator); defer w.deinit();` then print through `w.writer` (`src/automation/server.zig`). One-shot formatting still has `std.fmt.bufPrint` and `std.fmt.allocPrint`, unchanged. Functions that accept a writer take `*std.Io.Writer`, not `anytype` (`tools/native-sdk/skills.zig`; fixed-writer reference: `src/tooling/doctor.zig`).
81
+
82
+ ## error: struct 'array_list.Aligned(u8,null)' has no member named 'init' — ArrayList is unmanaged
83
+
84
+ `std.ArrayList(T).init(allocator)` is gone; the list no longer stores its allocator. Initialize with `.empty` and pass the allocator to every call that can allocate or free:
85
+
86
+ ```zig
87
+ var list: std.ArrayList(u8) = .empty;
88
+ defer list.deinit(allocator);
89
+ try list.append(allocator, 'a');
90
+ try list.appendSlice(allocator, "bc");
91
+ const owned = try list.toOwnedSlice(allocator);
92
+ ```
93
+
94
+ This is everywhere in the SDK — `src/tooling/templates.zig` builds every generated file this way, `tools/native-sdk/skills.zig` collects skills this way. Passing a managed-style call (`list.append('a')`) fails with "member function expected 2 argument(s), found 1". `std.StringHashMap`/`std.AutoHashMap` still have managed `.init(allocator)` forms; only explicitly `Unmanaged` maps take `.empty` (`tools/native-sdk/markup_lsp.zig`).
95
+
96
+ ## error: invalid format string 's' for type — enums print with `{t}`, format methods with `{f}`
97
+
98
+ `{s}` is for strings only. Enums and tagged unions print their tag name with `{t}` (equivalent to `@tagName`, which also still works):
99
+
100
+ ```zig
101
+ std.debug.print("native {t}: `zig build` step failed (exit code {d})\n", .{ verb, code });
102
+ ```
103
+
104
+ (`src/tooling/verbs.zig`.) Custom format methods changed shape twice over: the old four-parameter signature no longer compiles (`error: struct 'fmt' has no member named 'FormatOptions'`), and `{}` no longer calls a `format` method at all — it prints the default field dump silently. Declare the 0.16 signature and print with `{f}`:
105
+
106
+ ```zig
107
+ pub fn format(self: Point, writer: *std.Io.Writer) std.Io.Writer.Error!void {
108
+ try writer.print("({d},{d})", .{ self.x, self.y });
109
+ }
110
+ // call site
111
+ try writer.print("{f}\n", .{point});
112
+ ```
113
+
114
+ ## error: struct 'time' has no member named 'sleep' / 'milliTimestamp' — clocks live on Io
115
+
116
+ `std.time` keeps only the unit constants (`ns_per_ms`, `ms_per_s`, ...) and epoch helpers. Sleeping and reading clocks take `io` and typed durations:
117
+
118
+ ```zig
119
+ try std.Io.sleep(io, std.Io.Duration.fromMilliseconds(50), .awake);
120
+ const now_ns: i128 = std.Io.Timestamp.now(io, .real).nanoseconds;
121
+ ```
122
+
123
+ (`src/runtime/automation_liveness_tests.zig`, `src/automation/server.zig`.) In app code, do not reach for either: `native_sdk.nowMs()` / `native_sdk.monotonicMs()` are the facade, `fx.wallMs()` is the journaled read inside `update`, and `model.clock` is the testable seam — the native-ui skill's Time section owns that pattern.
124
+
125
+ ## error: struct 'process.Child' has no member named 'init' — spawning is `std.process.spawn(io, ...)`
126
+
127
+ The two-step `Child.init` + `child.spawn()` collapsed into one call, and lifecycle methods take `io`:
128
+
129
+ ```zig
130
+ var child = try std.process.spawn(io, .{
131
+ .argv = &.{ "npm", "run", "build" },
132
+ .stdin = .ignore,
133
+ .stdout = .inherit,
134
+ .stderr = .inherit,
135
+ });
136
+ const term = try child.wait(io); // child.kill(io) to stop it
137
+ ```
138
+
139
+ (`src/tooling/verbs.zig`, `src/tooling/dev.zig` — the latter also shows passing a custom environment via `.environ_map`.) Inside a UiApp, spawn through the effects channel (`fx.spawn`) instead — it is bounded, journaled, and delivers exit/output as Msgs.
140
+
141
+ ## error: struct 'process' has no member named 'getEnvMap' / 'argsAlloc' — environment and args come from Init
142
+
143
+ `std.process.getEnvMap`, `argsAlloc`, and `argsWithAllocator` are gone. `main` already has both: `init.environ_map` (a `*std.process.Environ.Map`) and `init.minimal.args.toSlice(allocator)` (`tools/native-sdk/main.zig`). Building an environment from scratch — for a child process, or in tests — is `var env = std.process.Environ.Map.init(allocator); defer env.deinit(); try env.put("KEY", "value");` (`src/tooling/dev.zig`).
144
+
145
+ ## error: struct 'std' has no member named 'net' — sockets live on `std.Io.net`
146
+
147
+ `std.net.Address` became `std.Io.net.IpAddress`, and connect/listen take `io`: `std.Io.net.IpAddress.resolve(io, host, port)`, then `IpAddress.connect(&address, io, .{ .mode = .stream, .protocol = .tcp })`; stream readers/writers follow the buffered-writer shape (`std.Io.net.Stream.writer(stream, io, &buffer)` then `.interface`). Live reference: `src/tooling/dev.zig` (`waitUntilReady`/`httpReady`). App-level HTTP belongs in `fx.fetch`, not hand-rolled sockets.
148
+
149
+ ## error: no field named 'root_source_file' in struct 'Build.ExecutableOptions' — build.zig artifacts take modules
150
+
151
+ Zero-config apps have no `build.zig` — the CLI owns the build graph, so this only appears in apps that ejected or scaffolded `--full`. Artifacts take a module, and the module owns root source, target, and optimize:
152
+
153
+ ```zig
154
+ const exe = b.addExecutable(.{
155
+ .name = "app",
156
+ .root_module = b.createModule(.{
157
+ .root_source_file = b.path("src/main.zig"),
158
+ .target = target,
159
+ .optimize = optimize,
160
+ }),
161
+ });
162
+ const tests = b.addTest(.{ .root_module = app_mod });
163
+ ```
164
+
165
+ The generated ejected `build.zig` is the reference shape (`native eject`, emitted by `src/tooling/templates.zig`); the SDK's own `build.zig` uses the same pattern throughout.
166
+
167
+ ## Reading files and streams incrementally
168
+
169
+ `file.reader()` with no arguments is gone. A reader takes `io` and a buffer, and the stream interface lives on `.interface`:
170
+
171
+ ```zig
172
+ var read_buffer: [4096]u8 = undefined;
173
+ var reader = file.reader(io, &read_buffer);
174
+ const bytes = try reader.interface.allocRemaining(allocator, .limited(1024 * 1024));
175
+ const line = try reader.interface.takeDelimiterExclusive('\n');
176
+ ```
177
+
178
+ (`src/tooling/manifest.zig` for allocRemaining, `src/tooling/toolchain.zig` for line reading from stdin.) For whole-file reads, prefer `readFileAlloc` above.
179
+
180
+ ## Tests: the Io is `std.testing.io`
181
+
182
+ Tests never construct an `Io` — `std.testing.io` is the canonical one, next to `std.testing.allocator`:
183
+
184
+ ```zig
185
+ test "reads the manifest" {
186
+ var tmp = std.testing.tmpDir(.{});
187
+ defer tmp.cleanup();
188
+ try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "app.zon", .data = source });
189
+ const content = try tmp.dir.readFileAlloc(std.testing.io, "app.zon", std.testing.allocator, .limited(4096));
190
+ defer std.testing.allocator.free(content);
191
+ }
192
+ ```
193
+
194
+ (`src/tooling/cef.zig` and `src/tooling/manifest.zig` tests.) Model/Msg/update tests need no `Io` at all — the markup-view testing pattern in the native-ui skill is pure.
195
+
196
+ ## Unchanged — do not "migrate" these
197
+
198
+ `std.fmt.bufPrint` / `allocPrint` / `parseInt` / `parseFloat`, `std.mem.*`, `std.debug.print`, `std.heap.page_allocator`, `std.time.ns_per_*` and `ms_per_*` constants, `@embedFile`, `std.testing.expect*`, and managed `std.StringHashMap` / `std.AutoHashMap` all work as before. If code using only these fails, the problem is elsewhere.
@@ -19,7 +19,7 @@ native skills get core
19
19
  native skills get core --full
20
20
  ```
21
21
 
22
- Use `native skills get core` for initial orientation. Use `native skills get core --full` for implementation tasks because it includes the reference files for project anatomy, runtime, frontend assets, bridge/security/native capabilities, packaging, and debugging. Use `native skills get automation` when testing a running app, taking snapshots, requesting reloads, or using the built-in automation server.
22
+ Use `native skills get core` for initial orientation. Use `native skills get core --full` for implementation tasks because it includes the reference files for project anatomy, runtime, frontend assets, bridge/security/native capabilities, packaging, and debugging. Use `native skills get automation` when testing a running app, taking snapshots, requesting reloads, or using the built-in automation server. Use `native skills get zig` when `zig build` fails with "no member named" errors on std APIs — the SDK requires Zig 0.16.0, and that skill maps each pre-0.16 idiom's compile error to the current one.
23
23
 
24
24
  ## Quick orientation
25
25
 
@@ -254,17 +254,54 @@ pub fn manifestThemePack() native_sdk.canvas.ThemePack {
254
254
  @compileError("unknown app.zon theme \"" ++ name ++ "\" — expected one of: house, geist");
255
255
  }
256
256
 
257
- /// Whether app.zon declares web content: the `webview` capability or a
258
- /// `frontend` block. Hosts build honest default menus from this — web
259
- /// items like Reload only exist when a webview can answer them, so
260
- /// canvas-only apps never ship dead menu items.
257
+ /// Whether app.zon declares web content — the shared declare-to-use
258
+ /// contract (`native_sdk.app_manifest.web_layer`) over the comptime
259
+ /// manifest import: a `.frontend` block, the `"webview"` capability, a
260
+ /// `.shell` webview view, or `.web_engine = "chromium"`. Hosts build
261
+ /// honest default menus from this — web items like Reload only exist
262
+ /// when a webview can answer them, so canvas-only apps never ship dead
263
+ /// menu items.
261
264
  fn manifestHasWebContent() bool {
262
- if (comptime @hasField(@TypeOf(app_manifest), "frontend")) return true;
263
- if (comptime !@hasField(@TypeOf(app_manifest), "capabilities")) return false;
264
- inline for (app_manifest.capabilities) |capability| {
265
- if (comptime std.mem.eql(u8, capability, "webview")) return true;
265
+ return manifestWebDeclaration() != null;
266
+ }
267
+
268
+ /// The first web declaration visible in app.zon, evaluated at comptime.
269
+ /// The engine input here is the MANIFEST engine: the runner never sees
270
+ /// the `-Dweb-engine` flag, so an engine resolved to Chromium by flag
271
+ /// alone is out of this boundary's reach — the standard build graph
272
+ /// (build/app.zig), which does see the flag, owns that configure-time
273
+ /// error. See the contract's module doc for the full ownership split.
274
+ fn manifestWebDeclaration() ?native_sdk.app_manifest.web_layer.Declaration {
275
+ const engine: native_sdk.app_manifest.WebEngine = comptime blk: {
276
+ if (!@hasField(@TypeOf(app_manifest), "web_engine")) break :blk .system;
277
+ break :blk native_sdk.app_manifest.web_layer.parseWebEngine(app_manifest.web_engine) orelse .system;
278
+ };
279
+ return comptime native_sdk.app_manifest.web_layer.webDeclaration(app_manifest, engine);
280
+ }
281
+
282
+ /// Whether this build ships the embedded web layer. The standard build
283
+ /// graph (build/app.zig) infers it from app.zon and passes it through
284
+ /// build options; an options module from an older hand-rolled build.zig
285
+ /// that predates the option keeps the layer — over-inclusion is safe.
286
+ fn webLayerEnabled() bool {
287
+ if (comptime !@hasDecl(build_options, "web_layer")) return true;
288
+ return build_options.web_layer;
289
+ }
290
+
291
+ // The runner-side half of the reject-conflicts contract: a build that
292
+ // excludes the web layer while app.zon declares web use must fail at
293
+ // compile time here too, so a hand-rolled build graph that bypasses the
294
+ // standard configure-time error still cannot ship an app whose declared
295
+ // webviews would fail at runtime. The guard covers every declaration
296
+ // visible in the manifest; only a Chromium engine resolved from the
297
+ // `-Dweb-engine` flag is invisible here, and that conflict is already a
298
+ // configure-time error in the graph that resolved the flag.
299
+ comptime {
300
+ if (!webLayerEnabled()) {
301
+ if (manifestWebDeclaration()) |declaration| {
302
+ @compileError("this build excludes the web layer (-Dweb-layer=exclude or a custom build graph) but app.zon declares web use (" ++ declaration.text() ++ "); remove the exclude or drop the web declaration");
303
+ }
266
304
  }
267
- return false;
268
305
  }
269
306
 
270
307
  fn windowLabel(comptime window: anytype, comptime index: usize) []const u8 {
@@ -374,6 +411,7 @@ fn runNull(app: native_sdk.App, options: RunOptions, init: std.process.Init) !vo
374
411
  .bridge = options.bridge,
375
412
  .builtin_bridge = options.builtin_bridge,
376
413
  .js_window_api = options.js_window_api,
414
+ .web_layer = webLayerEnabled(),
377
415
  .gpu_surface_frame_diagnostics = false,
378
416
  .security = options.security,
379
417
  .menus = options.menus,
@@ -428,6 +466,7 @@ fn runMacos(app: native_sdk.App, options: RunOptions, init: std.process.Init) !v
428
466
  .bridge = options.bridge,
429
467
  .builtin_bridge = options.builtin_bridge,
430
468
  .js_window_api = options.js_window_api,
469
+ .web_layer = webLayerEnabled(),
431
470
  .gpu_surface_frame_diagnostics = false,
432
471
  .security = options.security,
433
472
  .menus = options.menus,
@@ -479,6 +518,7 @@ fn runLinux(app: native_sdk.App, options: RunOptions, init: std.process.Init) !v
479
518
  .bridge = options.bridge,
480
519
  .builtin_bridge = options.builtin_bridge,
481
520
  .js_window_api = options.js_window_api,
521
+ .web_layer = webLayerEnabled(),
482
522
  .gpu_surface_frame_diagnostics = false,
483
523
  .security = options.security,
484
524
  .menus = options.menus,
@@ -529,6 +569,7 @@ fn runWindows(app: native_sdk.App, options: RunOptions, init: std.process.Init)
529
569
  .bridge = options.bridge,
530
570
  .builtin_bridge = options.builtin_bridge,
531
571
  .js_window_api = options.js_window_api,
572
+ .web_layer = webLayerEnabled(),
532
573
  .gpu_surface_frame_diagnostics = false,
533
574
  .security = options.security,
534
575
  .menus = options.menus,
@@ -643,6 +684,7 @@ fn runSessionReplay(app: native_sdk.App, options: RunOptions, init: std.process.
643
684
  .bridge = options.bridge,
644
685
  .builtin_bridge = options.builtin_bridge,
645
686
  .js_window_api = options.js_window_api,
687
+ .web_layer = webLayerEnabled(),
646
688
  .security = options.security,
647
689
  .menus = options.menus,
648
690
  });