@native-sdk/cli 0.9.3 → 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 (84) hide show
  1. package/README.md +3 -3
  2. package/build/app.zig +323 -76
  3. package/build/ts_run.mjs +15 -18
  4. package/build.zig +83 -8
  5. package/package.json +14 -10
  6. package/packages/core/compile-surface/core.ts +1 -0
  7. package/packages/core/package-lock.json +16 -13
  8. package/packages/core/package.json +5 -2
  9. package/packages/core/scripts/compiler_command.mjs +71 -0
  10. package/packages/core/scripts/compiler_typecheck.mjs +4 -4
  11. package/packages/core/scripts/embed_markup_c.mjs +25 -0
  12. package/packages/core/scripts/npm_static_spike.mjs +3 -3
  13. package/packages/core/scripts/run_external_core_compiler.mjs +21 -10
  14. package/packages/core/scripts/run_external_service_compiler.mjs +17 -7
  15. package/packages/core/scripts/vendor_service_packages.mjs +121 -8
  16. package/packages/core/sdk/core.ts +1 -0
  17. package/packages/core/sdk/events.d.ts +36 -4
  18. package/packages/core/sdk/events.ts +49 -6
  19. package/packages/core/src/checker.ts +106 -10
  20. package/packages/core/src/modules.ts +6 -2
  21. package/packages/core/src/sqlite_cli.ts +22 -2
  22. package/packages/core/src/typed_ast.ts +4 -2
  23. package/packages/core/src/types.ts +8 -8
  24. package/schemas/app.schema.json +435 -0
  25. package/skill-data/core/SKILL.md +53 -15
  26. package/skill-data/core/references/project-anatomy.md +6 -6
  27. package/skill-data/native-ui/SKILL.md +28 -6
  28. package/skill-data/ts-core/SKILL.md +9 -6
  29. package/skill-data/ts-services/references/service-surface.md +1 -1
  30. package/skills/native-sdk/SKILL.md +2 -2
  31. package/src/app_runner/ts_core_main.zig +12 -4
  32. package/src/app_runner/ts_core_mobile.zig +6 -2
  33. package/src/automation/snapshot.zig +91 -3
  34. package/src/platform/macos/appkit_host.h +41 -2
  35. package/src/platform/macos/appkit_host.m +198 -9
  36. package/src/platform/macos/cef_host.mm +191 -9
  37. package/src/platform/macos/root.zig +110 -3
  38. package/src/platform/null_platform.zig +50 -1
  39. package/src/platform/null_platform_tests.zig +53 -0
  40. package/src/platform/root.zig +9 -0
  41. package/src/platform/types.zig +58 -0
  42. package/src/platform/windows/root.zig +88 -15
  43. package/src/primitives/canvas/reference.zig +37 -15
  44. package/src/primitives/canvas/reference_tests.zig +63 -0
  45. package/src/primitives/canvas/ui.zig +9 -0
  46. package/src/primitives/canvas/ui_markup.zig +29 -0
  47. package/src/primitives/canvas/ui_markup_compiled.zig +32 -0
  48. package/src/primitives/canvas/ui_markup_compiled_tests.zig +4 -2
  49. package/src/primitives/canvas/ui_markup_contract.zig +7 -0
  50. package/src/primitives/canvas/ui_markup_contract_tests.zig +21 -0
  51. package/src/primitives/canvas/ui_markup_tests.zig +6 -0
  52. package/src/primitives/canvas/ui_markup_view.zig +28 -0
  53. package/src/primitives/canvas/ui_markup_view_tests.zig +32 -3
  54. package/src/primitives/canvas/ui_schema.zig +9 -0
  55. package/src/primitives/canvas/ui_schema_tests.zig +5 -3
  56. package/src/primitives/canvas/ui_tests.zig +4 -2
  57. package/src/primitives/canvas/widget_render.zig +7 -2
  58. package/src/primitives/canvas/widget_semantics_tests.zig +3 -1
  59. package/src/root.zig +4 -0
  60. package/src/runtime/automation_snapshot.zig +3 -0
  61. package/src/runtime/flow.zig +1 -1
  62. package/src/runtime/state.zig +14 -0
  63. package/src/runtime/system_services.zig +62 -0
  64. package/src/runtime/ts_ui_app.zig +181 -39
  65. package/src/runtime/ui_app.zig +40 -1
  66. package/src/runtime/ui_app_tests.zig +63 -0
  67. package/src/runtime/ui_app_window_tests.zig +23 -0
  68. package/src/runtime/validation.zig +87 -1
  69. package/src/tooling/android.zig +5 -4
  70. package/src/tooling/buildgraph.zig +24 -8
  71. package/src/tooling/db.zig +1 -1
  72. package/src/tooling/doctor.zig +1 -1
  73. package/src/tooling/ios.zig +5 -4
  74. package/src/tooling/json_to_zon.zig +136 -0
  75. package/src/tooling/manifest.zig +120 -33
  76. package/src/tooling/raw_manifest.zig +4 -0
  77. package/src/tooling/root.zig +1 -0
  78. package/src/tooling/templates.zig +171 -118
  79. package/src/tooling/ts_core.zig +12 -8
  80. package/src/tooling/verbs.zig +233 -5
  81. package/src/tooling/web_engine.zig +17 -1
  82. package/tools/corewire/emit_profile.zig +20 -7
  83. package/tools/corewire/emit_service.zig +49 -24
  84. package/tools/corewire/main.zig +21 -2
@@ -83,7 +83,6 @@ export function resolveModuleGraph(
83
83
  const entryPath = path.resolve(entry);
84
84
  const boundary = path.dirname(entryPath);
85
85
  const servicesBoundary = path.join(boundary, "services");
86
- const sdkBoundary = path.dirname(coreModulePath);
87
86
  const diagnostics: SubsetDiagnostic[] = [];
88
87
  const files: string[] = [];
89
88
  const coreFiles: string[] = [];
@@ -133,7 +132,12 @@ export function resolveModuleGraph(
133
132
  const text = fs.readFileSync(filePath, "utf8");
134
133
  const parsed = ts.createSourceFile(filePath, text, ts.ScriptTarget.ESNext, true);
135
134
  const isSdk = sdkFiles.has(filePath);
136
- const root = isSdk ? sdkBoundary : boundary;
135
+ // A generated relational core may live under .native/cache while the
136
+ // published library modules still resolve from the SDK package. Fence a
137
+ // library module against its own module directory, not the generated
138
+ // intrinsic core's directory; otherwise events.ts's valid ./text.ts
139
+ // re-export is falsely diagnosed as escaping the SDK.
140
+ const root = isSdk ? path.dirname(filePath) : boundary;
137
141
 
138
142
  for (const edge of edgesOf(parsed)) {
139
143
  const spec = edge.specifier;
@@ -21,15 +21,25 @@ try {
21
21
  const sdkIn = args.get("sdk-in");
22
22
  const staticIn = args.get("static-in");
23
23
  const sdkOut = args.get("sdk-out");
24
+ const sdkEventsOut = args.get("sdk-events-out");
25
+ const sdkTextOut = args.get("sdk-text-out");
26
+ const sdkBytesTextMethodsOut = args.get("sdk-bytes-text-methods-out");
27
+ const sdkEventsDtsOut = args.get("sdk-events-dts-out");
28
+ const sdkTextDtsOut = args.get("sdk-text-dts-out");
24
29
  const staticOut = args.get("static-out");
25
30
  const zigOut = args.get("zig-out");
26
31
  const metadataOut = args.get("metadata-out");
27
32
  const dtsOut = args.get("dts-out");
28
33
  const state = args.get("state");
29
34
  if (!zigOut) throw new Error("usage: sqlite_cli.ts --src <src> --zig-out <file> [--sdk-in <core.ts> --static-in <core.ts> --sdk-out <file> --static-out <file> --metadata-out <file>] [--state <file>]");
30
- const surfaceArgs = [sdkIn, staticIn, sdkOut, staticOut];
35
+ const surfaceArgs = [
36
+ sdkIn, staticIn, sdkOut, staticOut,
37
+ sdkEventsOut, sdkTextOut, sdkBytesTextMethodsOut, sdkEventsDtsOut, sdkTextDtsOut,
38
+ ];
31
39
  const emitsSurface = surfaceArgs.every((value) => value !== undefined);
32
- if (!emitsSurface && surfaceArgs.some((value) => value !== undefined)) throw new Error("SQLite SDK generation requires --sdk-in, --static-in, --sdk-out, and --static-out together");
40
+ if (!emitsSurface && surfaceArgs.some((value) => value !== undefined)) {
41
+ throw new Error("SQLite SDK generation requires its core, static, and SDK sibling outputs together");
42
+ }
33
43
  const analysis = analyzeSqlite(src);
34
44
  const diagnostics = [...analysis.diagnostics, ...(state ? checkMigrationState(analysis, state) : [])];
35
45
  for (const diagnostic of [...diagnostics, ...analysis.warnings]) console.error(formatSqliteDiagnostic(diagnostic));
@@ -37,6 +47,16 @@ try {
37
47
  if (emitsSurface) {
38
48
  const sdkSource = generateCoreSurface(fs.readFileSync(sdkIn!, "utf8"), analysis);
39
49
  fs.writeFileSync(sdkOut!, sdkSource);
50
+ const sdkDir = path.dirname(sdkIn!);
51
+ for (const [source, destination] of [
52
+ ["events.ts", sdkEventsOut!],
53
+ ["text.ts", sdkTextOut!],
54
+ ["bytes_text_methods.d.ts", sdkBytesTextMethodsOut!],
55
+ ["events.d.ts", sdkEventsDtsOut!],
56
+ ["text.d.ts", sdkTextDtsOut!],
57
+ ] as const) {
58
+ fs.copyFileSync(path.join(sdkDir, source), destination);
59
+ }
40
60
  if (dtsOut) {
41
61
  const compilerOptions: ts.CompilerOptions = {
42
62
  strict: true,
@@ -343,8 +343,10 @@ export class TypedAst {
343
343
  /// identifier-named, annotated property signature), so
344
344
  /// a shape this walk cannot carry whole refuses as an unsupported
345
345
  /// alias instead of registering a struct with silently missing fields.
346
- /// The one omission-carrying value record is the SDK-owned ThemeState;
347
- /// its caller opts in explicitly so authored/service records keep the
346
+ /// A tiny closed set of SDK-owned shell records carries omission
347
+ /// intentionally (ThemeState inheritance, optional tray typography, and
348
+ /// optional rich tray payloads);
349
+ /// their caller opts in explicitly so authored/service records keep the
348
350
  /// fixed-shape rule.
349
351
  propsOfTypeLiteral(node: tsImpl.TypeLiteralNode, allowOptional = false): PropInfo[] | null {
350
352
  const out: PropInfo[] = [];
@@ -266,7 +266,7 @@ export class TypeTable {
266
266
  this.declOrder.push(name);
267
267
  continue;
268
268
  }
269
- const projectOptional = this.isCanonicalThemeState(stmt);
269
+ const projectOptional = this.isCanonicalOptionalSdkRecord(stmt);
270
270
  if (ts.isTypeLiteralNode(stmt.type) && this.tast.propsOfTypeLiteral(stmt.type, projectOptional) !== null) {
271
271
  // A plain-record object-literal alias is a struct exactly like
272
272
  // an interface; the alias FORM is how a contract projection
@@ -275,8 +275,8 @@ export class TypeTable {
275
275
  // promotion walk. Shapes the plain-record walk cannot carry
276
276
  // whole (quoted or optional properties) stay unclassified and
277
277
  // refuse at emission instead of losing fields silently. The
278
- // canonical SDK ThemeState is the sole optional-property record:
279
- // omission is its manifest/system inheritance signal.
278
+ // A tiny closed set of SDK shell records may carry optional
279
+ // properties; authored records still spell absence as `| null`.
280
280
  this.structs.set(name, {
281
281
  name,
282
282
  decl: stmt,
@@ -323,7 +323,7 @@ export class TypeTable {
323
323
  }
324
324
  const structInfo = this.structs.get(stmt.name.text);
325
325
  if (structInfo && structInfo.decl === stmt && ts.isTypeLiteralNode(stmt.type)) {
326
- const projectOptional = this.isCanonicalThemeState(stmt);
326
+ const projectOptional = this.isCanonicalOptionalSdkRecord(stmt);
327
327
  const props = this.tast.propsOfTypeLiteral(stmt.type, projectOptional);
328
328
  if (props) structInfo.fields = props.map((p) => this.fieldOf(p, projectOptional));
329
329
  }
@@ -331,9 +331,9 @@ export class TypeTable {
331
331
  }
332
332
  }
333
333
 
334
- private isCanonicalThemeState(decl: ts.TypeAliasDeclaration): boolean {
334
+ private isCanonicalOptionalSdkRecord(decl: ts.TypeAliasDeclaration): boolean {
335
335
  const events = sdkLibraryModules.get("@native-sdk/core/events");
336
- return decl.name.text === "ThemeState" && events !== undefined &&
336
+ return (decl.name.text === "ThemeState" || decl.name.text === "StatusItemPresentation" || decl.name.text === "StatusItemMenuItem") && events !== undefined &&
337
337
  path.resolve(decl.getSourceFile().fileName) === path.resolve(events);
338
338
  }
339
339
 
@@ -342,8 +342,8 @@ export class TypeTable {
342
342
  return {
343
343
  tsName: p.name,
344
344
  zigName: zigDeclName(p.name),
345
- // Only the canonical ThemeState projects JS `undefined` omission onto
346
- // the contract's ordinary optional slot. Applying this globally would
345
+ // Only canonical SDK shell records project JS `undefined` omission
346
+ // onto the contract's ordinary optional slot. Applying this globally would
347
347
  // let service records acquire an absent state while their generated
348
348
  // codecs still accept only explicit null.
349
349
  type: projectOptional && p.optional && resolved.k !== "void" && resolved.k !== "optional"
@@ -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
+ }