@native-sdk/cli 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/app.zig +859 -62
- package/build.zig +543 -13
- package/build.zig.zon +1 -0
- package/native-sdk.d.ts +2 -0
- package/package.json +12 -11
- package/packages/core/compile-surface/core.ts +365 -2
- package/packages/core/package-lock.json +11 -11
- package/packages/core/package.json +2 -2
- package/packages/core/scripts/compiler_typecheck.mjs +116 -15
- package/packages/core/scripts/gen_service_surface.mjs +268 -0
- package/packages/core/scripts/npm_static_spike.mjs +64 -0
- package/packages/core/scripts/run_external_core_compiler.mjs +77 -6
- package/packages/core/scripts/run_external_service_compiler.mjs +240 -0
- package/packages/core/scripts/stage_external_core.mjs +9 -1
- package/packages/core/scripts/stage_external_services.mjs +172 -0
- package/packages/core/scripts/surface_manifest_diff.mjs +253 -0
- package/packages/core/scripts/vendor_service_packages.mjs +189 -0
- package/packages/core/sdk/core.d.ts +149 -0
- package/packages/core/sdk/core.ts +529 -12
- package/packages/core/sdk/events.d.ts +36 -0
- package/packages/core/sdk/events.ts +57 -0
- package/packages/core/src/checker.ts +468 -15
- package/packages/core/src/cli.ts +143 -3
- package/packages/core/src/contract.ts +26 -5
- package/packages/core/src/devhost.ts +1847 -16
- package/packages/core/src/devhost_journal.mjs +181 -0
- package/packages/core/src/devhost_resolver.mjs +17 -1
- package/packages/core/src/devhost_service_worker.mjs +90 -0
- package/packages/core/src/diagnostics.ts +82 -16
- package/packages/core/src/frontend.ts +204 -34
- package/packages/core/src/modules.ts +129 -80
- package/packages/core/src/service_contract.ts +597 -0
- package/packages/core/src/sqlite_cli.ts +93 -0
- package/packages/core/src/sqlite_codegen.ts +806 -0
- package/packages/core/src/sqlite_runtime_policy.ts +364 -0
- package/packages/core/src/typed_ast.ts +36 -8
- package/skill-data/core/references/project-anatomy.md +1 -1
- package/skill-data/native-ui/SKILL.md +47 -0
- package/skill-data/ts-core/SKILL.md +80 -31
- package/skill-data/ts-services/SKILL.md +126 -0
- package/skill-data/ts-services/references/service-surface.md +603 -0
- package/skill-data/zig/SKILL.md +1 -1
- package/skills/native-sdk/SKILL.md +1 -1
- package/src/app_runner/no_migrations.zig +3 -0
- package/src/app_runner/no_services.zig +20 -0
- package/src/app_runner/root.zig +104 -4
- package/src/app_runner/ts_core_main.zig +249 -8
- package/src/automation/snapshot.zig +23 -5
- package/src/embed/app_exports.zig +11 -1
- package/src/embed/c_api.zig +48 -2
- package/src/embed/conversions.zig +4 -5
- package/src/embed/host.zig +109 -1
- package/src/embed/root.zig +7 -0
- package/src/embed/tests.zig +213 -0
- package/src/embed/types.zig +51 -0
- package/src/embed/ui_host.zig +119 -5
- package/src/platform/android/NativeSdkActivity.java +131 -0
- package/src/platform/android/android_host.c +182 -1
- package/src/platform/android/native_sdk_app.h +17 -0
- package/src/platform/ios/native_sdk_app.h +17 -0
- package/src/platform/ios/uikit_host.m +115 -0
- package/src/platform/linux/cef_host.cpp +1 -1
- package/src/platform/linux/gtk_host.c +89 -17
- package/src/platform/linux/gtk_host.h +3 -0
- package/src/platform/linux/root.zig +40 -18
- package/src/platform/macos/appkit_host.h +16 -3
- package/src/platform/macos/appkit_host.m +536 -36
- package/src/platform/macos/cef_host.mm +248 -36
- package/src/platform/macos/root.zig +244 -34
- package/src/platform/null_platform.zig +223 -19
- package/src/platform/null_platform_tests.zig +74 -0
- package/src/platform/root.zig +9 -0
- package/src/platform/types.zig +179 -15
- package/src/platform/windows/root.zig +187 -21
- package/src/platform/windows/webview2_host.cpp +293 -46
- package/src/primitives/app_manifest/comptime_scene.zig +2 -0
- package/src/primitives/app_manifest/root.zig +4 -0
- package/src/primitives/app_manifest/tests.zig +3 -0
- package/src/primitives/app_manifest/types.zig +32 -0
- package/src/primitives/app_manifest/validation.zig +19 -1
- package/src/root.zig +46 -0
- package/src/runtime/api.zig +11 -0
- package/src/runtime/automation_snapshot.zig +4 -0
- package/src/runtime/bridge_permission_tests.zig +23 -2
- package/src/runtime/bridge_responses.zig +3 -1
- package/src/runtime/canvas_frame.zig +18 -11
- package/src/runtime/canvas_frame_animation_tests.zig +4 -0
- package/src/runtime/clock.zig +13 -1
- package/src/runtime/core.zig +133 -1
- package/src/runtime/credentials_store.zig +115 -0
- package/src/runtime/effects.zig +2295 -113
- package/src/runtime/effects_credentials_tests.zig +332 -0
- package/src/runtime/effects_host_tests.zig +208 -1
- package/src/runtime/effects_relational_tests.zig +314 -0
- package/src/runtime/effects_store_tests.zig +211 -0
- package/src/runtime/flow.zig +14 -1
- package/src/runtime/gpu_surface_events.zig +6 -1
- package/src/runtime/native_command_event_tests.zig +42 -0
- package/src/runtime/persist_store.zig +666 -0
- package/src/runtime/record_store.zig +788 -0
- package/src/runtime/relational_store.zig +854 -0
- package/src/runtime/root.zig +49 -0
- package/src/runtime/runtime_event_tests.zig +70 -0
- package/src/runtime/service_host.zig +711 -0
- package/src/runtime/service_pool.zig +1314 -0
- package/src/runtime/session_blobs.zig +1 -1
- package/src/runtime/session_journal.zig +102 -0
- package/src/runtime/session_record.zig +177 -0
- package/src/runtime/session_replay.zig +109 -4
- package/src/runtime/shell_layout.zig +1 -0
- package/src/runtime/shell_layout_tests.zig +120 -0
- package/src/runtime/sqlite_engine.zig +474 -0
- package/src/runtime/state.zig +6 -0
- package/src/runtime/system_services.zig +49 -10
- package/src/runtime/tests.zig +4 -0
- package/src/runtime/ts_core_host.zig +788 -86
- package/src/runtime/ts_core_host_tests.zig +231 -11
- package/src/runtime/ts_ui_app.zig +499 -1
- package/src/runtime/ui_app.zig +142 -16
- package/src/runtime/ui_app_tests.zig +155 -5
- package/src/runtime/validation.zig +22 -0
- package/src/runtime/view.zig +9 -0
- package/src/runtime/window_storage.zig +1 -0
- package/src/runtime/window_view_runtime.zig +2 -3
- package/src/runtime/window_views.zig +19 -0
- package/src/tooling/android.zig +21 -16
- package/src/tooling/db.zig +160 -0
- package/src/tooling/ios.zig +7 -1
- package/src/tooling/manifest.zig +214 -2
- package/src/tooling/package.zig +116 -0
- package/src/tooling/raw_manifest.zig +30 -0
- package/src/tooling/root.zig +1 -0
- package/src/tooling/templates.zig +161 -4
- package/src/tooling/ts_core.zig +283 -17
- package/src/tooling/verbs.zig +7 -0
- package/third_party/sqlite/README.md +13 -0
- package/third_party/sqlite/sqlite3.c +269649 -0
- package/third_party/sqlite/sqlite3.h +14349 -0
- package/tools/corewire/core_abi.zig +14 -2
- package/tools/corewire/emit.zig +98 -29
- package/tools/corewire/emit_facade.zig +378 -23
- package/tools/corewire/emit_profile.zig +6 -2
- package/tools/corewire/emit_service.zig +924 -0
- package/tools/corewire/main.zig +122 -0
- package/tools/corewire/service_contract.zig +250 -0
- package/tools/corewire/sidecar.zig +26 -15
|
@@ -34,6 +34,7 @@ typedef enum {
|
|
|
34
34
|
NATIVE_SDK_APPKIT_EVENT_AUDIO = 20,
|
|
35
35
|
NATIVE_SDK_APPKIT_EVENT_VIDEO = 21,
|
|
36
36
|
NATIVE_SDK_APPKIT_EVENT_VIEW_FOCUSED = 22,
|
|
37
|
+
NATIVE_SDK_APPKIT_EVENT_TRAY_COMMAND = 23,
|
|
37
38
|
} native_sdk_appkit_event_kind_t;
|
|
38
39
|
|
|
39
40
|
/* Audio player reports (EVENT_AUDIO payloads). LOADED acknowledges a
|
|
@@ -365,7 +366,8 @@ typedef void (*native_sdk_appkit_bridge_callback_t)(void *context, uint64_t wind
|
|
|
365
366
|
// the first canvas present (present-before-show: the window is created
|
|
366
367
|
// ordered-out and `makeKeyAndOrderFront` runs after the first
|
|
367
368
|
// gpu-surface present lands, with a short fallback deadline so a wedged
|
|
368
|
-
// first frame cannot leave the window invisible)
|
|
369
|
+
// first frame cannot leave the window invisible), 2 = explicitly hidden
|
|
370
|
+
// until a show/focus request.
|
|
369
371
|
//
|
|
370
372
|
// display_name is the human-facing app name (empty = fall back to
|
|
371
373
|
// app_name): it drives the application menu title and its About/Hide/
|
|
@@ -424,11 +426,20 @@ int native_sdk_appkit_close_window(native_sdk_appkit_host_t *host, uint64_t wind
|
|
|
424
426
|
// window controls on chromeless windows. Returns 0 when the window id
|
|
425
427
|
// is unknown.
|
|
426
428
|
int native_sdk_appkit_minimize_window(native_sdk_appkit_host_t *host, uint64_t window_id);
|
|
429
|
+
// Order a live window out without closing it. `show_window` is the inverse.
|
|
430
|
+
int native_sdk_appkit_hide_window(native_sdk_appkit_host_t *host, uint64_t window_id);
|
|
427
431
|
// The show verb: bring the window back to the glass and activate the
|
|
428
432
|
// app (deminiaturize + makeKeyAndOrderFront) — the counterpart to a
|
|
429
433
|
// close_policy .hide hide, and the tray-menu "Open" consequence.
|
|
430
434
|
// Returns 0 when the window id is unknown.
|
|
431
435
|
int native_sdk_appkit_show_window(native_sdk_appkit_host_t *host, uint64_t window_id);
|
|
436
|
+
// Change the process activation policy: visible = regular (Dock/app
|
|
437
|
+
// switcher), hidden = accessory. Returns 1 when applied.
|
|
438
|
+
int native_sdk_appkit_set_dock_presence(native_sdk_appkit_host_t *host, int visible);
|
|
439
|
+
// SMAppService.mainApp status values: 0 not registered, 1 enabled,
|
|
440
|
+
// 2 requires approval, 3 not found; -1 when unavailable.
|
|
441
|
+
int native_sdk_appkit_launch_at_login_status(native_sdk_appkit_host_t *host);
|
|
442
|
+
int native_sdk_appkit_set_launch_at_login(native_sdk_appkit_host_t *host, int enabled);
|
|
432
443
|
// What the user's close affordance does to this window: 0 = quit (the
|
|
433
444
|
// default: really close; last close follows app exit semantics),
|
|
434
445
|
// 1 = hide (order out and keep running — the menu-bar-app shape).
|
|
@@ -641,6 +652,7 @@ int native_sdk_appkit_clear_recent_documents(native_sdk_appkit_host_t *host);
|
|
|
641
652
|
int native_sdk_appkit_set_credential(native_sdk_appkit_host_t *host, const char *service, size_t service_len, const char *account, size_t account_len, const char *secret, size_t secret_len);
|
|
642
653
|
size_t native_sdk_appkit_get_credential(native_sdk_appkit_host_t *host, const char *service, size_t service_len, const char *account, size_t account_len, char *buffer, size_t buffer_len);
|
|
643
654
|
int native_sdk_appkit_delete_credential(native_sdk_appkit_host_t *host, const char *service, size_t service_len, const char *account, size_t account_len);
|
|
655
|
+
size_t native_sdk_appkit_format_local_time(native_sdk_appkit_host_t *host, int64_t timestamp_ms, int style, char *buffer, size_t buffer_len);
|
|
644
656
|
|
|
645
657
|
typedef struct {
|
|
646
658
|
const char *title;
|
|
@@ -754,13 +766,14 @@ int native_sdk_appkit_show_context_menu(native_sdk_appkit_host_t *host, uint64_t
|
|
|
754
766
|
native_sdk_appkit_open_dialog_result_t native_sdk_appkit_show_open_dialog(native_sdk_appkit_host_t *host, const native_sdk_appkit_open_dialog_opts_t *opts, char *buffer, size_t buffer_len);
|
|
755
767
|
size_t native_sdk_appkit_show_save_dialog(native_sdk_appkit_host_t *host, const native_sdk_appkit_save_dialog_opts_t *opts, char *buffer, size_t buffer_len);
|
|
756
768
|
int native_sdk_appkit_show_message_dialog(native_sdk_appkit_host_t *host, const native_sdk_appkit_message_dialog_opts_t *opts);
|
|
757
|
-
void native_sdk_appkit_create_tray(native_sdk_appkit_host_t *host, const char *icon_path, size_t icon_path_len, const char *title, size_t title_len, const char *tooltip, size_t tooltip_len);
|
|
758
|
-
void native_sdk_appkit_update_tray_menu(native_sdk_appkit_host_t *host, const uint32_t *item_ids, const char *const *labels, const size_t *label_lens, const int *separators, const int *enabled_flags, size_t count);
|
|
769
|
+
void native_sdk_appkit_create_tray(native_sdk_appkit_host_t *host, const char *icon_path, size_t icon_path_len, const char *title, size_t title_len, const char *tooltip, size_t tooltip_len, double width, int tone, double icon_opacity, int monospaced, const char *activation_command, size_t activation_command_len, const char *alternate_activation_command, size_t alternate_activation_command_len, const char *open_command, size_t open_command_len);
|
|
770
|
+
void native_sdk_appkit_update_tray_menu(native_sdk_appkit_host_t *host, const uint32_t *item_ids, const char *const *labels, const size_t *label_lens, const int *separators, const int *enabled_flags, const char *const *details, const size_t *detail_lens, const int *roles, const char *const *keys, const size_t *key_lens, const uint32_t *modifiers, size_t count);
|
|
759
771
|
/* Retitle the live status item's button without re-creating it (create
|
|
760
772
|
* would flicker and reshuffle the menu bar). Empty title falls back to
|
|
761
773
|
* the icon-only square well, or the app-name initial when there is no
|
|
762
774
|
* icon either — the same fallbacks as create. */
|
|
763
775
|
void native_sdk_appkit_update_tray_title(native_sdk_appkit_host_t *host, const char *title, size_t title_len);
|
|
776
|
+
void native_sdk_appkit_update_tray_presentation(native_sdk_appkit_host_t *host, const char *title, size_t title_len, double width, int tone, double icon_opacity, int monospaced);
|
|
764
777
|
void native_sdk_appkit_remove_tray(native_sdk_appkit_host_t *host);
|
|
765
778
|
void native_sdk_appkit_set_tray_callback(native_sdk_appkit_host_t *host, native_sdk_appkit_tray_callback_t callback, void *context);
|
|
766
779
|
|