@native-sdk/cli 0.10.1 → 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/README.md +8 -6
- package/bin/native.js +2 -1
- package/build/app.zig +393 -97
- package/build/corewire.zig +53 -0
- package/build/test_shards.zig +49 -0
- package/build/ts_run.mjs +3 -3
- package/build.zig +2030 -83
- package/native-sdk.d.ts +5 -1
- package/package.json +20 -14
- package/packages/core/compile-surface/core.ts +164 -72
- package/packages/core/package-lock.json +75 -357
- package/packages/core/package.json +25 -4
- package/packages/core/scripts/compiler_command.mjs +17 -12
- package/packages/core/scripts/compiler_typecheck.mjs +1 -0
- package/packages/core/scripts/gen_declarations.mjs +3 -2
- package/packages/core/scripts/gen_service_surface.mjs +22 -10
- package/packages/core/scripts/install_scriptc.mjs +182 -0
- package/packages/core/scripts/invoke_scriptc.mjs +18 -0
- package/packages/core/scripts/merge_static_archives.mjs +6 -1
- package/packages/core/scripts/npm_static_spike.mjs +2 -2
- package/packages/core/scripts/run_external_core_compiler.mjs +22 -10
- package/packages/core/scripts/run_external_service_compiler.mjs +15 -15
- package/packages/core/scripts/run_library_compiler.mjs +51 -0
- package/packages/core/scripts/run_native_tests.mjs +22 -0
- package/packages/core/scripts/scriptc-toolchain.json +101 -0
- package/packages/core/scripts/scriptc_toolchain.mjs +121 -0
- package/packages/core/scripts/stage_external_core.mjs +68 -1
- package/packages/core/scripts/surface_manifest_diff.mjs +19 -12
- package/packages/core/sdk/bytes.d.ts +2 -0
- package/packages/core/sdk/bytes.ts +86 -0
- package/packages/core/sdk/core.d.ts +332 -5
- package/packages/core/sdk/core.ts +371 -85
- package/packages/core/sdk/events.d.ts +252 -0
- package/packages/core/sdk/events.ts +240 -2
- package/packages/core/sdk/internal/image_identity.d.ts +7 -0
- package/packages/core/sdk/internal/image_identity.ts +71 -0
- package/packages/core/sdk/internal/markdown_policy.d.ts +5 -0
- package/packages/core/sdk/internal/markdown_policy.ts +878 -0
- package/packages/core/sdk/text.d.ts +27 -0
- package/packages/core/sdk/text.ts +206 -15
- package/packages/core/sdk/theme.d.ts +251 -0
- package/packages/core/sdk/theme.ts +267 -0
- package/packages/core/src/authorization.ts +137 -0
- package/packages/core/src/automation_commands.ts +201 -0
- package/packages/core/src/automation_interactions.ts +92 -0
- package/packages/core/src/bridge_descriptors.ts +104 -0
- package/packages/core/src/builtin_coordination.ts +172 -0
- package/packages/core/src/canvas_frame_coordination.ts +81 -0
- package/packages/core/src/canvas_presentation_lifecycle.ts +84 -0
- package/packages/core/src/canvas_scene_observation.ts +145 -0
- package/packages/core/src/chart_content.ts +161 -0
- package/packages/core/src/chart_plans.ts +432 -0
- package/packages/core/src/checker.ts +186 -19
- package/packages/core/src/cli.ts +2 -11
- package/packages/core/src/code_content.ts +580 -0
- package/packages/core/src/command_coordination.ts +140 -0
- package/packages/core/src/component_composition.ts +94 -0
- package/packages/core/src/component_construction.ts +149 -0
- package/packages/core/src/context_menus.ts +76 -0
- package/packages/core/src/contract.ts +25 -7
- package/packages/core/src/control_appearance.ts +232 -0
- package/packages/core/src/control_commands.ts +115 -0
- package/packages/core/src/control_content.ts +105 -0
- package/packages/core/src/control_geometry.ts +107 -0
- package/packages/core/src/control_payloads.ts +119 -0
- package/packages/core/src/control_primitives.ts +134 -0
- package/packages/core/src/devhost.ts +82 -7
- package/packages/core/src/devhost_journal.mjs +30 -7
- package/packages/core/src/diagnostics.ts +7 -0
- package/packages/core/src/effect_plans.ts +71 -0
- package/packages/core/src/extent_program.ts +53 -0
- package/packages/core/src/flow_measurement.ts +121 -0
- package/packages/core/src/font_registry.ts +37 -0
- package/packages/core/src/frontend.ts +12 -10
- package/packages/core/src/glyph_atlas.ts +86 -0
- package/packages/core/src/gpu_packet_preparation.ts +130 -0
- package/packages/core/src/gpu_planning.ts +123 -0
- package/packages/core/src/gpu_presentation.ts +55 -0
- package/packages/core/src/host_flow.ts +89 -0
- package/packages/core/src/host_input_regions.ts +165 -0
- package/packages/core/src/image_registry.ts +66 -0
- package/packages/core/src/indicator_plans.ts +132 -0
- package/packages/core/src/infer.ts +150 -8
- package/packages/core/src/input_composition.ts +116 -0
- package/packages/core/src/intrinsic_measure.ts +100 -0
- package/packages/core/src/layout_coordination.ts +207 -0
- package/packages/core/src/leaf_plans.ts +134 -0
- package/packages/core/src/markup_canonical.ts +140 -0
- package/packages/core/src/markup_construction.ts +189 -0
- package/packages/core/src/markup_development.ts +160 -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/measurement_coordination.ts +185 -0
- package/packages/core/src/modules.ts +1 -1
- package/packages/core/src/motion_sampling.ts +100 -0
- package/packages/core/src/paragraph_layout.ts +192 -0
- package/packages/core/src/portable_sources.json +98 -0
- package/packages/core/src/portable_sources.ts +17 -0
- package/packages/core/src/registered_font.ts +92 -0
- package/packages/core/src/render_animation_lifecycle.ts +128 -0
- package/packages/core/src/render_coordination.ts +170 -0
- package/packages/core/src/render_resources.ts +234 -0
- package/packages/core/src/runtime_policy.ts +3954 -0
- package/packages/core/src/scalar_text.ts +82 -0
- 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 +55 -3
- package/packages/core/src/session_codecs.ts +309 -0
- package/packages/core/src/shell_admission.ts +126 -0
- package/packages/core/src/shell_coordination.ts +93 -0
- package/packages/core/src/sqlite_cli.ts +14 -46
- package/packages/core/src/sqlite_codegen.ts +84 -0
- package/packages/core/src/staged_rebuild.ts +60 -0
- package/packages/core/src/status_validation.ts +232 -0
- package/packages/core/src/stream_policy.ts +63 -0
- package/packages/core/src/surface_recipes.ts +136 -0
- package/packages/core/src/system_admission.ts +60 -0
- package/packages/core/src/terminal_paint.ts +436 -0
- package/packages/core/src/text_document_width.ts +81 -0
- package/packages/core/src/text_measurement_cache.ts +69 -0
- package/packages/core/src/text_query_layout.ts +179 -0
- package/packages/core/src/text_run_layout.ts +410 -0
- package/packages/core/src/text_span_queries.ts +355 -0
- package/packages/core/src/typed_ast.ts +18 -1
- package/packages/core/src/types.ts +7 -5
- package/packages/core/src/vector_effects.ts +98 -0
- package/packages/core/src/vector_raster.ts +243 -0
- package/packages/core/src/view_bridge.ts +161 -0
- package/packages/core/src/view_check.ts +145 -0
- package/packages/core/src/view_components.ts +2415 -0
- package/packages/core/src/view_coordination.ts +198 -0
- package/packages/core/src/view_evaluator.ts +823 -0
- package/packages/core/src/view_frontend.ts +1102 -0
- 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_audits.ts +202 -0
- package/packages/core/src/widget_changes.ts +258 -0
- package/packages/core/src/widget_continuity.ts +37 -0
- package/packages/core/src/widget_metrics.ts +139 -0
- package/packages/core/src/widget_motion.ts +171 -0
- package/packages/core/src/widget_paint.ts +272 -0
- package/packages/core/src/widget_paint_walk.ts +203 -0
- package/packages/core/src/widget_presentation.ts +141 -0
- package/packages/core/src/widget_reconcile.ts +63 -0
- package/packages/core/src/widget_retention.ts +62 -0
- package/packages/core/src/widget_routing.ts +262 -0
- package/packages/core/src/window_lifecycle.ts +92 -0
- package/packages/core/testing/index.ts +430 -0
- package/schemas/app.schema.json +13 -0
- package/skill-data/core/SKILL.md +2 -2
- package/skill-data/native-ui/SKILL.md +77 -18
- package/skill-data/ts-core/SKILL.md +117 -11
- package/skill-data/ts-services/SKILL.md +1 -1
- package/skill-data/ts-services/references/service-surface.md +288 -144
- package/src/app_runner/root.zig +39 -12
- package/src/app_runner/ts_compiled_view.zig +1702 -0
- package/src/app_runner/ts_core_main.zig +185 -14
- package/src/app_runner/ts_core_mobile.zig +25 -13
- package/src/automation/server.zig +57 -6
- package/src/automation/snapshot.zig +9 -637
- package/src/automation/snapshot_reference.zig +656 -0
- package/src/automation/snapshot_serialization.zig +566 -0
- 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/gtk_host.c +36 -24
- package/src/platform/linux/gtk_pixels.h +118 -0
- package/src/platform/linux/gtk_pixels_test.c +241 -0
- package/src/platform/linux/root.zig +4 -0
- package/src/platform/macos/appkit_host.h +7 -2
- package/src/platform/macos/appkit_host.m +219 -39
- 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/pointer_motion_test.m +96 -0
- package/src/platform/macos/root.zig +25 -3
- package/src/platform/macos/scroll_driver_test.m +105 -0
- package/src/platform/macos/spectrum_bins.h +34 -0
- package/src/platform/macos/spectrum_bins_test.c +56 -0
- package/src/platform/macos/text_keyboard_test.m +80 -0
- package/src/platform/macos/webview_inspection_test.m +106 -0
- package/src/platform/macos/widget_focus_test.m +66 -0
- package/src/platform/null_platform.zig +130 -2
- package/src/platform/null_platform_tests.zig +13 -0
- package/src/platform/root.zig +15 -0
- package/src/platform/types.zig +115 -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 +17 -0
- package/src/platform/windows/webview2_host.cpp +7 -2
- package/src/primitives/app_manifest/comptime_scene.zig +1 -1
- package/src/primitives/app_manifest/root.zig +2 -0
- package/src/primitives/app_manifest/tests.zig +4 -1
- package/src/primitives/app_manifest/validation.zig +2 -0
- package/src/primitives/canvas/a11y_audit.zig +3 -1
- package/src/primitives/canvas/canvas_frame_coordination_policy.zig +134 -0
- package/src/primitives/canvas/chart_content_policy.zig +75 -0
- package/src/primitives/canvas/chart_plan_policy.zig +196 -0
- package/src/primitives/canvas/code_content_policy.zig +162 -0
- package/src/primitives/canvas/commands.zig +29 -1
- package/src/primitives/canvas/component_composition.zig +125 -0
- package/src/primitives/canvas/component_composition_policy.zig +44 -0
- package/src/primitives/canvas/component_construction_policy.zig +187 -0
- package/src/primitives/canvas/container_layout_policy.zig +87 -0
- package/src/primitives/canvas/control_appearance_policy.zig +142 -0
- package/src/primitives/canvas/control_command_policy.zig +75 -0
- package/src/primitives/canvas/control_content_policy.zig +90 -0
- package/src/primitives/canvas/control_geometry_policy.zig +165 -0
- package/src/primitives/canvas/control_payload_policy.zig +48 -0
- package/src/primitives/canvas/control_primitive_policy.zig +129 -0
- package/src/primitives/canvas/decision_reuse.zig +133 -0
- package/src/primitives/canvas/effect_plan_policy.zig +96 -0
- package/src/primitives/canvas/events.zig +1027 -1
- package/src/primitives/canvas/flow_measurement_policy.zig +237 -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/frame.zig +92 -23
- package/src/primitives/canvas/glyph_atlas_policy.zig +40 -0
- package/src/primitives/canvas/gpu.zig +10 -0
- package/src/primitives/canvas/gpu_packet_preparation_policy.zig +325 -0
- package/src/primitives/canvas/gpu_planning_policy.zig +364 -0
- package/src/primitives/canvas/gpu_presentation_policy.zig +74 -0
- package/src/primitives/canvas/grid_layout_policy.zig +51 -0
- package/src/primitives/canvas/indicator_plan_policy.zig +128 -0
- package/src/primitives/canvas/intrinsic_layout_policy.zig +87 -0
- package/src/primitives/canvas/intrinsic_measure_policy.zig +131 -0
- package/src/primitives/canvas/layout_audit.zig +5 -2
- package/src/primitives/canvas/layout_coordination_policy.zig +262 -0
- package/src/primitives/canvas/leaf_plan_policy.zig +117 -0
- package/src/primitives/canvas/markdown.zig +13 -3
- package/src/primitives/canvas/markdown_content_policy.zig +227 -0
- package/src/primitives/canvas/markdown_image_binding.zig +81 -0
- package/src/primitives/canvas/markdown_tests.zig +3 -3
- package/src/primitives/canvas/measurement_coordination_policy.zig +288 -0
- package/src/primitives/canvas/numeric_capabilities.zig +14 -0
- package/src/primitives/canvas/reference.zig +15 -11
- package/src/primitives/canvas/reference_tests.zig +58 -0
- package/src/primitives/canvas/registered_font_policy.zig +152 -0
- package/src/primitives/canvas/render.zig +48 -0
- package/src/primitives/canvas/render_cache_policy.zig +184 -0
- package/src/primitives/canvas/render_coordination_policy.zig +163 -0
- package/src/primitives/canvas/render_damage_policy.zig +160 -0
- package/src/primitives/canvas/render_effects.zig +14 -0
- package/src/primitives/canvas/render_generic_resources.zig +14 -0
- package/src/primitives/canvas/render_images.zig +14 -0
- package/src/primitives/canvas/render_layers.zig +14 -0
- package/src/primitives/canvas/render_override_policy.zig +119 -0
- package/src/primitives/canvas/render_paths.zig +14 -0
- package/src/primitives/canvas/render_plan_policy.zig +199 -0
- package/src/primitives/canvas/render_resource_policy.zig +476 -0
- package/src/primitives/canvas/root.zig +107 -4
- package/src/primitives/canvas/semantic_tree_policy.zig +158 -0
- package/src/primitives/canvas/serialization.zig +8 -1
- package/src/primitives/canvas/surface_layout_policy.zig +36 -0
- package/src/primitives/canvas/surface_recipe_policy.zig +231 -0
- package/src/primitives/canvas/terminal_grid.zig +10 -696
- package/src/primitives/canvas/terminal_grid_reference.zig +709 -0
- package/src/primitives/canvas/terminal_paint_policy.zig +191 -0
- package/src/primitives/canvas/text.zig +1 -0
- package/src/primitives/canvas/text_atlas.zig +113 -0
- package/src/primitives/canvas/text_cache_policy.zig +94 -0
- package/src/primitives/canvas/text_document_policy.zig +120 -0
- package/src/primitives/canvas/text_layout.zig +51 -2
- package/src/primitives/canvas/text_layout_cache.zig +29 -0
- package/src/primitives/canvas/text_layout_hash.zig +1 -0
- package/src/primitives/canvas/text_layout_types.zig +3 -0
- package/src/primitives/canvas/text_measure_cache.zig +46 -0
- package/src/primitives/canvas/text_measurement_policy.zig +124 -0
- package/src/primitives/canvas/text_metrics.zig +53 -37
- package/src/primitives/canvas/text_metrics_tests.zig +52 -7
- package/src/primitives/canvas/text_query_policy.zig +295 -0
- package/src/primitives/canvas/text_run_policy.zig +252 -0
- package/src/primitives/canvas/text_scalar_policy.zig +234 -0
- package/src/primitives/canvas/text_span_query_policy.zig +232 -0
- package/src/primitives/canvas/text_spans.zig +280 -8
- package/src/primitives/canvas/text_tests.zig +10 -0
- package/src/primitives/canvas/tokens.zig +47 -0
- package/src/primitives/canvas/ui.zig +251 -83
- package/src/primitives/canvas/ui_markup.zig +207 -46
- package/src/primitives/canvas/ui_markup_canonical.zig +237 -0
- package/src/primitives/canvas/ui_markup_compiled.zig +1724 -80
- package/src/primitives/canvas/ui_markup_compiled_tests.zig +225 -0
- 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_contract.zig +146 -14
- package/src/primitives/canvas/ui_markup_contract_tests.zig +77 -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_reflect.zig +56 -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_tests.zig +116 -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 +3026 -57
- package/src/primitives/canvas/ui_markup_view_tests.zig +142 -10
- package/src/primitives/canvas/ui_schema.zig +13 -1
- package/src/primitives/canvas/ui_schema_tests.zig +11 -7
- package/src/primitives/canvas/ui_tests.zig +1 -0
- package/src/primitives/canvas/vector.zig +36 -2
- package/src/primitives/canvas/vector_effect_policy.zig +236 -0
- package/src/primitives/canvas/vector_raster_policy.zig +190 -0
- package/src/primitives/canvas/virtual_extent_policy.zig +350 -0
- package/src/primitives/canvas/virtual_extents.zig +113 -3
- package/src/primitives/canvas/virtual_flow_policy.zig +108 -0
- package/src/primitives/canvas/widget_audit_policy.zig +293 -0
- package/src/primitives/canvas/widget_change_policy.zig +298 -0
- package/src/primitives/canvas/widget_invalidation.zig +113 -2
- package/src/primitives/canvas/widget_layout.zig +673 -128
- package/src/primitives/canvas/widget_layout_tests.zig +4 -0
- package/src/primitives/canvas/widget_metric_policy.zig +129 -0
- package/src/primitives/canvas/widget_metrics.zig +45 -6
- package/src/primitives/canvas/widget_paint_policy.zig +166 -0
- package/src/primitives/canvas/widget_paint_walk_policy.zig +252 -0
- package/src/primitives/canvas/widget_presentation_policy.zig +168 -0
- package/src/primitives/canvas/widget_render.zig +744 -74
- package/src/primitives/canvas/widget_render_controls.zig +1217 -133
- package/src/primitives/canvas/widget_render_scroll.zig +11 -3
- package/src/primitives/canvas/widget_render_style.zig +94 -0
- package/src/primitives/canvas/widget_render_surfaces.zig +61 -50
- package/src/primitives/canvas/widget_routing.zig +75 -0
- package/src/primitives/canvas/widget_routing_policy.zig +135 -0
- package/src/primitives/canvas/widget_runtime.zig +21 -1
- package/src/primitives/canvas/widget_semantics.zig +25 -0
- package/src/primitives/canvas/widget_text_input.zig +86 -23
- package/src/primitives/canvas/widget_text_select.zig +1 -0
- package/src/primitives/canvas/widget_tree.zig +8 -1
- package/src/primitives/canvas/widgets.zig +42 -12
- package/src/primitives/canvas/wrapped_layout_policy.zig +104 -0
- package/src/root.zig +26 -0
- package/src/runtime/accessibility_policy.zig +122 -0
- package/src/runtime/api.zig +29 -0
- package/src/runtime/app_dispatch_policy.zig +68 -0
- package/src/runtime/authorization_policy.zig +150 -0
- package/src/runtime/automation_command_policy.zig +241 -0
- package/src/runtime/automation_interaction_policy.zig +107 -0
- package/src/runtime/automation_snapshot.zig +52 -22
- package/src/runtime/automation_snapshot_reference.zig +290 -0
- package/src/runtime/automation_widget_dispatch.zig +267 -355
- package/src/runtime/automation_widget_dispatch_reference.zig +900 -0
- package/src/runtime/blob_policy.zig +58 -0
- package/src/runtime/blob_reference.zig +64 -0
- package/src/runtime/bridge_descriptor_policy.zig +206 -0
- package/src/runtime/bridge_payload.zig +2 -0
- package/src/runtime/builtin_bridge.zig +180 -44
- package/src/runtime/builtin_coordination_policy.zig +121 -0
- package/src/runtime/callback_policy_test_reference.zig +97 -0
- package/src/runtime/canvas_drag_policy.zig +94 -0
- package/src/runtime/canvas_fonts.zig +38 -10
- package/src/runtime/canvas_frame.zig +590 -134
- package/src/runtime/canvas_frame_helpers.zig +1 -0
- package/src/runtime/canvas_hover_policy.zig +131 -0
- package/src/runtime/canvas_images.zig +59 -30
- package/src/runtime/canvas_keyboard_focus_policy.zig +154 -0
- package/src/runtime/canvas_limits.zig +1 -1
- package/src/runtime/canvas_presentation_lifecycle_policy.zig +86 -0
- package/src/runtime/canvas_scene_observation_policy.zig +181 -0
- package/src/runtime/canvas_widget_context_menu.zig +183 -4
- 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_display.zig +110 -9
- package/src/runtime/canvas_widget_events.zig +718 -328
- package/src/runtime/canvas_widget_runtime.zig +720 -150
- package/src/runtime/canvas_widget_scroll_drivers.zig +39 -1
- package/src/runtime/canvas_widget_scroll_tests.zig +31 -0
- package/src/runtime/canvas_widget_state.zig +93 -56
- package/src/runtime/channel_sources.zig +80 -0
- package/src/runtime/command_policy.zig +161 -0
- package/src/runtime/component_policy.zig +83 -0
- package/src/runtime/context_menu_policy.zig +112 -0
- package/src/runtime/core.zig +170 -6
- package/src/runtime/desktop_files.zig +189 -0
- package/src/runtime/effects.zig +638 -33
- package/src/runtime/effects_host_tests.zig +25 -0
- package/src/runtime/effects_tests.zig +28 -0
- package/src/runtime/file_policy_test_reference.zig +113 -0
- package/src/runtime/flow.zig +419 -341
- package/src/runtime/flow_reference.zig +1427 -0
- package/src/runtime/font_registry_policy.zig +72 -0
- package/src/runtime/frame_profile.zig +24 -33
- package/src/runtime/global_shortcuts.zig +75 -0
- package/src/runtime/gpu_surface_events.zig +97 -35
- package/src/runtime/host_event_pump.zig +303 -0
- package/src/runtime/host_event_pump_reference.zig +268 -0
- package/src/runtime/host_flow_policy.zig +155 -0
- package/src/runtime/host_input_regions_policy.zig +156 -0
- package/src/runtime/image_registry_policy.zig +94 -0
- package/src/runtime/input_composition_policy.zig +138 -0
- package/src/runtime/journal_policy.zig +66 -0
- package/src/runtime/journal_reference.zig +53 -0
- package/src/runtime/keyboard_input.zig +86 -0
- package/src/runtime/lifecycle_policy_test_reference.zig +97 -0
- package/src/runtime/markup_development_policy.zig +91 -0
- package/src/runtime/media_surface.zig +40 -1
- package/src/runtime/motion_sampling_policy.zig +159 -0
- package/src/runtime/recording_policy.zig +42 -0
- package/src/runtime/render_animation_policy.zig +206 -0
- package/src/runtime/replay_policy.zig +66 -0
- package/src/runtime/replay_policy_reference.zig +326 -0
- package/src/runtime/replay_progress_policy.zig +64 -0
- package/src/runtime/replay_progress_reference.zig +34 -0
- package/src/runtime/request_policy_test_reference.zig +188 -0
- package/src/runtime/root.zig +16 -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_blobs.zig +157 -58
- package/src/runtime/session_blobs_reference.zig +692 -0
- package/src/runtime/session_codec.zig +361 -0
- package/src/runtime/session_codec_reference.zig +1027 -0
- package/src/runtime/session_journal.zig +246 -983
- package/src/runtime/session_record.zig +231 -45
- package/src/runtime/session_replay.zig +157 -415
- package/src/runtime/session_tests.zig +552 -0
- package/src/runtime/shell_admission_policy.zig +225 -0
- package/src/runtime/shell_coordination_policy.zig +138 -0
- package/src/runtime/shell_layout.zig +126 -1
- package/src/runtime/snapshot_policy.zig +60 -0
- package/src/runtime/snapshot_reference.zig +64 -0
- package/src/runtime/staged_rebuild_policy.zig +83 -0
- package/src/runtime/state.zig +16 -0
- package/src/runtime/status_validation.zig +190 -0
- package/src/runtime/system_admission_policy.zig +140 -0
- package/src/runtime/system_services.zig +65 -36
- package/src/runtime/tests.zig +2 -0
- package/src/runtime/ts_canvas_hooks.zig +261 -0
- package/src/runtime/ts_canvas_hooks_tests.zig +279 -0
- package/src/runtime/ts_canvas_icons.zig +234 -0
- package/src/runtime/ts_core_host.zig +2451 -411
- package/src/runtime/ts_core_host_tests.zig +1982 -0
- package/src/runtime/ts_test_host.zig +699 -0
- package/src/runtime/ts_ui_app.zig +1111 -45
- package/src/runtime/ui_app.zig +1381 -650
- package/src/runtime/ui_app_provenance.zig +147 -5
- package/src/runtime/ui_app_provenance_reference.zig +370 -0
- package/src/runtime/ui_app_tests.zig +667 -188
- package/src/runtime/ui_app_window_tests.zig +222 -0
- package/src/runtime/view.zig +25 -0
- package/src/runtime/view_canvas.zig +30 -6
- package/src/runtime/view_coordination_policy.zig +147 -0
- package/src/runtime/view_reload.zig +226 -0
- package/src/runtime/view_widget_control.zig +51 -14
- package/src/runtime/view_widget_scroll.zig +46 -26
- package/src/runtime/view_widget_text.zig +153 -68
- package/src/runtime/view_widget_tree.zig +503 -69
- 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/webview_view_bridge_tests.zig +2 -0
- package/src/runtime/widget_continuity_policy.zig +73 -0
- package/src/runtime/widget_motion_policy.zig +238 -0
- package/src/runtime/widget_reconcile_policy.zig +81 -0
- package/src/runtime/widget_retention_policy.zig +75 -0
- package/src/runtime/window_command_bridge_tests.zig +63 -0
- package/src/runtime/window_lifecycle_policy.zig +127 -0
- package/src/runtime/window_storage.zig +74 -8
- package/src/runtime/window_view_runtime.zig +148 -33
- package/src/runtime/window_views.zig +179 -11
- package/src/security/root.zig +1 -0
- package/src/tooling/components/identity_tests.zig +62 -36
- package/src/tooling/components/stepper.native +24 -0
- package/src/tooling/components/stepper.zig +0 -19
- package/src/tooling/components/timeline-item.native +22 -0
- package/src/tooling/components/timeline.native +5 -3
- package/src/tooling/components/timeline_item.zig +0 -32
- package/src/tooling/eject_components.zig +76 -8
- package/src/tooling/ios.zig +66 -12
- package/src/tooling/manifest.zig +35 -0
- package/src/tooling/raw_manifest.zig +6 -0
- package/src/tooling/templates.zig +23 -3
- package/src/tooling/ts_core.zig +97 -4
- package/src/tooling/verbs.zig +87 -1
- package/tools/corewire/build_profile.mjs +54 -0
- package/tools/corewire/contract_intake.ts +303 -0
- package/tools/corewire/contract_intake.zig +82 -0
- package/tools/corewire/core.test.ts +188 -0
- package/tools/corewire/core_abi.zig +55 -0
- package/tools/corewire/core_cases.ts +233 -0
- package/tools/corewire/core_contract.ts +407 -0
- package/tools/corewire/core_emission.ts +136 -0
- package/tools/corewire/core_emission.zig +69 -0
- package/tools/corewire/core_goldens.json +3110 -0
- package/tools/corewire/core_policy.ts +14 -0
- package/tools/corewire/core_policy.zig +48 -0
- package/tools/corewire/core_projection.ts +361 -0
- package/tools/corewire/core_vocabulary.ts +6 -0
- package/tools/corewire/emit.zig +19 -1590
- package/tools/corewire/emit_facade.ts +714 -0
- package/tools/corewire/emit_facade.zig +10 -3752
- package/tools/corewire/emit_mirror.ts +300 -0
- package/tools/corewire/emit_profile.ts +50 -0
- package/tools/corewire/emit_service.ts +331 -0
- package/tools/corewire/emit_service.zig +23 -842
- package/tools/corewire/entry.test.ts +95 -0
- package/tools/corewire/entry_coordination.ts +127 -0
- package/tools/corewire/entry_coordination.zig +190 -0
- package/tools/corewire/facade_templates.ts +85 -0
- package/tools/corewire/filesystem.test.ts +166 -0
- package/tools/corewire/filesystem_coordination.ts +213 -0
- package/tools/corewire/filesystem_coordination.zig +245 -0
- package/tools/corewire/intake.test.ts +39 -0
- package/tools/corewire/intake_cases.ts +55 -0
- package/tools/corewire/intake_goldens.json +12237 -0
- package/tools/corewire/invocation.test.ts +28 -0
- package/tools/corewire/invocation.ts +175 -0
- package/tools/corewire/invocation.zig +136 -0
- package/tools/corewire/invocation_cases.ts +60 -0
- package/tools/corewire/invocation_fixture.ts +33 -0
- package/tools/corewire/invocation_goldens.json +1143 -0
- package/tools/corewire/invocation_tests.zig +111 -0
- package/tools/corewire/invocation_usage.ts +2 -0
- package/tools/corewire/lossless_projection.ts +96 -0
- package/tools/corewire/main.zig +7 -680
- package/tools/corewire/main_reference.zig +415 -0
- package/tools/corewire/mirror_templates.ts +59 -0
- package/tools/corewire/profile.test.ts +248 -0
- package/tools/corewire/profile.zig +56 -0
- package/tools/corewire/profile_emission.ts +204 -0
- package/tools/corewire/profile_library.json +29 -0
- package/tools/corewire/profile_tests.zig +136 -0
- package/tools/corewire/service.test.ts +75 -0
- package/tools/corewire/service_cases.ts +61 -0
- package/tools/corewire/service_contract.zig +40 -146
- package/tools/corewire/service_goldens.json +650 -0
- package/tools/corewire/service_projection.zig +52 -0
- package/tools/corewire/service_templates.ts +14 -0
- package/tools/corewire/shim_rt.zig +9 -0
- package/tools/corewire/sidecar.zig +269 -1438
- package/tools/corewire/emit_profile.zig +0 -521
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//! Deterministic session journal: the on-disk format for record/replay.
|
|
2
2
|
//!
|
|
3
|
-
//! A Native SDK session
|
|
4
|
-
//!
|
|
5
|
-
//!
|
|
3
|
+
//! A Native SDK session consists of deterministic app init, platform
|
|
4
|
+
//! events, effect results, and synchronous OS chrome query results.
|
|
5
|
+
//! A journal file holds
|
|
6
6
|
//! a session header, every dispatched platform event (payload + implicit
|
|
7
7
|
//! ordinal), every effect RESULT the drain delivered to `update` (fetch
|
|
8
8
|
//! response bytes, subprocess lines and exits, file reads, clipboard
|
|
@@ -73,9 +73,43 @@ const platform = @import("../platform/root.zig");
|
|
|
73
73
|
const automation_protocol = @import("../automation/protocol.zig");
|
|
74
74
|
const layout_fingerprint = @import("../automation/layout_fingerprint.zig");
|
|
75
75
|
const runtime_effects = @import("effects.zig");
|
|
76
|
+
const journal_policy = @import("journal_policy.zig");
|
|
77
|
+
const codec = @import("session_codec.zig");
|
|
76
78
|
|
|
77
79
|
pub const EffectResultRecord = runtime_effects.EffectResultRecord;
|
|
78
80
|
|
|
81
|
+
const EventTag = enum(u8) {
|
|
82
|
+
app_start = 1,
|
|
83
|
+
app_activated = 2,
|
|
84
|
+
app_deactivated = 3,
|
|
85
|
+
appearance_changed = 4,
|
|
86
|
+
frame_requested = 5,
|
|
87
|
+
app_shutdown = 6,
|
|
88
|
+
surface_resized = 7,
|
|
89
|
+
window_frame_changed = 8,
|
|
90
|
+
window_focused = 9,
|
|
91
|
+
bridge_message = 10,
|
|
92
|
+
tray_action = 11,
|
|
93
|
+
shortcut = 12,
|
|
94
|
+
native_command = 13,
|
|
95
|
+
menu_command = 14,
|
|
96
|
+
timer = 15,
|
|
97
|
+
wake = 16,
|
|
98
|
+
files_dropped = 17,
|
|
99
|
+
gpu_surface_frame = 18,
|
|
100
|
+
gpu_surface_resized = 19,
|
|
101
|
+
gpu_surface_input = 20,
|
|
102
|
+
gpu_surface_scroll_driver = 21,
|
|
103
|
+
context_menu_action = 22,
|
|
104
|
+
widget_accessibility_action = 23,
|
|
105
|
+
audio = 24,
|
|
106
|
+
video = 25,
|
|
107
|
+
view_focused = 26,
|
|
108
|
+
tray_command = 27,
|
|
109
|
+
notification_command = 28,
|
|
110
|
+
widget_context_menu_action = 29,
|
|
111
|
+
};
|
|
112
|
+
|
|
79
113
|
/// File magic: first eight bytes of every session journal.
|
|
80
114
|
pub const magic = "NSDKSJNL";
|
|
81
115
|
|
|
@@ -169,6 +203,7 @@ fn formatLayoutDescription(comptime epoch: u32) []const u8 {
|
|
|
169
203
|
"checkpoint=" ++ layout_fingerprint.describe(Checkpoint) ++ "\n" ++
|
|
170
204
|
"screenshot=" ++ layout_fingerprint.describe(ScreenshotMark) ++ "\n" ++
|
|
171
205
|
"end=" ++ layout_fingerprint.describe(End) ++ "\n" ++
|
|
206
|
+
"window_chrome=" ++ layout_fingerprint.describe(WindowChromeRecord) ++ "\n" ++
|
|
172
207
|
"effect=" ++ layout_fingerprint.describe(EffectResultRecord) ++ "\n" ++
|
|
173
208
|
"event_tags=" ++ layout_fingerprint.describe(EventTag) ++ "\n" ++
|
|
174
209
|
// Per-variant payload types, reflected. Payload-free tags
|
|
@@ -204,7 +239,8 @@ fn formatLayoutDescription(comptime epoch: u32) []const u8 {
|
|
|
204
239
|
"gpu_surface_input=" ++ layout_fingerprint.describe(platform.GpuSurfaceInputEvent) ++ "\n" ++
|
|
205
240
|
"gpu_surface_scroll_driver=" ++ layout_fingerprint.describe(platform.GpuSurfaceScrollDriverEvent) ++ "\n" ++
|
|
206
241
|
"context_menu_action=" ++ layout_fingerprint.describe(platform.ContextMenuActionEvent) ++ "\n" ++
|
|
207
|
-
"widget_accessibility_action=" ++ layout_fingerprint.describe(platform.WidgetAccessibilityActionEvent) ++ "\n"
|
|
242
|
+
"widget_accessibility_action=" ++ layout_fingerprint.describe(platform.WidgetAccessibilityActionEvent) ++ "\n" ++
|
|
243
|
+
"widget_context_menu_action=" ++ layout_fingerprint.describe(platform.WidgetContextMenuActionEvent) ++ "\n";
|
|
208
244
|
}
|
|
209
245
|
}
|
|
210
246
|
|
|
@@ -269,8 +305,24 @@ pub const RecordKind = enum(u8) {
|
|
|
269
305
|
checkpoint = 4,
|
|
270
306
|
screenshot = 5,
|
|
271
307
|
end = 6,
|
|
308
|
+
window_chrome = 7,
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
/// Maximum synchronous chrome queries consumed by one recorded event.
|
|
312
|
+
/// Per-event staging preserves nested dispatch and accessibility ownership.
|
|
313
|
+
pub const max_session_window_chrome_queries: usize = 256;
|
|
314
|
+
|
|
315
|
+
/// One OS capability result, consumed in query order by the following event.
|
|
316
|
+
/// Values are copied; no native window or borrowed storage crosses replay.
|
|
317
|
+
pub const WindowChromeRecord = struct {
|
|
318
|
+
window_id: platform.WindowId,
|
|
319
|
+
chrome: platform.WindowChrome,
|
|
272
320
|
};
|
|
273
321
|
|
|
322
|
+
/// A logic-only host has no window chrome capability. Its explicit
|
|
323
|
+
/// absence replays as zero geometry; native sessions capture every query.
|
|
324
|
+
pub const WindowChromeSource = enum(u8) { native_queries, unavailable };
|
|
325
|
+
|
|
274
326
|
/// Session identity, written once as the first record.
|
|
275
327
|
pub const Header = struct {
|
|
276
328
|
/// The automation protocol fingerprint baked into the recording
|
|
@@ -288,6 +340,7 @@ pub const Header = struct {
|
|
|
288
340
|
/// Initial main-window geometry, for provenance and sanity checks.
|
|
289
341
|
window_width: f32 = 0,
|
|
290
342
|
window_height: f32 = 0,
|
|
343
|
+
window_chrome_source: WindowChromeSource = .native_queries,
|
|
291
344
|
};
|
|
292
345
|
|
|
293
346
|
/// A model-state fingerprint taken after the event with `event_ordinal`
|
|
@@ -319,6 +372,7 @@ pub const End = struct {
|
|
|
319
372
|
effect_count: u64,
|
|
320
373
|
checkpoint_count: u64,
|
|
321
374
|
screenshot_count: u64,
|
|
375
|
+
window_chrome_count: u64 = 0,
|
|
322
376
|
};
|
|
323
377
|
|
|
324
378
|
pub const Record = union(RecordKind) {
|
|
@@ -328,6 +382,7 @@ pub const Record = union(RecordKind) {
|
|
|
328
382
|
checkpoint: Checkpoint,
|
|
329
383
|
screenshot: ScreenshotMark,
|
|
330
384
|
end: End,
|
|
385
|
+
window_chrome: WindowChromeRecord,
|
|
331
386
|
};
|
|
332
387
|
|
|
333
388
|
/// Decode scratch for payloads that need an outer slice (dropped-file
|
|
@@ -346,990 +401,146 @@ pub const EventDecodeStorage = struct {
|
|
|
346
401
|
// one here means updating that description's `codec=` line in the same
|
|
347
402
|
// change.
|
|
348
403
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
len: usize = 0,
|
|
352
|
-
|
|
353
|
-
fn remaining(self: *const WriteCursor) usize {
|
|
354
|
-
return self.buffer.len - self.len;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
fn writeBytes(self: *WriteCursor, bytes: []const u8) JournalError!void {
|
|
358
|
-
if (bytes.len > self.remaining()) return error.JournalRecordOverBudget;
|
|
359
|
-
@memcpy(self.buffer[self.len .. self.len + bytes.len], bytes);
|
|
360
|
-
self.len += bytes.len;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
fn writeByte(self: *WriteCursor, value: u8) JournalError!void {
|
|
364
|
-
try self.writeBytes(&.{value});
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
fn writeBool(self: *WriteCursor, value: bool) JournalError!void {
|
|
368
|
-
try self.writeByte(@intFromBool(value));
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
fn writeInt(self: *WriteCursor, comptime T: type, value: T) JournalError!void {
|
|
372
|
-
var bytes: [@divExact(@typeInfo(T).int.bits, 8)]u8 = undefined;
|
|
373
|
-
std.mem.writeInt(T, &bytes, value, .little);
|
|
374
|
-
try self.writeBytes(&bytes);
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
fn writeF32(self: *WriteCursor, value: f32) JournalError!void {
|
|
378
|
-
try self.writeInt(u32, @bitCast(value));
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
fn writeEnum(self: *WriteCursor, value: anytype) JournalError!void {
|
|
382
|
-
const int_value = @intFromEnum(value);
|
|
383
|
-
if (int_value < 0 or int_value > std.math.maxInt(u8)) return error.JournalRecordOverBudget;
|
|
384
|
-
try self.writeByte(@intCast(int_value));
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
fn writeStr(self: *WriteCursor, bytes: []const u8) JournalError!void {
|
|
388
|
-
if (bytes.len > std.math.maxInt(u32)) return error.JournalRecordOverBudget;
|
|
389
|
-
try self.writeInt(u32, @intCast(bytes.len));
|
|
390
|
-
try self.writeBytes(bytes);
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
const ReadCursor = struct {
|
|
395
|
-
bytes: []const u8,
|
|
396
|
-
pos: usize = 0,
|
|
397
|
-
|
|
398
|
-
fn readBytes(self: *ReadCursor, len: usize) JournalError![]const u8 {
|
|
399
|
-
if (len > self.bytes.len - self.pos) return error.JournalCorrupt;
|
|
400
|
-
const slice = self.bytes[self.pos .. self.pos + len];
|
|
401
|
-
self.pos += len;
|
|
402
|
-
return slice;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
fn readByte(self: *ReadCursor) JournalError!u8 {
|
|
406
|
-
return (try self.readBytes(1))[0];
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
fn readBool(self: *ReadCursor) JournalError!bool {
|
|
410
|
-
return switch (try self.readByte()) {
|
|
411
|
-
0 => false,
|
|
412
|
-
1 => true,
|
|
413
|
-
else => error.JournalCorrupt,
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
fn readInt(self: *ReadCursor, comptime T: type) JournalError!T {
|
|
418
|
-
const size = @divExact(@typeInfo(T).int.bits, 8);
|
|
419
|
-
const bytes = try self.readBytes(size);
|
|
420
|
-
return std.mem.readInt(T, bytes[0..size], .little);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
fn readF32(self: *ReadCursor) JournalError!f32 {
|
|
424
|
-
return @bitCast(try self.readInt(u32));
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
fn readEnum(self: *ReadCursor, comptime T: type) JournalError!T {
|
|
428
|
-
return std.enums.fromInt(T, try self.readByte()) orelse error.JournalCorrupt;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
fn readStr(self: *ReadCursor) JournalError![]const u8 {
|
|
432
|
-
const len = try self.readInt(u32);
|
|
433
|
-
return self.readBytes(len);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
fn done(self: *const ReadCursor) bool {
|
|
437
|
-
return self.pos == self.bytes.len;
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
// ------------------------------------------------------- event codec
|
|
442
|
-
//
|
|
443
|
-
// Explicit stable tags per event variant (never `@intFromEnum` of the
|
|
444
|
-
// union tag, whose order is free to change).
|
|
445
|
-
|
|
446
|
-
const EventTag = enum(u8) {
|
|
447
|
-
app_start = 1,
|
|
448
|
-
app_activated = 2,
|
|
449
|
-
app_deactivated = 3,
|
|
450
|
-
appearance_changed = 4,
|
|
451
|
-
frame_requested = 5,
|
|
452
|
-
app_shutdown = 6,
|
|
453
|
-
surface_resized = 7,
|
|
454
|
-
window_frame_changed = 8,
|
|
455
|
-
window_focused = 9,
|
|
456
|
-
bridge_message = 10,
|
|
457
|
-
tray_action = 11,
|
|
458
|
-
shortcut = 12,
|
|
459
|
-
native_command = 13,
|
|
460
|
-
menu_command = 14,
|
|
461
|
-
timer = 15,
|
|
462
|
-
wake = 16,
|
|
463
|
-
files_dropped = 17,
|
|
464
|
-
gpu_surface_frame = 18,
|
|
465
|
-
gpu_surface_resized = 19,
|
|
466
|
-
gpu_surface_input = 20,
|
|
467
|
-
gpu_surface_scroll_driver = 21,
|
|
468
|
-
context_menu_action = 22,
|
|
469
|
-
widget_accessibility_action = 23,
|
|
470
|
-
audio = 24,
|
|
471
|
-
video = 25,
|
|
472
|
-
view_focused = 26,
|
|
473
|
-
tray_command = 27,
|
|
474
|
-
notification_command = 28,
|
|
475
|
-
};
|
|
476
|
-
|
|
477
|
-
// The bit assignments below are hand-written wire layout: they are
|
|
478
|
-
// stated in `formatLayoutDescription` (reflection sees the bool fields,
|
|
479
|
-
// not the bits), so changing a bit here means updating that line too.
|
|
480
|
-
fn writeModifiers(cursor: *WriteCursor, modifiers: platform.ShortcutModifiers) JournalError!void {
|
|
481
|
-
var bits: u8 = 0;
|
|
482
|
-
if (modifiers.primary) bits |= 1;
|
|
483
|
-
if (modifiers.command) bits |= 2;
|
|
484
|
-
if (modifiers.control) bits |= 4;
|
|
485
|
-
if (modifiers.option) bits |= 8;
|
|
486
|
-
if (modifiers.shift) bits |= 16;
|
|
487
|
-
try cursor.writeByte(bits);
|
|
404
|
+
pub fn encodeEvent(value: platform.Event, buffer: []u8) JournalError![]const u8 {
|
|
405
|
+
return encodeEventWithPolicy(null, value, buffer);
|
|
488
406
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
const bits = try cursor.readByte();
|
|
492
|
-
if (bits > 31) return error.JournalCorrupt;
|
|
493
|
-
return .{
|
|
494
|
-
.primary = bits & 1 != 0,
|
|
495
|
-
.command = bits & 2 != 0,
|
|
496
|
-
.control = bits & 4 != 0,
|
|
497
|
-
.option = bits & 8 != 0,
|
|
498
|
-
.shift = bits & 16 != 0,
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
fn writeInsets(cursor: *WriteCursor, insets: geometry.InsetsF) JournalError!void {
|
|
503
|
-
try cursor.writeF32(insets.top);
|
|
504
|
-
try cursor.writeF32(insets.right);
|
|
505
|
-
try cursor.writeF32(insets.bottom);
|
|
506
|
-
try cursor.writeF32(insets.left);
|
|
407
|
+
pub fn encodeEventWithPolicy(policy: journal_policy.Policy, value: platform.Event, buffer: []u8) JournalError![]const u8 {
|
|
408
|
+
return codec.encodeEvent(policy, value, buffer);
|
|
507
409
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
return .{
|
|
511
|
-
.top = try cursor.readF32(),
|
|
512
|
-
.right = try cursor.readF32(),
|
|
513
|
-
.bottom = try cursor.readF32(),
|
|
514
|
-
.left = try cursor.readF32(),
|
|
515
|
-
};
|
|
410
|
+
pub fn decodeEvent(bytes: []const u8, storage: *EventDecodeStorage) JournalError!platform.Event {
|
|
411
|
+
return decodeEventWithPolicy(null, bytes, storage);
|
|
516
412
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
try cursor.writeF32(rect.x);
|
|
520
|
-
try cursor.writeF32(rect.y);
|
|
521
|
-
try cursor.writeF32(rect.width);
|
|
522
|
-
try cursor.writeF32(rect.height);
|
|
413
|
+
pub fn decodeEventWithPolicy(policy: journal_policy.Policy, bytes: []const u8, storage: *EventDecodeStorage) JournalError!platform.Event {
|
|
414
|
+
return codec.decodeEvent(policy, bytes, storage);
|
|
523
415
|
}
|
|
524
416
|
|
|
525
|
-
fn
|
|
526
|
-
|
|
527
|
-
const y = try cursor.readF32();
|
|
528
|
-
const width = try cursor.readF32();
|
|
529
|
-
const height = try cursor.readF32();
|
|
530
|
-
return geometry.RectF.init(x, y, width, height);
|
|
417
|
+
pub fn encodeEffect(value: EffectResultRecord, buffer: []u8) JournalError![]const u8 {
|
|
418
|
+
return encodeEffectWithPolicy(null, value, buffer);
|
|
531
419
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
/// payload. `gpu_surface_frame` deliberately journals only the fields
|
|
535
|
-
/// dispatch semantics depend on (identity, geometry, frame index and
|
|
536
|
-
/// timestamps, full-repaint) — the rest of that struct is host render
|
|
537
|
-
/// telemetry about the PREVIOUS present, meaningless under replay's
|
|
538
|
-
/// null host; decode fills those with defaults.
|
|
539
|
-
pub fn encodeEvent(event: platform.Event, buffer: []u8) JournalError![]const u8 {
|
|
540
|
-
var cursor = WriteCursor{ .buffer = buffer };
|
|
541
|
-
switch (event) {
|
|
542
|
-
.app_start => try cursor.writeEnum(EventTag.app_start),
|
|
543
|
-
.app_activated => try cursor.writeEnum(EventTag.app_activated),
|
|
544
|
-
.app_deactivated => try cursor.writeEnum(EventTag.app_deactivated),
|
|
545
|
-
.frame_requested => try cursor.writeEnum(EventTag.frame_requested),
|
|
546
|
-
.app_shutdown => try cursor.writeEnum(EventTag.app_shutdown),
|
|
547
|
-
.wake => try cursor.writeEnum(EventTag.wake),
|
|
548
|
-
.appearance_changed => |appearance| {
|
|
549
|
-
try cursor.writeEnum(EventTag.appearance_changed);
|
|
550
|
-
try cursor.writeEnum(appearance.color_scheme);
|
|
551
|
-
try cursor.writeBool(appearance.reduce_motion);
|
|
552
|
-
try cursor.writeBool(appearance.high_contrast);
|
|
553
|
-
},
|
|
554
|
-
.surface_resized => |surface| {
|
|
555
|
-
try cursor.writeEnum(EventTag.surface_resized);
|
|
556
|
-
try cursor.writeInt(u64, surface.id);
|
|
557
|
-
try cursor.writeF32(surface.size.width);
|
|
558
|
-
try cursor.writeF32(surface.size.height);
|
|
559
|
-
try cursor.writeF32(surface.scale_factor);
|
|
560
|
-
try writeInsets(&cursor, surface.safe_area_insets);
|
|
561
|
-
try writeInsets(&cursor, surface.keyboard_insets);
|
|
562
|
-
// `native_handle` is process-local and never journaled.
|
|
563
|
-
},
|
|
564
|
-
.window_frame_changed => |state| {
|
|
565
|
-
try cursor.writeEnum(EventTag.window_frame_changed);
|
|
566
|
-
try cursor.writeInt(u64, state.id);
|
|
567
|
-
try cursor.writeStr(state.label);
|
|
568
|
-
try cursor.writeStr(state.title);
|
|
569
|
-
try writeRect(&cursor, state.frame);
|
|
570
|
-
try cursor.writeF32(state.scale_factor);
|
|
571
|
-
try cursor.writeBool(state.open);
|
|
572
|
-
try cursor.writeBool(state.focused);
|
|
573
|
-
try cursor.writeBool(state.maximized);
|
|
574
|
-
try cursor.writeBool(state.fullscreen);
|
|
575
|
-
// v6: alive-but-policy-hidden (`close_policy = .hide`).
|
|
576
|
-
try cursor.writeBool(state.hidden);
|
|
577
|
-
},
|
|
578
|
-
.window_focused => |window_id| {
|
|
579
|
-
try cursor.writeEnum(EventTag.window_focused);
|
|
580
|
-
try cursor.writeInt(u64, window_id);
|
|
581
|
-
},
|
|
582
|
-
.view_focused => |focus| {
|
|
583
|
-
try cursor.writeEnum(EventTag.view_focused);
|
|
584
|
-
try cursor.writeInt(u64, focus.window_id);
|
|
585
|
-
try cursor.writeStr(focus.label);
|
|
586
|
-
},
|
|
587
|
-
.bridge_message => |message| {
|
|
588
|
-
try cursor.writeEnum(EventTag.bridge_message);
|
|
589
|
-
try cursor.writeStr(message.bytes);
|
|
590
|
-
try cursor.writeStr(message.origin);
|
|
591
|
-
try cursor.writeInt(u64, message.window_id);
|
|
592
|
-
try cursor.writeStr(message.webview_label);
|
|
593
|
-
},
|
|
594
|
-
.tray_action => |action| {
|
|
595
|
-
try cursor.writeEnum(EventTag.tray_action);
|
|
596
|
-
try cursor.writeInt(u32, action.status_item_id);
|
|
597
|
-
try cursor.writeInt(u32, action.item_id);
|
|
598
|
-
},
|
|
599
|
-
.shortcut => |shortcut| {
|
|
600
|
-
try cursor.writeEnum(EventTag.shortcut);
|
|
601
|
-
try cursor.writeStr(shortcut.id);
|
|
602
|
-
try cursor.writeStr(shortcut.key);
|
|
603
|
-
try writeModifiers(&cursor, shortcut.modifiers);
|
|
604
|
-
try cursor.writeInt(u64, shortcut.window_id);
|
|
605
|
-
},
|
|
606
|
-
.native_command => |command| {
|
|
607
|
-
try cursor.writeEnum(EventTag.native_command);
|
|
608
|
-
try cursor.writeStr(command.name);
|
|
609
|
-
try cursor.writeInt(u64, command.window_id);
|
|
610
|
-
try cursor.writeStr(command.view_label);
|
|
611
|
-
},
|
|
612
|
-
.menu_command => |command| {
|
|
613
|
-
try cursor.writeEnum(EventTag.menu_command);
|
|
614
|
-
try cursor.writeStr(command.name);
|
|
615
|
-
try cursor.writeInt(u64, command.window_id);
|
|
616
|
-
},
|
|
617
|
-
.tray_command => |command| {
|
|
618
|
-
try cursor.writeEnum(EventTag.tray_command);
|
|
619
|
-
try cursor.writeStr(command.name);
|
|
620
|
-
try cursor.writeInt(u64, command.window_id);
|
|
621
|
-
try cursor.writeInt(u32, command.status_item_id);
|
|
622
|
-
},
|
|
623
|
-
.notification_command => |command| {
|
|
624
|
-
try cursor.writeEnum(EventTag.notification_command);
|
|
625
|
-
try cursor.writeStr(command.name);
|
|
626
|
-
try cursor.writeInt(u64, command.window_id);
|
|
627
|
-
},
|
|
628
|
-
.timer => |timer| {
|
|
629
|
-
try cursor.writeEnum(EventTag.timer);
|
|
630
|
-
try cursor.writeInt(u64, timer.id);
|
|
631
|
-
try cursor.writeInt(u64, timer.timestamp_ns);
|
|
632
|
-
},
|
|
633
|
-
// Recorded for stream fidelity; inert on replay (the journaled
|
|
634
|
-
// audio EFFECT records are the Msg source — `takeAudioMsg`
|
|
635
|
-
// ignores platform audio events under replay).
|
|
636
|
-
.audio => |audio| {
|
|
637
|
-
try cursor.writeEnum(EventTag.audio);
|
|
638
|
-
try cursor.writeEnum(audio.kind);
|
|
639
|
-
try cursor.writeInt(u64, audio.position_ms);
|
|
640
|
-
try cursor.writeInt(u64, audio.duration_ms);
|
|
641
|
-
try cursor.writeBool(audio.playing);
|
|
642
|
-
try cursor.writeBool(audio.buffering);
|
|
643
|
-
try cursor.writeBytes(&audio.bands);
|
|
644
|
-
},
|
|
645
|
-
// Recorded for stream fidelity like `.audio`. On replay the
|
|
646
|
-
// journaled video EFFECT records are the Msg source; the
|
|
647
|
-
// platform events steer only the channel MIRRORS (the house
|
|
648
|
-
// chrome's render state for handler-less playbacks), gated by
|
|
649
|
-
// the load token exactly as live (`Effects.takeVideoMsg`).
|
|
650
|
-
.video => |video| {
|
|
651
|
-
try cursor.writeEnum(EventTag.video);
|
|
652
|
-
try cursor.writeEnum(video.kind);
|
|
653
|
-
try cursor.writeInt(u64, video.token);
|
|
654
|
-
try cursor.writeInt(u64, video.position_ms);
|
|
655
|
-
try cursor.writeInt(u64, video.duration_ms);
|
|
656
|
-
try cursor.writeBool(video.playing);
|
|
657
|
-
try cursor.writeBool(video.buffering);
|
|
658
|
-
try cursor.writeInt(u64, video.width);
|
|
659
|
-
try cursor.writeInt(u64, video.height);
|
|
660
|
-
},
|
|
661
|
-
.files_dropped => |drop| {
|
|
662
|
-
try cursor.writeEnum(EventTag.files_dropped);
|
|
663
|
-
try cursor.writeInt(u64, drop.window_id);
|
|
664
|
-
try cursor.writeStr(drop.view_label);
|
|
665
|
-
try cursor.writeBool(drop.point != null);
|
|
666
|
-
if (drop.point) |point| {
|
|
667
|
-
try cursor.writeF32(point.x);
|
|
668
|
-
try cursor.writeF32(point.y);
|
|
669
|
-
}
|
|
670
|
-
if (drop.paths.len > max_session_drop_paths) return error.JournalRecordOverBudget;
|
|
671
|
-
try cursor.writeInt(u16, @intCast(drop.paths.len));
|
|
672
|
-
for (drop.paths) |path| try cursor.writeStr(path);
|
|
673
|
-
},
|
|
674
|
-
// This arm journals a deliberate SUBSET of the frame event (the
|
|
675
|
-
// fields dispatch semantics depend on — see the fn doc). The
|
|
676
|
-
// subset is stated by hand in `formatLayoutDescription`, so
|
|
677
|
-
// journaling another field here means adding it to that line in
|
|
678
|
-
// the same change.
|
|
679
|
-
.gpu_surface_frame => |frame| {
|
|
680
|
-
try cursor.writeEnum(EventTag.gpu_surface_frame);
|
|
681
|
-
try cursor.writeInt(u64, frame.window_id);
|
|
682
|
-
try cursor.writeStr(frame.label);
|
|
683
|
-
try cursor.writeF32(frame.size.width);
|
|
684
|
-
try cursor.writeF32(frame.size.height);
|
|
685
|
-
try cursor.writeF32(frame.scale_factor);
|
|
686
|
-
try cursor.writeInt(u64, frame.frame_index);
|
|
687
|
-
try cursor.writeInt(u64, frame.timestamp_ns);
|
|
688
|
-
try cursor.writeInt(u64, frame.frame_interval_ns);
|
|
689
|
-
try cursor.writeInt(u64, frame.input_timestamp_ns);
|
|
690
|
-
try cursor.writeBool(frame.canvas_frame_full_repaint);
|
|
691
|
-
},
|
|
692
|
-
.gpu_surface_resized => |resize| {
|
|
693
|
-
try cursor.writeEnum(EventTag.gpu_surface_resized);
|
|
694
|
-
try cursor.writeInt(u64, resize.window_id);
|
|
695
|
-
try cursor.writeStr(resize.label);
|
|
696
|
-
try writeRect(&cursor, resize.frame);
|
|
697
|
-
try cursor.writeF32(resize.scale_factor);
|
|
698
|
-
},
|
|
699
|
-
.gpu_surface_input => |input| {
|
|
700
|
-
try cursor.writeEnum(EventTag.gpu_surface_input);
|
|
701
|
-
try cursor.writeInt(u64, input.window_id);
|
|
702
|
-
try cursor.writeStr(input.label);
|
|
703
|
-
try cursor.writeEnum(input.kind);
|
|
704
|
-
try cursor.writeInt(u64, input.timestamp_ns);
|
|
705
|
-
try cursor.writeInt(u64, input.pointer_id);
|
|
706
|
-
try cursor.writeF32(input.x);
|
|
707
|
-
try cursor.writeF32(input.y);
|
|
708
|
-
try cursor.writeInt(i32, input.button);
|
|
709
|
-
try cursor.writeF32(input.pressure);
|
|
710
|
-
try cursor.writeF32(input.delta_x);
|
|
711
|
-
try cursor.writeF32(input.delta_y);
|
|
712
|
-
try cursor.writeStr(input.key);
|
|
713
|
-
try cursor.writeStr(input.text);
|
|
714
|
-
try cursor.writeBool(input.composition_cursor != null);
|
|
715
|
-
if (input.composition_cursor) |composition_cursor| {
|
|
716
|
-
try cursor.writeInt(u64, @intCast(composition_cursor));
|
|
717
|
-
}
|
|
718
|
-
try writeModifiers(&cursor, input.modifiers);
|
|
719
|
-
// v5: the pinch magnification delta (0 on non-pinch kinds).
|
|
720
|
-
try cursor.writeF32(input.scale);
|
|
721
|
-
},
|
|
722
|
-
.gpu_surface_scroll_driver => |driver| {
|
|
723
|
-
try cursor.writeEnum(EventTag.gpu_surface_scroll_driver);
|
|
724
|
-
try cursor.writeInt(u64, driver.window_id);
|
|
725
|
-
try cursor.writeStr(driver.label);
|
|
726
|
-
try cursor.writeInt(u64, driver.driver_id);
|
|
727
|
-
try cursor.writeF32(driver.offset_x);
|
|
728
|
-
try cursor.writeF32(driver.offset_y);
|
|
729
|
-
try cursor.writeInt(u64, driver.timestamp_ns);
|
|
730
|
-
},
|
|
731
|
-
.context_menu_action => |action| {
|
|
732
|
-
try cursor.writeEnum(EventTag.context_menu_action);
|
|
733
|
-
try cursor.writeInt(u64, action.window_id);
|
|
734
|
-
try cursor.writeStr(action.view_label);
|
|
735
|
-
try cursor.writeInt(u64, action.token);
|
|
736
|
-
try cursor.writeInt(u32, action.item_id);
|
|
737
|
-
},
|
|
738
|
-
.widget_accessibility_action => |action| {
|
|
739
|
-
try cursor.writeEnum(EventTag.widget_accessibility_action);
|
|
740
|
-
try cursor.writeInt(u64, action.window_id);
|
|
741
|
-
try cursor.writeStr(action.label);
|
|
742
|
-
try cursor.writeInt(u64, action.id);
|
|
743
|
-
// The verb rides i32, not the u8 every other enum takes — a
|
|
744
|
-
// hand-written width stated in `formatLayoutDescription`.
|
|
745
|
-
try cursor.writeInt(i32, @intFromEnum(action.action));
|
|
746
|
-
try cursor.writeStr(action.text);
|
|
747
|
-
try cursor.writeBool(action.selection != null);
|
|
748
|
-
if (action.selection) |selection| {
|
|
749
|
-
try cursor.writeInt(u64, @intCast(selection.start));
|
|
750
|
-
try cursor.writeInt(u64, @intCast(selection.end));
|
|
751
|
-
}
|
|
752
|
-
},
|
|
753
|
-
}
|
|
754
|
-
return buffer[0..cursor.len];
|
|
420
|
+
pub fn encodeEffectWithPolicy(policy: journal_policy.Policy, value: EffectResultRecord, buffer: []u8) JournalError![]const u8 {
|
|
421
|
+
return codec.encodeEffect(policy, value, buffer);
|
|
755
422
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
/// `storage` for path lists) — valid until the caller's buffers move.
|
|
759
|
-
pub fn decodeEvent(bytes: []const u8, storage: *EventDecodeStorage) JournalError!platform.Event {
|
|
760
|
-
var cursor = ReadCursor{ .bytes = bytes };
|
|
761
|
-
const tag = try cursor.readEnum(EventTag);
|
|
762
|
-
const event: platform.Event = switch (tag) {
|
|
763
|
-
.app_start => .app_start,
|
|
764
|
-
.app_activated => .app_activated,
|
|
765
|
-
.app_deactivated => .app_deactivated,
|
|
766
|
-
.frame_requested => .frame_requested,
|
|
767
|
-
.app_shutdown => .app_shutdown,
|
|
768
|
-
.wake => .wake,
|
|
769
|
-
.appearance_changed => .{ .appearance_changed = .{
|
|
770
|
-
.color_scheme = try cursor.readEnum(platform.ColorScheme),
|
|
771
|
-
.reduce_motion = try cursor.readBool(),
|
|
772
|
-
.high_contrast = try cursor.readBool(),
|
|
773
|
-
} },
|
|
774
|
-
.surface_resized => blk: {
|
|
775
|
-
const id = try cursor.readInt(u64);
|
|
776
|
-
const width = try cursor.readF32();
|
|
777
|
-
const height = try cursor.readF32();
|
|
778
|
-
const scale_factor = try cursor.readF32();
|
|
779
|
-
const safe_area = try readInsets(&cursor);
|
|
780
|
-
const keyboard = try readInsets(&cursor);
|
|
781
|
-
break :blk .{ .surface_resized = .{
|
|
782
|
-
.id = id,
|
|
783
|
-
.size = geometry.SizeF.init(width, height),
|
|
784
|
-
.scale_factor = scale_factor,
|
|
785
|
-
.safe_area_insets = safe_area,
|
|
786
|
-
.keyboard_insets = keyboard,
|
|
787
|
-
} };
|
|
788
|
-
},
|
|
789
|
-
.window_frame_changed => blk: {
|
|
790
|
-
const id = try cursor.readInt(u64);
|
|
791
|
-
const label = try cursor.readStr();
|
|
792
|
-
const title = try cursor.readStr();
|
|
793
|
-
const frame = try readRect(&cursor);
|
|
794
|
-
const scale_factor = try cursor.readF32();
|
|
795
|
-
break :blk .{ .window_frame_changed = .{
|
|
796
|
-
.id = id,
|
|
797
|
-
.label = label,
|
|
798
|
-
.title = title,
|
|
799
|
-
.frame = frame,
|
|
800
|
-
.scale_factor = scale_factor,
|
|
801
|
-
.open = try cursor.readBool(),
|
|
802
|
-
.focused = try cursor.readBool(),
|
|
803
|
-
.maximized = try cursor.readBool(),
|
|
804
|
-
.fullscreen = try cursor.readBool(),
|
|
805
|
-
.hidden = try cursor.readBool(),
|
|
806
|
-
} };
|
|
807
|
-
},
|
|
808
|
-
.window_focused => .{ .window_focused = try cursor.readInt(u64) },
|
|
809
|
-
.view_focused => .{ .view_focused = .{
|
|
810
|
-
.window_id = try cursor.readInt(u64),
|
|
811
|
-
.label = try cursor.readStr(),
|
|
812
|
-
} },
|
|
813
|
-
.bridge_message => blk: {
|
|
814
|
-
const message_bytes = try cursor.readStr();
|
|
815
|
-
const origin = try cursor.readStr();
|
|
816
|
-
const window_id = try cursor.readInt(u64);
|
|
817
|
-
const webview_label = try cursor.readStr();
|
|
818
|
-
break :blk .{ .bridge_message = .{
|
|
819
|
-
.bytes = message_bytes,
|
|
820
|
-
.origin = origin,
|
|
821
|
-
.window_id = window_id,
|
|
822
|
-
.webview_label = webview_label,
|
|
823
|
-
} };
|
|
824
|
-
},
|
|
825
|
-
.tray_action => .{ .tray_action = .{
|
|
826
|
-
.status_item_id = try cursor.readInt(u32),
|
|
827
|
-
.item_id = try cursor.readInt(u32),
|
|
828
|
-
} },
|
|
829
|
-
.shortcut => blk: {
|
|
830
|
-
const id = try cursor.readStr();
|
|
831
|
-
const key = try cursor.readStr();
|
|
832
|
-
const modifiers = try readModifiers(&cursor);
|
|
833
|
-
break :blk .{ .shortcut = .{
|
|
834
|
-
.id = id,
|
|
835
|
-
.key = key,
|
|
836
|
-
.modifiers = modifiers,
|
|
837
|
-
.window_id = try cursor.readInt(u64),
|
|
838
|
-
} };
|
|
839
|
-
},
|
|
840
|
-
.native_command => blk: {
|
|
841
|
-
const name = try cursor.readStr();
|
|
842
|
-
const window_id = try cursor.readInt(u64);
|
|
843
|
-
break :blk .{ .native_command = .{
|
|
844
|
-
.name = name,
|
|
845
|
-
.window_id = window_id,
|
|
846
|
-
.view_label = try cursor.readStr(),
|
|
847
|
-
} };
|
|
848
|
-
},
|
|
849
|
-
.menu_command => blk: {
|
|
850
|
-
const name = try cursor.readStr();
|
|
851
|
-
break :blk .{ .menu_command = .{
|
|
852
|
-
.name = name,
|
|
853
|
-
.window_id = try cursor.readInt(u64),
|
|
854
|
-
} };
|
|
855
|
-
},
|
|
856
|
-
.tray_command => blk: {
|
|
857
|
-
const name = try cursor.readStr();
|
|
858
|
-
break :blk .{ .tray_command = .{
|
|
859
|
-
.name = name,
|
|
860
|
-
.window_id = try cursor.readInt(u64),
|
|
861
|
-
.status_item_id = try cursor.readInt(u32),
|
|
862
|
-
} };
|
|
863
|
-
},
|
|
864
|
-
.notification_command => blk: {
|
|
865
|
-
const name = try cursor.readStr();
|
|
866
|
-
break :blk .{ .notification_command = .{
|
|
867
|
-
.name = name,
|
|
868
|
-
.window_id = try cursor.readInt(u64),
|
|
869
|
-
} };
|
|
870
|
-
},
|
|
871
|
-
.timer => blk: {
|
|
872
|
-
const id = try cursor.readInt(u64);
|
|
873
|
-
break :blk .{ .timer = .{
|
|
874
|
-
.id = id,
|
|
875
|
-
.timestamp_ns = try cursor.readInt(u64),
|
|
876
|
-
} };
|
|
877
|
-
},
|
|
878
|
-
.audio => blk: {
|
|
879
|
-
const kind = try cursor.readEnum(platform.AudioEventKind);
|
|
880
|
-
var decoded: platform.AudioEvent = .{
|
|
881
|
-
.kind = kind,
|
|
882
|
-
.position_ms = try cursor.readInt(u64),
|
|
883
|
-
.duration_ms = try cursor.readInt(u64),
|
|
884
|
-
.playing = try cursor.readBool(),
|
|
885
|
-
.buffering = try cursor.readBool(),
|
|
886
|
-
};
|
|
887
|
-
@memcpy(&decoded.bands, try cursor.readBytes(decoded.bands.len));
|
|
888
|
-
break :blk .{ .audio = decoded };
|
|
889
|
-
},
|
|
890
|
-
.video => blk: {
|
|
891
|
-
const kind = try cursor.readEnum(platform.VideoEventKind);
|
|
892
|
-
break :blk .{ .video = .{
|
|
893
|
-
.kind = kind,
|
|
894
|
-
.token = try cursor.readInt(u64),
|
|
895
|
-
.position_ms = try cursor.readInt(u64),
|
|
896
|
-
.duration_ms = try cursor.readInt(u64),
|
|
897
|
-
.playing = try cursor.readBool(),
|
|
898
|
-
.buffering = try cursor.readBool(),
|
|
899
|
-
.width = try cursor.readInt(u64),
|
|
900
|
-
.height = try cursor.readInt(u64),
|
|
901
|
-
} };
|
|
902
|
-
},
|
|
903
|
-
.files_dropped => blk: {
|
|
904
|
-
const window_id = try cursor.readInt(u64);
|
|
905
|
-
const view_label = try cursor.readStr();
|
|
906
|
-
var point: ?geometry.PointF = null;
|
|
907
|
-
if (try cursor.readBool()) {
|
|
908
|
-
const x = try cursor.readF32();
|
|
909
|
-
const y = try cursor.readF32();
|
|
910
|
-
point = geometry.PointF.init(x, y);
|
|
911
|
-
}
|
|
912
|
-
const count = try cursor.readInt(u16);
|
|
913
|
-
if (count > max_session_drop_paths) return error.JournalCorrupt;
|
|
914
|
-
for (0..count) |index| {
|
|
915
|
-
storage.drop_paths[index] = try cursor.readStr();
|
|
916
|
-
}
|
|
917
|
-
break :blk .{ .files_dropped = .{
|
|
918
|
-
.window_id = window_id,
|
|
919
|
-
.view_label = view_label,
|
|
920
|
-
.point = point,
|
|
921
|
-
.paths = storage.drop_paths[0..count],
|
|
922
|
-
} };
|
|
923
|
-
},
|
|
924
|
-
.gpu_surface_frame => blk: {
|
|
925
|
-
const window_id = try cursor.readInt(u64);
|
|
926
|
-
const label = try cursor.readStr();
|
|
927
|
-
const width = try cursor.readF32();
|
|
928
|
-
const height = try cursor.readF32();
|
|
929
|
-
break :blk .{ .gpu_surface_frame = .{
|
|
930
|
-
.window_id = window_id,
|
|
931
|
-
.label = label,
|
|
932
|
-
.size = geometry.SizeF.init(width, height),
|
|
933
|
-
.scale_factor = try cursor.readF32(),
|
|
934
|
-
.frame_index = try cursor.readInt(u64),
|
|
935
|
-
.timestamp_ns = try cursor.readInt(u64),
|
|
936
|
-
.frame_interval_ns = try cursor.readInt(u64),
|
|
937
|
-
.input_timestamp_ns = try cursor.readInt(u64),
|
|
938
|
-
.canvas_frame_full_repaint = try cursor.readBool(),
|
|
939
|
-
} };
|
|
940
|
-
},
|
|
941
|
-
.gpu_surface_resized => blk: {
|
|
942
|
-
const window_id = try cursor.readInt(u64);
|
|
943
|
-
const label = try cursor.readStr();
|
|
944
|
-
const frame = try readRect(&cursor);
|
|
945
|
-
break :blk .{ .gpu_surface_resized = .{
|
|
946
|
-
.window_id = window_id,
|
|
947
|
-
.label = label,
|
|
948
|
-
.frame = frame,
|
|
949
|
-
.scale_factor = try cursor.readF32(),
|
|
950
|
-
} };
|
|
951
|
-
},
|
|
952
|
-
.gpu_surface_input => blk: {
|
|
953
|
-
const window_id = try cursor.readInt(u64);
|
|
954
|
-
const label = try cursor.readStr();
|
|
955
|
-
const kind = try cursor.readEnum(platform.GpuSurfaceInputKind);
|
|
956
|
-
const timestamp_ns = try cursor.readInt(u64);
|
|
957
|
-
const pointer_id = try cursor.readInt(u64);
|
|
958
|
-
const x = try cursor.readF32();
|
|
959
|
-
const y = try cursor.readF32();
|
|
960
|
-
const button = try cursor.readInt(i32);
|
|
961
|
-
const pressure = try cursor.readF32();
|
|
962
|
-
const delta_x = try cursor.readF32();
|
|
963
|
-
const delta_y = try cursor.readF32();
|
|
964
|
-
const key = try cursor.readStr();
|
|
965
|
-
const text = try cursor.readStr();
|
|
966
|
-
var composition_cursor: ?usize = null;
|
|
967
|
-
if (try cursor.readBool()) {
|
|
968
|
-
composition_cursor = std.math.cast(usize, try cursor.readInt(u64)) orelse return error.JournalCorrupt;
|
|
969
|
-
}
|
|
970
|
-
break :blk .{
|
|
971
|
-
.gpu_surface_input = .{
|
|
972
|
-
.window_id = window_id,
|
|
973
|
-
.label = label,
|
|
974
|
-
.kind = kind,
|
|
975
|
-
.timestamp_ns = timestamp_ns,
|
|
976
|
-
.pointer_id = pointer_id,
|
|
977
|
-
.x = x,
|
|
978
|
-
.y = y,
|
|
979
|
-
.button = button,
|
|
980
|
-
.pressure = pressure,
|
|
981
|
-
.delta_x = delta_x,
|
|
982
|
-
.delta_y = delta_y,
|
|
983
|
-
.key = key,
|
|
984
|
-
.text = text,
|
|
985
|
-
.composition_cursor = composition_cursor,
|
|
986
|
-
.modifiers = try readModifiers(&cursor),
|
|
987
|
-
// v5: the pinch magnification delta (0 on non-pinch kinds).
|
|
988
|
-
.scale = try cursor.readF32(),
|
|
989
|
-
},
|
|
990
|
-
};
|
|
991
|
-
},
|
|
992
|
-
.gpu_surface_scroll_driver => blk: {
|
|
993
|
-
const window_id = try cursor.readInt(u64);
|
|
994
|
-
const label = try cursor.readStr();
|
|
995
|
-
const driver_id = try cursor.readInt(u64);
|
|
996
|
-
const offset_x = try cursor.readF32();
|
|
997
|
-
const offset_y = try cursor.readF32();
|
|
998
|
-
break :blk .{ .gpu_surface_scroll_driver = .{
|
|
999
|
-
.window_id = window_id,
|
|
1000
|
-
.label = label,
|
|
1001
|
-
.driver_id = driver_id,
|
|
1002
|
-
.offset_x = offset_x,
|
|
1003
|
-
.offset_y = offset_y,
|
|
1004
|
-
.timestamp_ns = try cursor.readInt(u64),
|
|
1005
|
-
} };
|
|
1006
|
-
},
|
|
1007
|
-
.context_menu_action => blk: {
|
|
1008
|
-
const window_id = try cursor.readInt(u64);
|
|
1009
|
-
const view_label = try cursor.readStr();
|
|
1010
|
-
const token = try cursor.readInt(u64);
|
|
1011
|
-
break :blk .{ .context_menu_action = .{
|
|
1012
|
-
.window_id = window_id,
|
|
1013
|
-
.view_label = view_label,
|
|
1014
|
-
.token = token,
|
|
1015
|
-
.item_id = try cursor.readInt(u32),
|
|
1016
|
-
} };
|
|
1017
|
-
},
|
|
1018
|
-
.widget_accessibility_action => blk: {
|
|
1019
|
-
const window_id = try cursor.readInt(u64);
|
|
1020
|
-
const label = try cursor.readStr();
|
|
1021
|
-
const id = try cursor.readInt(u64);
|
|
1022
|
-
const action = std.enums.fromInt(platform.WidgetAccessibilityActionKind, try cursor.readInt(i32)) orelse return error.JournalCorrupt;
|
|
1023
|
-
const text = try cursor.readStr();
|
|
1024
|
-
var selection: ?platform.WidgetAccessibilityTextRange = null;
|
|
1025
|
-
if (try cursor.readBool()) {
|
|
1026
|
-
const start = std.math.cast(usize, try cursor.readInt(u64)) orelse return error.JournalCorrupt;
|
|
1027
|
-
const end = std.math.cast(usize, try cursor.readInt(u64)) orelse return error.JournalCorrupt;
|
|
1028
|
-
selection = .{ .start = start, .end = end };
|
|
1029
|
-
}
|
|
1030
|
-
break :blk .{ .widget_accessibility_action = .{
|
|
1031
|
-
.window_id = window_id,
|
|
1032
|
-
.label = label,
|
|
1033
|
-
.id = id,
|
|
1034
|
-
.action = action,
|
|
1035
|
-
.text = text,
|
|
1036
|
-
.selection = selection,
|
|
1037
|
-
} };
|
|
1038
|
-
},
|
|
1039
|
-
};
|
|
1040
|
-
if (!cursor.done()) return error.JournalCorrupt;
|
|
1041
|
-
return event;
|
|
423
|
+
pub fn decodeEffect(bytes: []const u8) JournalError!EffectResultRecord {
|
|
424
|
+
return decodeEffectWithPolicy(null, bytes);
|
|
1042
425
|
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
pub fn encodeEffect(record: EffectResultRecord, buffer: []u8) JournalError![]const u8 {
|
|
1047
|
-
var cursor = WriteCursor{ .buffer = buffer };
|
|
1048
|
-
try cursor.writeEnum(record.kind);
|
|
1049
|
-
try cursor.writeInt(u64, record.key);
|
|
1050
|
-
try cursor.writeStr(record.payload);
|
|
1051
|
-
try cursor.writeStr(record.stderr_tail);
|
|
1052
|
-
try cursor.writeBool(record.truncated);
|
|
1053
|
-
try cursor.writeInt(u32, record.dropped);
|
|
1054
|
-
try cursor.writeInt(i32, record.code);
|
|
1055
|
-
try cursor.writeEnum(record.exit_reason);
|
|
1056
|
-
try cursor.writeBool(record.output_truncated);
|
|
1057
|
-
try cursor.writeBool(record.stderr_truncated);
|
|
1058
|
-
try cursor.writeInt(u16, record.status);
|
|
1059
|
-
try cursor.writeEnum(record.fetch_outcome);
|
|
1060
|
-
try cursor.writeEnum(record.file_op);
|
|
1061
|
-
try cursor.writeEnum(record.file_event);
|
|
1062
|
-
try cursor.writeEnum(record.file_outcome);
|
|
1063
|
-
try cursor.writeInt(u64, record.file_total);
|
|
1064
|
-
try cursor.writeInt(i64, record.file_mtime_ms);
|
|
1065
|
-
try cursor.writeBool(record.file_exists);
|
|
1066
|
-
try cursor.writeBool(record.file_rejected_admission);
|
|
1067
|
-
try cursor.writeEnum(record.clipboard_op);
|
|
1068
|
-
try cursor.writeEnum(record.clipboard_outcome);
|
|
1069
|
-
try cursor.writeInt(u64, record.timer_timestamp_ns);
|
|
1070
|
-
try cursor.writeEnum(record.timer_outcome);
|
|
1071
|
-
try cursor.writeInt(i64, record.clock_wall_ms);
|
|
1072
|
-
try cursor.writeEnum(record.audio_kind);
|
|
1073
|
-
try cursor.writeInt(u64, record.audio_position_ms);
|
|
1074
|
-
try cursor.writeInt(u64, record.audio_duration_ms);
|
|
1075
|
-
try cursor.writeBool(record.audio_playing);
|
|
1076
|
-
try cursor.writeBool(record.audio_buffering);
|
|
1077
|
-
try cursor.writeBytes(&record.file_blob_hash);
|
|
1078
|
-
try cursor.writeInt(u64, record.file_blob_len);
|
|
1079
|
-
try cursor.writeBytes(&record.audio_bands);
|
|
1080
|
-
// v7: image terminals — outcome, decoded dimensions, and the blob
|
|
1081
|
-
// store content address of the journaled source bytes.
|
|
1082
|
-
try cursor.writeEnum(record.image_outcome);
|
|
1083
|
-
try cursor.writeInt(u64, record.image_width);
|
|
1084
|
-
try cursor.writeInt(u64, record.image_height);
|
|
1085
|
-
try cursor.writeBytes(&record.image_blob_hash);
|
|
1086
|
-
try cursor.writeInt(u64, record.image_blob_len);
|
|
1087
|
-
// v8: channel events — the event kind and the occupancy's
|
|
1088
|
-
// cumulative drop total (post bytes ride `payload` inline;
|
|
1089
|
-
// dropped_pending rides the shared `dropped` field).
|
|
1090
|
-
try cursor.writeEnum(record.channel_kind);
|
|
1091
|
-
try cursor.writeInt(u32, record.channel_dropped_total);
|
|
1092
|
-
// Video terminals — the delivered event, verbatim (fingerprint
|
|
1093
|
-
// era: these fields move the format identity through reflection).
|
|
1094
|
-
try cursor.writeEnum(record.video_kind);
|
|
1095
|
-
try cursor.writeInt(u64, record.video_position_ms);
|
|
1096
|
-
try cursor.writeInt(u64, record.video_duration_ms);
|
|
1097
|
-
try cursor.writeBool(record.video_playing);
|
|
1098
|
-
try cursor.writeBool(record.video_buffering);
|
|
1099
|
-
try cursor.writeInt(u64, record.video_width);
|
|
1100
|
-
try cursor.writeInt(u64, record.video_height);
|
|
1101
|
-
// The producing load's identity, how replay routes the record
|
|
1102
|
-
// (`EffectResultRecord.video_token`).
|
|
1103
|
-
try cursor.writeInt(u64, record.video_token);
|
|
1104
|
-
// `.video_load` records: the recording host's cascade resolution.
|
|
1105
|
-
try cursor.writeEnum(record.video_source);
|
|
1106
|
-
// `.video` records: whether the delivery dispatched a Msg.
|
|
1107
|
-
try cursor.writeBool(record.video_handled);
|
|
1108
|
-
// Pty events — the event kind, the terminating signal and refused
|
|
1109
|
-
// writes, and the blob store content address of a journaled output
|
|
1110
|
-
// batch (exit code and reason ride the shared fields).
|
|
1111
|
-
try cursor.writeEnum(record.pty_kind);
|
|
1112
|
-
try cursor.writeInt(i32, record.pty_signal);
|
|
1113
|
-
try cursor.writeInt(u32, record.pty_dropped_writes);
|
|
1114
|
-
try cursor.writeBytes(&record.pty_blob_hash);
|
|
1115
|
-
try cursor.writeInt(u64, record.pty_blob_len);
|
|
1116
|
-
// Model restore is the first kind-local suffix. Keeping it conditional
|
|
1117
|
-
// preserves every established effect record's byte layout (tests and
|
|
1118
|
-
// tooling deliberately patch those records at known offsets).
|
|
1119
|
-
if (record.kind == .persist) {
|
|
1120
|
-
try cursor.writeEnum(record.persist_outcome);
|
|
1121
|
-
try cursor.writeBytes(&record.persist_blob_hash);
|
|
1122
|
-
try cursor.writeInt(u64, record.persist_blob_len);
|
|
1123
|
-
}
|
|
1124
|
-
if (record.kind == .db) {
|
|
1125
|
-
try cursor.writeBytes(&record.db_blob_hash);
|
|
1126
|
-
try cursor.writeInt(u64, record.db_blob_len);
|
|
1127
|
-
}
|
|
1128
|
-
if (record.kind == .credentials) {
|
|
1129
|
-
try cursor.writeEnum(record.credentials_operation);
|
|
1130
|
-
try cursor.writeEnum(record.credentials_outcome);
|
|
1131
|
-
try cursor.writeInt(u64, record.credentials_secret_len);
|
|
1132
|
-
try cursor.writeBytes(&record.credentials_salt);
|
|
1133
|
-
try cursor.writeBytes(&record.credentials_digest);
|
|
1134
|
-
}
|
|
1135
|
-
return buffer[0..cursor.len];
|
|
426
|
+
pub fn decodeEffectWithPolicy(policy: journal_policy.Policy, bytes: []const u8) JournalError!EffectResultRecord {
|
|
427
|
+
return codec.decodeEffect(policy, bytes);
|
|
1136
428
|
}
|
|
1137
429
|
|
|
1138
|
-
pub fn
|
|
1139
|
-
|
|
1140
|
-
var record: EffectResultRecord = .{
|
|
1141
|
-
.kind = try cursor.readEnum(runtime_effects.EffectResultKind),
|
|
1142
|
-
.key = try cursor.readInt(u64),
|
|
1143
|
-
.payload = try cursor.readStr(),
|
|
1144
|
-
.stderr_tail = try cursor.readStr(),
|
|
1145
|
-
.truncated = try cursor.readBool(),
|
|
1146
|
-
.dropped = try cursor.readInt(u32),
|
|
1147
|
-
.code = try cursor.readInt(i32),
|
|
1148
|
-
.exit_reason = try cursor.readEnum(runtime_effects.EffectExitReason),
|
|
1149
|
-
.output_truncated = try cursor.readBool(),
|
|
1150
|
-
.stderr_truncated = try cursor.readBool(),
|
|
1151
|
-
.status = try cursor.readInt(u16),
|
|
1152
|
-
.fetch_outcome = try cursor.readEnum(runtime_effects.EffectFetchOutcome),
|
|
1153
|
-
.file_op = try cursor.readEnum(runtime_effects.EffectFileOp),
|
|
1154
|
-
.file_event = try cursor.readEnum(runtime_effects.EffectFileEvent),
|
|
1155
|
-
.file_outcome = try cursor.readEnum(runtime_effects.EffectFileOutcome),
|
|
1156
|
-
.file_total = try cursor.readInt(u64),
|
|
1157
|
-
.file_mtime_ms = try cursor.readInt(i64),
|
|
1158
|
-
.file_exists = try cursor.readBool(),
|
|
1159
|
-
.file_rejected_admission = try cursor.readBool(),
|
|
1160
|
-
.clipboard_op = try cursor.readEnum(runtime_effects.EffectClipboardOp),
|
|
1161
|
-
.clipboard_outcome = try cursor.readEnum(runtime_effects.EffectClipboardOutcome),
|
|
1162
|
-
.timer_timestamp_ns = try cursor.readInt(u64),
|
|
1163
|
-
.timer_outcome = try cursor.readEnum(runtime_effects.EffectTimerOutcome),
|
|
1164
|
-
.clock_wall_ms = try cursor.readInt(i64),
|
|
1165
|
-
.audio_kind = try cursor.readEnum(runtime_effects.EffectAudioEventKind),
|
|
1166
|
-
.audio_position_ms = try cursor.readInt(u64),
|
|
1167
|
-
.audio_duration_ms = try cursor.readInt(u64),
|
|
1168
|
-
.audio_playing = try cursor.readBool(),
|
|
1169
|
-
.audio_buffering = try cursor.readBool(),
|
|
1170
|
-
};
|
|
1171
|
-
@memcpy(&record.file_blob_hash, try cursor.readBytes(record.file_blob_hash.len));
|
|
1172
|
-
record.file_blob_len = try cursor.readInt(u64);
|
|
1173
|
-
@memcpy(&record.audio_bands, try cursor.readBytes(record.audio_bands.len));
|
|
1174
|
-
// v7: image terminals.
|
|
1175
|
-
record.image_outcome = try cursor.readEnum(runtime_effects.EffectImageOutcome);
|
|
1176
|
-
record.image_width = try cursor.readInt(u64);
|
|
1177
|
-
record.image_height = try cursor.readInt(u64);
|
|
1178
|
-
@memcpy(&record.image_blob_hash, try cursor.readBytes(record.image_blob_hash.len));
|
|
1179
|
-
record.image_blob_len = try cursor.readInt(u64);
|
|
1180
|
-
// v8: channel events.
|
|
1181
|
-
record.channel_kind = try cursor.readEnum(runtime_effects.EffectChannelEventKind);
|
|
1182
|
-
record.channel_dropped_total = try cursor.readInt(u32);
|
|
1183
|
-
// Video terminals.
|
|
1184
|
-
record.video_kind = try cursor.readEnum(runtime_effects.EffectVideoEventKind);
|
|
1185
|
-
record.video_position_ms = try cursor.readInt(u64);
|
|
1186
|
-
record.video_duration_ms = try cursor.readInt(u64);
|
|
1187
|
-
record.video_playing = try cursor.readBool();
|
|
1188
|
-
record.video_buffering = try cursor.readBool();
|
|
1189
|
-
record.video_width = try cursor.readInt(u64);
|
|
1190
|
-
record.video_height = try cursor.readInt(u64);
|
|
1191
|
-
record.video_token = try cursor.readInt(u64);
|
|
1192
|
-
record.video_source = try cursor.readEnum(runtime_effects.EffectVideoSource);
|
|
1193
|
-
record.video_handled = try cursor.readBool();
|
|
1194
|
-
// Pty events.
|
|
1195
|
-
record.pty_kind = try cursor.readEnum(runtime_effects.EffectPtyEventKind);
|
|
1196
|
-
record.pty_signal = try cursor.readInt(i32);
|
|
1197
|
-
record.pty_dropped_writes = try cursor.readInt(u32);
|
|
1198
|
-
@memcpy(&record.pty_blob_hash, try cursor.readBytes(record.pty_blob_hash.len));
|
|
1199
|
-
record.pty_blob_len = try cursor.readInt(u64);
|
|
1200
|
-
if (record.kind == .persist) {
|
|
1201
|
-
record.persist_outcome = try cursor.readEnum(runtime_effects.EffectPersistOutcome);
|
|
1202
|
-
@memcpy(&record.persist_blob_hash, try cursor.readBytes(record.persist_blob_hash.len));
|
|
1203
|
-
record.persist_blob_len = try cursor.readInt(u64);
|
|
1204
|
-
}
|
|
1205
|
-
if (record.kind == .db) {
|
|
1206
|
-
@memcpy(&record.db_blob_hash, try cursor.readBytes(record.db_blob_hash.len));
|
|
1207
|
-
record.db_blob_len = try cursor.readInt(u64);
|
|
1208
|
-
}
|
|
1209
|
-
if (record.kind == .credentials) {
|
|
1210
|
-
record.credentials_operation = try cursor.readEnum(runtime_effects.EffectCredentialsOperation);
|
|
1211
|
-
record.credentials_outcome = try cursor.readEnum(runtime_effects.EffectCredentialsOutcome);
|
|
1212
|
-
record.credentials_secret_len = try cursor.readInt(u64);
|
|
1213
|
-
@memcpy(&record.credentials_salt, try cursor.readBytes(record.credentials_salt.len));
|
|
1214
|
-
@memcpy(&record.credentials_digest, try cursor.readBytes(record.credentials_digest.len));
|
|
1215
|
-
}
|
|
1216
|
-
if (!cursor.done()) return error.JournalCorrupt;
|
|
1217
|
-
return record;
|
|
430
|
+
pub fn encodeHeader(value: Header, buffer: []u8) JournalError![]const u8 {
|
|
431
|
+
return encodeHeaderWithPolicy(null, value, buffer);
|
|
1218
432
|
}
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
pub fn encodeHeader(header: Header, buffer: []u8) JournalError![]const u8 {
|
|
1223
|
-
var cursor = WriteCursor{ .buffer = buffer };
|
|
1224
|
-
try cursor.writeInt(u64, header.protocol_fingerprint);
|
|
1225
|
-
try cursor.writeStr(header.platform_name);
|
|
1226
|
-
try cursor.writeStr(header.app_name);
|
|
1227
|
-
try cursor.writeInt(i64, header.recorded_at_wall_ms);
|
|
1228
|
-
try cursor.writeF32(header.window_width);
|
|
1229
|
-
try cursor.writeF32(header.window_height);
|
|
1230
|
-
return buffer[0..cursor.len];
|
|
433
|
+
pub fn encodeHeaderWithPolicy(policy: journal_policy.Policy, value: Header, buffer: []u8) JournalError![]const u8 {
|
|
434
|
+
return codec.encodeHeader(policy, value, buffer);
|
|
1231
435
|
}
|
|
1232
|
-
|
|
1233
436
|
pub fn decodeHeader(bytes: []const u8) JournalError!Header {
|
|
1234
|
-
|
|
1235
|
-
const header: Header = .{
|
|
1236
|
-
.protocol_fingerprint = try cursor.readInt(u64),
|
|
1237
|
-
.platform_name = try cursor.readStr(),
|
|
1238
|
-
.app_name = try cursor.readStr(),
|
|
1239
|
-
.recorded_at_wall_ms = try cursor.readInt(i64),
|
|
1240
|
-
.window_width = try cursor.readF32(),
|
|
1241
|
-
.window_height = try cursor.readF32(),
|
|
1242
|
-
};
|
|
1243
|
-
if (!cursor.done()) return error.JournalCorrupt;
|
|
1244
|
-
return header;
|
|
437
|
+
return decodeHeaderWithPolicy(null, bytes);
|
|
1245
438
|
}
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
var cursor = WriteCursor{ .buffer = buffer };
|
|
1249
|
-
try cursor.writeInt(u64, checkpoint.event_ordinal);
|
|
1250
|
-
try cursor.writeInt(u64, checkpoint.frame_index);
|
|
1251
|
-
try cursor.writeInt(u64, checkpoint.fingerprint);
|
|
1252
|
-
return buffer[0..cursor.len];
|
|
439
|
+
pub fn decodeHeaderWithPolicy(policy: journal_policy.Policy, bytes: []const u8) JournalError!Header {
|
|
440
|
+
return codec.decodeHeader(policy, bytes);
|
|
1253
441
|
}
|
|
1254
442
|
|
|
443
|
+
pub fn encodeCheckpoint(value: Checkpoint, buffer: []u8) JournalError![]const u8 {
|
|
444
|
+
return encodeCheckpointWithPolicy(null, value, buffer);
|
|
445
|
+
}
|
|
446
|
+
pub fn encodeCheckpointWithPolicy(policy: journal_policy.Policy, value: Checkpoint, buffer: []u8) JournalError![]const u8 {
|
|
447
|
+
return codec.encodeCheckpoint(policy, value, buffer);
|
|
448
|
+
}
|
|
1255
449
|
pub fn decodeCheckpoint(bytes: []const u8) JournalError!Checkpoint {
|
|
1256
|
-
|
|
1257
|
-
const checkpoint: Checkpoint = .{
|
|
1258
|
-
.event_ordinal = try cursor.readInt(u64),
|
|
1259
|
-
.frame_index = try cursor.readInt(u64),
|
|
1260
|
-
.fingerprint = try cursor.readInt(u64),
|
|
1261
|
-
};
|
|
1262
|
-
if (!cursor.done()) return error.JournalCorrupt;
|
|
1263
|
-
return checkpoint;
|
|
450
|
+
return decodeCheckpointWithPolicy(null, bytes);
|
|
1264
451
|
}
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
var cursor = WriteCursor{ .buffer = buffer };
|
|
1268
|
-
try cursor.writeInt(u64, mark.event_ordinal);
|
|
1269
|
-
try cursor.writeStr(mark.view_label);
|
|
1270
|
-
try cursor.writeF32(mark.scale);
|
|
1271
|
-
try cursor.writeInt(u64, mark.png_hash);
|
|
1272
|
-
try cursor.writeInt(u64, mark.png_len);
|
|
1273
|
-
return buffer[0..cursor.len];
|
|
452
|
+
pub fn decodeCheckpointWithPolicy(policy: journal_policy.Policy, bytes: []const u8) JournalError!Checkpoint {
|
|
453
|
+
return codec.decodeCheckpoint(policy, bytes);
|
|
1274
454
|
}
|
|
1275
455
|
|
|
456
|
+
pub fn encodeScreenshot(value: ScreenshotMark, buffer: []u8) JournalError![]const u8 {
|
|
457
|
+
return encodeScreenshotWithPolicy(null, value, buffer);
|
|
458
|
+
}
|
|
459
|
+
pub fn encodeScreenshotWithPolicy(policy: journal_policy.Policy, value: ScreenshotMark, buffer: []u8) JournalError![]const u8 {
|
|
460
|
+
return codec.encodeScreenshot(policy, value, buffer);
|
|
461
|
+
}
|
|
1276
462
|
pub fn decodeScreenshot(bytes: []const u8) JournalError!ScreenshotMark {
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
.event_ordinal = ordinal,
|
|
1282
|
-
.view_label = label,
|
|
1283
|
-
.scale = try cursor.readF32(),
|
|
1284
|
-
.png_hash = try cursor.readInt(u64),
|
|
1285
|
-
.png_len = try cursor.readInt(u64),
|
|
1286
|
-
};
|
|
1287
|
-
if (!cursor.done()) return error.JournalCorrupt;
|
|
1288
|
-
return mark;
|
|
463
|
+
return decodeScreenshotWithPolicy(null, bytes);
|
|
464
|
+
}
|
|
465
|
+
pub fn decodeScreenshotWithPolicy(policy: journal_policy.Policy, bytes: []const u8) JournalError!ScreenshotMark {
|
|
466
|
+
return codec.decodeScreenshot(policy, bytes);
|
|
1289
467
|
}
|
|
1290
468
|
|
|
1291
|
-
pub fn
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
469
|
+
pub fn encodeWindowChrome(value: WindowChromeRecord, buffer: []u8) JournalError![]const u8 {
|
|
470
|
+
return encodeWindowChromeWithPolicy(null, value, buffer);
|
|
471
|
+
}
|
|
472
|
+
pub fn encodeWindowChromeWithPolicy(policy: journal_policy.Policy, value: WindowChromeRecord, buffer: []u8) JournalError![]const u8 {
|
|
473
|
+
return codec.encodeWindowChrome(policy, value, buffer);
|
|
474
|
+
}
|
|
475
|
+
pub fn decodeWindowChrome(bytes: []const u8) JournalError!WindowChromeRecord {
|
|
476
|
+
return decodeWindowChromeWithPolicy(null, bytes);
|
|
477
|
+
}
|
|
478
|
+
pub fn decodeWindowChromeWithPolicy(policy: journal_policy.Policy, bytes: []const u8) JournalError!WindowChromeRecord {
|
|
479
|
+
return codec.decodeWindowChrome(policy, bytes);
|
|
1298
480
|
}
|
|
1299
481
|
|
|
482
|
+
pub fn encodeEnd(value: End, buffer: []u8) JournalError![]const u8 {
|
|
483
|
+
return encodeEndWithPolicy(null, value, buffer);
|
|
484
|
+
}
|
|
485
|
+
pub fn encodeEndWithPolicy(policy: journal_policy.Policy, value: End, buffer: []u8) JournalError![]const u8 {
|
|
486
|
+
return codec.encodeEnd(policy, value, buffer);
|
|
487
|
+
}
|
|
1300
488
|
pub fn decodeEnd(bytes: []const u8) JournalError!End {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
.checkpoint_count = try cursor.readInt(u64),
|
|
1306
|
-
.screenshot_count = try cursor.readInt(u64),
|
|
1307
|
-
};
|
|
1308
|
-
if (!cursor.done()) return error.JournalCorrupt;
|
|
1309
|
-
return end;
|
|
489
|
+
return decodeEndWithPolicy(null, bytes);
|
|
490
|
+
}
|
|
491
|
+
pub fn decodeEndWithPolicy(policy: journal_policy.Policy, bytes: []const u8) JournalError!End {
|
|
492
|
+
return codec.decodeEnd(policy, bytes);
|
|
1310
493
|
}
|
|
1311
494
|
|
|
1312
495
|
// ------------------------------------------------------------ framing
|
|
1313
496
|
|
|
1314
497
|
/// Frame one record (kind + u32 length prefix + payload) into `buffer`.
|
|
1315
498
|
pub fn frameRecord(kind: RecordKind, payload: []const u8, buffer: []u8) JournalError![]const u8 {
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
499
|
+
return frameRecordWithPolicy(null, kind, payload, buffer);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
pub fn frameRecordWithPolicy(policy: journal_policy.Policy, kind: RecordKind, payload: []const u8, buffer: []u8) JournalError![]const u8 {
|
|
503
|
+
const frame = try frameHeader(policy, kind, payload.len, buffer.len);
|
|
504
|
+
@memcpy(buffer[0..5], &frame);
|
|
1320
505
|
@memcpy(buffer[5 .. 5 + payload.len], payload);
|
|
1321
506
|
return buffer[0 .. 5 + payload.len];
|
|
1322
507
|
}
|
|
1323
508
|
|
|
509
|
+
/// A copied frame header; the caller still owns the payload and sink writes.
|
|
510
|
+
pub fn frameHeader(policy: journal_policy.Policy, kind: RecordKind, length: usize, capacity: usize) JournalError![5]u8 {
|
|
511
|
+
const decision = journal_policy.plan(policy, .frame, .{ .kind = @intFromEnum(kind), .a = length, .b = capacity, .limit = max_session_record_bytes });
|
|
512
|
+
try checkPlan(decision);
|
|
513
|
+
return decision.frame;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
fn checkPlan(decision: journal_policy.Plan) JournalError!void {
|
|
517
|
+
switch (decision.action) {
|
|
518
|
+
.proceed, .done => {},
|
|
519
|
+
.bad_magic => return error.JournalBadMagic,
|
|
520
|
+
.format_mismatch => return error.JournalFormatMismatch,
|
|
521
|
+
.truncated => return error.JournalTruncated,
|
|
522
|
+
.corrupt => return error.JournalCorrupt,
|
|
523
|
+
.over_budget => return error.JournalRecordOverBudget,
|
|
524
|
+
.missing_header => return error.JournalMissingHeader,
|
|
525
|
+
.count_mismatch => return error.JournalCountMismatch,
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
1324
529
|
/// The journal preamble (magic + format fingerprint). The fingerprint
|
|
1325
530
|
/// field widened from the retired u32 counter to the full u64 hash when
|
|
1326
531
|
/// identity replaced ordering — this change refuses every older journal
|
|
1327
532
|
/// anyway, and the full width keeps the refuse-on-mismatch tripwire's
|
|
1328
533
|
/// collision odds at 2^-64 instead of 2^-32 for free.
|
|
1329
534
|
pub fn writePreamble(buffer: []u8) []const u8 {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
535
|
+
return writePreambleWithPolicy(null, buffer);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
pub fn writePreambleWithPolicy(policy: journal_policy.Policy, buffer: []u8) []const u8 {
|
|
539
|
+
std.debug.assert(buffer.len >= preamble_len);
|
|
540
|
+
const decision = journal_policy.plan(policy, .preamble, .{ .fingerprint = format_fingerprint });
|
|
541
|
+
if (decision.action != .proceed) @panic("invalid compiled journal preamble");
|
|
542
|
+
@memcpy(buffer[0..preamble_len], &decision.preamble);
|
|
543
|
+
return buffer[0..preamble_len];
|
|
1333
544
|
}
|
|
1334
545
|
|
|
1335
546
|
pub const preamble_len: usize = magic.len + 8;
|
|
@@ -1342,6 +553,7 @@ pub const preamble_len: usize = magic.len + 8;
|
|
|
1342
553
|
pub const Reader = struct {
|
|
1343
554
|
bytes: []const u8,
|
|
1344
555
|
pos: usize,
|
|
556
|
+
policy: journal_policy.Policy = null,
|
|
1345
557
|
storage: EventDecodeStorage = .{},
|
|
1346
558
|
header: ?Header = null,
|
|
1347
559
|
end: ?End = null,
|
|
@@ -1349,65 +561,73 @@ pub const Reader = struct {
|
|
|
1349
561
|
effect_count: u64 = 0,
|
|
1350
562
|
checkpoint_count: u64 = 0,
|
|
1351
563
|
screenshot_count: u64 = 0,
|
|
564
|
+
window_chrome_count: u64 = 0,
|
|
1352
565
|
|
|
1353
566
|
pub fn init(bytes: []const u8) JournalError!Reader {
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
567
|
+
return initWithPolicy(bytes, null);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
pub fn initWithPolicy(bytes: []const u8, policy: journal_policy.Policy) JournalError!Reader {
|
|
571
|
+
const decision = journal_policy.plan(policy, .init, .{ .a = bytes.len, .fingerprint = format_fingerprint, .sample = bytes[0..@min(bytes.len, preamble_len)] });
|
|
572
|
+
try checkPlan(decision);
|
|
573
|
+
return .{ .bytes = bytes, .pos = @intCast(decision.pos), .policy = policy };
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
fn counts(self: *const Reader) [5]u64 {
|
|
577
|
+
return .{ self.event_count, self.effect_count, self.checkpoint_count, self.screenshot_count, self.window_chrome_count };
|
|
1359
578
|
}
|
|
1360
579
|
|
|
1361
580
|
/// The next record, or null after the end record. Records after the
|
|
1362
581
|
/// end record, a missing end record, and count mismatches are all
|
|
1363
582
|
/// refused.
|
|
1364
583
|
pub fn next(self: *Reader) JournalError!?Record {
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
584
|
+
const old_pos = self.pos;
|
|
585
|
+
const decision = journal_policy.plan(self.policy, .next, .{
|
|
586
|
+
.a = self.bytes.len,
|
|
587
|
+
.b = self.pos,
|
|
588
|
+
.header = self.header != null,
|
|
589
|
+
.ended = self.end != null,
|
|
590
|
+
.counts = self.counts(),
|
|
591
|
+
.sample = self.bytes[self.pos..][0..@min(self.bytes.len - self.pos, 5)],
|
|
592
|
+
.limit = max_session_record_bytes,
|
|
593
|
+
});
|
|
594
|
+
// The admitted frame advances position and counters before payload
|
|
595
|
+
// decoding. Even failed decodes retain those mutations.
|
|
596
|
+
self.pos = @intCast(decision.pos);
|
|
597
|
+
self.event_count = decision.counts[0];
|
|
598
|
+
self.effect_count = decision.counts[1];
|
|
599
|
+
self.checkpoint_count = decision.counts[2];
|
|
600
|
+
self.screenshot_count = decision.counts[3];
|
|
601
|
+
self.window_chrome_count = decision.counts[4];
|
|
602
|
+
try checkPlan(decision);
|
|
603
|
+
if (decision.action == .done) return null;
|
|
604
|
+
const kind = std.enums.fromInt(RecordKind, decision.kind) orelse @panic("invalid compiled journal record kind");
|
|
605
|
+
const payload = self.bytes[old_pos + 5 .. self.pos];
|
|
606
|
+
|
|
1379
607
|
switch (kind) {
|
|
1380
608
|
.header => {
|
|
1381
|
-
|
|
1382
|
-
const header = try decodeHeader(payload);
|
|
609
|
+
const header = try decodeHeaderWithPolicy(self.policy, payload);
|
|
1383
610
|
self.header = header;
|
|
1384
611
|
return .{ .header = header };
|
|
1385
612
|
},
|
|
1386
613
|
.event => {
|
|
1387
|
-
self.
|
|
1388
|
-
return .{ .event = try decodeEvent(payload, &self.storage) };
|
|
614
|
+
return .{ .event = try decodeEventWithPolicy(self.policy, payload, &self.storage) };
|
|
1389
615
|
},
|
|
1390
616
|
.effect => {
|
|
1391
|
-
self.
|
|
1392
|
-
return .{ .effect = try decodeEffect(payload) };
|
|
617
|
+
return .{ .effect = try decodeEffectWithPolicy(self.policy, payload) };
|
|
1393
618
|
},
|
|
1394
619
|
.checkpoint => {
|
|
1395
|
-
self.
|
|
1396
|
-
return .{ .checkpoint = try decodeCheckpoint(payload) };
|
|
620
|
+
return .{ .checkpoint = try decodeCheckpointWithPolicy(self.policy, payload) };
|
|
1397
621
|
},
|
|
1398
622
|
.screenshot => {
|
|
1399
|
-
self.
|
|
1400
|
-
|
|
623
|
+
return .{ .screenshot = try decodeScreenshotWithPolicy(self.policy, payload) };
|
|
624
|
+
},
|
|
625
|
+
.window_chrome => {
|
|
626
|
+
return .{ .window_chrome = try decodeWindowChromeWithPolicy(self.policy, payload) };
|
|
1401
627
|
},
|
|
1402
628
|
.end => {
|
|
1403
|
-
const end = try
|
|
1404
|
-
|
|
1405
|
-
end.effect_count != self.effect_count or
|
|
1406
|
-
end.checkpoint_count != self.checkpoint_count or
|
|
1407
|
-
end.screenshot_count != self.screenshot_count)
|
|
1408
|
-
{
|
|
1409
|
-
return error.JournalCountMismatch;
|
|
1410
|
-
}
|
|
629
|
+
const end = try decodeEndWithPolicy(self.policy, payload);
|
|
630
|
+
try checkPlan(journal_policy.plan(self.policy, .seal, .{ .counts = self.counts(), .sealed = .{ end.event_count, end.effect_count, end.checkpoint_count, end.screenshot_count, end.window_chrome_count } }));
|
|
1411
631
|
self.end = end;
|
|
1412
632
|
return .{ .end = end };
|
|
1413
633
|
},
|
|
@@ -1614,6 +834,18 @@ test "event codec round-trips every payload variant" {
|
|
|
1614
834
|
try testing.expectEqual(@as(?usize, 3), decoded.gpu_surface_input.composition_cursor);
|
|
1615
835
|
try testing.expect(decoded.gpu_surface_input.modifiers.control);
|
|
1616
836
|
try testing.expectEqual(@as(f32, 0), decoded.gpu_surface_input.scale);
|
|
837
|
+
try testing.expect(!decoded.gpu_surface_input.scroll_is_detented);
|
|
838
|
+
}
|
|
839
|
+
{
|
|
840
|
+
const decoded = try roundTripEvent(.{ .gpu_surface_input = .{
|
|
841
|
+
.label = "feed-canvas",
|
|
842
|
+
.kind = .scroll,
|
|
843
|
+
.delta_y = 40,
|
|
844
|
+
.scroll_is_detented = true,
|
|
845
|
+
} });
|
|
846
|
+
try testing.expectEqual(platform.GpuSurfaceInputKind.scroll, decoded.gpu_surface_input.kind);
|
|
847
|
+
try testing.expectEqual(@as(f32, 40), decoded.gpu_surface_input.delta_y);
|
|
848
|
+
try testing.expect(decoded.gpu_surface_input.scroll_is_detented);
|
|
1617
849
|
}
|
|
1618
850
|
{
|
|
1619
851
|
// Command+Backspace journals as the raw platform key chord; replay
|
|
@@ -1671,6 +903,10 @@ test "event codec round-trips every payload variant" {
|
|
|
1671
903
|
try testing.expectEqual(@as(f32, -12.5), decoded.gpu_surface_scroll_driver.offset_y);
|
|
1672
904
|
try testing.expectEqual(@as(f32, 7.25), decoded.gpu_surface_scroll_driver.offset_x);
|
|
1673
905
|
}
|
|
906
|
+
{
|
|
907
|
+
const decoded = try roundTripEvent(.{ .widget_context_menu_action = .{ .window_id = 7, .label = "secondary", .id = 0xffffffffffffffff, .item_index = 31 } });
|
|
908
|
+
try testing.expectEqualDeep(platform.WidgetContextMenuActionEvent{ .window_id = 7, .label = "secondary", .id = 0xffffffffffffffff, .item_index = 31 }, decoded.widget_context_menu_action);
|
|
909
|
+
}
|
|
1674
910
|
{
|
|
1675
911
|
const decoded = try roundTripEvent(.{ .context_menu_action = .{ .view_label = "canvas", .token = 5, .item_id = 2 } });
|
|
1676
912
|
try testing.expectEqual(@as(u32, 2), decoded.context_menu_action.item_id);
|
|
@@ -2101,3 +1337,30 @@ test "reader requires the header first" {
|
|
|
2101
1337
|
var reader = try Reader.init(buffer[0..len]);
|
|
2102
1338
|
try testing.expectError(error.JournalMissingHeader, reader.next());
|
|
2103
1339
|
}
|
|
1340
|
+
|
|
1341
|
+
test "window chrome codec preserves every OS field and refuses damaged payloads" {
|
|
1342
|
+
const expected: WindowChromeRecord = .{
|
|
1343
|
+
.window_id = 18446744073709551615,
|
|
1344
|
+
.chrome = .{ .insets = .{ .top = 66, .right = 7.25, .bottom = 3.5, .left = 98 }, .buttons = .init(20, 26, 68, 14), .form_factor = .compact, .tabs_projected = true },
|
|
1345
|
+
};
|
|
1346
|
+
var buffer: [64]u8 = undefined;
|
|
1347
|
+
const bytes = try encodeWindowChrome(expected, &buffer);
|
|
1348
|
+
try testing.expectEqualDeep(expected, try decodeWindowChrome(bytes));
|
|
1349
|
+
for (0..bytes.len) |len| try testing.expectError(error.JournalCorrupt, decodeWindowChrome(bytes[0..len]));
|
|
1350
|
+
buffer[bytes.len] = 0;
|
|
1351
|
+
try testing.expectError(error.JournalCorrupt, decodeWindowChrome(buffer[0 .. bytes.len + 1]));
|
|
1352
|
+
buffer[40] = 255;
|
|
1353
|
+
try testing.expectError(error.JournalCorrupt, decodeWindowChrome(bytes));
|
|
1354
|
+
buffer[40] = 1;
|
|
1355
|
+
buffer[41] = 2;
|
|
1356
|
+
try testing.expectError(error.JournalCorrupt, decodeWindowChrome(bytes));
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
comptime {
|
|
1360
|
+
if (!std.mem.eql(u8, magic, "NSDKSJNL") or preamble_len != 16 or max_session_record_bytes != 1114112 or
|
|
1361
|
+
@typeInfo(RecordKind).@"enum".fields.len != 7 or @intFromEnum(RecordKind.header) != 1 or
|
|
1362
|
+
@intFromEnum(RecordKind.event) != 2 or @intFromEnum(RecordKind.effect) != 3 or
|
|
1363
|
+
@intFromEnum(RecordKind.checkpoint) != 4 or @intFromEnum(RecordKind.screenshot) != 5 or
|
|
1364
|
+
@intFromEnum(RecordKind.end) != 6 or @intFromEnum(RecordKind.window_chrome) != 7)
|
|
1365
|
+
@compileError("update the portable journal framing schema with the journal format");
|
|
1366
|
+
}
|