@legendapp/spark 0.0.1-next.3 → 0.0.1-next.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 (161) hide show
  1. package/README.md +1 -1
  2. package/camera.ts +13 -0
  3. package/customize.ts +2 -0
  4. package/html.ts +1 -0
  5. package/markdown.ts +1 -0
  6. package/package.json +34 -15
  7. package/patches/camera/react-native-nitro-image.patch +320 -0
  8. package/patches/camera/react-native-nitro-modules.patch +50 -0
  9. package/patches/camera/react-native-vision-camera.patch +2662 -0
  10. package/patches/camera/upstream.json +22 -0
  11. package/patches/dependencies.json +14 -0
  12. package/patches/react-native-enriched-html@1.1.1.patch +854 -0
  13. package/patches/react-native-enriched-markdown@1.1.1.patch +9261 -0
  14. package/postinstall.cjs +1 -0
  15. package/schema.json +104 -0
  16. package/skills/spark/SKILL.md +56 -0
  17. package/skills/spark/UPGRADING.md +246 -0
  18. package/ui-swipe.ts +1 -0
  19. package/vendor/node_modules/@legendapp/spark-ai/package.json +4 -4
  20. package/vendor/node_modules/@legendapp/spark-ai/src/invocation-command.cjs +11 -0
  21. package/vendor/node_modules/@legendapp/spark-ai/src/invocation-command.d.cts +2 -0
  22. package/vendor/node_modules/@legendapp/spark-ai/src/invocations.ts +2 -19
  23. package/vendor/node_modules/@legendapp/spark-audio/package.json +3 -3
  24. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -3
  25. package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +4 -4
  26. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +65 -11
  27. package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +2 -1
  28. package/vendor/node_modules/@legendapp/spark-cli/dist/commands.js +3 -2
  29. package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +36 -13
  30. package/vendor/node_modules/@legendapp/spark-cli/dist/credentials.js +41 -26
  31. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-ai.cjs +108 -0
  32. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-artifacts.js +315 -0
  33. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-cli.cjs +75 -0
  34. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-github.cjs +133 -0
  35. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-policy.cjs +102 -0
  36. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-provider.cjs +2 -0
  37. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-worker.cjs +273 -0
  38. package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +157 -0
  39. package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +3 -1
  40. package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +1 -1
  41. package/vendor/node_modules/@legendapp/spark-cli/dist/enriched-html-pins.js +128 -0
  42. package/vendor/node_modules/@legendapp/spark-cli/dist/errors.js +100 -0
  43. package/vendor/node_modules/@legendapp/spark-cli/dist/examples.js +1 -1
  44. package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-patch.cjs +30 -1
  45. package/vendor/node_modules/@legendapp/spark-cli/dist/expo-native.cjs +5 -1
  46. package/vendor/node_modules/@legendapp/spark-cli/dist/helpers.js +1 -1
  47. package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +52 -7
  48. package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.d.cts +1 -0
  49. package/vendor/node_modules/@legendapp/spark-cli/dist/js-runtime.cjs +96 -0
  50. package/vendor/node_modules/@legendapp/spark-cli/dist/json.js +16 -0
  51. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +152 -0
  52. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +15 -0
  53. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +184 -0
  54. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.d.cts +16 -0
  55. package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +5 -1
  56. package/vendor/node_modules/@legendapp/spark-cli/dist/package-manager-config.js +41 -0
  57. package/vendor/node_modules/@legendapp/spark-cli/dist/package-manager.js +13 -0
  58. package/vendor/node_modules/@legendapp/spark-cli/dist/process.js +7 -0
  59. package/vendor/node_modules/@legendapp/spark-cli/dist/project-version.js +12 -0
  60. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +66 -30
  61. package/vendor/node_modules/@legendapp/spark-cli/dist/release.js +2 -1
  62. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +20 -20
  63. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-bootstrap.ps1 +87 -0
  64. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-bootstrap.sh +107 -0
  65. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-downloads.tsv +13 -0
  66. package/vendor/node_modules/@legendapp/spark-cli/dist/sdk-install.js +8 -3
  67. package/vendor/node_modules/@legendapp/spark-cli/dist/universal.cjs +2 -1
  68. package/vendor/node_modules/@legendapp/spark-cli/dist/upgrade.js +102 -0
  69. package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +1 -8
  70. package/vendor/node_modules/@legendapp/spark-cli/package.json +6 -4
  71. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/.claude/skills/spark/SKILL.md +9 -0
  72. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/AGENTS.md +4 -0
  73. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/CLAUDE.md +4 -0
  74. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/README.md +15 -0
  75. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +47 -3
  76. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/.claude/skills/spark/SKILL.md +9 -0
  77. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/AGENTS.md +4 -0
  78. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/CLAUDE.md +4 -0
  79. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/README.md +15 -0
  80. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +46 -3
  81. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/.claude/skills/spark/SKILL.md +9 -0
  82. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/AGENTS.md +4 -0
  83. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/CLAUDE.md +4 -0
  84. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/README.md +15 -0
  85. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +47 -3
  86. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +3 -3
  87. package/vendor/node_modules/@legendapp/spark-codex/package.json +4 -4
  88. package/vendor/node_modules/@legendapp/spark-commands/package.json +6 -6
  89. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +3 -3
  90. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/RNDesktopApp.mm +14 -1
  91. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +2 -2
  92. package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/menu.ts +6 -4
  93. package/vendor/node_modules/@legendapp/spark-desktop-app/src/customize-hooks.ts +17 -0
  94. package/vendor/node_modules/@legendapp/spark-desktop-app/src/customize.ts +117 -0
  95. package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +20 -1
  96. package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +5 -2
  97. package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +14 -0
  98. package/vendor/node_modules/@legendapp/spark-desktop-config/customize-provider.cjs +16 -0
  99. package/vendor/node_modules/@legendapp/spark-desktop-config/customize.cjs +16 -0
  100. package/vendor/node_modules/@legendapp/spark-desktop-config/expo.cjs +1 -0
  101. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +106 -0
  102. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +1 -0
  103. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +5 -4
  104. package/vendor/node_modules/@legendapp/spark-desktop-config/schema.json +104 -0
  105. package/vendor/node_modules/@legendapp/spark-desktop-host/SparkCustomize.mm +517 -0
  106. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +4 -3
  107. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +3 -3
  108. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/RNDesktopShortcuts.mm +3 -1
  109. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.h +3 -0
  110. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.mm +1 -1
  111. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +3 -3
  112. package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +44 -4
  113. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +4 -4
  114. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/api.ts +65 -26
  115. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +8 -6
  116. package/vendor/node_modules/@legendapp/spark-documents/package.json +8 -8
  117. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +3 -3
  118. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +3 -3
  119. package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.h +1 -0
  120. package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.mm +11 -10
  121. package/vendor/node_modules/@legendapp/spark-file-system/package.json +3 -3
  122. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +3 -3
  123. package/vendor/node_modules/@legendapp/spark-html/package.json +24 -0
  124. package/vendor/node_modules/@legendapp/spark-html/src/Html.tsx +22 -0
  125. package/vendor/node_modules/@legendapp/spark-html/src/HtmlInput.tsx +102 -0
  126. package/vendor/node_modules/@legendapp/spark-html/src/index.ts +4 -0
  127. package/vendor/node_modules/@legendapp/spark-html/src/types.ts +4 -0
  128. package/vendor/node_modules/@legendapp/spark-markdown/package.json +24 -0
  129. package/vendor/node_modules/@legendapp/spark-markdown/src/Markdown.tsx +24 -0
  130. package/vendor/node_modules/@legendapp/spark-markdown/src/MarkdownInput.tsx +111 -0
  131. package/vendor/node_modules/@legendapp/spark-markdown/src/index.ts +4 -0
  132. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +3 -3
  133. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +3 -3
  134. package/vendor/node_modules/@legendapp/spark-notifications/package.json +3 -3
  135. package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/SparkNotifications.h +16 -11
  136. package/vendor/node_modules/@legendapp/spark-processes/package.json +3 -3
  137. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +18 -0
  138. package/vendor/node_modules/@legendapp/spark-rich-text/src/components.tsx +52 -0
  139. package/vendor/node_modules/@legendapp/spark-rich-text/src/index.ts +4 -0
  140. package/vendor/node_modules/@legendapp/spark-rich-text/src/types.ts +24 -0
  141. package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputShortcuts.macos.ts +55 -0
  142. package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputShortcuts.ts +13 -0
  143. package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputValue.ts +14 -0
  144. package/vendor/node_modules/@legendapp/spark-rich-text/src/value.ts +16 -0
  145. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +3 -3
  146. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  147. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +5 -5
  148. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
  149. package/vendor/node_modules/@legendapp/spark-system/package.json +3 -3
  150. package/vendor/node_modules/@legendapp/spark-tray/package.json +3 -3
  151. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +360 -35
  152. package/vendor/node_modules/@legendapp/spark-ui/macos/swipe-actions/RNSwipeActions.h +10 -0
  153. package/vendor/node_modules/@legendapp/spark-ui/macos/swipe-actions/RNSwipeActions.mm +422 -0
  154. package/vendor/node_modules/@legendapp/spark-ui/package.json +4 -3
  155. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +11 -0
  156. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +30 -13
  157. package/vendor/node_modules/@legendapp/spark-ui/src/swipe-actions/SwipeActionsNativeComponent.ts +11 -0
  158. package/vendor/node_modules/@legendapp/spark-ui/src/swipe-actions/index.tsx +41 -0
  159. package/vendor/node_modules/@legendapp/spark-updates/package.json +3 -3
  160. package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
  161. package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
@@ -0,0 +1,106 @@
1
+ const { createHash } = require("node:crypto");
2
+ const fs = require("node:fs");
3
+ const path = require("node:path");
4
+ const { createRequire } = require("node:module");
5
+
6
+ const cameraPackages = ["react-native-nitro-image", "react-native-vision-camera"];
7
+
8
+ function prepareNativePatches(root) {
9
+ const manifestFile = path.join(root, "package.json");
10
+ if (!fs.existsSync(manifestFile)) return {};
11
+ const app = JSON.parse(fs.readFileSync(manifestFile, "utf8"));
12
+ if (app.name !== "@legendapp/spark" && !app.dependencies?.["@legendapp/spark"] && !app.devDependencies?.["@legendapp/spark"]) return {};
13
+ const appRequire = createRequire(manifestFile);
14
+ let sparkFile;
15
+ try { sparkFile = appRequire.resolve("@legendapp/spark/package.json"); }
16
+ catch (error) { if (error.code === "MODULE_NOT_FOUND") return {}; throw error; }
17
+ const spark = JSON.parse(fs.readFileSync(sparkFile, "utf8"));
18
+ const directory = path.dirname(sparkFile);
19
+ const patchesRoot = spark.spark?.bundledModuleRoot
20
+ ? path.join(directory, "patches") : path.resolve(__dirname, "../../patches");
21
+ const pins = {};
22
+ if (cameraPackages.some(name => spark.dependencies?.[name])) {
23
+ const cameraPins = JSON.parse(fs.readFileSync(path.join(patchesRoot, "camera/upstream.json"), "utf8"));
24
+ for (const name of ["react-native-nitro-modules", ...cameraPackages]) {
25
+ pins[name] = { ...cameraPins[name], patch: `camera/${name}.patch`,
26
+ requires: name === "react-native-vision-camera" ? ["react-native-nitro-modules", "react-native-nitro-image"] : ["react-native-nitro-modules"] };
27
+ }
28
+ }
29
+ const integrations = path.join(patchesRoot, "dependencies.json");
30
+ if (fs.existsSync(integrations)) Object.assign(pins, JSON.parse(fs.readFileSync(integrations, "utf8")));
31
+ const active = Object.keys(pins).filter(name => spark.dependencies?.[name]);
32
+ if (!active.length) return {};
33
+ const { parsePatch, applyPatch, reversePatch } = require("diff");
34
+ const queue = [appRequire, createRequire(sparkFile)];
35
+ const visited = new Set();
36
+ const packages = {};
37
+ for (const req of queue) {
38
+ for (const name of active) {
39
+ let file;
40
+ try { file = req.resolve(`${name}/package.json`); }
41
+ catch (error) {
42
+ if (error.code !== "MODULE_NOT_FOUND") throw error;
43
+ if (req === appRequire) continue;
44
+ throw new Error(`Spark needs ${name}@${pins[name].version}. Finish installing dependencies before native preparation.`);
45
+ }
46
+ if (!fs.existsSync(file)) throw new Error(`Spark needs ${name}@${pins[name].version}. Finish installing dependencies before native preparation.`);
47
+ const packageRoot = fs.realpathSync(path.dirname(file));
48
+ if (visited.has(packageRoot)) continue;
49
+ visited.add(packageRoot);
50
+ packages[name] = { root: packageRoot };
51
+ queue.push(createRequire(file));
52
+ const manifest = JSON.parse(fs.readFileSync(file, "utf8"));
53
+ const pin = pins[name];
54
+ if (manifest.version !== pin.version) throw new Error(`Spark needs ${name}@${pin.version}; found ${manifest.version}. Use the SDK's pinned dependency version.`);
55
+ const bytes = fs.readFileSync(path.join(patchesRoot, pin.patch));
56
+ const writes = [];
57
+ for (const patch of parsePatch(bytes.toString("utf8"))) {
58
+ const relative = patch.newFileName.replace(/^b\//, "");
59
+ const target = path.resolve(packageRoot, relative);
60
+ if (!target.startsWith(packageRoot + path.sep) || patch.newFileName === "/dev/null") throw new Error(`Invalid native patch target: ${relative}`);
61
+ let current = fs.existsSync(target) ? fs.readFileSync(target, "utf8") : "";
62
+ if (patch.oldFileName === "/dev/null") {
63
+ const next = applyPatch("", patch);
64
+ if (current === next) continue;
65
+ if (current !== "") throw new Error(`Cannot apply Spark's ${name} patch to ${relative}. Reinstall dependencies before retrying.`);
66
+ writes.push([target, next]);
67
+ continue;
68
+ }
69
+ if (relative === "package.json" && manifest.spark?.dependencyPatch) {
70
+ const original = JSON.parse(current);
71
+ delete original.spark.dependencyPatch;
72
+ delete original.spark.sdk;
73
+ delete original.spark.requires;
74
+ if (!Object.keys(original.spark).length) delete original.spark;
75
+ current = JSON.stringify(original, null, 2) + "\n";
76
+ }
77
+ if (applyPatch(current, reversePatch(patch)) !== false) continue;
78
+ const next = applyPatch(current, patch);
79
+ if (next === false) throw new Error(`Cannot apply Spark's ${name} patch to ${relative}. Reinstall dependencies before retrying.`);
80
+ writes.push([target, next]);
81
+ }
82
+ // Verify every file before writing; rename rather than mutate package-manager cache hardlinks.
83
+ for (const [target, next] of writes) {
84
+ fs.mkdirSync(path.dirname(target), { recursive: true });
85
+ const temporary = `${target}.spark-${process.pid}.tmp`;
86
+ fs.writeFileSync(temporary, next); fs.renameSync(temporary, target);
87
+ }
88
+ const patched = JSON.parse(fs.readFileSync(file, "utf8"));
89
+ patched.spark ??= {};
90
+ if (name !== "react-native-nitro-modules") {
91
+ patched.spark.sdk = true;
92
+ patched.spark.requires = pin.requires ?? [];
93
+ }
94
+ patched.spark.dependencyPatch = { schema: 1, version: pin.version,
95
+ patchHash: createHash("sha256").update(bytes).digest("hex"), upstreamIntegrity: pin.integrity };
96
+ const serialized = JSON.stringify(patched, null, 2) + "\n";
97
+ if (fs.readFileSync(file, "utf8") !== serialized) {
98
+ const temporary = `${file}.spark-${process.pid}.tmp`;
99
+ fs.writeFileSync(temporary, serialized); fs.renameSync(temporary, file);
100
+ }
101
+ }
102
+ }
103
+ return packages;
104
+ }
105
+
106
+ module.exports = { prepareNativePatches };
@@ -0,0 +1 @@
1
+ export function prepareNativePatches(root: string): Record<string, { root: string }>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-config",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "license": "MIT",
5
5
  "main": "app.plugin.cjs",
6
6
  "files": [
@@ -11,10 +11,11 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "expo-desktop-config-plugins": "1.2.0",
14
- "@legendapp/spark-desktop-host": "0.0.1-next.3",
15
- "@legendapp/spark-window-options": "0.0.1-next.3",
14
+ "@legendapp/spark-desktop-host": "0.0.1-next.5",
15
+ "@legendapp/spark-window-options": "0.0.1-next.5",
16
16
  "@expo/config-plugins": "54.0.5",
17
- "@expo/config-types": "54.0.10"
17
+ "@expo/config-types": "54.0.10",
18
+ "diff": "8.0.4"
18
19
  },
19
20
  "private": true
20
21
  }
@@ -452,6 +452,110 @@
452
452
  "extends": {
453
453
  "const": "expo",
454
454
  "description": "Compose desktop options onto the existing Expo configuration."
455
+ },
456
+ "customize": {
457
+ "oneOf": [
458
+ {
459
+ "const": false
460
+ },
461
+ {
462
+ "type": "object",
463
+ "additionalProperties": false,
464
+ "required": [
465
+ "repository",
466
+ "files"
467
+ ],
468
+ "properties": {
469
+ "repository": {
470
+ "type": "string",
471
+ "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
472
+ },
473
+ "files": {
474
+ "type": "array",
475
+ "minItems": 1,
476
+ "items": {
477
+ "type": "string"
478
+ }
479
+ },
480
+ "tag": {
481
+ "type": "string"
482
+ },
483
+ "toolkitRepository": {
484
+ "type": "string"
485
+ },
486
+ "toolkitTag": {
487
+ "type": "string"
488
+ },
489
+ "ui": {
490
+ "enum": [
491
+ "default",
492
+ "custom"
493
+ ],
494
+ "default": "default"
495
+ },
496
+ "provider": {
497
+ "oneOf": [
498
+ {
499
+ "type": "object",
500
+ "additionalProperties": false,
501
+ "required": [
502
+ "kind",
503
+ "endpoint",
504
+ "model"
505
+ ],
506
+ "properties": {
507
+ "kind": {
508
+ "enum": [
509
+ "local",
510
+ "remote"
511
+ ]
512
+ },
513
+ "endpoint": {
514
+ "type": "string"
515
+ },
516
+ "model": {
517
+ "type": "string",
518
+ "minLength": 1
519
+ }
520
+ }
521
+ },
522
+ {
523
+ "type": "object",
524
+ "additionalProperties": false,
525
+ "required": [
526
+ "kind",
527
+ "tool"
528
+ ],
529
+ "properties": {
530
+ "kind": {
531
+ "const": "cli"
532
+ },
533
+ "tool": {
534
+ "enum": [
535
+ "codex",
536
+ "claude"
537
+ ]
538
+ },
539
+ "model": {
540
+ "type": "string",
541
+ "minLength": 1
542
+ }
543
+ }
544
+ }
545
+ ]
546
+ },
547
+ "sourceRoot": {
548
+ "type": "string",
549
+ "description": "Relative ancestor of the app project. files are relative to this source snapshot root."
550
+ },
551
+ "githubClientId": {
552
+ "type": "string",
553
+ "pattern": "^[A-Za-z0-9_]+$",
554
+ "description": "GitHub OAuth app client ID with device flow enabled."
555
+ }
556
+ }
557
+ }
558
+ ]
455
559
  }
456
560
  },
457
561
  "allOf": [