@native-sdk/cli 0.11.0 → 0.11.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 +73 -37
- package/build.zig +239 -5
- package/native-sdk.d.ts +5 -1
- package/package.json +13 -12
- package/packages/core/compile-surface/core.ts +30 -0
- package/packages/core/package-lock.json +6 -6
- package/packages/core/package.json +3 -3
- package/packages/core/scripts/scriptc-toolchain.json +44 -44
- package/packages/core/scripts/stage_external_core.mjs +27 -16
- package/packages/core/sdk/core.d.ts +24 -1
- package/packages/core/sdk/core.ts +51 -1
- package/packages/core/sdk/events.d.ts +5 -0
- package/packages/core/sdk/events.ts +10 -0
- package/packages/core/src/bridge_descriptors.ts +3 -3
- package/packages/core/src/checker.ts +20 -0
- package/packages/core/src/cli.ts +2 -11
- package/packages/core/src/context_menus.ts +76 -0
- package/packages/core/src/diagnostics.ts +7 -0
- package/packages/core/src/extent_program.ts +53 -0
- package/packages/core/src/frontend.ts +12 -10
- package/packages/core/src/markup_canonical.ts +140 -0
- package/packages/core/src/markup_construction.ts +189 -0
- package/packages/core/src/markup_display.ts +43 -0
- package/packages/core/src/markup_document.ts +226 -0
- package/packages/core/src/markup_elements.ts +225 -0
- package/packages/core/src/markup_expressions.ts +79 -0
- package/packages/core/src/markup_imports.ts +146 -0
- package/packages/core/src/markup_parser.ts +228 -0
- package/packages/core/src/markup_runtime.ts +93 -0
- package/packages/core/src/markup_scalars.ts +143 -0
- package/packages/core/src/markup_shapes.ts +243 -0
- package/packages/core/src/markup_specialized.ts +242 -0
- package/packages/core/src/markup_text.ts +86 -0
- package/packages/core/src/markup_values.ts +336 -0
- package/packages/core/src/portable_sources.json +24 -0
- package/packages/core/src/registered_font.ts +2 -3
- package/packages/core/src/runtime_policy.ts +24 -0
- package/packages/core/src/scalar_text.ts +1 -3
- package/packages/core/src/scroll_mutation.ts +86 -0
- package/packages/core/src/scroll_tree.ts +86 -0
- package/packages/core/src/service_contract.ts +53 -2
- package/packages/core/src/sqlite_cli.ts +3 -46
- package/packages/core/src/sqlite_codegen.ts +84 -0
- package/packages/core/src/staged_rebuild.ts +60 -0
- package/packages/core/src/view_bridge.ts +161 -0
- package/packages/core/src/view_check.ts +145 -0
- package/packages/core/src/view_evaluator.ts +823 -0
- package/packages/core/src/view_frontend.ts +340 -218
- package/packages/core/src/view_program.ts +221 -0
- package/packages/core/src/view_reload.ts +166 -0
- package/packages/core/src/view_reload_watch.ts +98 -0
- package/packages/core/src/view_sources.ts +34 -0
- package/packages/core/src/virtual_windows.ts +88 -0
- package/packages/core/src/web_panes.ts +67 -0
- package/packages/core/src/widget_continuity.ts +37 -0
- package/packages/core/src/widget_reconcile.ts +63 -0
- package/packages/core/src/widget_retention.ts +62 -0
- package/skill-data/native-ui/SKILL.md +2 -2
- package/skill-data/ts-core/SKILL.md +5 -3
- package/skill-data/ts-services/references/service-surface.md +29 -5
- package/src/app_runner/root.zig +14 -0
- package/src/app_runner/ts_compiled_view.zig +88 -17
- package/src/app_runner/ts_core_main.zig +43 -5
- package/src/app_runner/ts_core_mobile.zig +1 -1
- package/src/automation/server.zig +56 -3
- package/src/embed/host.zig +2 -0
- package/src/embed/tests.zig +2 -0
- package/src/embed/ui_host.zig +2 -0
- package/src/platform/keyboard_input.zig +32 -0
- package/src/platform/linux/root.zig +2 -0
- package/src/platform/macos/appkit_host.h +7 -2
- package/src/platform/macos/appkit_host.m +31 -9
- package/src/platform/macos/cef_host.mm +15 -1
- package/src/platform/macos/global_shortcuts.zig +138 -0
- package/src/platform/macos/key_codes.zig +102 -0
- package/src/platform/macos/keyboard_input.zig +81 -0
- package/src/platform/macos/root.zig +25 -3
- package/src/platform/macos/webview_inspection_test.m +106 -0
- package/src/platform/null_platform.zig +104 -0
- package/src/platform/root.zig +14 -0
- package/src/platform/types.zig +102 -0
- package/src/platform/windows/global_shortcuts.zig +157 -0
- package/src/platform/windows/key_codes.zig +63 -0
- package/src/platform/windows/keyboard_input.zig +136 -0
- package/src/platform/windows/root.zig +15 -0
- package/src/primitives/canvas/decision_reuse.zig +133 -0
- package/src/primitives/canvas/font_ttf.zig +27 -3
- package/src/primitives/canvas/fonts/Geist-Bold.ttf +0 -0
- package/src/primitives/canvas/fonts/Geist-Medium.ttf +0 -0
- package/src/primitives/canvas/fonts/OFL.txt +93 -0
- package/src/primitives/canvas/fonts/README.md +15 -0
- package/src/primitives/canvas/intrinsic_measure_policy.zig +4 -1
- package/src/primitives/canvas/markdown_tests.zig +3 -3
- package/src/primitives/canvas/reference.zig +3 -5
- package/src/primitives/canvas/reference_tests.zig +58 -0
- package/src/primitives/canvas/registered_font_policy.zig +1 -1
- package/src/primitives/canvas/root.zig +7 -4
- package/src/primitives/canvas/text_metrics.zig +32 -39
- package/src/primitives/canvas/text_metrics_tests.zig +52 -7
- package/src/primitives/canvas/text_query_policy.zig +142 -3
- package/src/primitives/canvas/text_scalar_policy.zig +80 -2
- package/src/primitives/canvas/tokens.zig +9 -0
- package/src/primitives/canvas/ui.zig +1 -0
- package/src/primitives/canvas/ui_markup.zig +69 -14
- package/src/primitives/canvas/ui_markup_canonical.zig +237 -0
- package/src/primitives/canvas/ui_markup_compiled.zig +1407 -23
- package/src/primitives/canvas/ui_markup_compiled_values.zig +76 -0
- package/src/primitives/canvas/ui_markup_construction.zig +146 -0
- package/src/primitives/canvas/ui_markup_display.zig +82 -0
- package/src/primitives/canvas/ui_markup_document.zig +196 -0
- package/src/primitives/canvas/ui_markup_elements.zig +163 -0
- package/src/primitives/canvas/ui_markup_expr.zig +192 -2
- package/src/primitives/canvas/ui_markup_imports.zig +262 -0
- package/src/primitives/canvas/ui_markup_parser.zig +117 -0
- package/src/primitives/canvas/ui_markup_runtime.zig +76 -0
- package/src/primitives/canvas/ui_markup_scalars.zig +115 -0
- package/src/primitives/canvas/ui_markup_shapes.zig +224 -0
- package/src/primitives/canvas/ui_markup_specialized.zig +106 -0
- package/src/primitives/canvas/ui_markup_text.zig +128 -0
- package/src/primitives/canvas/ui_markup_values.zig +368 -0
- package/src/primitives/canvas/ui_markup_view.zig +2817 -74
- package/src/primitives/canvas/virtual_extent_policy.zig +58 -0
- package/src/primitives/canvas/virtual_extents.zig +47 -33
- package/src/primitives/canvas/widget_metric_policy.zig +4 -1
- package/src/primitives/canvas/widget_runtime.zig +2 -1
- package/src/root.zig +5 -0
- package/src/runtime/api.zig +1 -0
- package/src/runtime/bridge_descriptor_policy.zig +1 -1
- package/src/runtime/bridge_payload.zig +2 -0
- package/src/runtime/canvas_widget_context_menu.zig +179 -0
- package/src/runtime/canvas_widget_context_menu_test_cases.zig +1147 -0
- package/src/runtime/canvas_widget_context_menu_tests.zig +23 -1098
- package/src/runtime/canvas_widget_runtime.zig +306 -92
- package/src/runtime/context_menu_policy.zig +112 -0
- package/src/runtime/core.zig +14 -0
- package/src/runtime/effects.zig +172 -4
- package/src/runtime/effects_host_tests.zig +25 -0
- package/src/runtime/flow.zig +1 -0
- package/src/runtime/flow_reference.zig +1 -0
- package/src/runtime/global_shortcuts.zig +75 -0
- package/src/runtime/keyboard_input.zig +86 -0
- package/src/runtime/root.zig +3 -0
- package/src/runtime/scroll_mutation_policy.zig +130 -0
- package/src/runtime/scroll_mutation_runtime.zig +158 -0
- package/src/runtime/scroll_tree_policy.zig +99 -0
- package/src/runtime/session_record.zig +7 -0
- package/src/runtime/staged_rebuild_policy.zig +83 -0
- package/src/runtime/system_services.zig +19 -0
- package/src/runtime/tests.zig +1 -0
- package/src/runtime/ts_core_host.zig +126 -0
- package/src/runtime/ts_ui_app.zig +24 -0
- package/src/runtime/ui_app.zig +274 -31
- package/src/runtime/ui_app_tests.zig +48 -179
- package/src/runtime/ui_app_window_tests.zig +133 -0
- package/src/runtime/view_reload.zig +226 -0
- package/src/runtime/view_widget_scroll.zig +30 -21
- package/src/runtime/view_widget_tree.zig +43 -13
- package/src/runtime/virtual_window_policy.zig +128 -0
- package/src/runtime/web_pane_policy.zig +111 -0
- package/src/runtime/web_pane_test_cases.zig +204 -0
- package/src/runtime/widget_continuity_policy.zig +73 -0
- package/src/runtime/widget_reconcile_policy.zig +81 -0
- package/src/runtime/widget_retention_policy.zig +75 -0
- package/src/runtime/window_views.zig +19 -4
- package/src/security/root.zig +1 -0
- package/src/tooling/templates.zig +8 -0
- package/src/tooling/ts_core.zig +84 -1
- package/src/tooling/verbs.zig +79 -15
- package/tools/corewire/core.test.ts +25 -3
- package/tools/corewire/core_abi.zig +4 -0
- package/tools/corewire/core_contract.ts +1 -1
- package/tools/corewire/core_goldens.json +75 -75
- package/tools/corewire/core_projection.ts +3 -2
- package/tools/corewire/emit_mirror.ts +19 -9
- package/tools/corewire/facade_templates.ts +1 -1
- package/tools/corewire/intake.test.ts +4 -0
- package/tools/corewire/intake_goldens.json +50 -50
- package/tools/corewire/invocation.test.ts +4 -0
- package/tools/corewire/invocation_goldens.json +3 -3
- package/tools/corewire/mirror_templates.ts +4 -0
- package/tools/corewire/profile_emission.ts +2 -0
- package/tools/corewire/sidecar.zig +2 -0
|
@@ -439,6 +439,8 @@ pub const db_key_base: u64 = 0x5453_4442_0000_0000;
|
|
|
439
439
|
/// Dedicated raw-file stream key namespace ("TSFS").
|
|
440
440
|
pub const file_stream_key_base: u64 = 0x5453_4653_0000_0000;
|
|
441
441
|
|
|
442
|
+
pub const global_shortcut_key: u64 = 0x5453_4753_0000_0000;
|
|
443
|
+
|
|
442
444
|
/// The spawn wire record's "no line routing" tag sentinel (the wire
|
|
443
445
|
/// format's shared constant).
|
|
444
446
|
pub const spawn_no_line_tag: u8 = 0xFF;
|
|
@@ -525,6 +527,9 @@ pub fn TsCoreHostWithRuntimeModel(comptime core: type, comptime compiled_model:
|
|
|
525
527
|
}
|
|
526
528
|
};
|
|
527
529
|
|
|
530
|
+
const GlobalShortcutEntry = struct { used: bool = false, declared: bool = false, binding: platform.OwnedShortcut = .{}, tag: u8 = 0, pressed: bool = false };
|
|
531
|
+
const DeclaredShortcut = struct { shortcut: platform.Shortcut, tag: u8 };
|
|
532
|
+
|
|
528
533
|
/// One in-flight named engine op (read_file / write_file /
|
|
529
534
|
/// fetch / clip_read): same lifecycle as `RequestEntry` — the
|
|
530
535
|
/// table index IS the engine key (minus `effect_key_base`),
|
|
@@ -736,6 +741,10 @@ pub fn TsCoreHostWithRuntimeModel(comptime core: type, comptime compiled_model:
|
|
|
736
741
|
var audio_captures: [runtime_effects.max_effect_channels]AudioCaptureEntry = @splat(.{});
|
|
737
742
|
var ptys: [runtime_effects.max_effect_ptys]PtyEntry = @splat(.{});
|
|
738
743
|
var dbs: [runtime_effects.max_db_effects]DbEntry = @splat(.{});
|
|
744
|
+
var global_shortcuts: [2 * platform.max_global_shortcuts]GlobalShortcutEntry = @splat(.{});
|
|
745
|
+
var global_shortcut_count: usize = 0;
|
|
746
|
+
var rejected_shortcuts: [platform.max_global_shortcuts]u64 = undefined;
|
|
747
|
+
var rejected_shortcut_count: usize = 0;
|
|
739
748
|
/// The platform caches directory for URL image sources, the
|
|
740
749
|
/// audio cache dir's twin (`setImageCacheDir` / `TsUiApp`'s
|
|
741
750
|
/// `image_cache_dir`): bridge-side derivation of the
|
|
@@ -836,6 +845,9 @@ pub fn TsCoreHostWithRuntimeModel(comptime core: type, comptime compiled_model:
|
|
|
836
845
|
audio_captures = @splat(.{});
|
|
837
846
|
ptys = @splat(.{});
|
|
838
847
|
dbs = @splat(.{});
|
|
848
|
+
global_shortcuts = @splat(.{});
|
|
849
|
+
global_shortcut_count = 0;
|
|
850
|
+
rejected_shortcut_count = 0;
|
|
839
851
|
clip_write_counter = 0;
|
|
840
852
|
clipboard_writes = @splat(.{});
|
|
841
853
|
audio_cache_dir_len = 0;
|
|
@@ -4695,6 +4707,10 @@ pub fn TsCoreHostWithRuntimeModel(comptime core: type, comptime compiled_model:
|
|
|
4695
4707
|
} else borrowed_subs;
|
|
4696
4708
|
var seen_timers = [_]bool{false} ** timers.len;
|
|
4697
4709
|
var seen_db = [_]bool{false} ** dbs.len;
|
|
4710
|
+
var declared_shortcuts: [platform.max_global_shortcuts]DeclaredShortcut = undefined;
|
|
4711
|
+
var declared_shortcut_count: usize = 0;
|
|
4712
|
+
var rejected_now: [platform.max_global_shortcuts]u64 = undefined;
|
|
4713
|
+
var rejected_now_count: usize = 0;
|
|
4698
4714
|
|
|
4699
4715
|
// Free live DB slots whose wire keys disappeared before the pass
|
|
4700
4716
|
// allocates replacements. Otherwise two independently valid sets
|
|
@@ -4827,9 +4843,32 @@ pub fn TsCoreHostWithRuntimeModel(comptime core: type, comptime compiled_model:
|
|
|
4827
4843
|
});
|
|
4828
4844
|
}
|
|
4829
4845
|
},
|
|
4846
|
+
0x03 => {
|
|
4847
|
+
const id = takeShortBytes(subs, &at);
|
|
4848
|
+
const key = takeLongBytes(subs, &at);
|
|
4849
|
+
const modifiers = @import("global_shortcuts.zig").modifiersFromMask(takeByte(subs, &at));
|
|
4850
|
+
const tag = takeByte(subs, &at);
|
|
4851
|
+
const duplicate = for (declared_shortcuts[0..declared_shortcut_count]) |declared| {
|
|
4852
|
+
if (std.mem.eql(u8, declared.shortcut.id, id)) break true;
|
|
4853
|
+
} else false;
|
|
4854
|
+
if (id.len == 0 or id.len > platform.max_shortcut_id_bytes or duplicate or declared_shortcut_count == declared_shortcuts.len) {
|
|
4855
|
+
const signature = std.hash.Wyhash.hash(tag, id);
|
|
4856
|
+
if (rejected_now_count == rejected_now.len) continue;
|
|
4857
|
+
rejected_now[rejected_now_count] = signature;
|
|
4858
|
+
rejected_now_count += 1;
|
|
4859
|
+
const reported = std.mem.indexOfScalar(u64, rejected_shortcuts[0..rejected_shortcut_count], signature) != null;
|
|
4860
|
+
if (!reported) fx.stageLoopMsg(msgFromTagGlobalShortcut(tag, .rejected, fx.stageLoopKey(id)));
|
|
4861
|
+
continue;
|
|
4862
|
+
}
|
|
4863
|
+
declared_shortcuts[declared_shortcut_count] = .{ .shortcut = .{ .id = id, .key = key[0..@min(key.len, platform.max_shortcut_key_bytes)], .modifiers = modifiers }, .tag = tag };
|
|
4864
|
+
declared_shortcut_count += 1;
|
|
4865
|
+
},
|
|
4830
4866
|
else => @panic("ts core host: unknown subscription wire record - the core and this runtime disagree on cmd_format_version"),
|
|
4831
4867
|
}
|
|
4832
4868
|
}
|
|
4869
|
+
@memcpy(rejected_shortcuts[0..rejected_now_count], rejected_now[0..rejected_now_count]);
|
|
4870
|
+
rejected_shortcut_count = rejected_now_count;
|
|
4871
|
+
reconcileGlobalShortcuts(fx, declared_shortcuts[0..declared_shortcut_count]);
|
|
4833
4872
|
const cancellations: ?u16 = if (comptime @hasDecl(core, "nativeTimerPolicy")) compiledTimerCancellations(seen_timers) else null;
|
|
4834
4873
|
for (&timers, 0..) |*entry, index| {
|
|
4835
4874
|
const cancel = if (cancellations) |mask| mask & (@as(u16, 1) << @intCast(index)) != 0 else entry.used and !seen_timers[index];
|
|
@@ -4840,6 +4879,73 @@ pub fn TsCoreHostWithRuntimeModel(comptime core: type, comptime compiled_model:
|
|
|
4840
4879
|
}
|
|
4841
4880
|
}
|
|
4842
4881
|
|
|
4882
|
+
fn reconcileGlobalShortcuts(fx: *Fx, declared: []const DeclaredShortcut) void {
|
|
4883
|
+
var changed = declared.len != global_shortcut_count;
|
|
4884
|
+
var was_declared: [global_shortcuts.len]bool = undefined;
|
|
4885
|
+
for (&global_shortcuts, &was_declared) |*entry, *was| {
|
|
4886
|
+
was.* = entry.declared;
|
|
4887
|
+
entry.declared = false;
|
|
4888
|
+
}
|
|
4889
|
+
var shortcuts: [platform.max_global_shortcuts]platform.Shortcut = undefined;
|
|
4890
|
+
for (declared, 0..) |item, position| {
|
|
4891
|
+
const index = findGlobalShortcut(item.shortcut.id) orelse freeGlobalShortcutIndex();
|
|
4892
|
+
const entry = &global_shortcuts[index];
|
|
4893
|
+
if (!was_declared[index] or !entry.binding.matches(item.shortcut)) changed = true;
|
|
4894
|
+
entry.* = .{ .used = true, .declared = true, .binding = .init(item.shortcut), .tag = item.tag, .pressed = entry.pressed };
|
|
4895
|
+
shortcuts[position] = entry.binding.shortcut();
|
|
4896
|
+
}
|
|
4897
|
+
global_shortcut_count = declared.len;
|
|
4898
|
+
if (changed) fx.setGlobalShortcuts(.{ .key = global_shortcut_key, .shortcuts = shortcuts[0..declared.len], .on_event = globalShortcutEventMsg });
|
|
4899
|
+
}
|
|
4900
|
+
|
|
4901
|
+
fn findGlobalShortcut(id: []const u8) ?usize {
|
|
4902
|
+
for (&global_shortcuts, 0..) |*entry, index| {
|
|
4903
|
+
if (entry.used and std.mem.eql(u8, entry.binding.shortcut().id, id)) return index;
|
|
4904
|
+
}
|
|
4905
|
+
return null;
|
|
4906
|
+
}
|
|
4907
|
+
|
|
4908
|
+
fn freeGlobalShortcutIndex() usize {
|
|
4909
|
+
for (&global_shortcuts, 0..) |*entry, index| {
|
|
4910
|
+
if (!entry.used) return index;
|
|
4911
|
+
}
|
|
4912
|
+
for (&global_shortcuts, 0..) |*entry, index| {
|
|
4913
|
+
if (!entry.declared and !entry.pressed) return index;
|
|
4914
|
+
}
|
|
4915
|
+
unreachable;
|
|
4916
|
+
}
|
|
4917
|
+
|
|
4918
|
+
fn channelReportIndex() usize {
|
|
4919
|
+
for (&global_shortcuts, 0..) |*entry, index| {
|
|
4920
|
+
if (entry.declared) return index;
|
|
4921
|
+
}
|
|
4922
|
+
for (&global_shortcuts, 0..) |*entry, index| {
|
|
4923
|
+
if (entry.used) return index;
|
|
4924
|
+
}
|
|
4925
|
+
@panic("ts core host: a global shortcut channel report arrived with no route");
|
|
4926
|
+
}
|
|
4927
|
+
|
|
4928
|
+
fn globalShortcutEventMsg(event: runtime_effects.EffectChannelEvent) Msg {
|
|
4929
|
+
const report = @import("global_shortcuts.zig").decodeChannelEvent(event);
|
|
4930
|
+
const index = findGlobalShortcut(report.shortcut.id) orelse if (report.shortcut.id.len == 0)
|
|
4931
|
+
channelReportIndex()
|
|
4932
|
+
else
|
|
4933
|
+
@panic("ts core host: a global shortcut report arrived with no bridge entry");
|
|
4934
|
+
const entry = &global_shortcuts[index];
|
|
4935
|
+
switch (report.kind) {
|
|
4936
|
+
.pressed => entry.pressed = true,
|
|
4937
|
+
.released => entry.pressed = false,
|
|
4938
|
+
else => {},
|
|
4939
|
+
}
|
|
4940
|
+
var id: []const u8 = "";
|
|
4941
|
+
if (report.shortcut.id.len > 0) {
|
|
4942
|
+
const copy = core.rt.frameAlloc(u8, report.shortcut.id.len);
|
|
4943
|
+
@memcpy(copy, report.shortcut.id);
|
|
4944
|
+
id = copy;
|
|
4945
|
+
}
|
|
4946
|
+
return msgFromTagGlobalShortcut(entry.tag, report.kind, id);
|
|
4947
|
+
}
|
|
4948
|
+
|
|
4843
4949
|
const TimerPlan = struct { slot: usize, start: bool, tag: u8, interval_ms: u64 };
|
|
4844
4950
|
|
|
4845
4951
|
/// Native supplies owned table facts; TypeScript resolves slot order,
|
|
@@ -5008,6 +5114,11 @@ pub fn TsCoreHostWithRuntimeModel(comptime core: type, comptime compiled_model:
|
|
|
5008
5114
|
_ = takeBytes(subs, &at, 8);
|
|
5009
5115
|
_ = takeByte(subs, &at);
|
|
5010
5116
|
},
|
|
5117
|
+
0x03 => {
|
|
5118
|
+
_ = takeShortBytes(subs, &at);
|
|
5119
|
+
_ = takeLongBytes(subs, &at);
|
|
5120
|
+
_ = takeBytes(subs, &at, 2);
|
|
5121
|
+
},
|
|
5011
5122
|
0x02 => {
|
|
5012
5123
|
const key = takeShortBytes(subs, &at);
|
|
5013
5124
|
if (key.len == 0) @panic("ts core host: a live query requires a non-empty subscription key");
|
|
@@ -5667,6 +5778,21 @@ pub fn TsCoreHostWithRuntimeModel(comptime core: type, comptime compiled_model:
|
|
|
5667
5778
|
@panic("ts core host: a channel event names a Msg tag outside the union");
|
|
5668
5779
|
}
|
|
5669
5780
|
|
|
5781
|
+
fn msgFromTagGlobalShortcut(tag: u8, kind: runtime_effects.EffectGlobalShortcutEventKind, id: []const u8) Msg {
|
|
5782
|
+
inline for (msg_arms, 0..) |arm, index| {
|
|
5783
|
+
if (tag == index) {
|
|
5784
|
+
const T = arm.type;
|
|
5785
|
+
if (comptime @typeInfo(T) != .@"struct" or @typeInfo(T).@"struct".fields.len != 2 or !@hasField(T, "id") or !@hasField(T, "state") or
|
|
5786
|
+
@FieldType(T, "id") != []const u8 or @typeInfo(@FieldType(T, "state")) != .@"enum")
|
|
5787
|
+
@panic("ts core host: a global shortcut report targets Msg arm '" ++ arm.name ++ "', which is not the { id, state } record");
|
|
5788
|
+
const state = std.meta.stringToEnum(@FieldType(T, "state"), if (kind == .stopped) "rejected" else @tagName(kind)) orelse
|
|
5789
|
+
@panic("ts core host: a global shortcut report state has no member in the arm's state union");
|
|
5790
|
+
return @unionInit(Msg, arm.name, .{ .id = id, .state = state });
|
|
5791
|
+
}
|
|
5792
|
+
}
|
|
5793
|
+
@panic("ts core host: a global shortcut report names a Msg tag outside the union");
|
|
5794
|
+
}
|
|
5795
|
+
|
|
5670
5796
|
fn audioCaptureArmShape(comptime T: type) bool {
|
|
5671
5797
|
const info = @typeInfo(T);
|
|
5672
5798
|
if (info != .@"struct") return false;
|
|
@@ -452,8 +452,14 @@ pub fn TsUiAppWithFeatures(comptime core: type, comptime features: ui_app.UiAppF
|
|
|
452
452
|
if (options.pty_key_resolver != null) @panic("TsUiApp owns pty_key_resolver - remove custom PTY identity wiring");
|
|
453
453
|
stamped.pty_key_resolver = Host.resolvePtyKey;
|
|
454
454
|
if (comptime @hasDecl(core, "nativeWindowPolicy")) {
|
|
455
|
+
// The compiled core's window policy answers from its request bytes
|
|
456
|
+
// alone (no module state, deterministic core), so layout may reuse
|
|
457
|
+
// an earlier answer to an identical request.
|
|
458
|
+
canvas.decision_reuse.registerPurePolicy(core.nativeWindowPolicy);
|
|
455
459
|
if (options.construction_policy != null) @panic("TsUiApp owns construction_policy - remove custom construction wiring");
|
|
456
460
|
stamped.construction_policy = core.nativeWindowPolicy;
|
|
461
|
+
if (options.expression_policy != null) @panic("TsUiApp owns expression_policy - remove custom expression wiring");
|
|
462
|
+
stamped.expression_policy = core.nativeWindowPolicy;
|
|
457
463
|
if (options.composition_policy != null) @panic("TsUiApp owns composition_policy - remove custom composition wiring");
|
|
458
464
|
stamped.composition_policy = core.nativeWindowPolicy;
|
|
459
465
|
if (options.code_content_policy != null) @panic("TsUiApp owns code_content_policy - remove custom code content wiring");
|
|
@@ -494,6 +500,24 @@ pub fn TsUiAppWithFeatures(comptime core: type, comptime features: ui_app.UiAppF
|
|
|
494
500
|
stamped.widget_routing_policy = core.nativeWindowPolicy;
|
|
495
501
|
if (options.widget_change_policy != null) @panic("TsUiApp owns widget_change_policy - remove custom change wiring");
|
|
496
502
|
stamped.widget_change_policy = core.nativeWindowPolicy;
|
|
503
|
+
if (options.widget_retention_policy != null) @panic("TsUiApp owns widget_retention_policy - remove custom retention wiring");
|
|
504
|
+
stamped.widget_retention_policy = core.nativeWindowPolicy;
|
|
505
|
+
if (options.widget_reconcile_policy != null) @panic("TsUiApp owns widget_reconcile_policy - remove custom reconcile wiring");
|
|
506
|
+
stamped.widget_reconcile_policy = core.nativeWindowPolicy;
|
|
507
|
+
if (options.scroll_tree_policy != null) @panic("TsUiApp owns scroll_tree_policy - remove custom scroll tree wiring");
|
|
508
|
+
stamped.scroll_tree_policy = core.nativeWindowPolicy;
|
|
509
|
+
if (options.scroll_mutation_policy != null) @panic("TsUiApp owns scroll_mutation_policy - remove custom scroll mutation wiring");
|
|
510
|
+
stamped.scroll_mutation_policy = core.nativeWindowPolicy;
|
|
511
|
+
if (options.widget_continuity_policy != null) @panic("TsUiApp owns widget_continuity_policy - remove custom continuity wiring");
|
|
512
|
+
stamped.widget_continuity_policy = core.nativeWindowPolicy;
|
|
513
|
+
if (options.staged_rebuild_policy != null) @panic("TsUiApp owns staged_rebuild_policy - remove custom staged rebuild wiring");
|
|
514
|
+
stamped.staged_rebuild_policy = core.nativeWindowPolicy;
|
|
515
|
+
if (options.virtual_window_policy != null) @panic("TsUiApp owns virtual_window_policy - remove custom virtual window wiring");
|
|
516
|
+
stamped.virtual_window_policy = core.nativeWindowPolicy;
|
|
517
|
+
if (options.context_menu_policy != null) @panic("TsUiApp owns context_menu_policy - remove custom context menu wiring");
|
|
518
|
+
stamped.context_menu_policy = core.nativeWindowPolicy;
|
|
519
|
+
if (options.web_pane_policy != null) @panic("TsUiApp owns web_pane_policy - remove custom pane coordination wiring");
|
|
520
|
+
stamped.web_pane_policy = core.nativeWindowPolicy;
|
|
497
521
|
if (options.widget_paint_policy != null) @panic("TsUiApp owns widget_paint_policy - remove custom paint wiring");
|
|
498
522
|
stamped.widget_paint_policy = core.nativeWindowPolicy;
|
|
499
523
|
if (options.widget_presentation_policy != null) @panic("TsUiApp owns widget_presentation_policy - remove custom presentation wiring");
|