@native-sdk/cli 0.9.5 → 0.10.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.
Files changed (49) hide show
  1. package/build/app.zig +7 -0
  2. package/build/ts_run.mjs +1 -1
  3. package/build.zig +30 -5
  4. package/package.json +10 -10
  5. package/packages/core/package-lock.json +12 -11
  6. package/packages/core/package.json +2 -2
  7. package/packages/core/scripts/compiler_command.mjs +1 -1
  8. package/schemas/app.schema.json +12 -1
  9. package/skill-data/core/references/web-engines-packaging-debugging.md +2 -1
  10. package/skill-data/ts-services/references/service-surface.md +1 -1
  11. package/src/app_runner/root.zig +25 -0
  12. package/src/platform/macos/appkit_host.h +25 -0
  13. package/src/platform/macos/appkit_host.m +537 -15
  14. package/src/platform/macos/cef_host.mm +17 -0
  15. package/src/platform/macos/root.zig +95 -0
  16. package/src/platform/root.zig +3 -0
  17. package/src/platform/types.zig +15 -0
  18. package/src/primitives/app_manifest/tests.zig +19 -0
  19. package/src/primitives/app_manifest/validation.zig +14 -2
  20. package/src/primitives/canvas/font_ttf.zig +24 -0
  21. package/src/primitives/canvas/gpu.zig +5 -0
  22. package/src/primitives/canvas/reference.zig +4 -1
  23. package/src/primitives/canvas/render_tests.zig +1 -1
  24. package/src/primitives/canvas/root.zig +1 -0
  25. package/src/primitives/canvas/serialization.zig +1 -0
  26. package/src/primitives/canvas/test_support.zig +1 -0
  27. package/src/primitives/canvas/text.zig +1 -0
  28. package/src/primitives/canvas/text_layout.zig +84 -15
  29. package/src/primitives/canvas/text_layout_hash.zig +3 -1
  30. package/src/primitives/canvas/text_layout_types.zig +3 -0
  31. package/src/primitives/canvas/text_metrics.zig +28 -1
  32. package/src/primitives/canvas/text_tests.zig +61 -6
  33. package/src/primitives/canvas/widget_render.zig +6 -0
  34. package/src/primitives/canvas/widget_render_controls.zig +1 -0
  35. package/src/root.zig +2 -0
  36. package/src/runtime/canvas_fonts.zig +87 -0
  37. package/src/runtime/core.zig +1 -0
  38. package/src/runtime/flow.zig +7 -0
  39. package/src/runtime/native_command_event_tests.zig +58 -0
  40. package/src/tooling/codesign.zig +125 -74
  41. package/src/tooling/manifest.zig +79 -2
  42. package/src/tooling/package.zig +118 -1
  43. package/src/tooling/raw_manifest.zig +7 -0
  44. package/src/tooling/root.zig +1 -0
  45. package/src/tooling/templates.zig +45 -0
  46. package/src/tooling/update.zig +576 -0
  47. package/src/updater/c_api.zig +123 -0
  48. package/src/updater/feed.zig +215 -0
  49. package/src/updater/root.zig +10 -0
package/build/app.zig CHANGED
@@ -1742,6 +1742,9 @@ pub fn addAppArtifacts(b: *std.Build, dep: *std.Build.Dependency, app_options: A
1742
1742
  @panic("-Dplatform=windows requires a Windows target");
1743
1743
  }
1744
1744
  const web_engine = web_engine_override orelse app_config.web_engine;
1745
+ if (app_config.updates_enabled and selected_platform == .macos and web_engine == .chromium) {
1746
+ @panic("\nnative updates currently require the system macOS host; use web_engine = \"system\" or remove the updates block\n");
1747
+ }
1745
1748
  const cef_dir = cef_dir_override orelse defaultCefDir(selected_platform, app_config.cef_dir);
1746
1749
  const cef_auto_install = cef_auto_install_override orelse app_config.cef_auto_install;
1747
1750
  if (web_engine == .chromium and selected_platform != .macos) {
@@ -1973,6 +1976,7 @@ pub fn addAppArtifacts(b: *std.Build, dep: *std.Build.Dependency, app_options: A
1973
1976
  // runtime (the generated build graph already forwards them).
1974
1977
  package_run.addArgs(&.{ "--web-engine", @tagName(web_engine), "--cef-dir", cef_dir });
1975
1978
  if (cef_auto_install) package_run.addArg("--cef-auto-install");
1979
+ if (app_config.updates_enabled and host_os == .macos) package_run.addArg("--update-archive");
1976
1980
  package_run.has_side_effects = true;
1977
1981
  const package_step = b.step("package", "Create a distributable package via the native CLI");
1978
1982
  package_step.dependOn(&package_run.step);
@@ -2747,6 +2751,7 @@ const AppManifestBuildConfig = struct {
2747
2751
  credentials_permission: bool = false,
2748
2752
  filesystem_permission: bool = false,
2749
2753
  max_image_pixel_bytes: usize = 1024 * 1024,
2754
+ updates_enabled: bool = false,
2750
2755
  sqlite_capability: bool = false,
2751
2756
  /// The first web declaration found (for teaching messages), or null
2752
2757
  /// when app.zon declares no web use. `web_engine = "system"` alone is
@@ -2786,6 +2791,7 @@ const InferenceManifest = struct {
2786
2791
  service_packages: []const ServicePackageConfig = &.{},
2787
2792
  service_carrier: []const u8 = "auto",
2788
2793
  service_pool_size: u8 = 0,
2794
+ updates: ?struct {} = null,
2789
2795
  shell: struct {
2790
2796
  windows: []const struct {
2791
2797
  views: []const struct {
@@ -2851,6 +2857,7 @@ fn appManifestBuildConfig(b: *std.Build, app_root: []const u8, manifest_name: []
2851
2857
  .credentials_permission = hasManifestPermission(raw.permissions, "credentials"),
2852
2858
  .filesystem_permission = hasManifestPermission(raw.permissions, "filesystem"),
2853
2859
  .max_image_pixel_bytes = raw.images.max_image_pixel_bytes,
2860
+ .updates_enabled = raw.updates != null,
2854
2861
  .sqlite_capability = hasManifestCapability(raw.capabilities, "store") or hasManifestCapability(raw.capabilities, "sqlite"),
2855
2862
  .web_declaration = web_layer_contract.manifestDeclaration(raw),
2856
2863
  };
package/build/ts_run.mjs CHANGED
@@ -13,7 +13,7 @@
13
13
  // relied on: it refuses node_modules-resident .ts by design
14
14
  // (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING), and outside node_modules
15
15
  // it only became DEFAULT in node 22.18. Hooking everything keeps both layouts
16
- // identical. scriptc 0.0.33 requires Node 24 for its published compile-cache
16
+ // identical. scriptc 0.0.35 requires Node 24 for its published compile-cache
17
17
  // bootstrap, so this shared runner enforces the same floor before importing
18
18
  // any frontend module. Then it imports the requested module with argv
19
19
  // respliced so the target sees its usual shape (its own path at argv[1],
package/build.zig CHANGED
@@ -119,6 +119,9 @@ pub fn build(b: *std.Build) void {
119
119
  _ = b.option(bool, "js-bridge", "Enable optional JavaScript bridge stubs") orelse false;
120
120
  const package_target = b.option(PackageTarget, "package-target", "Package target: macos, windows, linux, ios, android") orelse .macos;
121
121
  const signing_mode = b.option(SigningMode, "signing", "Signing mode: none, adhoc, identity") orelse .none;
122
+ const signing_identity = b.option([]const u8, "identity", "Code signing identity for distribution packages");
123
+ const signing_entitlements = b.option([]const u8, "entitlements", "Entitlements plist for identity signing");
124
+ const notary_profile = b.option([]const u8, "notary-profile", "notarytool Keychain profile for notarization");
122
125
  const package_version = packageVersion(b);
123
126
  const optimize_name = @tagName(optimize);
124
127
  // Resolve against THIS build's root: as a dependency of a user app the
@@ -320,6 +323,7 @@ pub fn build(b: *std.Build) void {
320
323
  const ios_host_mod = module(b, target, optimize, "src/platform/ios/files.zig");
321
324
  const android_host_mod = module(b, target, optimize, "src/platform/android/files.zig");
322
325
  const tooling_mod = module(b, target, optimize, "src/tooling/root.zig");
326
+ const update_feed_mod = module(b, target, optimize, "src/updater/feed.zig");
323
327
  tooling_mod.addImport("assets", assets_mod);
324
328
  tooling_mod.addImport("app_dirs", app_dirs_mod);
325
329
  tooling_mod.addImport("app_manifest", app_manifest_mod);
@@ -331,6 +335,7 @@ pub fn build(b: *std.Build) void {
331
335
  tooling_mod.addImport("ios_host", ios_host_mod);
332
336
  tooling_mod.addImport("android_host", android_host_mod);
333
337
  tooling_mod.addImport("sqlite_engine", module(b, target, optimize, "src/runtime/sqlite_engine.zig"));
338
+ tooling_mod.addImport("update_feed", update_feed_mod);
334
339
  tooling_mod.addIncludePath(b.path("third_party/sqlite"));
335
340
  tooling_mod.addCSourceFile(.{
336
341
  .file = b.path("third_party/sqlite/sqlite3.c"),
@@ -440,6 +445,7 @@ pub fn build(b: *std.Build) void {
440
445
  const host_ios_host_mod = module(b, host_target, optimize, "src/platform/ios/files.zig");
441
446
  const host_android_host_mod = module(b, host_target, optimize, "src/platform/android/files.zig");
442
447
  const host_tooling_mod = module(b, host_target, optimize, "src/tooling/root.zig");
448
+ const host_update_feed_mod = module(b, host_target, optimize, "src/updater/feed.zig");
443
449
  host_tooling_mod.addImport("assets", host_assets_mod);
444
450
  host_tooling_mod.addImport("app_dirs", host_app_dirs_mod);
445
451
  host_tooling_mod.addImport("app_manifest", host_app_manifest_mod);
@@ -451,6 +457,7 @@ pub fn build(b: *std.Build) void {
451
457
  host_tooling_mod.addImport("ios_host", host_ios_host_mod);
452
458
  host_tooling_mod.addImport("android_host", host_android_host_mod);
453
459
  host_tooling_mod.addImport("sqlite_engine", module(b, host_target, optimize, "src/runtime/sqlite_engine.zig"));
460
+ host_tooling_mod.addImport("update_feed", host_update_feed_mod);
454
461
  host_tooling_mod.addIncludePath(b.path("third_party/sqlite"));
455
462
  host_tooling_mod.addCSourceFile(.{
456
463
  .file = b.path("third_party/sqlite/sqlite3.c"),
@@ -1347,8 +1354,11 @@ pub fn build(b: *std.Build) void {
1347
1354
  .{ .path = "src/platform/macos/appkit_host.m", .pattern = "NSMutableParagraphStyle" },
1348
1355
  .{ .path = "src/platform/macos/appkit_host.m", .pattern = "NativeSdkPacketTextLineBreakMode" },
1349
1356
  .{ .path = "src/platform/macos/appkit_host.m", .pattern = "NativeSdkPacketTextAlignment" },
1357
+ .{ .path = "src/platform/macos/appkit_host.m", .pattern = "static BOOL NativeSdkPacketDrawAttributedText(" },
1358
+ .{ .path = "src/platform/macos/appkit_host.m", .pattern = "drawGlyphsForGlyphRange:glyphRange atPoint:" },
1359
+ .{ .path = "src/platform/macos/appkit_host.m", .pattern = "glyphRangeForTextContainer:container" },
1350
1360
  .{ .path = "src/platform/macos/appkit_host.m", .pattern = "NativeSdkPacketNumber(layout[@\"maxWidth\"], 0)" },
1351
- .{ .path = "src/platform/macos/appkit_host.m", .pattern = "[value drawWithRect:NSMakeRect(origin.x, origin.y - size, textWidth, textHeight)" },
1361
+ .{ .path = "src/platform/macos/appkit_host.m", .pattern = "native_sdk_appkit_measure_text_ink(" },
1352
1362
  });
1353
1363
  addFileContainsCheckStep(b, file_contains_checker, test_step, "test-appkit-gpu-packet-font-assets", "Verify AppKit GPU packet text registers bundled font assets", &.{
1354
1364
  .{ .path = "src/platform/macos/appkit_host.m", .pattern = "#import <CoreText/CoreText.h>" },
@@ -2955,6 +2965,8 @@ pub fn build(b: *std.Build) void {
2955
2965
  });
2956
2966
  package_run.addFileArg(embed_lib.getEmittedBin());
2957
2967
  package_run.addArgs(&.{ "--manifest", "app.zon", "--assets", "assets", "--optimize", optimize_name, "--signing", @tagName(signing_mode), "--web-engine", @tagName(web_engine), "--cef-dir", cef_dir });
2968
+ if (signing_identity) |identity| package_run.addArgs(&.{ "--identity", identity });
2969
+ if (signing_entitlements) |entitlements| package_run.addArgs(&.{ "--entitlements", entitlements });
2958
2970
  if (cef_auto_install) package_run.addArg("--cef-auto-install");
2959
2971
  package_run.step.dependOn(&embed_lib.step);
2960
2972
  package_run.step.dependOn(&bundle_run.step);
@@ -2992,6 +3004,13 @@ pub fn build(b: *std.Build) void {
2992
3004
  const package_cef_smoke_step = b.step("test-package-cef-layout", "Verify macOS Chromium package layout");
2993
3005
  package_cef_smoke_step.dependOn(&package_cef_check.step);
2994
3006
 
3007
+ // The repository's macOS distribution helpers need a real launchable
3008
+ // executable inside the .app. Keep the notarization helper on the same
3009
+ // emitted host CLI binary that the signed-package smoke executes below;
3010
+ // the SDK embed artifact is a static `.a` library and is not a valid
3011
+ // CFBundleExecutable even though codesign can seal a bundle around it.
3012
+ const macos_distribution_executable = host_cli_exe.getEmittedBin();
3013
+
2995
3014
  // Signed-package seal pin: package an ad-hoc signed bundle and prove
2996
3015
  // the signature survives packaging intact with codesign's own strict
2997
3016
  // verifier. This is the regression gate for the ordering bug where a
@@ -3008,7 +3027,7 @@ pub fn build(b: *std.Build) void {
3008
3027
  const package_signing_mode: []const u8 = if (b.graph.host.result.os.tag == .macos) "adhoc" else "none";
3009
3028
  const package_signing_run = b.addRunArtifact(host_cli_exe);
3010
3029
  package_signing_run.addArgs(&.{ "package", "--target", "macos", "--output", "zig-out/package/native-sdk-signing-verify.app", "--binary" });
3011
- package_signing_run.addFileArg(host_cli_exe.getEmittedBin());
3030
+ package_signing_run.addFileArg(macos_distribution_executable);
3012
3031
  package_signing_run.addArgs(&.{ "--manifest", "app.zon", "--assets", "assets", "--optimize", optimize_name, "--signing", package_signing_mode });
3013
3032
  package_signing_run.has_side_effects = true;
3014
3033
  const package_signing_check = b.addSystemCommand(&.{
@@ -3020,6 +3039,7 @@ pub fn build(b: *std.Build) void {
3020
3039
  \\ exit 0
3021
3040
  \\fi
3022
3041
  \\codesign --verify --strict --deep "$app"
3042
+ \\"$app/Contents/MacOS/native-sdk" version >/dev/null
3023
3043
  \\grep -q "ad-hoc signed" "$app/Contents/Resources/signing-plan.txt"
3024
3044
  \\echo "signed package verify ok"
3025
3045
  ,
@@ -3087,10 +3107,13 @@ pub fn build(b: *std.Build) void {
3087
3107
  b.fmt("zig-out/package/native-sdk-{s}-macos-{s}.app", .{ package_version, optimize_name }),
3088
3108
  "--binary",
3089
3109
  });
3090
- notarize_run.addFileArg(embed_lib.getEmittedBin());
3091
- notarize_run.addArgs(&.{ "--manifest", "app.zon", "--assets", "assets", "--optimize", optimize_name, "--signing", "identity", "--web-engine", @tagName(web_engine), "--cef-dir", cef_dir });
3110
+ notarize_run.addFileArg(macos_distribution_executable);
3111
+ notarize_run.addArgs(&.{ "--manifest", "app.zon", "--assets", "assets", "--optimize", optimize_name, "--signing", "identity", "--web-engine", @tagName(web_engine), "--cef-dir", cef_dir, "--archive", "--notarize" });
3112
+ if (signing_identity) |identity| notarize_run.addArgs(&.{ "--identity", identity });
3113
+ if (signing_entitlements) |entitlements| notarize_run.addArgs(&.{ "--entitlements", entitlements });
3114
+ if (notary_profile) |profile| notarize_run.addArgs(&.{ "--notary-profile", profile });
3092
3115
  if (cef_auto_install) notarize_run.addArg("--cef-auto-install");
3093
- notarize_run.step.dependOn(&embed_lib.step);
3116
+ notarize_run.step.dependOn(&host_cli_exe.step);
3094
3117
  notarize_run.step.dependOn(&bundle_run.step);
3095
3118
  const notarize_step = b.step("notarize", "Package, sign with identity, and notarize for macOS distribution");
3096
3119
  notarize_step.dependOn(&notarize_run.step);
@@ -3111,6 +3134,8 @@ pub fn build(b: *std.Build) void {
3111
3134
  });
3112
3135
  dmg_run.addFileArg(embed_lib.getEmittedBin());
3113
3136
  dmg_run.addArgs(&.{ "--manifest", "app.zon", "--assets", "assets", "--optimize", optimize_name, "--signing", @tagName(signing_mode), "--web-engine", @tagName(web_engine), "--cef-dir", cef_dir, "--archive" });
3137
+ if (signing_identity) |identity| dmg_run.addArgs(&.{ "--identity", identity });
3138
+ if (signing_entitlements) |entitlements| dmg_run.addArgs(&.{ "--entitlements", entitlements });
3114
3139
  if (cef_auto_install) dmg_run.addArg("--cef-auto-install");
3115
3140
  dmg_run.step.dependOn(&embed_lib.step);
3116
3141
  dmg_run.step.dependOn(&bundle_run.step);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@native-sdk/cli",
3
- "version": "0.9.5",
3
+ "version": "0.10.1",
4
4
  "description": "The Native SDK: the complete toolkit for building native desktop applications — declarative markup, native rendering, WebView surfaces, and OS capabilities",
5
5
  "type": "module",
6
6
  "engines": {
@@ -36,17 +36,17 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@typescript/old": "npm:typescript@6.0.3",
39
- "scriptc": "0.0.33"
39
+ "scriptc": "0.0.35"
40
40
  },
41
41
  "optionalDependencies": {
42
- "@native-sdk/cli-darwin-arm64": "0.9.5",
43
- "@native-sdk/cli-darwin-x64": "0.9.5",
44
- "@native-sdk/cli-linux-arm64-gnu": "0.9.5",
45
- "@native-sdk/cli-linux-arm64-musl": "0.9.5",
46
- "@native-sdk/cli-linux-x64-gnu": "0.9.5",
47
- "@native-sdk/cli-linux-x64-musl": "0.9.5",
48
- "@native-sdk/cli-win32-arm64": "0.9.5",
49
- "@native-sdk/cli-win32-x64": "0.9.5"
42
+ "@native-sdk/cli-darwin-arm64": "0.10.1",
43
+ "@native-sdk/cli-darwin-x64": "0.10.1",
44
+ "@native-sdk/cli-linux-arm64-gnu": "0.10.1",
45
+ "@native-sdk/cli-linux-arm64-musl": "0.10.1",
46
+ "@native-sdk/cli-linux-x64-gnu": "0.10.1",
47
+ "@native-sdk/cli-linux-x64-musl": "0.10.1",
48
+ "@native-sdk/cli-win32-arm64": "0.10.1",
49
+ "@native-sdk/cli-win32-x64": "0.10.1"
50
50
  },
51
51
  "repository": {
52
52
  "type": "git",
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@native-sdk/core",
3
- "version": "0.9.5",
3
+ "version": "0.10.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@native-sdk/core",
9
- "version": "0.9.5",
9
+ "version": "0.10.1",
10
10
  "dependencies": {
11
- "scriptc": "0.0.33"
11
+ "scriptc": "0.0.35"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@typescript/old": "npm:typescript@6.0.3"
@@ -18,18 +18,18 @@
18
18
  }
19
19
  },
20
20
  "node_modules/@scriptc/compiler": {
21
- "version": "0.0.33",
22
- "integrity": "sha512-Hkxo+Z0WwY/c/X9jR/EXVqQv4uHxRuVoE7THIdfYOgTbnshqVvW2z8k5womnSu33j4pAV8MCo4vDImgOpoAeUw==",
21
+ "version": "0.0.35",
22
+ "integrity": "sha512-OLTmyGpFPJAAVn0RfRBoXuCjpaTfpBC1wt6XdO/SzqMab/DaRjCIJY9vv5b1VspP6zLZP2WEYWZPgP8vHKAJPg==",
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@scriptc/runtime": "0.0.33",
25
+ "@scriptc/runtime": "0.0.35",
26
26
  "typescript": "7.0.2",
27
27
  "typescript5": "npm:typescript@5.9.3"
28
28
  }
29
29
  },
30
30
  "node_modules/@scriptc/runtime": {
31
- "version": "0.0.33",
32
- "integrity": "sha512-dvmfPdS/Jz4l7rmvnHk76yC469il+zk317RTnTDzP3iW4PHjOhd+W8ZCDgQZEp1VSsNSBy2EQnh2+8Eyv+uVKA==",
31
+ "version": "0.0.35",
32
+ "integrity": "sha512-kjtKfneGr9YGxx631jOPJ1XVh0X6h5LM+rwQmhF6loI9oA+zW7rlYmoF+VkTXLdkre+bu9LptIIgdxKPdAquPA==",
33
33
  "license": "Apache-2.0"
34
34
  },
35
35
  "node_modules/@typescript/old": {
@@ -347,11 +347,12 @@
347
347
  }
348
348
  },
349
349
  "node_modules/scriptc": {
350
- "version": "0.0.33",
351
- "integrity": "sha512-GzNvPRl41xzPA+E9hifmhACoIWPHxx2gU0BT++2T1CatrkQLvt5QKrjPw+OZzRLQBtOD/xGr3Tt4lT5gV/ganA==",
350
+ "version": "0.0.35",
351
+ "integrity": "sha512-46Td/02HJZNLuosdYDiUSQ+auKwGmQ03+odD6Pg+J7D+eAV7sOYQvjZu9M+3ePyYfL3hFQa6wWiGexV/Bd0r+w==",
352
+ "hasInstallScript": true,
352
353
  "license": "Apache-2.0",
353
354
  "dependencies": {
354
- "@scriptc/compiler": "0.0.33"
355
+ "@scriptc/compiler": "0.0.35"
355
356
  },
356
357
  "bin": {
357
358
  "scriptc": "dist/bootstrap.js"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@native-sdk/core",
3
- "version": "0.9.5",
3
+ "version": "0.10.1",
4
4
  "description": "The TypeScript authoring tier: the app-core subset, its checker and contract frontend, the exact-pinned core compiler dependency, and the SDK module cores import",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,6 +39,6 @@
39
39
  "@typescript/old": "npm:typescript@6.0.3"
40
40
  },
41
41
  "dependencies": {
42
- "scriptc": "0.0.33"
42
+ "scriptc": "0.0.35"
43
43
  }
44
44
  }
@@ -49,7 +49,7 @@ export function compilerArgv(command, options = {}) {
49
49
  }
50
50
 
51
51
  /// Resolve scriptc through its published package `bin` declaration. This is
52
- /// intentionally not `scriptc/dist/main.js`: 0.0.33's bin points at the Node
52
+ /// intentionally not `scriptc/dist/main.js`: 0.0.35's bin points at the Node
53
53
  /// 24 compile-cache bootstrap, and future package entrypoint changes should
54
54
  /// reach every Native check/build invocation automatically.
55
55
  export function publishedScriptcArgv(origin, options = {}) {
@@ -12,7 +12,7 @@
12
12
  "name": { "type": "string", "minLength": 1, "description": "Short machine-readable app name." },
13
13
  "display_name": { "type": "string", "minLength": 1, "description": "Human-readable app name." },
14
14
  "description": { "type": "string", "minLength": 1, "maxLength": 256 },
15
- "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
15
+ "version": { "type": "string", "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$" },
16
16
  "icons": { "$ref": "#/$defs/stringArray" },
17
17
  "platforms": {
18
18
  "type": "array",
@@ -77,6 +77,7 @@
77
77
  "type": "array",
78
78
  "items": { "$ref": "#/$defs/urlScheme" }
79
79
  },
80
+ "updates": { "$ref": "#/$defs/updates" },
80
81
  "dmg": { "$ref": "#/$defs/dmg" }
81
82
  },
82
83
  "$defs": {
@@ -130,6 +131,16 @@
130
131
  "content_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
131
132
  }
132
133
  },
134
+ "updates": {
135
+ "type": "object",
136
+ "additionalProperties": false,
137
+ "required": ["feed_url", "public_key"],
138
+ "properties": {
139
+ "feed_url": { "type": "string", "pattern": "^https://", "maxLength": 4096 },
140
+ "public_key": { "type": "string", "pattern": "^[A-Za-z0-9+/]{43}=$" },
141
+ "check_on_start": { "type": "boolean", "default": false }
142
+ }
143
+ },
133
144
  "bridge": {
134
145
  "type": "object",
135
146
  "additionalProperties": false,
@@ -106,9 +106,10 @@ Signing modes:
106
106
  native package --target macos --signing none
107
107
  native package --target macos --signing adhoc
108
108
  native package --target macos --signing identity --identity "Developer ID Application: Your Name"
109
+ native package --target macos --signing identity --identity "Developer ID Application: Your Name" --archive --notarize --notary-profile "my-app-release"
109
110
  ```
110
111
 
111
- For Chromium apps, verify the CEF framework and resources are included and signed before notarization.
112
+ Identity signing enables the hardened runtime and requires a secure timestamp. `--notarize` uses a `notarytool` Keychain profile, submits the final DMG when `--archive` is present, and staples and validates the accepted tickets. For Chromium apps, verify the CEF framework and resources are included and signed before notarization.
112
113
 
113
114
  ## Linux and Windows packages
114
115
 
@@ -6,7 +6,7 @@
6
6
  Verify without writing:
7
7
  node packages/core/scripts/gen_service_surface.mjs --check -->
8
8
 
9
- # Service compile surface — scriptc 0.0.33
9
+ # Service compile surface — scriptc 0.0.35
10
10
 
11
11
  What TypeScript under `src/services/` can use, as stated by the pinned
12
12
  compiler itself (surface manifest schema 1, 527 entries:
@@ -95,6 +95,9 @@ pub const RunOptions = struct {
95
95
  .window_title = self.window_title,
96
96
  .bundle_id = self.bundle_id,
97
97
  .icon_path = self.icon_path,
98
+ .update_feed_url = manifestUpdateString("feed_url"),
99
+ .update_public_key = manifestUpdateString("public_key"),
100
+ .update_check_on_start = manifestUpdateCheckOnStart(),
98
101
  .main_window = .{
99
102
  .id = 1,
100
103
  .label = "main",
@@ -155,6 +158,23 @@ pub const RunOptions = struct {
155
158
  }
156
159
  };
157
160
 
161
+ fn manifestUpdateString(comptime field: []const u8) []const u8 {
162
+ if (comptime !@hasField(@TypeOf(app_manifest), "updates")) return "";
163
+ const updates = app_manifest.updates;
164
+ if (comptime !@hasField(@TypeOf(updates), field)) return "";
165
+ const value = @field(updates, field);
166
+ return switch (@typeInfo(@TypeOf(value))) {
167
+ .optional => value orelse "",
168
+ else => value,
169
+ };
170
+ }
171
+
172
+ fn manifestUpdateCheckOnStart() bool {
173
+ if (comptime !@hasField(@TypeOf(app_manifest), "updates")) return false;
174
+ if (comptime !@hasField(@TypeOf(app_manifest.updates), "check_on_start")) return false;
175
+ return app_manifest.updates.check_on_start;
176
+ }
177
+
158
178
  const CommandStorage = struct {
159
179
  commands: [native_sdk.app_manifest.max_commands]native_sdk.Command = undefined,
160
180
 
@@ -1256,6 +1276,11 @@ test "RunOptions resolves manifest commands menus and shortcuts" {
1256
1276
  .app_name = "runner-fixture",
1257
1277
  .bundle_id = "dev.native_sdk.runner_fixture",
1258
1278
  };
1279
+ var info_buffers: StateBuffers = .{};
1280
+ const app_info = options.appInfo(&info_buffers);
1281
+ try std.testing.expectEqualStrings("https://example.com/native-update.json", app_info.update_feed_url);
1282
+ try std.testing.expectEqualStrings("11qYAYKxCrfVS/7TyWQHOg7hcvPapiMlrwIaaPcHURo=", app_info.update_public_key);
1283
+ try std.testing.expect(app_info.update_check_on_start);
1259
1284
 
1260
1285
  var command_storage: CommandStorage = .{};
1261
1286
  const commands = options.resolvedCommands(&command_storage);
@@ -367,6 +367,27 @@ typedef struct {
367
367
  typedef void (*native_sdk_appkit_event_callback_t)(void *context, const native_sdk_appkit_event_t *event);
368
368
  typedef void (*native_sdk_appkit_bridge_callback_t)(void *context, uint64_t window_id, const char *webview_label, size_t webview_label_len, const char *message, size_t message_len, const char *origin, size_t origin_len);
369
369
 
370
+ typedef struct native_sdk_update_verify_result {
371
+ int ok;
372
+ int error_code;
373
+ size_t version_len;
374
+ size_t archive_url_len;
375
+ size_t release_notes_len;
376
+ uint64_t archive_bytes;
377
+ char sha256[64];
378
+ } native_sdk_update_verify_result_t;
379
+
380
+ native_sdk_update_verify_result_t native_sdk_update_verify_feed(
381
+ const char *envelope, size_t envelope_len,
382
+ const char *public_key, size_t public_key_len,
383
+ const char *bundle_id, size_t bundle_id_len,
384
+ const char *current_version, size_t current_version_len,
385
+ const char *target, size_t target_len,
386
+ char *version_out, size_t version_capacity,
387
+ char *archive_url_out, size_t archive_url_capacity,
388
+ char *release_notes_out, size_t release_notes_capacity);
389
+ int native_sdk_update_verify_archive(const char *path, size_t path_len, uint64_t expected_bytes, const char *sha256, size_t sha256_len);
390
+
370
391
  // show_policy 0 = immediate (ordered front at create), 1 = deferred to
371
392
  // the first canvas present (present-before-show: the window is created
372
393
  // ordered-out and `makeKeyAndOrderFront` runs after the first
@@ -396,6 +417,8 @@ void native_sdk_appkit_set_dock_icon_rgba(native_sdk_appkit_host_t *host, const
396
417
  // Debug dev-run path falls back to this when its masked render fails,
397
418
  // keeping the pre-masking behavior (icon shown unshaped) as the floor.
398
419
  void native_sdk_appkit_set_dock_icon_file(native_sdk_appkit_host_t *host, const char *path, size_t path_len);
420
+ void native_sdk_appkit_configure_updates(native_sdk_appkit_host_t *host, const char *feed_url, size_t feed_url_len, const char *public_key, size_t public_key_len, int check_on_start, const char *target, size_t target_len);
421
+ int native_sdk_appkit_check_for_updates(native_sdk_appkit_host_t *host, int user_initiated);
399
422
  void native_sdk_appkit_run(native_sdk_appkit_host_t *host, native_sdk_appkit_event_callback_t callback, void *context);
400
423
  // The host-side shutdown request: a failed event emit asks the host to
401
424
  // deliver SHUTDOWN and stop. While the run loop is live the delivery is
@@ -616,6 +639,8 @@ double native_sdk_appkit_measure_text(uint64_t font_id, double size, const char
616
639
  * not valid UTF-8 or the font id cannot resolve (the engine then keeps
617
640
  * its per-prefix path for that run). */
618
641
  int native_sdk_appkit_measure_text_advances(uint64_t font_id, double size, const char *text, size_t text_len, float *advances);
642
+ /* Shaped glyph-path bounds for one line, relative to its baseline. */
643
+ int native_sdk_appkit_measure_text_ink(uint64_t font_id, double size, const char *text, size_t text_len, double *min_x, double *max_x, double *min_y, double *max_y);
619
644
 
620
645
  // Register engine-validated TrueType bytes under a canvas font id so
621
646
  // measurement and packet text drawing resolve the id to this exact face.