@native-sdk/cli 0.9.4 → 0.9.5

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 (70) hide show
  1. package/README.md +3 -3
  2. package/build/app.zig +68 -57
  3. package/build.zig +12 -1
  4. package/package.json +10 -9
  5. package/packages/core/package-lock.json +2 -2
  6. package/packages/core/package.json +1 -1
  7. package/packages/core/scripts/run_external_core_compiler.mjs +19 -9
  8. package/packages/core/scripts/run_external_service_compiler.mjs +17 -8
  9. package/packages/core/scripts/vendor_service_packages.mjs +121 -8
  10. package/packages/core/sdk/events.d.ts +33 -4
  11. package/packages/core/sdk/events.ts +45 -6
  12. package/packages/core/src/checker.ts +103 -8
  13. package/packages/core/src/modules.ts +6 -2
  14. package/packages/core/src/sqlite_cli.ts +22 -2
  15. package/packages/core/src/typed_ast.ts +4 -2
  16. package/packages/core/src/types.ts +8 -8
  17. package/schemas/app.schema.json +435 -0
  18. package/skill-data/core/SKILL.md +53 -15
  19. package/skill-data/core/references/project-anatomy.md +6 -6
  20. package/skill-data/native-ui/SKILL.md +26 -5
  21. package/skill-data/ts-core/SKILL.md +6 -6
  22. package/skills/native-sdk/SKILL.md +2 -2
  23. package/src/automation/snapshot.zig +91 -3
  24. package/src/platform/macos/appkit_host.h +41 -2
  25. package/src/platform/macos/appkit_host.m +198 -9
  26. package/src/platform/macos/cef_host.mm +191 -9
  27. package/src/platform/macos/root.zig +110 -3
  28. package/src/platform/null_platform.zig +50 -1
  29. package/src/platform/null_platform_tests.zig +53 -0
  30. package/src/platform/root.zig +9 -0
  31. package/src/platform/types.zig +58 -0
  32. package/src/platform/windows/root.zig +88 -15
  33. package/src/primitives/canvas/reference.zig +37 -15
  34. package/src/primitives/canvas/reference_tests.zig +63 -0
  35. package/src/primitives/canvas/ui.zig +9 -0
  36. package/src/primitives/canvas/ui_markup.zig +29 -0
  37. package/src/primitives/canvas/ui_markup_compiled.zig +32 -0
  38. package/src/primitives/canvas/ui_markup_compiled_tests.zig +4 -2
  39. package/src/primitives/canvas/ui_markup_contract.zig +7 -0
  40. package/src/primitives/canvas/ui_markup_contract_tests.zig +21 -0
  41. package/src/primitives/canvas/ui_markup_tests.zig +6 -0
  42. package/src/primitives/canvas/ui_markup_view.zig +28 -0
  43. package/src/primitives/canvas/ui_markup_view_tests.zig +32 -3
  44. package/src/primitives/canvas/ui_schema.zig +9 -0
  45. package/src/primitives/canvas/ui_schema_tests.zig +5 -3
  46. package/src/primitives/canvas/ui_tests.zig +4 -2
  47. package/src/primitives/canvas/widget_render.zig +7 -2
  48. package/src/primitives/canvas/widget_semantics_tests.zig +3 -1
  49. package/src/root.zig +4 -0
  50. package/src/runtime/automation_snapshot.zig +3 -0
  51. package/src/runtime/flow.zig +1 -1
  52. package/src/runtime/state.zig +14 -0
  53. package/src/runtime/system_services.zig +62 -0
  54. package/src/runtime/ts_ui_app.zig +161 -33
  55. package/src/runtime/ui_app.zig +33 -1
  56. package/src/runtime/ui_app_tests.zig +63 -0
  57. package/src/runtime/validation.zig +87 -1
  58. package/src/tooling/android.zig +5 -4
  59. package/src/tooling/buildgraph.zig +24 -8
  60. package/src/tooling/db.zig +1 -1
  61. package/src/tooling/doctor.zig +1 -1
  62. package/src/tooling/ios.zig +5 -4
  63. package/src/tooling/json_to_zon.zig +136 -0
  64. package/src/tooling/manifest.zig +120 -33
  65. package/src/tooling/raw_manifest.zig +4 -0
  66. package/src/tooling/root.zig +1 -0
  67. package/src/tooling/templates.zig +165 -116
  68. package/src/tooling/ts_core.zig +11 -7
  69. package/src/tooling/verbs.zig +7 -6
  70. package/src/tooling/web_engine.zig +17 -1
@@ -0,0 +1,435 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.native-sdk.dev/app/v1.json",
4
+ "title": "Native SDK app manifest",
5
+ "description": "Complete app.json manifest for a Native SDK application. app.zon remains supported as a legacy alternative.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["id", "name", "version"],
9
+ "properties": {
10
+ "$schema": { "type": "string", "format": "uri-reference" },
11
+ "id": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Reverse-DNS application identifier." },
12
+ "name": { "type": "string", "minLength": 1, "description": "Short machine-readable app name." },
13
+ "display_name": { "type": "string", "minLength": 1, "description": "Human-readable app name." },
14
+ "description": { "type": "string", "minLength": 1, "maxLength": 256 },
15
+ "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
16
+ "icons": { "$ref": "#/$defs/stringArray" },
17
+ "platforms": {
18
+ "type": "array",
19
+ "uniqueItems": true,
20
+ "items": { "enum": ["macos", "linux", "windows", "ios", "android", "web"] }
21
+ },
22
+ "permissions": { "$ref": "#/$defs/stringArray" },
23
+ "capabilities": {
24
+ "type": "array",
25
+ "uniqueItems": true,
26
+ "items": {
27
+ "enum": [
28
+ "native_module", "webview", "js_bridge", "native_views", "gpu_surfaces",
29
+ "menus", "shortcuts", "tray", "filesystem", "network", "notifications",
30
+ "dialog", "clipboard", "credentials", "persist", "store", "sqlite",
31
+ "open_url", "reveal_path", "recent_documents", "file_drops",
32
+ "app_activation_events", "file_associations", "url_schemes"
33
+ ]
34
+ }
35
+ },
36
+ "dock_visible": { "type": "boolean", "default": true },
37
+ "persist": { "$ref": "#/$defs/persist" },
38
+ "images": { "$ref": "#/$defs/images" },
39
+ "service_packages": {
40
+ "type": "array",
41
+ "items": { "$ref": "#/$defs/servicePackage" }
42
+ },
43
+ "service_carrier": { "enum": ["auto", "in_process", "child"], "default": "auto" },
44
+ "service_pool_size": { "type": "integer", "minimum": 1, "maximum": 16 },
45
+ "bridge": { "$ref": "#/$defs/bridge" },
46
+ "web_engine": { "enum": ["system", "chromium"], "default": "system" },
47
+ "webview_layer": { "enum": ["auto", "include", "exclude"], "default": "auto" },
48
+ "core_compiler": { "const": "external", "default": "external" },
49
+ "theme": { "enum": ["house", "geist"] },
50
+ "theme_accent": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
51
+ "cef": { "$ref": "#/$defs/cef" },
52
+ "frontend": { "$ref": "#/$defs/frontend" },
53
+ "security": { "$ref": "#/$defs/security" },
54
+ "assets": { "$ref": "#/$defs/assets" },
55
+ "windows": {
56
+ "type": "array",
57
+ "items": { "$ref": "#/$defs/window" }
58
+ },
59
+ "shell": { "$ref": "#/$defs/shell" },
60
+ "commands": {
61
+ "type": "array",
62
+ "items": { "$ref": "#/$defs/command" }
63
+ },
64
+ "menus": {
65
+ "type": "array",
66
+ "items": { "$ref": "#/$defs/menu" }
67
+ },
68
+ "shortcuts": {
69
+ "type": "array",
70
+ "items": { "$ref": "#/$defs/shortcut" }
71
+ },
72
+ "file_associations": {
73
+ "type": "array",
74
+ "items": { "$ref": "#/$defs/fileAssociation" }
75
+ },
76
+ "url_schemes": {
77
+ "type": "array",
78
+ "items": { "$ref": "#/$defs/urlScheme" }
79
+ },
80
+ "dmg": { "$ref": "#/$defs/dmg" }
81
+ },
82
+ "$defs": {
83
+ "stringArray": {
84
+ "type": "array",
85
+ "uniqueItems": true,
86
+ "items": { "type": "string" }
87
+ },
88
+ "position": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": ["x", "y"],
92
+ "properties": {
93
+ "x": { "type": "integer", "minimum": 0, "maximum": 65535 },
94
+ "y": { "type": "integer", "minimum": 0, "maximum": 65535 }
95
+ }
96
+ },
97
+ "persist": {
98
+ "type": "object",
99
+ "additionalProperties": false,
100
+ "required": ["version", "restore"],
101
+ "properties": {
102
+ "version": { "type": "integer", "minimum": 1 },
103
+ "debounce_ms": { "type": "integer", "minimum": 0, "maximum": 60000, "default": 500 },
104
+ "restore": {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": ["ok", "none", "err"],
108
+ "properties": {
109
+ "ok": { "type": "string", "minLength": 1 },
110
+ "none": { "type": "string", "minLength": 1 },
111
+ "err": { "type": "string", "minLength": 1 }
112
+ }
113
+ }
114
+ }
115
+ },
116
+ "images": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "properties": {
120
+ "max_image_pixel_bytes": { "type": "integer", "minimum": 1048576, "maximum": 8388608, "default": 1048576 }
121
+ }
122
+ },
123
+ "servicePackage": {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "required": ["name", "version", "content_hash"],
127
+ "properties": {
128
+ "name": { "type": "string", "minLength": 1 },
129
+ "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
130
+ "content_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
131
+ }
132
+ },
133
+ "bridge": {
134
+ "type": "object",
135
+ "additionalProperties": false,
136
+ "properties": {
137
+ "commands": {
138
+ "type": "array",
139
+ "items": {
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": ["name"],
143
+ "properties": {
144
+ "name": { "type": "string", "minLength": 1 },
145
+ "permissions": { "$ref": "#/$defs/stringArray" },
146
+ "origins": { "$ref": "#/$defs/stringArray" }
147
+ }
148
+ }
149
+ }
150
+ }
151
+ },
152
+ "cef": {
153
+ "type": "object",
154
+ "additionalProperties": false,
155
+ "properties": {
156
+ "dir": { "type": "string", "default": "third_party/cef/macos" },
157
+ "auto_install": { "type": "boolean", "default": false }
158
+ }
159
+ },
160
+ "frontend": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "properties": {
164
+ "dist": { "type": "string", "default": "dist" },
165
+ "entry": { "type": "string", "default": "index.html" },
166
+ "spa_fallback": { "type": "boolean", "default": true },
167
+ "dev": {
168
+ "type": "object",
169
+ "additionalProperties": false,
170
+ "required": ["url"],
171
+ "properties": {
172
+ "url": { "type": "string", "format": "uri" },
173
+ "command": { "$ref": "#/$defs/stringArray" },
174
+ "ready_path": { "type": "string", "default": "/" },
175
+ "timeout_ms": { "type": "integer", "minimum": 1, "maximum": 4294967295, "default": 30000 }
176
+ }
177
+ }
178
+ }
179
+ },
180
+ "security": {
181
+ "type": "object",
182
+ "additionalProperties": false,
183
+ "properties": {
184
+ "navigation": {
185
+ "type": "object",
186
+ "additionalProperties": false,
187
+ "properties": {
188
+ "allowed_origins": { "$ref": "#/$defs/stringArray" },
189
+ "external_links": {
190
+ "type": "object",
191
+ "additionalProperties": false,
192
+ "properties": {
193
+ "action": { "enum": ["deny", "open_system_browser"], "default": "deny" },
194
+ "allowed_urls": { "$ref": "#/$defs/stringArray" }
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ },
201
+ "assets": {
202
+ "type": "object",
203
+ "additionalProperties": false,
204
+ "properties": {
205
+ "images": {
206
+ "type": "array",
207
+ "items": {
208
+ "type": "object",
209
+ "additionalProperties": false,
210
+ "required": ["id", "path"],
211
+ "properties": {
212
+ "id": { "type": "integer", "minimum": 1 },
213
+ "path": { "type": "string", "minLength": 1 }
214
+ }
215
+ }
216
+ }
217
+ }
218
+ },
219
+ "windowBase": {
220
+ "type": "object",
221
+ "properties": {
222
+ "label": { "type": "string", "default": "main" },
223
+ "title": { "type": "string" },
224
+ "width": { "type": "number", "exclusiveMinimum": 0, "default": 720 },
225
+ "height": { "type": "number", "exclusiveMinimum": 0, "default": 480 },
226
+ "x": { "type": "number" },
227
+ "y": { "type": "number" },
228
+ "resizable": { "type": "boolean", "default": true },
229
+ "restore_state": { "type": "boolean", "default": true },
230
+ "titlebar": { "enum": ["standard", "hidden_inset", "hidden_inset_tall", "chromeless"], "default": "standard" },
231
+ "transparent": { "type": "boolean", "default": false },
232
+ "always_on_top": { "type": "boolean", "default": false },
233
+ "click_through": { "type": "boolean", "default": false },
234
+ "activate_on_show": { "type": "boolean", "default": true },
235
+ "initially_hidden": { "type": "boolean", "default": false },
236
+ "allows_fullscreen": { "type": "boolean", "default": true },
237
+ "min_width": { "type": "number", "minimum": 0, "default": 0 },
238
+ "min_height": { "type": "number", "minimum": 0, "default": 0 },
239
+ "close_policy": { "enum": ["quit", "hide"], "default": "quit" }
240
+ }
241
+ },
242
+ "window": {
243
+ "allOf": [{ "$ref": "#/$defs/windowBase" }],
244
+ "unevaluatedProperties": false
245
+ },
246
+ "shell": {
247
+ "type": "object",
248
+ "additionalProperties": false,
249
+ "properties": {
250
+ "windows": {
251
+ "type": "array",
252
+ "items": { "$ref": "#/$defs/shellWindow" }
253
+ },
254
+ "chrome": { "$ref": "#/$defs/shellChrome" }
255
+ }
256
+ },
257
+ "shellWindow": {
258
+ "allOf": [
259
+ { "$ref": "#/$defs/windowBase" },
260
+ {
261
+ "type": "object",
262
+ "properties": {
263
+ "restore_policy": { "enum": ["clamp_to_visible_screen", "center_on_primary"], "default": "clamp_to_visible_screen" },
264
+ "views": { "type": "array", "items": { "$ref": "#/$defs/shellView" } }
265
+ }
266
+ }
267
+ ],
268
+ "unevaluatedProperties": false
269
+ },
270
+ "shellChrome": {
271
+ "type": "object",
272
+ "additionalProperties": false,
273
+ "properties": {
274
+ "tabs": {
275
+ "type": "array",
276
+ "items": { "$ref": "#/$defs/shellTab" }
277
+ },
278
+ "primary_action": { "$ref": "#/$defs/shellTab" }
279
+ }
280
+ },
281
+ "shellTab": {
282
+ "type": "object",
283
+ "additionalProperties": false,
284
+ "required": ["id", "label"],
285
+ "properties": {
286
+ "id": { "type": "string", "minLength": 1 },
287
+ "label": { "type": "string", "minLength": 1 },
288
+ "icon": { "type": "string", "default": "" }
289
+ }
290
+ },
291
+ "shellView": {
292
+ "type": "object",
293
+ "additionalProperties": false,
294
+ "required": ["label", "kind"],
295
+ "properties": {
296
+ "label": { "type": "string", "minLength": 1 },
297
+ "kind": {
298
+ "enum": [
299
+ "webview", "toolbar", "titlebar_accessory", "sidebar", "statusbar", "split", "stack",
300
+ "button", "icon_button", "list_item", "checkbox", "toggle", "segmented_control",
301
+ "text_field", "search_field", "label", "spacer", "gpu_surface", "progress_indicator"
302
+ ]
303
+ },
304
+ "parent": { "type": "string" },
305
+ "edge": { "enum": ["top", "right", "bottom", "left"] },
306
+ "axis": { "enum": ["row", "horizontal", "column", "vertical"] },
307
+ "x": { "type": "number" },
308
+ "y": { "type": "number" },
309
+ "width": { "type": "number" },
310
+ "height": { "type": "number" },
311
+ "min_width": { "type": "number" },
312
+ "min_height": { "type": "number" },
313
+ "max_width": { "type": "number" },
314
+ "max_height": { "type": "number" },
315
+ "fill": { "type": "boolean", "default": false },
316
+ "layer": { "type": "integer", "minimum": -2147483648, "maximum": 2147483647, "default": 0 },
317
+ "visible": { "type": "boolean", "default": true },
318
+ "enabled": { "type": "boolean", "default": true },
319
+ "role": { "type": "string" },
320
+ "accessibility_label": { "type": "string" },
321
+ "url": { "type": "string" },
322
+ "text": { "type": "string" },
323
+ "command": { "type": "string" },
324
+ "gpu_backend": { "enum": ["none", "metal", "software"] },
325
+ "gpu_pixel_format": { "enum": ["none", "bgra8_unorm"] },
326
+ "gpu_present_mode": { "enum": ["none", "timer"] },
327
+ "gpu_alpha_mode": { "enum": ["none", "opaque", "premultiplied"] },
328
+ "gpu_color_space": { "enum": ["none", "srgb", "display_p3"] },
329
+ "gpu_vsync": { "type": "boolean" }
330
+ }
331
+ },
332
+ "command": {
333
+ "type": "object",
334
+ "additionalProperties": false,
335
+ "required": ["id"],
336
+ "properties": {
337
+ "id": { "type": "string", "minLength": 1 },
338
+ "title": { "type": "string", "default": "" },
339
+ "enabled": { "type": "boolean", "default": true },
340
+ "checked": { "type": "boolean", "default": false }
341
+ }
342
+ },
343
+ "menu": {
344
+ "type": "object",
345
+ "additionalProperties": false,
346
+ "required": ["title"],
347
+ "properties": {
348
+ "title": { "type": "string", "minLength": 1 },
349
+ "items": {
350
+ "type": "array",
351
+ "items": { "$ref": "#/$defs/menuItem" }
352
+ }
353
+ }
354
+ },
355
+ "menuItem": {
356
+ "type": "object",
357
+ "additionalProperties": false,
358
+ "properties": {
359
+ "label": { "type": "string", "default": "" },
360
+ "command": { "type": "string", "default": "" },
361
+ "key": { "type": "string", "default": "" },
362
+ "modifiers": { "$ref": "#/$defs/modifiers" },
363
+ "separator": { "type": "boolean", "default": false },
364
+ "enabled": { "type": "boolean", "default": true },
365
+ "checked": { "type": "boolean", "default": false }
366
+ }
367
+ },
368
+ "modifiers": {
369
+ "type": "array",
370
+ "uniqueItems": true,
371
+ "items": { "enum": ["primary", "command", "control", "option", "alt", "shift"] }
372
+ },
373
+ "shortcut": {
374
+ "type": "object",
375
+ "additionalProperties": false,
376
+ "required": ["id", "key"],
377
+ "properties": {
378
+ "id": { "type": "string", "minLength": 1 },
379
+ "key": { "type": "string", "minLength": 1 },
380
+ "modifiers": { "$ref": "#/$defs/modifiers" }
381
+ }
382
+ },
383
+ "fileAssociation": {
384
+ "type": "object",
385
+ "additionalProperties": false,
386
+ "required": ["name"],
387
+ "properties": {
388
+ "name": { "type": "string", "minLength": 1 },
389
+ "role": { "$ref": "#/$defs/associationRole" },
390
+ "extensions": { "$ref": "#/$defs/stringArray" },
391
+ "mime_types": { "$ref": "#/$defs/stringArray" },
392
+ "icon": { "type": "string" }
393
+ }
394
+ },
395
+ "urlScheme": {
396
+ "type": "object",
397
+ "additionalProperties": false,
398
+ "required": ["scheme"],
399
+ "properties": {
400
+ "scheme": { "type": "string", "minLength": 1 },
401
+ "role": { "$ref": "#/$defs/associationRole" }
402
+ }
403
+ },
404
+ "associationRole": { "enum": ["viewer", "editor", "shell", "none"], "default": "viewer" },
405
+ "dmg": {
406
+ "type": "object",
407
+ "additionalProperties": false,
408
+ "properties": {
409
+ "volume_name": { "type": "string" },
410
+ "background": { "type": "string" },
411
+ "window_width": { "type": "integer", "minimum": 320, "maximum": 2000, "default": 660 },
412
+ "window_height": { "type": "integer", "minimum": 240, "maximum": 1400, "default": 400 },
413
+ "icon_size": { "type": "integer", "minimum": 32, "maximum": 256, "default": 128 },
414
+ "app_position": { "$ref": "#/$defs/position" },
415
+ "applications_position": { "$ref": "#/$defs/position" },
416
+ "applications_link": { "type": "boolean", "default": true },
417
+ "items": {
418
+ "type": "array",
419
+ "items": { "$ref": "#/$defs/dmgItem" }
420
+ }
421
+ }
422
+ },
423
+ "dmgItem": {
424
+ "type": "object",
425
+ "additionalProperties": false,
426
+ "required": ["kind", "position"],
427
+ "properties": {
428
+ "kind": { "enum": ["app", "applications", "file", "link"] },
429
+ "path": { "type": "string" },
430
+ "name": { "type": "string" },
431
+ "position": { "$ref": "#/$defs/position" }
432
+ }
433
+ }
434
+ }
435
+ }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: core
3
- description: Core Native SDK guide for AI agents. Read this before explaining the Native SDK or changing a Native SDK app. Establishes TypeScript + Native markup as the default app-authoring path, routes default app work to the native-ui and ts-core skills, and covers the shared foundation: project structure, app.zon, lower-level App and Runtime patterns, frontend integration, web engines, JavaScript bridge commands, permissions, windows, WebViews, dialogs, packaging, debugging, and testing. Use when the user asks what the Native SDK is, how to build or modify an app, how to package or debug it, or how to add native capabilities.
3
+ description: Core Native SDK guide for AI agents. Read this before explaining the Native SDK or changing a Native SDK app. Establishes TypeScript + Native markup as the default app-authoring path, routes default app work to the native-ui and ts-core skills, and covers the shared foundation: project structure, app.json and legacy app.zon, lower-level App and Runtime patterns, frontend integration, web engines, JavaScript bridge commands, permissions, windows, WebViews, dialogs, packaging, debugging, and testing. Use when the user asks what the Native SDK is, how to build or modify an app, how to package or debug it, or how to add native capabilities.
4
4
  ---
5
5
 
6
6
  # Build Native SDK apps
@@ -13,13 +13,13 @@ Agents should assume they do not know the Native SDK from general model knowledg
13
13
 
14
14
  ## Mental model
15
15
 
16
- - The default app has three files of truth: `src/core.ts` (`Model`, `Msg`, `update`), `src/app.native` (UI), and `app.zon` (manifest).
16
+ - The default app has three files of truth: `src/core.ts` (`Model`, `Msg`, `update`), `src/app.native` (UI), and `app.json` (manifest).
17
17
  - Native markup binds model values and dispatches typed messages; only `update` changes state.
18
18
  - The TypeScript core compiles to native code. Node is a build/check/dev tool, not an app runtime.
19
19
  - `App` is the lower-level product/runtime interface used by generated wiring, Zig-core apps, WebView shells, and extensions.
20
20
  - `Runtime` owns the event loop, windows, bridge dispatch, security checks, automation, tracing, platform services, and window state.
21
21
  - `WebViewSource` tells the runtime what to load: inline HTML, a URL, or packaged assets from a local app origin.
22
- - `app.zon` is the app manifest: identity, icons, windows, frontend assets, web engine, permissions, bridge policy, security policy, and packaging inputs.
22
+ - `app.json` is the default app manifest: identity, icons, windows, frontend assets, web engine, permissions, bridge policy, security policy, and packaging inputs. `app.zon` remains supported.
23
23
  - `src/runner.zig` and `src/main.zig` appear only when an app explicitly owns lower-level Zig wiring (for example a `zig-core` app or a WebView shell). `--full` makes a TypeScript app own `build.zig` but still does not give it Zig app logic. Do not add Zig sources to a default TypeScript app merely because SDK examples contain them.
24
24
  - `frontend/` is normal web code. It talks to native Zig through `window.zero.invoke()` or builtin helpers when those are enabled.
25
25
 
@@ -48,13 +48,13 @@ cd my_app
48
48
  native dev
49
49
  ```
50
50
 
51
- This creates `src/core.ts`, `src/app.native`, and `app.zon`; a native window opens with `native dev`. Use `native init my_app --template zig-core` only when the user chooses Zig. Frontend choices (`--frontend next|vite|react|svelte|vue`) are the separate WebView migration/integration path.
51
+ This creates `src/core.ts`, `src/app.native`, and `app.json`; a native window opens with `native dev`. Use `native init my_app --template zig-core` only when the user chooses Zig. Frontend choices (`--frontend next|vite|react|svelte|vue`) are the separate WebView migration/integration path.
52
52
 
53
53
  ## Workflow for existing apps
54
54
 
55
55
  Before editing an existing Native SDK app:
56
56
 
57
- 1. Read `app.zon` and inspect `src/` before assuming a core language. Read `src/core.ts` + `src/app.native` for the default path; read `src/main.zig`, `src/runner.zig`, and `build.zig` only when they exist.
57
+ 1. Read `app.json` or `app.zon` and inspect `src/` before assuming a core language. Read `src/core.ts` + `src/app.native` for the default path; read `src/main.zig`, `src/runner.zig`, and `build.zig` only when they exist.
58
58
  2. Identify whether the app is TypeScript + Native markup (default), an explicitly chosen Zig core, or a WebView frontend, then identify the layer the change belongs to.
59
59
  3. Follow the generated code and examples in the repository instead of inventing a new app layout.
60
60
  4. Prefer exact security policy changes over broad allowances.
@@ -62,7 +62,7 @@ Before editing an existing Native SDK app:
62
62
 
63
63
  Common file ownership:
64
64
 
65
- - `app.zon`: app identity, version, icons, windows, permissions, capabilities, bridge command policy, allowed origins, frontend dist/dev config, web engine, CEF config.
65
+ - `app.json` / `app.zon`: app identity, version, icons, windows, permissions, capabilities, bridge command policy, allowed origins, frontend dist/dev config, web engine, CEF config.
66
66
  - `src/core.ts`: default app state and behavior — `Model`, `Msg`, `update`, pure helpers, `Cmd`, and `Sub`.
67
67
  - `src/app.native`: default app UI — elements, layout, bindings, and message dispatch.
68
68
  - `src/main.zig`: explicitly chosen Zig-core logic or lower-level `App` behavior, source selection, lifecycle callbacks, and custom bridge handlers.
@@ -106,9 +106,47 @@ fn source(context: *anyopaque) anyerror!native_sdk.WebViewSource {
106
106
 
107
107
  `sourceFromEnv` reads `NATIVE_SDK_FRONTEND_URL`; otherwise it serves the configured asset directory. Use it for most framework apps.
108
108
 
109
- ## app.zon essentials
109
+ ## app.json essentials
110
+
111
+ Keep `app.json` as the source of truth for app-level behavior. Existing `app.zon` projects use the same fields in ZON syntax.
112
+
113
+ ```json
114
+ {
115
+ "$schema": "https://schema.native-sdk.dev/app/v1.json",
116
+ "id": "com.example.my-app",
117
+ "name": "my-app",
118
+ "display_name": "My App",
119
+ "description": "One line about the app, shown in the About panel.",
120
+ "version": "0.1.0",
121
+ "icons": ["assets/icon.png"],
122
+ "platforms": ["macos", "linux"],
123
+ "permissions": [],
124
+ "capabilities": ["webview"],
125
+ "frontend": {
126
+ "dist": "frontend/dist",
127
+ "entry": "index.html",
128
+ "spa_fallback": true,
129
+ "dev": {
130
+ "url": "http://127.0.0.1:5173/",
131
+ "command": ["npm", "--prefix", "frontend", "run", "dev", "--", "--host", "127.0.0.1"],
132
+ "ready_path": "/",
133
+ "timeout_ms": 30000
134
+ }
135
+ },
136
+ "security": {
137
+ "navigation": {
138
+ "allowed_origins": ["zero://app", "http://127.0.0.1:5173"],
139
+ "external_links": { "action": "deny" }
140
+ }
141
+ },
142
+ "web_engine": "system",
143
+ "windows": [
144
+ { "label": "main", "title": "My App", "width": 960, "height": 640, "restore_state": true }
145
+ ]
146
+ }
147
+ ```
110
148
 
111
- Keep `app.zon` as the source of truth for app-level behavior:
149
+ Legacy ZON equivalent:
112
150
 
113
151
  ```zig
114
152
  .{
@@ -151,13 +189,13 @@ Use exact local origins for dev servers. Add `zero://inline` only for inline HTM
151
189
 
152
190
  ### Add a new framework app
153
191
 
154
- Use `native init <path> --frontend <next|vite|react|svelte|vue>`. Then inspect the generated `app.zon`, `src/main.zig`, and `build.zig` before customizing. For framework behavior, keep frontend work in `frontend/` and use `sourceFromEnv` so development and packaged builds share one app shell.
192
+ Use `native init <path> --frontend <next|vite|react|svelte|vue>`. Then inspect the generated `app.json`, `src/main.zig`, and `build.zig` before customizing. For framework behavior, keep frontend work in `frontend/` and use `sourceFromEnv` so development and packaged builds share one app shell.
155
193
 
156
194
  ### Add a native bridge command
157
195
 
158
196
  1. Add state and a handler in `src/main.zig`.
159
197
  2. Register the handler in `bridge()`.
160
- 3. Allow the command in `app.zon` and in the runtime bridge policy if the runner reads manifest policy into runtime.
198
+ 3. Allow the command in the app manifest and in the runtime bridge policy if the runner reads manifest policy into runtime.
161
199
  4. Call it from JavaScript with `window.zero.invoke("namespace.command", payload)`.
162
200
  5. Return valid JSON from Zig. Use `native_sdk.bridge.writeJsonStringValue()` for user-controlled strings.
163
201
 
@@ -182,11 +220,11 @@ native package --target macos --archive
182
220
 
183
221
  On macOS, `--archive` adds a zero-config drag-to-Applications DMG with a generated 1×/2× Retina background. The optional `app.zon` `.dmg` block controls its volume name, PNG/JPEG/TIFF background, usable Finder canvas/icon geometry, and Applications link. An adjacent `name@2x.png`/`.jpg` is discovered automatically. Use `.dmg.items` only for a fully art-directed list: exactly one `app`, plus optional `applications`, project-relative `file`, and absolute `link` entries, each with its own icon-center position.
184
222
 
185
- Apps that own their build (ejected or scaffolded `--full`) wire the same step into the build graph: keep package metadata in `app.zon`, build the frontend assets, build the native binary, then package:
223
+ Apps that own their build (ejected or scaffolded `--full`) wire the same step into the build graph: keep package metadata in the app manifest, build the frontend assets, build the native binary, then package:
186
224
 
187
225
  ```bash
188
226
  zig build package
189
- native doctor --manifest app.zon --strict
227
+ native doctor --manifest app.json --strict
190
228
  ```
191
229
 
192
230
  Use signing and CEF options only when the product requires them.
@@ -211,7 +249,7 @@ zig build dev
211
249
  Or run the CLI directly after building the binary:
212
250
 
213
251
  ```bash
214
- native dev --manifest app.zon --binary zig-out/bin/MyApp
252
+ native dev --manifest app.json --binary zig-out/bin/MyApp
215
253
  ```
216
254
 
217
255
  Vite usually uses `http://127.0.0.1:5173/`; Next.js usually uses `http://127.0.0.1:3000/`. The app WebView loads the dev URL directly, so framework HMR remains owned by Vite, Next.js, or the selected dev server.
@@ -247,8 +285,8 @@ zig build run
247
285
  zig build dev
248
286
  zig build test
249
287
  zig build test-tooling
250
- native validate app.zon
251
- native doctor --manifest app.zon --strict
288
+ native validate app.json
289
+ native doctor --manifest app.json --strict
252
290
  zig build package
253
291
  ```
254
292
 
@@ -4,13 +4,13 @@ Use this when creating, orienting in, or restructuring a Native SDK app.
4
4
 
5
5
  ## Generated project files
6
6
 
7
- A default zero-config app ships no build files at all. Its authored files are `app.zon`, `src/core.ts`, and `src/app.native` (+ `assets/`). `native check` validates the TypeScript core, markup, and manifest without generating a build graph; `native dev|test|build` compile the app to native code and synthesize the build graph into `.native/build/` (gitignored). `build.zig`/`build.zig.zon` appear only in apps that own their build (`native eject`, the `--full` scaffold, or an expanded example). A Zig core is an explicit alternative created with `--template zig-core`, not something to infer from the SDK's implementation or older examples.
7
+ A default zero-config app ships no build files at all. Its authored files are `app.json`, `src/core.ts`, and `src/app.native` (+ `assets/`). Existing `app.zon` manifests remain fully supported. `native check` validates the TypeScript core, markup, and manifest without generating a build graph; `native dev|test|build` compile the app to native code and synthesize the build graph into `.native/build/` (gitignored). `build.zig`/`build.zig.zon` appear only in apps that own their build (`native eject`, the `--full` scaffold, or an expanded example). A Zig core is an explicit alternative created with `--template zig-core`, not something to infer from the SDK's implementation or older examples.
8
8
 
9
9
  Files by path:
10
10
 
11
11
  - `build.zig`: Zig build graph. Expanded scaffolds expose platform selection, trace mode, debug overlay, automation, JS bridge, web engine overrides, frontend install/build/dev steps, tests, and package steps.
12
12
  - `build.zig.zon`: Zig package manifest and dependency declaration.
13
- - `app.zon`: app manifest read by CLI/build/package/doctor tooling.
13
+ - `app.json`: default app manifest read by CLI/build/package/doctor tooling. `app.zon` is the supported alternative.
14
14
  - `src/core.ts`: the default app core — `Model`, `Msg`, `update`, pure helpers, effects (`Cmd`), and subscriptions (`Sub`).
15
15
  - `src/app.native`: the default app view — elements, layout, bindings, and typed message dispatch.
16
16
  - `src/main.zig`: present for an explicitly selected Zig core or lower-level WebView/runtime app; app state, `app()` method, source resolver, optional bridge dispatcher, lifecycle callbacks.
@@ -18,9 +18,9 @@ Files by path:
18
18
  - `assets/`: icons and other package resources.
19
19
  - `frontend/`: framework app when using Next, Vite, React, Svelte, or Vue.
20
20
 
21
- ## app.zon responsibilities
21
+ ## App manifest responsibilities
22
22
 
23
- Keep product-level metadata and policies in `app.zon`:
23
+ Keep product-level metadata and policies in `app.json` (or `app.zon` in an existing project):
24
24
 
25
25
  ```zig
26
26
  .{
@@ -115,11 +115,11 @@ zig build test-package-cef-layout -Dplatform=macos
115
115
 
116
116
  ## Layering rule
117
117
 
118
- - If changing app identity, packaging inputs, permissions, origins, windows, frontend dist/dev paths, or web engine, update `app.zon`.
118
+ - If changing app identity, packaging inputs, permissions, origins, windows, frontend dist/dev paths, or web engine, update the app's manifest.
119
119
  - If changing default app state, messages, transitions, effects, subscriptions, or derived bindings, update `src/core.ts` and follow the `ts-core` skill.
120
120
  - If changing the default app UI, update `src/app.native` and follow the `native-ui` skill.
121
121
  - If changing runtime services, platform setup, automation, logging, security wiring, or builtin bridge policy, update `src/runner.zig`.
122
122
  - If an existing lower-level/Zig app changes native lifecycle callbacks, bridge handlers, source selection, or Zig-core behavior, update its `src/main.zig`.
123
123
  - If changing UI, routes, CSS, or web calls, update `frontend/`.
124
124
 
125
- Do not add `src/main.zig`, `src/runner.zig`, or an owned build merely to implement ordinary behavior in a default TypeScript app. Do not put package metadata in app state or bypass `app.zon` policy for convenience.
125
+ Do not add `src/main.zig`, `src/runner.zig`, or an owned build merely to implement ordinary behavior in a default TypeScript app. Do not put package metadata in app state or bypass manifest policy for convenience.