@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
|
@@ -23,20 +23,27 @@
|
|
|
23
23
|
// - an SC diagnostic code (SC0000..SC9999) appears in docs/, skills/,
|
|
24
24
|
// or skill-data/ outside the generated reference — compiler
|
|
25
25
|
// capability claims live in the generated table, never in prose;
|
|
26
|
-
// - a scriptc version literal (
|
|
26
|
+
// - a scriptc version literal (X.Y.Z) in those same trees names a
|
|
27
27
|
// version other than the pin — the calibration/spike sentences the
|
|
28
28
|
// docs carry must move with the pin.
|
|
29
29
|
//
|
|
30
30
|
// Exit 2: the compiler manifest is not installed or unreadable.
|
|
31
31
|
|
|
32
32
|
import fs from "node:fs";
|
|
33
|
+
import { compilerSurfacePath } from "./scriptc_toolchain.mjs";
|
|
33
34
|
import path from "node:path";
|
|
34
35
|
import { fileURLToPath } from "node:url";
|
|
35
36
|
|
|
36
|
-
const
|
|
37
|
+
const KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
37
38
|
const coreRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
38
39
|
const repoRoot = path.resolve(coreRoot, "..", "..");
|
|
39
|
-
|
|
40
|
+
let manifestPath;
|
|
41
|
+
try {
|
|
42
|
+
manifestPath = compilerSurfacePath(path.join(coreRoot, "package.json"));
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error(`gen_service_surface: ${error.message}`);
|
|
45
|
+
process.exit(2);
|
|
46
|
+
}
|
|
40
47
|
const outputRel = "skill-data/ts-services/references/service-surface.md";
|
|
41
48
|
const outputPath = path.join(repoRoot, outputRel);
|
|
42
49
|
|
|
@@ -53,8 +60,13 @@ try {
|
|
|
53
60
|
console.error(`gen_service_surface: cannot read ${manifestPath}: ${error.message}`);
|
|
54
61
|
process.exit(2);
|
|
55
62
|
}
|
|
56
|
-
if (manifest.schemaVersion
|
|
57
|
-
console.error(`gen_service_surface: manifest schemaVersion ${manifest.schemaVersion} is unknown (this tool knows ${
|
|
63
|
+
if (!KNOWN_SCHEMA_VERSIONS.includes(manifest.schemaVersion)) {
|
|
64
|
+
console.error(`gen_service_surface: manifest schemaVersion ${manifest.schemaVersion} is unknown (this tool knows ${KNOWN_SCHEMA_VERSIONS.join(", ")}) — update the tool before regenerating`);
|
|
65
|
+
process.exit(2);
|
|
66
|
+
}
|
|
67
|
+
const statuses = manifest.schemaVersion === 1 ? ["static", "dynamic-only", "unsupported"] : ["static", "unsupported"];
|
|
68
|
+
if (!Array.isArray(manifest.entries) || manifest.entries.some(entry => !statuses.includes(entry.status))) {
|
|
69
|
+
console.error(`gen_service_surface: invalid entries or status for schemaVersion ${manifest.schemaVersion}`);
|
|
58
70
|
process.exit(2);
|
|
59
71
|
}
|
|
60
72
|
|
|
@@ -102,7 +114,7 @@ const constrainedCallRefusal = missingLoweringFence?.code
|
|
|
102
114
|
const sections = [];
|
|
103
115
|
sections.push(`<!-- GENERATED FILE — do not edit by hand.
|
|
104
116
|
Derived byte-for-byte from the pinned compiler's surface manifest:
|
|
105
|
-
packages/core/
|
|
117
|
+
resolved through packages/core/scripts/scriptc_toolchain.mjs
|
|
106
118
|
Regenerate after any compiler pin move:
|
|
107
119
|
node packages/core/scripts/gen_service_surface.mjs
|
|
108
120
|
Verify without writing:
|
|
@@ -112,14 +124,14 @@ sections.push(`<!-- GENERATED FILE — do not edit by hand.
|
|
|
112
124
|
|
|
113
125
|
What TypeScript under \`src/services/\` can use, as stated by the pinned
|
|
114
126
|
compiler itself (surface manifest schema ${manifest.schemaVersion}, ${manifest.entries.length} entries:
|
|
115
|
-
${counts.static} static, ${counts["dynamic-only"]} dynamic-only, ${counts.unsupported} unsupported).
|
|
127
|
+
${counts.static} static, ${manifest.schemaVersion === 1 ? `${counts["dynamic-only"]} dynamic-only, ` : ""}${counts.unsupported} unsupported).
|
|
116
128
|
|
|
117
129
|
How to read the tables:
|
|
118
130
|
|
|
119
131
|
- **static** — compiles in the engine-free static tier services use.
|
|
120
|
-
|
|
132
|
+
${manifest.schemaVersion === 1 ? `- **dynamic-only** — needs the embedded dynamic engine (\`--dynamic\`),
|
|
121
133
|
which Native SDK builds never pass, so for services this means
|
|
122
|
-
**unavailable** until the entry goes static.
|
|
134
|
+
**unavailable** until the entry goes static.` : "- Compilation is native-only; unsupported dependencies receive build diagnostics."}
|
|
123
135
|
- **unsupported** — refused with the listed SC code. A status describes
|
|
124
136
|
where the named code is *raised*: forms outside the supported subset
|
|
125
137
|
refuse with that code, while supported forms appear as their own
|
|
@@ -201,7 +213,7 @@ if (existing === null) {
|
|
|
201
213
|
|
|
202
214
|
// 2. Pin sanity: the installed manifest is the pinned compiler's.
|
|
203
215
|
const pkg = JSON.parse(fs.readFileSync(path.join(coreRoot, "package.json"), "utf8"));
|
|
204
|
-
const pin = pkg.dependencies?.scriptc;
|
|
216
|
+
const pin = pkg.nativeToolchain?.scriptc ?? pkg.dependencies?.scriptc;
|
|
205
217
|
if (manifest.compilerVersion !== pin) {
|
|
206
218
|
problems.push(`installed compiler manifest is ${manifest.compilerVersion} but packages/core/package.json pins scriptc ${pin} — run \`npm ci --include=dev\` in packages/core`);
|
|
207
219
|
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Install unchanged, integrity-pinned upstream payloads into an atomic cache.
|
|
3
|
+
// Target packs are installed up front so subsequent builds work offline.
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import { promises as fsp } from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
8
|
+
import { Readable } from "node:stream";
|
|
9
|
+
import { pipeline } from "node:stream/promises";
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
11
|
+
import { spawnSync } from "node:child_process";
|
|
12
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
13
|
+
import { installedRelease, nativeManifestName, nativeTargetName, releaseConfiguration, toolchainPackageDirectory } from "./scriptc_toolchain.mjs";
|
|
14
|
+
|
|
15
|
+
function transientDownloadError(error) {
|
|
16
|
+
for (let cause = error, depth = 0; cause && depth < 8; cause = cause.cause, depth++) {
|
|
17
|
+
if (["ECONNRESET", "ETIMEDOUT", "ECONNREFUSED", "EPIPE", "ENETUNREACH", "EHOSTUNREACH", "EAI_AGAIN", "UND_ERR_CONNECT_TIMEOUT", "UND_ERR_SOCKET", "UND_ERR_HEADERS_TIMEOUT", "UND_ERR_BODY_TIMEOUT", "ERR_STREAM_PREMATURE_CLOSE"].includes(cause.code) || cause.name === "TimeoutError") return true;
|
|
18
|
+
}
|
|
19
|
+
return error instanceof TypeError && error.message === "fetch failed" && !error.cause;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function downloadVerified(asset, output, options = {}) {
|
|
23
|
+
const url = new URL(asset.url);
|
|
24
|
+
if (url.protocol !== "https:") throw new Error("toolchain assets require HTTPS");
|
|
25
|
+
const algorithm = asset.sha256 ? "sha256" : "sha512";
|
|
26
|
+
const expected = asset.sha256 ?? asset.integrity?.replace(/^sha512-/, "");
|
|
27
|
+
if (!expected || (!asset.sha256 && !asset.integrity.startsWith("sha512-"))) throw new Error("toolchain asset has no supported digest");
|
|
28
|
+
// Retry transport failures within the original two-minute asset budget.
|
|
29
|
+
// Each attempt owns a new stream and hash; corrupt bytes are never retried.
|
|
30
|
+
const deadline = Date.now() + 120_000;
|
|
31
|
+
for (let attempt = 0; attempt < 4; attempt++) {
|
|
32
|
+
let owned = false, retryable = false;
|
|
33
|
+
try {
|
|
34
|
+
const signal = AbortSignal.timeout(Math.max(1, deadline - Date.now()));
|
|
35
|
+
const response = await (options.fetch ?? fetch)(asset.url, { signal });
|
|
36
|
+
if (!response.ok || !response.body) {
|
|
37
|
+
retryable = [408, 429, 500, 502, 503, 504].includes(response.status);
|
|
38
|
+
await response.body?.cancel().catch(() => {});
|
|
39
|
+
throw new Error(`cannot download ${asset.url}: HTTP ${response.status}`);
|
|
40
|
+
}
|
|
41
|
+
const handle = await fsp.open(output, "wx", 0o600);
|
|
42
|
+
owned = true;
|
|
43
|
+
const hash = createHash(algorithm);
|
|
44
|
+
let bytes = 0;
|
|
45
|
+
try {
|
|
46
|
+
const body = Readable.fromWeb(response.body);
|
|
47
|
+
body.on("data", chunk => { bytes += chunk.length; hash.update(chunk); });
|
|
48
|
+
await pipeline(body, handle.createWriteStream(), { signal });
|
|
49
|
+
} finally { await handle.close(); }
|
|
50
|
+
const digest = hash.digest(asset.sha256 ? "hex" : "base64");
|
|
51
|
+
if (digest !== expected || (asset.bytes !== undefined && bytes !== asset.bytes)) throw new Error(`toolchain checksum or size mismatch: ${asset.url}`);
|
|
52
|
+
return { bytes, digest };
|
|
53
|
+
} catch (error) {
|
|
54
|
+
if (owned) await fsp.rm(output, { force: true });
|
|
55
|
+
const backoff = 1000 * 2 ** attempt;
|
|
56
|
+
if (!(retryable || transientDownloadError(error)) || attempt === 3 || Date.now() + backoff >= deadline) throw error;
|
|
57
|
+
await (options.sleep ?? sleep)(backoff);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export async function extractVerified(archive, destination, options = {}) {
|
|
63
|
+
const { x } = await import("tar");
|
|
64
|
+
await fsp.mkdir(destination, { recursive: true });
|
|
65
|
+
const strip = options.strip ?? 0;
|
|
66
|
+
let violation;
|
|
67
|
+
await x({
|
|
68
|
+
file: archive, cwd: destination, strip, strict: true, preservePaths: false,
|
|
69
|
+
filter(name, entry) {
|
|
70
|
+
const normalized = name.replace(/^\.\//, "");
|
|
71
|
+
if (path.posix.isAbsolute(normalized) || /[\\\0]/.test(normalized) || normalized.split("/").includes("..") || /^[A-Za-z]:/.test(normalized)) {
|
|
72
|
+
violation ??= new Error(`unsafe toolchain archive path: ${name}`);
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
if (!["File", "Directory", "ExtendedHeader", "GlobalExtendedHeader"].includes(entry.type)) {
|
|
76
|
+
violation ??= new Error(`unsupported toolchain archive entry: ${entry.type}`);
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return options.prefix === undefined || normalized === options.prefix || normalized.startsWith(options.prefix + "/");
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
if (violation) throw violation;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function readJson(file) { return JSON.parse(fs.readFileSync(file, "utf8")); }
|
|
86
|
+
function requireVersion(directory, version, expectedName) {
|
|
87
|
+
const pkg = readJson(path.join(directory, "package.json"));
|
|
88
|
+
if (pkg.version !== version || (expectedName && pkg.name !== expectedName)) throw new Error(`incorrect toolchain package identity: ${directory}`);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function verifyPack(directory, version, abi) {
|
|
92
|
+
requireVersion(directory, version);
|
|
93
|
+
const pack = readJson(path.join(directory, "runtime-pack.json"));
|
|
94
|
+
if (pack.version !== version || pack.runtime_abi.version !== abi) throw new Error(`runtime ABI or version mismatch: ${directory}`);
|
|
95
|
+
// Verify every declared object, bitcode, archive and license path before
|
|
96
|
+
// publishing the installation, including targets not runnable on this host.
|
|
97
|
+
const walk = value => {
|
|
98
|
+
if (!value || typeof value !== "object") return;
|
|
99
|
+
if (typeof value.path === "string") {
|
|
100
|
+
const relative = value.path;
|
|
101
|
+
if (path.isAbsolute(relative) || relative.split(/[\\/]/).includes("..")) throw new Error("runtime artifact escapes its pack");
|
|
102
|
+
const raw = fs.readFileSync(path.join(directory, relative));
|
|
103
|
+
if ((value.size !== undefined && raw.length !== value.size) || (value.sha256 && createHash("sha256").update(raw).digest("hex") !== value.sha256)) throw new Error(`runtime artifact mismatch: ${relative}`);
|
|
104
|
+
}
|
|
105
|
+
for (const child of Object.values(value)) walk(child);
|
|
106
|
+
};
|
|
107
|
+
walk(pack);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export async function installScriptc(origin = new URL("../package.json", import.meta.url), options = {}) {
|
|
111
|
+
const config = releaseConfiguration(origin, options);
|
|
112
|
+
if (config === null) throw new Error("SDK manifest does not select a release toolchain");
|
|
113
|
+
try { installedRelease(origin, options); return config; } catch { /* install or repair */ }
|
|
114
|
+
// Each installer has its own staging directory. Concurrent installs never
|
|
115
|
+
// expose partial payloads or remove another installer's temporary files.
|
|
116
|
+
await fsp.mkdir(path.dirname(config.root), { recursive: true });
|
|
117
|
+
const staging = config.root + ".install-" + randomUUID();
|
|
118
|
+
await fsp.mkdir(staging, { mode: 0o700 });
|
|
119
|
+
const modules = path.join(staging, "api", "node_modules");
|
|
120
|
+
const scope = path.join(modules, "@scriptc");
|
|
121
|
+
const releaseRoot = path.join(staging, "release");
|
|
122
|
+
const downloaded = [];
|
|
123
|
+
const acquire = async (asset, destination, extraction = {}) => {
|
|
124
|
+
const archive = path.join(staging, "asset-" + randomUUID() + ".tar.gz");
|
|
125
|
+
try {
|
|
126
|
+
const result = await downloadVerified(asset, archive, options);
|
|
127
|
+
await extractVerified(archive, destination, extraction);
|
|
128
|
+
downloaded.push({ url: asset.url, ...result });
|
|
129
|
+
} finally { await fsp.rm(archive, { force: true }); }
|
|
130
|
+
};
|
|
131
|
+
try {
|
|
132
|
+
console.error(`Installing scriptc ${config.release.version} for ${config.host}`);
|
|
133
|
+
await acquire(config.release.releases[config.host], releaseRoot);
|
|
134
|
+
const nativeManifestPath = path.join(releaseRoot, "bin", nativeManifestName(config.host));
|
|
135
|
+
const nativeManifest = readJson(nativeManifestPath);
|
|
136
|
+
if (nativeManifest.compiler_version !== config.release.version || nativeManifest.target !== nativeTargetName(config.host)) throw new Error("native compiler release identity mismatch");
|
|
137
|
+
for (const [key, asset] of Object.entries(config.release.packages)) {
|
|
138
|
+
const directory = toolchainPackageDirectory(modules, key, asset);
|
|
139
|
+
await acquire(asset, directory, { strip: 1 });
|
|
140
|
+
requireVersion(directory, asset.version, asset.name);
|
|
141
|
+
}
|
|
142
|
+
// Matching API dependencies are copied from the verified host release;
|
|
143
|
+
// their package identities remain upstream's and their contents unchanged.
|
|
144
|
+
await fsp.mkdir(scope, { recursive: true });
|
|
145
|
+
await fsp.cp(path.join(releaseRoot, "lib", "runtime-sources"), path.join(scope, "runtime"), { recursive: true });
|
|
146
|
+
await fsp.cp(path.join(releaseRoot, "lib", "llvm"), path.join(scope, "llvm-" + config.host), { recursive: true });
|
|
147
|
+
const nativeTypescript = readJson(path.join(releaseRoot, "lib", "typescript", "package.json"));
|
|
148
|
+
if (nativeTypescript.version !== config.release.typescriptNativeVersion || !nativeTypescript.name.startsWith("@typescript/typescript-")) throw new Error("native TypeScript parser version mismatch");
|
|
149
|
+
await fsp.cp(path.join(releaseRoot, "lib", "typescript"), path.join(modules, ...nativeTypescript.name.split("/")), { recursive: true });
|
|
150
|
+
requireVersion(path.join(scope, "runtime"), config.release.version, "@scriptc/runtime");
|
|
151
|
+
requireVersion(path.join(scope, "llvm-" + config.host), config.release.version);
|
|
152
|
+
for (const [target, asset] of Object.entries(config.release.releases)) {
|
|
153
|
+
const packRoot = path.join(scope, "runtime-" + target);
|
|
154
|
+
if (target === config.host) await fsp.cp(path.join(releaseRoot, "lib", "runtime-" + target), packRoot, { recursive: true });
|
|
155
|
+
else await acquire(asset, packRoot, { prefix: "lib/runtime-" + target, strip: 3 });
|
|
156
|
+
}
|
|
157
|
+
const packs = fs.readdirSync(scope).filter(name => name.startsWith("runtime-"));
|
|
158
|
+
for (const name of packs) verifyPack(path.join(scope, name), config.release.version, config.release.runtimeAbi);
|
|
159
|
+
// Extend the upstream relocatable manifest with the complete matching
|
|
160
|
+
// target packs. Keep the original manifest alongside it for provenance.
|
|
161
|
+
await fsp.copyFile(nativeManifestPath, path.join(releaseRoot, "bin", "scriptc.upstream.json"));
|
|
162
|
+
nativeManifest.runtime_packs = packs.map(name => ({ target: nativeTargetName(name.slice("runtime-".length)), path: "../../api/node_modules/@scriptc/" + name }));
|
|
163
|
+
await fsp.writeFile(nativeManifestPath, JSON.stringify(nativeManifest, null, 2) + "\n");
|
|
164
|
+
const probe = spawnSync(path.join(releaseRoot, "bin", process.platform === "win32" ? "scriptc.exe" : "scriptc"), ["-v"], { encoding: "utf8" });
|
|
165
|
+
if (probe.status !== 0 || probe.stdout.trim() !== config.release.version) throw new Error("native compiler executable reports another release");
|
|
166
|
+
const receipt = { schemaVersion: 1, version: config.release.version, host: config.host, manifestSha256: config.identity, complete: true, runtimeAbi: config.release.runtimeAbi, runtimePacks: packs, downloaded };
|
|
167
|
+
await fsp.writeFile(path.join(staging, "installed.json"), JSON.stringify(receipt, null, 2) + "\n");
|
|
168
|
+
try { await fsp.rename(staging, config.root); }
|
|
169
|
+
catch (error) {
|
|
170
|
+
// A concurrent successful install wins. A corrupt existing directory
|
|
171
|
+
// needs explicit removal instead of overwriting a possibly active build.
|
|
172
|
+
try { installedRelease(origin, options); } catch { throw error; }
|
|
173
|
+
}
|
|
174
|
+
installedRelease(origin, options);
|
|
175
|
+
return config;
|
|
176
|
+
} finally { await fsp.rm(staging, { recursive: true, force: true }); }
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
180
|
+
try { await installScriptc(); }
|
|
181
|
+
catch (error) { console.error(`scriptc installation failed: ${error.message}`); process.exitCode = 1; }
|
|
182
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { publishedScriptcArgv } from "./compiler_command.mjs";
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
const command = publishedScriptcArgv(new URL("../package.json", import.meta.url));
|
|
7
|
+
if (process.argv[2] === "--path") {
|
|
8
|
+
if (command.length !== 1) throw new Error("this compiler requires an argv launcher");
|
|
9
|
+
console.log(command[0]);
|
|
10
|
+
} else {
|
|
11
|
+
const result = spawnSync(command[0], [...command.slice(1), ...process.argv.slice(2)], { stdio: "inherit" });
|
|
12
|
+
if (result.error) throw result.error;
|
|
13
|
+
process.exitCode = result.status ?? 1;
|
|
14
|
+
}
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error(error.message);
|
|
17
|
+
process.exitCode = 2;
|
|
18
|
+
}
|
|
@@ -62,7 +62,12 @@ try {
|
|
|
62
62
|
for (const name of fs.readdirSync(dir)) {
|
|
63
63
|
const member = path.join(dir, name);
|
|
64
64
|
if (name.endsWith(".a")) extract(member);
|
|
65
|
-
else
|
|
65
|
+
else {
|
|
66
|
+
// Zig's Mach-O archive members can extract with mode 000. The
|
|
67
|
+
// Darwin re-archive must be able to read each object.
|
|
68
|
+
fs.chmodSync(member, 0o644);
|
|
69
|
+
objects.push(member);
|
|
70
|
+
}
|
|
66
71
|
}
|
|
67
72
|
};
|
|
68
73
|
for (const input of args.in) extract(input);
|
|
@@ -14,13 +14,13 @@ const here = path.dirname(fileURLToPath(import.meta.url));
|
|
|
14
14
|
const coreRoot = path.resolve(here, "..");
|
|
15
15
|
const repoRoot = path.resolve(coreRoot, "..", "..");
|
|
16
16
|
const compilerArgv = publishedScriptcArgv(path.join(coreRoot, "package.json"));
|
|
17
|
-
const compilerVersion = JSON.parse(fs.readFileSync(path.join(coreRoot, "package.json"), "utf8")).
|
|
17
|
+
const compilerVersion = JSON.parse(fs.readFileSync(path.join(coreRoot, "package.json"), "utf8")).nativeToolchain.scriptc;
|
|
18
18
|
|
|
19
19
|
const candidates = [
|
|
20
20
|
{ name: "escape-string-regexp", version: "5.0.0", source: 'import escape from "escape-string-regexp";\nconsole.log(escape("a.b"));\n' },
|
|
21
21
|
{ name: "comma-separated-tokens", version: "2.0.3", source: 'import { parse } from "comma-separated-tokens";\nconsole.log(parse("a,b").length);\n' },
|
|
22
22
|
{ name: "space-separated-tokens", version: "2.0.2", source: 'import { parse } from "space-separated-tokens";\nconsole.log(parse("a b").length);\n' },
|
|
23
|
-
{ name: "nanoid", version: "3.3.
|
|
23
|
+
{ name: "nanoid", version: "3.3.19", source: 'import { nanoid } from "nanoid";\nconsole.log(nanoid(4));\n' },
|
|
24
24
|
{ name: "micromark", version: "4.0.2", source: 'import { micromark } from "micromark";\nconsole.log(micromark("# hi"));\n' },
|
|
25
25
|
];
|
|
26
26
|
|
|
@@ -21,6 +21,7 @@ import { spawnSync } from "node:child_process";
|
|
|
21
21
|
import fs from "node:fs";
|
|
22
22
|
import os from "node:os";
|
|
23
23
|
import path from "node:path";
|
|
24
|
+
import { fileURLToPath } from "node:url";
|
|
24
25
|
import { compilerArgv, publishedScriptcArgv } from "./compiler_command.mjs";
|
|
25
26
|
|
|
26
27
|
function parseArgs(argv) {
|
|
@@ -79,8 +80,9 @@ try {
|
|
|
79
80
|
// build mixes a host-format core archive with target-format Zig and service
|
|
80
81
|
// objects. Standalone host-only callers may omit both platform arguments.
|
|
81
82
|
// The pairing matrix is the pinned compiler's build matrix, shared with
|
|
82
|
-
// run_external_service_compiler.mjs: same-triple compiles run the
|
|
83
|
-
// lane
|
|
83
|
+
// run_external_service_compiler.mjs: same-triple compiles normally run the
|
|
84
|
+
// native lane, but Windows GNU always uses zig-cc for its headers and CRT;
|
|
85
|
+
// Linux and Windows GNU targets cross-compile from any desktop host, while
|
|
84
86
|
// macOS targets need a macOS build host.
|
|
85
87
|
const hostParts = args["host-platform"]?.split("-") ?? [];
|
|
86
88
|
const targetParts = args["target-platform"]?.split("-") ?? [];
|
|
@@ -109,6 +111,7 @@ const nativeWindows = hostOs === "windows" && targetOs === "windows" && hostArch
|
|
|
109
111
|
(targetAbi === hostAbi || targetAbi === "msvc");
|
|
110
112
|
const cross = args["host-platform"] !== undefined &&
|
|
111
113
|
args["target-platform"] !== args["host-platform"] && !nativeWindows;
|
|
114
|
+
const zigCcCompile = cross || (targetOs === "windows" && targetAbi === "gnu");
|
|
112
115
|
if (mobileTarget) {
|
|
113
116
|
const desktopHost = ["macos", "linux", "windows"].includes(hostOs);
|
|
114
117
|
const admitted = desktopHost && targetArch === "aarch64" && (!iosTarget || hostOs === "macos");
|
|
@@ -137,11 +140,11 @@ if (mobileTarget) {
|
|
|
137
140
|
process.exit(2);
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
|
-
//
|
|
141
|
-
//
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
const compileEnv =
|
|
143
|
+
// Zig-cc compiles include native Windows GNU: host Clang alone cannot supply
|
|
144
|
+
// that target's headers and CRT. SCRIPTC_TARGET carries the compiler's mobile
|
|
145
|
+
// spellings for iOS/Android, --zig-exe's directory fronts PATH, and Android
|
|
146
|
+
// builds pass --android-ndk through as ANDROID_NDK_ROOT.
|
|
147
|
+
const compileEnv = zigCcCompile
|
|
145
148
|
? {
|
|
146
149
|
...process.env,
|
|
147
150
|
SCRIPTC_CC: "zigcc",
|
|
@@ -154,12 +157,12 @@ const compileEnv = cross
|
|
|
154
157
|
: process.env;
|
|
155
158
|
|
|
156
159
|
// The profile's determinism-fence table is RELEASE-PINNED DATA (see
|
|
157
|
-
// tools/corewire/emit_profile.
|
|
160
|
+
// tools/corewire/emit_profile.ts): its ids resolve against one
|
|
158
161
|
// toolchain release's surface manifest, so the supplied command must BE
|
|
159
162
|
// the release the SDK pins — the exact-pinned dependency of
|
|
160
163
|
// packages/core (the ONE place the pin lives).
|
|
161
164
|
const manifest = JSON.parse(fs.readFileSync(args.manifest, "utf8"));
|
|
162
|
-
const pin = manifest.dependencies?.scriptc;
|
|
165
|
+
const pin = manifest.nativeToolchain?.scriptc ?? manifest.dependencies?.scriptc;
|
|
163
166
|
if (typeof pin !== "string" || !/^\d+\.\d+\.\d+$/.test(pin)) {
|
|
164
167
|
console.error("the SDK's packages/core/package.json carries no exact external core compiler pin — the SDK tree is broken; reinstall or re-clone it");
|
|
165
168
|
process.exit(2);
|
|
@@ -180,7 +183,16 @@ if (reported !== pin) {
|
|
|
180
183
|
const work = fs.mkdtempSync(path.join(os.tmpdir(), "native-external-core-"));
|
|
181
184
|
try {
|
|
182
185
|
fs.cpSync(args.stage, work, { recursive: true });
|
|
183
|
-
|
|
186
|
+
// The exact matching compiler package's Node API co-emits the archive
|
|
187
|
+
// and sidecar for byte-bearing core contracts in one compile. The native
|
|
188
|
+
// binary supplies the version probe above; explicit compiler overrides
|
|
189
|
+
// keep their requested command.
|
|
190
|
+
const libraryHelper = path.join(path.dirname(fileURLToPath(import.meta.url)), "run_library_compiler.mjs");
|
|
191
|
+
const buildCommand = args["compiler-package-origin"] ? process.execPath : argv0[0];
|
|
192
|
+
const buildArgs = args["compiler-package-origin"]
|
|
193
|
+
? [libraryHelper, "--profile", "profile.json", "--out", args.name, "--version", pin, "--origin", args["compiler-package-origin"]]
|
|
194
|
+
: [...argv0.slice(1), "build", "--lib", "--profile", "profile.json", "-o", args.name];
|
|
195
|
+
const build = spawnSync(buildCommand, buildArgs, {
|
|
184
196
|
cwd: work,
|
|
185
197
|
stdio: "inherit",
|
|
186
198
|
env: compileEnv,
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
// The compiler version is verified against the one packages/core pin and the
|
|
8
8
|
// echo in services.contract.json before any compiler work starts. Host/target
|
|
9
9
|
// pairings follow the pinned compiler's build matrix: same-triple compiles run
|
|
10
|
-
// natively
|
|
11
|
-
//
|
|
10
|
+
// natively except Windows GNU, which needs zig-cc even on a Windows host;
|
|
11
|
+
// Linux and Windows GNU targets cross-compile from any desktop host over
|
|
12
|
+
// zig-cc; macOS targets need a macOS build host.
|
|
12
13
|
// Mobile targets (aarch64 iOS, iOS simulator, and Android) are archive-only:
|
|
13
14
|
// --out-archive is admitted (iOS from a macOS host, Android from any desktop
|
|
14
15
|
// host with an NDK), --out-exe refuses with the in-process pointer.
|
|
@@ -50,9 +51,9 @@ function parseArgs(argv) {
|
|
|
50
51
|
|
|
51
52
|
const args = parseArgs(process.argv);
|
|
52
53
|
|
|
53
|
-
// The pairing matrix the pinned compiler covers. Same-triple compiles
|
|
54
|
-
//
|
|
55
|
-
//
|
|
54
|
+
// The pairing matrix the pinned compiler covers. Same-triple compiles are
|
|
55
|
+
// local pairings, though Windows GNU still needs zig-cc for headers and CRT.
|
|
56
|
+
// Different triples use zig-cc: Linux and Windows GNU targets build from any
|
|
56
57
|
// desktop host (the compiler cross-compiles its runtime and localizes ELF and
|
|
57
58
|
// COFF objects itself); macOS targets build on a macOS host only, where Apple
|
|
58
59
|
// linking rides the host toolchain's SDK.
|
|
@@ -78,11 +79,12 @@ const scriptcTarget = iosTarget
|
|
|
78
79
|
? `aarch64-apple-ios${targetAbi === "simulator" ? "-simulator" : ""}`
|
|
79
80
|
: args["target-platform"];
|
|
80
81
|
// Zig names a native Windows host with the GNU ABI by default, while a user
|
|
81
|
-
// may explicitly target MSVC on that same machine.
|
|
82
|
-
//
|
|
82
|
+
// may explicitly target MSVC on that same machine. Both pairings are local
|
|
83
|
+
// for the build matrix; the GNU compiler lane is selected separately below.
|
|
83
84
|
const nativeWindows = hostOs === "windows" && targetOs === "windows" && hostArch === targetArch &&
|
|
84
85
|
(targetAbi === hostAbi || targetAbi === "msvc");
|
|
85
86
|
const cross = args["target-platform"] !== args["host-platform"] && !nativeWindows;
|
|
87
|
+
const zigCcCompile = cross || (targetOs === "windows" && targetAbi === "gnu");
|
|
86
88
|
if (mobileTarget) {
|
|
87
89
|
// Mobile services are archive-only: there is no child process to spawn on
|
|
88
90
|
// iOS or Android, so the plain-scriptc executable lane refuses here.
|
|
@@ -156,14 +158,12 @@ try {
|
|
|
156
158
|
process.exit(2);
|
|
157
159
|
}
|
|
158
160
|
|
|
159
|
-
//
|
|
160
|
-
// SCRIPTC_TARGET
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
// build threads the NDK location the same way (--android-ndk becomes
|
|
164
|
-
// ANDROID_NDK_ROOT for the compiler's sysroot discovery). Native compiles
|
|
161
|
+
// Zig-cc compiles include native Windows GNU: host Clang alone cannot supply
|
|
162
|
+
// that target's headers and CRT. SCRIPTC_TARGET uses the compiler's mobile
|
|
163
|
+
// spellings for iOS/Android, and --zig-exe's directory fronts PATH. Android
|
|
164
|
+
// builds pass --android-ndk through as ANDROID_NDK_ROOT. Other native compiles
|
|
165
165
|
// keep the process environment untouched.
|
|
166
|
-
const compileEnv =
|
|
166
|
+
const compileEnv = zigCcCompile
|
|
167
167
|
? {
|
|
168
168
|
...process.env,
|
|
169
169
|
SCRIPTC_CC: "zigcc",
|
|
@@ -190,7 +190,7 @@ function printNpmStaticTeaching() {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
const manifest = JSON.parse(fs.readFileSync(args.manifest, "utf8"));
|
|
193
|
-
const pin = manifest.dependencies?.scriptc;
|
|
193
|
+
const pin = manifest.nativeToolchain?.scriptc ?? manifest.dependencies?.scriptc;
|
|
194
194
|
const contract = JSON.parse(fs.readFileSync(args.contract, "utf8"));
|
|
195
195
|
if (typeof pin !== "string" || !/^\d+\.\d+\.\d+$/.test(pin)) {
|
|
196
196
|
console.error("packages/core/package.json carries no exact scriptc pin");
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// scriptc's Node library API co-emits the profile's archive and contract
|
|
3
|
+
// sidecar for the SDK's byte-bearing contracts in one compile.
|
|
4
|
+
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { pathToFileURL } from "node:url";
|
|
7
|
+
import { compilerApiEntry } from "./scriptc_toolchain.mjs";
|
|
8
|
+
|
|
9
|
+
async function main() {
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
if (![6, 8].includes(args.length) || args[0] !== "--profile" || args[2] !== "--out" || args[4] !== "--version") {
|
|
12
|
+
console.error("usage: run_library_compiler.mjs --profile <profile.json> --out <archive> --version <exact-version>");
|
|
13
|
+
return 2;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let compiler;
|
|
17
|
+
try {
|
|
18
|
+
compiler = await import(pathToFileURL(compilerApiEntry(args.length === 8 && args[6] === "--origin" ? args[7] : import.meta.url)));
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error(`the pinned @scriptc/compiler package is missing: ${error instanceof Error ? error.message : String(error)} — reinstall @native-sdk/cli or run npm ci in packages/core`);
|
|
21
|
+
return 2;
|
|
22
|
+
}
|
|
23
|
+
const version = compiler.compilerReleaseVersion();
|
|
24
|
+
if (version !== args[5]) {
|
|
25
|
+
console.error(`the library compiler package reports ${version}, but the SDK pins ${args[5]}`);
|
|
26
|
+
return 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const output = path.resolve(args[3]);
|
|
30
|
+
try {
|
|
31
|
+
const result = await compiler.compileLibrary({
|
|
32
|
+
profilePath: path.resolve(args[1]),
|
|
33
|
+
outDir: path.dirname(output),
|
|
34
|
+
outPath: output,
|
|
35
|
+
});
|
|
36
|
+
if (!result.ok) {
|
|
37
|
+
console.error(compiler.renderDiagnostics(result.diagnostics, result.sourceTexts));
|
|
38
|
+
return 1;
|
|
39
|
+
}
|
|
40
|
+
if (!result.sidecarPath) {
|
|
41
|
+
console.error("the library compiler produced no contract sidecar");
|
|
42
|
+
return 1;
|
|
43
|
+
}
|
|
44
|
+
return 0;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error(`the library compiler failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
47
|
+
return 1;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
process.exitCode = await main();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Invoked through build/ts_run.mjs so installed node_modules layouts use the
|
|
2
|
+
// same pinned TS loader. Tests resolve the build's SDK, like core compilation.
|
|
3
|
+
import { registerHooks } from 'node:module';
|
|
4
|
+
import { readdirSync } from 'node:fs';
|
|
5
|
+
import { resolve } from 'node:path';
|
|
6
|
+
import { pathToFileURL } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const [host, directory] = process.argv.slice(2);
|
|
9
|
+
if (!host || !directory) throw new Error('usage: run_native_tests.mjs <host> <tests-directory>');
|
|
10
|
+
process.env.NATIVE_SDK_TEST_HOST = resolve(host);
|
|
11
|
+
const testingUrl = new URL('../testing/index.ts', import.meta.url).href;
|
|
12
|
+
registerHooks({
|
|
13
|
+
resolve(specifier, context, nextResolve) {
|
|
14
|
+
if (specifier === '@native-sdk/core/testing') return { url: testingUrl, shortCircuit: true };
|
|
15
|
+
return nextResolve(specifier, context);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
const tests = readdirSync(directory, { withFileTypes: true })
|
|
19
|
+
.filter(entry => entry.isFile() && entry.name.endsWith('.test.ts'))
|
|
20
|
+
.map(entry => entry.name).sort();
|
|
21
|
+
if (!tests.length) throw new Error('No tests/*.test.ts files found');
|
|
22
|
+
for (const test of tests) await import(pathToFileURL(resolve(directory, test)).href);
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"installationFormat": 2,
|
|
4
|
+
"version": "0.3.2",
|
|
5
|
+
"repository": "vercel-labs/scriptc",
|
|
6
|
+
"releases": {
|
|
7
|
+
"darwin-arm64": {
|
|
8
|
+
"url": "https://github.com/vercel-labs/scriptc/releases/download/v0.3.2/scriptc-0.3.2-darwin-arm64.tar.gz",
|
|
9
|
+
"bytes": 61103733,
|
|
10
|
+
"sha256": "a915c1d5e1236b9b871e6b9f3eda4006486b147566af9a52b59aeeed09e2512f"
|
|
11
|
+
},
|
|
12
|
+
"darwin-x64": {
|
|
13
|
+
"url": "https://github.com/vercel-labs/scriptc/releases/download/v0.3.2/scriptc-0.3.2-darwin-x64.tar.gz",
|
|
14
|
+
"bytes": 63256126,
|
|
15
|
+
"sha256": "dad6ff96e80473fdd612f5648c7697300860623cebdabb7a0ab02898f6c293b8"
|
|
16
|
+
},
|
|
17
|
+
"linux-arm64-gnu": {
|
|
18
|
+
"url": "https://github.com/vercel-labs/scriptc/releases/download/v0.3.2/scriptc-0.3.2-linux-arm64-gnu.tar.gz",
|
|
19
|
+
"bytes": 72765037,
|
|
20
|
+
"sha256": "33e380e0c7cff941eda57966b18c1be9f22da4fb5c6770f49f50af1b66868df4"
|
|
21
|
+
},
|
|
22
|
+
"linux-arm64-musl": {
|
|
23
|
+
"url": "https://github.com/vercel-labs/scriptc/releases/download/v0.3.2/scriptc-0.3.2-linux-arm64-musl.tar.gz",
|
|
24
|
+
"bytes": 63971343,
|
|
25
|
+
"sha256": "9fc6e33cdd54962c7c3f53f009a13a9ac2c67ae139b1ae306d5e647cfe3911ad"
|
|
26
|
+
},
|
|
27
|
+
"linux-x64-gnu": {
|
|
28
|
+
"url": "https://github.com/vercel-labs/scriptc/releases/download/v0.3.2/scriptc-0.3.2-linux-x64-gnu.tar.gz",
|
|
29
|
+
"bytes": 75664254,
|
|
30
|
+
"sha256": "b6255ab2456b7afaee384cfca54f94b1d9aa5e7d8d5e343be6c558a9dcf4c13b"
|
|
31
|
+
},
|
|
32
|
+
"linux-x64-musl": {
|
|
33
|
+
"url": "https://github.com/vercel-labs/scriptc/releases/download/v0.3.2/scriptc-0.3.2-linux-x64-musl.tar.gz",
|
|
34
|
+
"bytes": 66837074,
|
|
35
|
+
"sha256": "33790ceac5227eb3f5bae6f04e17baba3e2f95db5ddc05bdb39b310d4180bbc2"
|
|
36
|
+
},
|
|
37
|
+
"win32-x64-msvc": {
|
|
38
|
+
"url": "https://github.com/vercel-labs/scriptc/releases/download/v0.3.2/scriptc-0.3.2-win32-x64-msvc.tar.gz",
|
|
39
|
+
"bytes": 74275594,
|
|
40
|
+
"sha256": "20af007e7b894ddcf22471c5f7b3a3e1a87f1c08e4e3d99baea3b7dd6e29285e"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"packages": {
|
|
44
|
+
"compiler": {
|
|
45
|
+
"name": "@scriptc/compiler",
|
|
46
|
+
"version": "0.3.2",
|
|
47
|
+
"url": "https://registry.npmjs.org/@scriptc/compiler/-/compiler-0.3.2.tgz",
|
|
48
|
+
"integrity": "sha512-mSBaJdJVRu1DvFAV/N06lilhwf8I0xiaW6+rRsvBn1ezG9uNXygVkyBD+WBVW2VGx7D6zd6KezzLiWI6QfHqEQ=="
|
|
49
|
+
},
|
|
50
|
+
"typescript": {
|
|
51
|
+
"name": "typescript",
|
|
52
|
+
"version": "7.0.2",
|
|
53
|
+
"url": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz",
|
|
54
|
+
"integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="
|
|
55
|
+
},
|
|
56
|
+
"typescript5": {
|
|
57
|
+
"name": "typescript",
|
|
58
|
+
"version": "5.9.3",
|
|
59
|
+
"url": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
|
60
|
+
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="
|
|
61
|
+
},
|
|
62
|
+
"runtime-ios-arm64": {
|
|
63
|
+
"name": "@scriptc/runtime-ios-arm64",
|
|
64
|
+
"version": "0.3.2",
|
|
65
|
+
"url": "https://registry.npmjs.org/@scriptc/runtime-ios-arm64/-/runtime-ios-arm64-0.3.2.tgz",
|
|
66
|
+
"integrity": "sha512-rRqnQLoGzi0uUmJXe7nPyTxRt0vBzauoPQJPixQKK+LWKJPk2YsU0GMYcbLfCXHkZ8uVMeVoP9qD1Wzhvn+2qQ=="
|
|
67
|
+
},
|
|
68
|
+
"runtime-ios-simulator-arm64": {
|
|
69
|
+
"name": "@scriptc/runtime-ios-simulator-arm64",
|
|
70
|
+
"version": "0.3.2",
|
|
71
|
+
"url": "https://registry.npmjs.org/@scriptc/runtime-ios-simulator-arm64/-/runtime-ios-simulator-arm64-0.3.2.tgz",
|
|
72
|
+
"integrity": "sha512-+mTut4yurH/gxU4aMEaxUU6IfDAj9WTf6mqSdDudqs/kPhZ7bhg3hqSQe05Mwg4fB5KHPpYX5E7Rbj5nBp27GQ=="
|
|
73
|
+
},
|
|
74
|
+
"runtime-android-arm64": {
|
|
75
|
+
"name": "@scriptc/runtime-android-arm64",
|
|
76
|
+
"version": "0.3.2",
|
|
77
|
+
"url": "https://registry.npmjs.org/@scriptc/runtime-android-arm64/-/runtime-android-arm64-0.3.2.tgz",
|
|
78
|
+
"integrity": "sha512-x2bKlP3Qiy3A93MVWpqdUlX+klIjWIZYUt5Ucys7SxXQuWWIkt9qRYojn0Ni9XtstJ8n/ZCMQVi5Mol5Q1A7+w=="
|
|
79
|
+
},
|
|
80
|
+
"runtime-wasm32-wasi": {
|
|
81
|
+
"name": "@scriptc/runtime-wasm32-wasi",
|
|
82
|
+
"version": "0.3.2",
|
|
83
|
+
"url": "https://registry.npmjs.org/@scriptc/runtime-wasm32-wasi/-/runtime-wasm32-wasi-0.3.2.tgz",
|
|
84
|
+
"integrity": "sha512-J4tqKQYWS8pbqZ1YhydCmcf6/4rRoi9TMUMV6xJE3k5gJk0/nsKx4pashMZowXBOQ4CZsoVchlzwyB1kTxdsDg=="
|
|
85
|
+
},
|
|
86
|
+
"types": {
|
|
87
|
+
"name": "@scriptc/types",
|
|
88
|
+
"version": "0.3.2",
|
|
89
|
+
"url": "https://registry.npmjs.org/@scriptc/types/-/types-0.3.2.tgz",
|
|
90
|
+
"integrity": "sha512-cHoAZJOpJxfYDWcYsTIZvJGCtpQWbMqqO0Z+BBqk+dbkRtMrcRXiepPzN0vSsV9PMdAyBvYIdAIzdJ5X8jSLqA=="
|
|
91
|
+
},
|
|
92
|
+
"threads": {
|
|
93
|
+
"name": "@scriptc/threads",
|
|
94
|
+
"version": "0.3.2",
|
|
95
|
+
"url": "https://registry.npmjs.org/@scriptc/threads/-/threads-0.3.2.tgz",
|
|
96
|
+
"integrity": "sha512-CE3cvQ7LfgxX+9F9elf27ThGD2rArCI9C2ticx6WvqPsBsHWUYH9e4xNQ+Ci0dTFdJgwp0lplE2TdlkiqdPIKQ=="
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"runtimeAbi": 20,
|
|
100
|
+
"typescriptNativeVersion": "7.0.2"
|
|
101
|
+
}
|