@native-sdk/cli 0.5.3 → 0.6.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.
- package/build/app.zig +91 -2
- package/build.zig +756 -5
- package/build.zig.zon +7 -0
- package/native-sdk.d.ts +19 -1
- package/package.json +9 -9
- package/packages/core/package-lock.json +2 -2
- package/packages/core/package.json +1 -1
- package/packages/core/rt/rt.zig +416 -9
- package/packages/core/sdk/core.ts +706 -5
- package/packages/core/sdk/events.ts +17 -8
- package/packages/core/src/checker.ts +305 -2
- package/packages/core/src/diagnostics.ts +12 -0
- package/packages/core/src/emitter.ts +3187 -264
- package/packages/core/src/typed_ast.ts +51 -4
- package/packages/core/src/types.ts +34 -1
- package/skill-data/native-ui/SKILL.md +42 -4
- package/skill-data/ts-core/SKILL.md +13 -3
- package/src/app_runner/root.zig +112 -10
- package/src/app_runner/ts_core_main.zig +4 -0
- package/src/automation/layout_fingerprint.zig +160 -0
- package/src/automation/protocol.zig +82 -33
- package/src/automation/root.zig +1 -0
- package/src/automation/server.zig +1 -1
- package/src/automation/snapshot.zig +68 -9
- package/src/automation/watcher.zig +1 -1
- package/src/embed/host.zig +5 -0
- package/src/embed/tests.zig +119 -1
- package/src/embed/ui_host.zig +13 -0
- package/src/platform/linux/gtk_host.c +639 -16
- package/src/platform/linux/gtk_host.h +25 -0
- package/src/platform/linux/root.zig +351 -7
- package/src/platform/macos/appkit_host.h +152 -8
- package/src/platform/macos/appkit_host.m +1816 -100
- package/src/platform/macos/cef_host.mm +372 -11
- package/src/platform/macos/root.zig +379 -11
- package/src/platform/null_platform.zig +696 -9
- package/src/platform/null_platform_tests.zig +35 -0
- package/src/platform/root.zig +42 -0
- package/src/platform/types.zig +524 -18
- package/src/platform/windows/root.zig +432 -9
- package/src/platform/windows/webview2_host.cpp +482 -45
- package/src/primitives/app_manifest/comptime_scene.zig +5 -0
- package/src/primitives/app_manifest/root.zig +1 -0
- package/src/primitives/app_manifest/types.zig +32 -0
- package/src/primitives/app_manifest/validation.zig +18 -0
- package/src/primitives/canvas/a11y_audit.zig +33 -11
- package/src/primitives/canvas/a11y_audit_tests.zig +20 -0
- package/src/primitives/canvas/drawing.zig +25 -0
- package/src/primitives/canvas/equality.zig +8 -0
- package/src/primitives/canvas/events.zig +103 -16
- package/src/primitives/canvas/frame.zig +125 -1
- package/src/primitives/canvas/layout_audit.zig +22 -5
- package/src/primitives/canvas/markdown_hostile_tests.zig +8 -4
- package/src/primitives/canvas/render_tests.zig +13 -10
- package/src/primitives/canvas/root.zig +48 -0
- package/src/primitives/canvas/terminal_box.zig +471 -0
- package/src/primitives/canvas/terminal_grid.zig +978 -0
- package/src/primitives/canvas/terminal_grid_tests.zig +1093 -0
- package/src/primitives/canvas/test_support.zig +1 -0
- package/src/primitives/canvas/tests.zig +2 -0
- package/src/primitives/canvas/text_tests.zig +39 -4
- package/src/primitives/canvas/tokens.zig +115 -12
- package/src/primitives/canvas/ui.zig +535 -12
- package/src/primitives/canvas/ui_markup.zig +253 -36
- package/src/primitives/canvas/ui_markup_binary.zig +4 -1
- package/src/primitives/canvas/ui_markup_compiled.zig +195 -9
- package/src/primitives/canvas/ui_markup_compiled_tests.zig +188 -8
- package/src/primitives/canvas/ui_markup_contract.zig +89 -6
- package/src/primitives/canvas/ui_markup_contract_tests.zig +65 -1
- package/src/primitives/canvas/ui_markup_huge_document_tests.zig +154 -0
- package/src/primitives/canvas/ui_markup_huge_model_tests.zig +1 -0
- package/src/primitives/canvas/ui_markup_reflect.zig +75 -24
- package/src/primitives/canvas/ui_markup_tests.zig +178 -9
- package/src/primitives/canvas/ui_markup_view.zig +220 -11
- package/src/primitives/canvas/ui_markup_view_tests.zig +553 -28
- package/src/primitives/canvas/ui_schema.zig +110 -17
- package/src/primitives/canvas/ui_schema_tests.zig +18 -10
- package/src/primitives/canvas/ui_tests.zig +141 -9
- package/src/primitives/canvas/widget_access.zig +28 -2
- package/src/primitives/canvas/widget_anchored_tests.zig +48 -0
- package/src/primitives/canvas/widget_invalidation.zig +81 -1
- package/src/primitives/canvas/widget_layout.zig +59 -11
- package/src/primitives/canvas/widget_layout_tests.zig +125 -4
- package/src/primitives/canvas/widget_render.zig +272 -18
- package/src/primitives/canvas/widget_render_scroll.zig +108 -27
- package/src/primitives/canvas/widget_routing.zig +59 -7
- package/src/primitives/canvas/widget_runtime.zig +23 -0
- package/src/primitives/canvas/widget_runtime_tests.zig +149 -0
- package/src/primitives/canvas/widget_semantics.zig +119 -11
- package/src/primitives/canvas/widget_semantics_tests.zig +409 -0
- package/src/primitives/canvas/widget_tree.zig +17 -0
- package/src/primitives/canvas/widgets.zig +132 -0
- package/src/root.zig +23 -0
- package/src/runtime/api.zig +76 -5
- package/src/runtime/automation_commands.zig +20 -1
- package/src/runtime/automation_snapshot.zig +25 -1
- package/src/runtime/automation_widget_dispatch.zig +73 -8
- package/src/runtime/bridge_payload.zig +8 -0
- package/src/runtime/bridge_responses.zig +5 -0
- package/src/runtime/builtin_bridge.zig +9 -4
- package/src/runtime/canvas_font_tests.zig +439 -2
- package/src/runtime/canvas_fonts.zig +61 -6
- package/src/runtime/canvas_frame.zig +62 -7
- package/src/runtime/canvas_frame_animation_tests.zig +5 -4
- package/src/runtime/canvas_frame_helpers.zig +190 -1
- package/src/runtime/canvas_frame_invalidation_tests.zig +531 -0
- package/src/runtime/canvas_frame_patch_tests.zig +161 -10
- package/src/runtime/canvas_frame_retained_tests.zig +5 -2
- package/src/runtime/canvas_image_tests.zig +195 -0
- package/src/runtime/canvas_images.zig +45 -12
- package/src/runtime/canvas_widget_accessibility_tests.zig +1 -1
- package/src/runtime/canvas_widget_clipboard_tests.zig +40 -0
- package/src/runtime/canvas_widget_context_menu.zig +269 -32
- package/src/runtime/canvas_widget_context_menu_tests.zig +640 -14
- package/src/runtime/canvas_widget_display.zig +1 -1
- package/src/runtime/canvas_widget_event_tests.zig +1823 -0
- package/src/runtime/canvas_widget_events.zig +240 -24
- package/src/runtime/canvas_widget_runtime.zig +213 -29
- package/src/runtime/canvas_widget_scroll_driver_tests.zig +170 -7
- package/src/runtime/canvas_widget_scroll_drivers.zig +151 -17
- package/src/runtime/canvas_widget_scroll_tests.zig +435 -23
- package/src/runtime/canvas_widget_state.zig +6 -0
- package/src/runtime/canvas_widget_text_tests.zig +1 -1
- package/src/runtime/core.zig +131 -13
- package/src/runtime/effects.zig +8136 -180
- package/src/runtime/effects_channel_tests.zig +3519 -0
- package/src/runtime/effects_fetch_tests.zig +89 -1
- package/src/runtime/effects_file_tests.zig +41 -1
- package/src/runtime/effects_image_tests.zig +1304 -0
- package/src/runtime/effects_pty_tests.zig +1362 -0
- package/src/runtime/effects_tests.zig +167 -9
- package/src/runtime/effects_video_tests.zig +3609 -0
- package/src/runtime/flow.zig +42 -4
- package/src/runtime/gpu_surface_events.zig +473 -13
- package/src/runtime/media_surface.zig +116 -11
- package/src/runtime/media_surface_tests.zig +61 -0
- package/src/runtime/pty.zig +1252 -0
- package/src/runtime/pty_windows.zig +1780 -0
- package/src/runtime/root.zig +36 -0
- package/src/runtime/runtime_event_tests.zig +20 -1
- package/src/runtime/session_blobs.zig +689 -0
- package/src/runtime/session_journal.zig +432 -62
- package/src/runtime/session_record.zig +43 -2
- package/src/runtime/session_replay.zig +556 -20
- package/src/runtime/session_tests.zig +2087 -1
- package/src/runtime/shell_layout.zig +7 -0
- package/src/runtime/terminal_session.zig +1569 -0
- package/src/runtime/terminal_session_tests.zig +450 -0
- package/src/runtime/terminal_vt_ghostty.zig +15 -0
- package/src/runtime/terminal_vt_stub.zig +13 -0
- package/src/runtime/testdata/fonts/NotoSansSC-Receipt.ttf +0 -0
- package/src/runtime/testdata/fonts/OFL.txt +93 -0
- package/src/runtime/tests.zig +8 -0
- package/src/runtime/ts_core_host.zig +1320 -45
- package/src/runtime/ts_core_host_tests.zig +1100 -1
- package/src/runtime/ts_ui_app.zig +23 -5
- package/src/runtime/ui_app.zig +2444 -69
- package/src/runtime/ui_app_tests.zig +3171 -744
- package/src/runtime/ui_app_virtual_variable_tests.zig +4 -2
- package/src/runtime/ui_app_window_tests.zig +736 -0
- package/src/runtime/view.zig +190 -2
- package/src/runtime/view_widget_scroll.zig +218 -68
- package/src/runtime/view_widget_text.zig +11 -2
- package/src/runtime/view_widget_tree.zig +111 -3
- package/src/runtime/window_command_bridge_tests.zig +117 -0
- package/src/runtime/window_storage.zig +77 -2
- package/src/runtime/window_view_runtime.zig +34 -2
- package/src/runtime/window_views.zig +62 -1
- package/src/terminal_session_tests_root.zig +15 -0
- package/src/tooling/manifest.zig +75 -0
- package/src/tooling/raw_manifest.zig +2 -0
- package/src/tooling/templates.zig +244 -8
|
@@ -162,6 +162,41 @@ test "null platform emits deterministic lifecycle events" {
|
|
|
162
162
|
try std.testing.expectEqualStrings("app_shutdown", recorder.names[5]);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
test "the videoLoadUrl seam refuses non-http(s) schemes for every caller" {
|
|
166
|
+
// The streaming contract holds at the seam, not just behind the
|
|
167
|
+
// engine's own gated loads: hosts hand the URL to their media
|
|
168
|
+
// stack whole, and AVPlayer opens file: URLs happily.
|
|
169
|
+
var null_platform = NullPlatform.init(.{});
|
|
170
|
+
null_platform.video_playback = true;
|
|
171
|
+
const services = null_platform.platform().services;
|
|
172
|
+
const sink: types.VideoFrameSink = .{};
|
|
173
|
+
try std.testing.expectError(error.InvalidVideoOptions, services.videoLoadUrl("file:///tmp/clip.mp4", 1, sink));
|
|
174
|
+
try std.testing.expectError(error.InvalidVideoOptions, services.videoLoadUrl("ftp://media.example.test/clip.mp4", 1, sink));
|
|
175
|
+
try std.testing.expectError(error.InvalidVideoOptions, services.videoLoadUrl("not a url", 1, sink));
|
|
176
|
+
try std.testing.expectEqual(@as(usize, 0), null_platform.video_load_url_count);
|
|
177
|
+
try services.videoLoadUrl("https://media.example.test/clip.mp4", 2, sink);
|
|
178
|
+
try std.testing.expectEqual(@as(usize, 1), null_platform.video_load_url_count);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
test "a refused video load retires the player it was replacing" {
|
|
182
|
+
// The macOS host stops the previous player before the file probe,
|
|
183
|
+
// so a load that then refuses leaves NO playback behind — the null
|
|
184
|
+
// platform must model the same ordering, or a replaced player
|
|
185
|
+
// keeps emitting frames and events under its old token.
|
|
186
|
+
var null_platform = NullPlatform.init(.{});
|
|
187
|
+
null_platform.video_playback = true;
|
|
188
|
+
const services = null_platform.platform().services;
|
|
189
|
+
const sink: types.VideoFrameSink = .{};
|
|
190
|
+
try services.videoLoad("a.mp4", 1, sink);
|
|
191
|
+
try services.videoPlay();
|
|
192
|
+
try std.testing.expect(null_platform.video.playing);
|
|
193
|
+
null_platform.video_local_files = false;
|
|
194
|
+
try std.testing.expectError(error.VideoSourceNotFound, services.videoLoad("b.mp4", 2, sink));
|
|
195
|
+
try std.testing.expect(!null_platform.video.loaded);
|
|
196
|
+
try std.testing.expect(null_platform.takeVideoLoaded() == null);
|
|
197
|
+
try std.testing.expect(null_platform.advanceVideo(500) == null);
|
|
198
|
+
}
|
|
199
|
+
|
|
165
200
|
test "null platform records loaded webview source" {
|
|
166
201
|
var null_platform = NullPlatform.initWithOptions(.{}, .chromium, .{ .app_name = "Demo", .window_title = "Demo Window" });
|
|
167
202
|
try null_platform.platform().services.loadWebView(WebViewSource.html("<h1>Hello</h1>"));
|
package/src/platform/root.zig
CHANGED
|
@@ -78,6 +78,7 @@ pub const WindowChrome = types.WindowChrome;
|
|
|
78
78
|
pub const FormFactor = types.FormFactor;
|
|
79
79
|
pub const WindowDragRegion = types.WindowDragRegion;
|
|
80
80
|
pub const WindowShowMode = types.WindowShowMode;
|
|
81
|
+
pub const WindowClosePolicy = types.WindowClosePolicy;
|
|
81
82
|
pub const WindowOptions = types.WindowOptions;
|
|
82
83
|
pub const WindowState = types.WindowState;
|
|
83
84
|
pub const WindowInfo = types.WindowInfo;
|
|
@@ -103,6 +104,7 @@ pub const ViewInfo = types.ViewInfo;
|
|
|
103
104
|
pub const AppInfo = types.AppInfo;
|
|
104
105
|
pub const Surface = types.Surface;
|
|
105
106
|
pub const BridgeMessage = types.BridgeMessage;
|
|
107
|
+
pub const ViewFocusEvent = types.ViewFocusEvent;
|
|
106
108
|
pub const max_dialog_path_bytes = types.max_dialog_path_bytes;
|
|
107
109
|
pub const max_dialog_paths_bytes = types.max_dialog_paths_bytes;
|
|
108
110
|
pub const max_dialog_title_bytes = types.max_dialog_title_bytes;
|
|
@@ -134,16 +136,24 @@ pub const AudioLoadResolution = types.AudioLoadResolution;
|
|
|
134
136
|
pub const max_audio_path_bytes = types.max_audio_path_bytes;
|
|
135
137
|
pub const audio_spectrum_band_count = types.audio_spectrum_band_count;
|
|
136
138
|
pub const audio_spectrum_floor_db = types.audio_spectrum_floor_db;
|
|
139
|
+
pub const VideoEvent = types.VideoEvent;
|
|
140
|
+
pub const VideoEventKind = types.VideoEventKind;
|
|
141
|
+
pub const VideoFrameSink = types.VideoFrameSink;
|
|
142
|
+
pub const max_video_path_bytes = types.max_video_path_bytes;
|
|
137
143
|
pub const FileDropEvent = types.FileDropEvent;
|
|
138
144
|
pub const GpuFrame = types.GpuFrame;
|
|
139
145
|
pub const GpuSurfaceFrameEvent = types.GpuSurfaceFrameEvent;
|
|
140
146
|
pub const GpuSurfaceResizeEvent = types.GpuSurfaceResizeEvent;
|
|
141
147
|
pub const GpuSurfaceInputKind = types.GpuSurfaceInputKind;
|
|
142
148
|
pub const GpuSurfaceInputEvent = types.GpuSurfaceInputEvent;
|
|
149
|
+
pub const touch_pointer_id_bit = types.touch_pointer_id_bit;
|
|
143
150
|
pub const PinchPhase = types.PinchPhase;
|
|
144
151
|
pub const PinchEvent = types.PinchEvent;
|
|
152
|
+
pub const WheelEvent = types.WheelEvent;
|
|
145
153
|
pub const max_gpu_surface_scroll_drivers = types.max_gpu_surface_scroll_drivers;
|
|
154
|
+
pub const max_gpu_surface_scroll_occluders = types.max_gpu_surface_scroll_occluders;
|
|
146
155
|
pub const GpuSurfaceScrollDriver = types.GpuSurfaceScrollDriver;
|
|
156
|
+
pub const GpuSurfaceScrollOccluder = types.GpuSurfaceScrollOccluder;
|
|
147
157
|
pub const GpuSurfaceScrollDriverEvent = types.GpuSurfaceScrollDriverEvent;
|
|
148
158
|
pub const max_context_menu_items = types.max_context_menu_items;
|
|
149
159
|
pub const ContextMenuItem = types.ContextMenuItem;
|
|
@@ -178,6 +188,38 @@ pub const macos = @import("macos/root.zig");
|
|
|
178
188
|
pub const linux = @import("linux/root.zig");
|
|
179
189
|
pub const windows = @import("windows/root.zig");
|
|
180
190
|
|
|
191
|
+
/// Install the host image codec for a headless session replay over the
|
|
192
|
+
/// null platform. Replay decode serves JOURNALED bytes only — the
|
|
193
|
+
/// network and the filesystem stay absent — but those bytes must decode
|
|
194
|
+
/// through the SAME codec the recording host used, or replayed loads
|
|
195
|
+
/// drop their pixels and replayed screenshots lose images. Every
|
|
196
|
+
/// desktop host's codec is a context-free bytes-to-pixels call
|
|
197
|
+
/// (CGImageSource / gdk-pixbuf / WIC), so a headless replay serves it
|
|
198
|
+
/// with no window and no run loop. `platform_name` is the build's
|
|
199
|
+
/// platform selection (the app runner's `build_options.platform`,
|
|
200
|
+
/// comptime — arms for other platforms are never analyzed, so the
|
|
201
|
+
/// codec-less test tier links without the host shims). A build with no
|
|
202
|
+
/// host codec ("null") falls back to the null platform's strict
|
|
203
|
+
/// test-PNG decoder — honest but narrow: only the canvas PNG writer's
|
|
204
|
+
/// subset decodes there, and any other recorded format drops its pixels
|
|
205
|
+
/// with the replay diagnostic while the Msg stream still replays
|
|
206
|
+
/// verbatim.
|
|
207
|
+
pub fn installHeadlessImageCodec(
|
|
208
|
+
comptime platform_name: []const u8,
|
|
209
|
+
headless_host: *NullPlatform,
|
|
210
|
+
services: *PlatformServices,
|
|
211
|
+
) void {
|
|
212
|
+
if (comptime std.mem.eql(u8, platform_name, "macos")) {
|
|
213
|
+
macos.installHeadlessImageCodec(services);
|
|
214
|
+
} else if (comptime std.mem.eql(u8, platform_name, "linux")) {
|
|
215
|
+
linux.installHeadlessImageCodec(services);
|
|
216
|
+
} else if (comptime std.mem.eql(u8, platform_name, "windows")) {
|
|
217
|
+
windows.installHeadlessImageCodec(services);
|
|
218
|
+
} else {
|
|
219
|
+
headless_host.image_decode = true;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
181
223
|
test {
|
|
182
224
|
std.testing.refAllDecls(@This());
|
|
183
225
|
_ = @import("null_platform_tests.zig");
|