@native-sdk/cli 0.5.4 → 0.6.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.
- package/build/app.zig +50 -1
- package/build.zig +588 -32
- package/build.zig.zon +7 -0
- package/native-sdk.d.ts +3 -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 +280 -8
- package/packages/core/sdk/core.ts +481 -2
- 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 +599 -3
- package/packages/core/src/typed_ast.ts +51 -4
- package/packages/core/src/types.ts +34 -1
- package/skill-data/native-ui/SKILL.md +39 -2
- package/skill-data/ts-core/SKILL.md +4 -2
- package/src/app_runner/root.zig +32 -10
- 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/ui_host.zig +13 -0
- package/src/platform/linux/gtk_host.c +527 -13
- package/src/platform/linux/gtk_host.h +25 -0
- package/src/platform/linux/root.zig +280 -7
- package/src/platform/macos/appkit_host.h +104 -6
- package/src/platform/macos/appkit_host.m +1368 -74
- package/src/platform/macos/cef_host.mm +110 -1
- package/src/platform/macos/root.zig +287 -7
- package/src/platform/null_platform.zig +398 -4
- package/src/platform/null_platform_tests.zig +35 -0
- package/src/platform/root.zig +9 -0
- package/src/platform/types.zig +386 -14
- package/src/platform/windows/root.zig +298 -9
- package/src/platform/windows/webview2_host.cpp +330 -5
- 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 +1 -0
- package/src/primitives/canvas/text_tests.zig +39 -4
- package/src/primitives/canvas/tokens.zig +115 -12
- package/src/primitives/canvas/ui.zig +524 -5
- package/src/primitives/canvas/ui_markup.zig +195 -2
- package/src/primitives/canvas/ui_markup_compiled.zig +172 -1
- package/src/primitives/canvas/ui_markup_compiled_tests.zig +133 -8
- package/src/primitives/canvas/ui_markup_contract.zig +88 -5
- package/src/primitives/canvas/ui_markup_contract_tests.zig +39 -1
- 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 +149 -0
- package/src/primitives/canvas/ui_markup_view.zig +191 -0
- package/src/primitives/canvas/ui_markup_view_tests.zig +403 -19
- package/src/primitives/canvas/ui_schema.zig +97 -17
- package/src/primitives/canvas/ui_schema_tests.zig +18 -11
- 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 +16 -0
- package/src/runtime/api.zig +76 -6
- 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 +1 -0
- 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_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 +268 -26
- 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 +73 -2
- package/src/runtime/effects.zig +6389 -54
- package/src/runtime/effects_channel_tests.zig +3519 -0
- package/src/runtime/effects_pty_tests.zig +1362 -0
- package/src/runtime/effects_tests.zig +14 -9
- package/src/runtime/effects_video_tests.zig +3609 -0
- package/src/runtime/flow.zig +25 -4
- package/src/runtime/gpu_surface_events.zig +475 -15
- 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 +25 -0
- package/src/runtime/runtime_event_tests.zig +20 -1
- package/src/runtime/session_journal.zig +367 -61
- package/src/runtime/session_record.zig +16 -0
- package/src/runtime/session_replay.zig +395 -11
- package/src/runtime/session_tests.zig +114 -19
- 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/tests.zig +6 -0
- package/src/runtime/ts_core_host.zig +980 -140
- package/src/runtime/ts_core_host_tests.zig +1059 -1
- package/src/runtime/ts_ui_app.zig +16 -5
- package/src/runtime/ui_app.zig +2338 -67
- 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 +268 -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_storage.zig +45 -2
- package/src/runtime/window_view_runtime.zig +34 -2
- package/src/runtime/window_views.zig +1 -0
- package/src/terminal_session_tests_root.zig +15 -0
- package/src/tooling/templates.zig +25 -7
package/build/app.zig
CHANGED
|
@@ -40,6 +40,17 @@ pub const AppOptions = struct {
|
|
|
40
40
|
/// "../.." so `src/`, `app.zon`, and `assets/` keep resolving in the
|
|
41
41
|
/// app directory rather than the cache directory.
|
|
42
42
|
app_root: []const u8 = ".",
|
|
43
|
+
/// Live `<terminal>` sessions: set true AND pin ghostty as a LAZY
|
|
44
|
+
/// dependency in the app's OWN build.zig.zon (the examples/workbench
|
|
45
|
+
/// pin) — the framework then resolves `ghostty-vt` with the app
|
|
46
|
+
/// module's target/optimize and the safe flags (simd off, no macOS
|
|
47
|
+
/// app or xcframework artifacts), and the runtime owns the emulator
|
|
48
|
+
/// behind every `<terminal pty={key}>` binding. Default false wires
|
|
49
|
+
/// the stub: `<terminal>` renders the honest empty surface, and the
|
|
50
|
+
/// build never traverses ghostty's dependency graph (whose configure
|
|
51
|
+
/// step walks wuffs/translate_c and whose full build pulls harfbuzz)
|
|
52
|
+
/// — the load-bearing property for scaffolded apps.
|
|
53
|
+
terminal_sessions: bool = false,
|
|
43
54
|
};
|
|
44
55
|
|
|
45
56
|
/// Which core the app tree carries. No flag and no config anywhere: the
|
|
@@ -765,7 +776,7 @@ fn exampleOptimizeMode(b: *std.Build, requested: ?std.builtin.OptimizeMode, defa
|
|
|
765
776
|
}
|
|
766
777
|
|
|
767
778
|
fn appModule(b: *std.Build, dep: *std.Build.Dependency, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, app_options: AppOptions, options_mod: *std.Build.Module, ts_stage: ?TsCoreStage) *std.Build.Module {
|
|
768
|
-
const native_sdk_mod =
|
|
779
|
+
const native_sdk_mod = nativeSdkModuleWithTerminal(b, dep, target, optimize, app_options.terminal_sessions);
|
|
769
780
|
const runner_mod = b.createModule(.{
|
|
770
781
|
.root_source_file = dep.path("src/app_runner/root.zig"),
|
|
771
782
|
.target = target,
|
|
@@ -837,6 +848,10 @@ fn localModule(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bu
|
|
|
837
848
|
}
|
|
838
849
|
|
|
839
850
|
fn nativeSdkModule(b: *std.Build, dep: *std.Build.Dependency, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) *std.Build.Module {
|
|
851
|
+
return nativeSdkModuleWithTerminal(b, dep, target, optimize, false);
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
fn nativeSdkModuleWithTerminal(b: *std.Build, dep: *std.Build.Dependency, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, terminal_sessions: bool) *std.Build.Module {
|
|
840
855
|
const geometry_mod = externalModule(b, dep, target, optimize, "src/primitives/geometry/root.zig");
|
|
841
856
|
const assets_mod = externalModule(b, dep, target, optimize, "src/primitives/assets/root.zig");
|
|
842
857
|
const app_dirs_mod = externalModule(b, dep, target, optimize, "src/primitives/app_dirs/root.zig");
|
|
@@ -862,6 +877,36 @@ fn nativeSdkModule(b: *std.Build, dep: *std.Build.Dependency, target: std.Build.
|
|
|
862
877
|
native_sdk_mod.addImport("platform_info", platform_info_mod);
|
|
863
878
|
native_sdk_mod.addImport("json", json_mod);
|
|
864
879
|
native_sdk_mod.addImport("canvas", canvas_mod);
|
|
880
|
+
// The terminal-session emulator seam (see
|
|
881
|
+
// `AppOptions.terminal_sessions`): an opted-in app's OWN lazy
|
|
882
|
+
// ghostty pin resolves here with the app module's target/optimize;
|
|
883
|
+
// everything else gets the stub and never traverses ghostty's
|
|
884
|
+
// dependency graph. An opted-in build whose pin is still unfetched
|
|
885
|
+
// takes the stub for THIS configure pass — the build runner fetches
|
|
886
|
+
// the lazy dependency and re-runs, and the second pass wires the
|
|
887
|
+
// real module.
|
|
888
|
+
native_sdk_mod.addImport("terminal_vt", terminal_vt: {
|
|
889
|
+
if (terminal_sessions) {
|
|
890
|
+
if (b.lazyDependency("ghostty", .{
|
|
891
|
+
.target = target,
|
|
892
|
+
.optimize = optimize,
|
|
893
|
+
// Keep the vt module pure Zig: the SIMD paths pull
|
|
894
|
+
// vendored C++ dependencies the session store never uses.
|
|
895
|
+
.simd = false,
|
|
896
|
+
// Only the vt MODULE is consumed: ghostty's macOS app and
|
|
897
|
+
// xcframework artifacts default ON for Darwin hosts and
|
|
898
|
+
// their configure step resolves the iOS libc, which
|
|
899
|
+
// aborts on a machine with only the command-line tools.
|
|
900
|
+
.@"emit-xcframework" = false,
|
|
901
|
+
.@"emit-macos-app" = false,
|
|
902
|
+
})) |ghostty| {
|
|
903
|
+
const wrapper = externalModule(b, dep, target, optimize, "src/runtime/terminal_vt_ghostty.zig");
|
|
904
|
+
wrapper.addImport("ghostty-vt", ghostty.module("ghostty-vt"));
|
|
905
|
+
break :terminal_vt wrapper;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
break :terminal_vt externalModule(b, dep, target, optimize, "src/runtime/terminal_vt_stub.zig");
|
|
909
|
+
});
|
|
865
910
|
return native_sdk_mod;
|
|
866
911
|
}
|
|
867
912
|
|
|
@@ -918,6 +963,10 @@ fn linkPlatform(b: *std.Build, dep: *std.Build.Dependency, target: std.Build.Res
|
|
|
918
963
|
app_mod.linkFramework("AppKit", .{});
|
|
919
964
|
// The audio playback service (the AppKit host's single AVPlayer).
|
|
920
965
|
app_mod.linkFramework("AVFoundation", .{});
|
|
966
|
+
// CVPixelBuffer for the video frame path (the video player's
|
|
967
|
+
// AVPlayerItemVideoOutput frames). CoreMedia's CMTime use stays
|
|
968
|
+
// header-only, but the pixel-buffer calls are real symbols.
|
|
969
|
+
app_mod.linkFramework("CoreVideo", .{});
|
|
921
970
|
// Spectrum analysis of the app's own playback: the MediaToolbox
|
|
922
971
|
// audio tap hands the player's PCM to the host, and Accelerate
|
|
923
972
|
// (vDSP) turns it into band magnitudes.
|