peachsim 0.1.2605 → 0.1.2607

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 (147) hide show
  1. package/cli/commands/package.ts +71 -39
  2. package/cli/commands/perf-native.ts +259 -6
  3. package/cli/commands/shell-url.ts +1 -0
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +2 -2
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +5 -5
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +3 -3
  16. package/dist-lib/bundle-channel.cjs +1520 -932
  17. package/dist-lib/capture-contract.cjs +1 -1
  18. package/dist-lib/capture-contract.mjs +3 -3
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +3 -3
  21. package/dist-lib/cloud-test-args.cjs +1 -1
  22. package/dist-lib/cloud-test-args.mjs +2 -2
  23. package/dist-lib/cloud.cjs +1 -1
  24. package/dist-lib/cloud.mjs +7 -7
  25. package/dist-lib/config.cjs +1 -1
  26. package/dist-lib/config.mjs +5 -5
  27. package/dist-lib/detox/index.cjs +1 -1
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/esm-chunks/{acorn-UNOYFUKI.mjs → acorn-KFWXYMX5.mjs} +3 -3
  30. package/dist-lib/esm-chunks/{chunk-WSRPZF7M.mjs → chunk-6JPUMAC2.mjs} +1 -1
  31. package/dist-lib/esm-chunks/{chunk-M4G5YUO7.mjs → chunk-6NDABMDX.mjs} +3 -3
  32. package/dist-lib/esm-chunks/{chunk-GT54N3GG.mjs → chunk-7SKDPTZN.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-FXONOT2L.mjs → chunk-ACAXWH62.mjs} +1 -1
  34. package/dist-lib/esm-chunks/chunk-ARYRQJUB.mjs +326 -0
  35. package/dist-lib/esm-chunks/{chunk-WB2EBX5Q.mjs → chunk-BNAXRY5Q.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-AST6VA7D.mjs → chunk-CA64UUHF.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-B54SPDLA.mjs → chunk-DBW62F4N.mjs} +3 -2
  38. package/dist-lib/esm-chunks/{chunk-7K33ENH6.mjs → chunk-ESS2CG5G.mjs} +5 -5
  39. package/dist-lib/esm-chunks/{chunk-LFN7VAPB.mjs → chunk-IGSLOAPL.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-RJCM34J7.mjs → chunk-KIIALACX.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-YO756PYQ.mjs → chunk-LJZ373SO.mjs} +819 -681
  42. package/dist-lib/esm-chunks/{chunk-VRQPEROV.mjs → chunk-M4ORY3NH.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-3XUIDCBF.mjs → chunk-MBWWOGI5.mjs} +4 -4
  44. package/dist-lib/esm-chunks/{chunk-M3V4F5OV.mjs → chunk-O5BPZVLB.mjs} +5 -5
  45. package/dist-lib/esm-chunks/chunk-P5Q5QCTP.mjs +32 -0
  46. package/dist-lib/esm-chunks/{chunk-O55DZ2EL.mjs → chunk-QJUAWJDB.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-HHS4A7GI.mjs → chunk-RIDXKGBZ.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-LG76KUUO.mjs → chunk-TD2DBEKQ.mjs} +1 -1
  49. package/dist-lib/esm-chunks/{chunk-AYHTHFG4.mjs → chunk-UTSB5CDG.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-UPUOCALX.mjs → chunk-WMWOBH7E.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{chunk-6TE7WLSF.mjs → chunk-ZNGLVJYL.mjs} +1 -1
  52. package/dist-lib/esm-chunks/{metro-layout-parser-YRBZCLVD.mjs → metro-layout-parser-UY3B6VGU.mjs} +3 -3
  53. package/dist-lib/esm-chunks/{swift-package-prebuilt-S7KR6TKE.mjs → swift-package-prebuilt-HDHPWS44.mjs} +10 -10
  54. package/dist-lib/esm-chunks/{swift-sdk-app-module-3JNA7PCB.mjs → swift-sdk-app-module-U6G5RZV2.mjs} +14 -14
  55. package/dist-lib/esm-chunks/{swift-sdk-image-3P4IUP2A.mjs → swift-sdk-image-PVDA2MVM.mjs} +14 -14
  56. package/dist-lib/esm-chunks/{swift-sdk-image-producer-EA2RYBM4.mjs → swift-sdk-image-producer-YHPS3KNR.mjs} +4 -4
  57. package/dist-lib/expo-swift-bundle.cjs +1519 -931
  58. package/dist-lib/expo-swift-metadata.cjs +1 -1
  59. package/dist-lib/expo-swift-metadata.mjs +7 -7
  60. package/dist-lib/home-paths.cjs +1 -1
  61. package/dist-lib/host/bridge-host.cjs +1677 -947
  62. package/dist-lib/host/fetch-proxy-handler.cjs +44 -37
  63. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  64. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  65. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  66. package/dist-lib/host/websocket-proxy.cjs +1 -1
  67. package/dist-lib/index.cjs +1 -1
  68. package/dist-lib/kotlin-host.cjs +1 -1
  69. package/dist-lib/menu.cjs +1 -1
  70. package/dist-lib/menu.mjs +3 -3
  71. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  72. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  73. package/dist-lib/metro-production-bundle.cjs +1 -1
  74. package/dist-lib/metro-production-bundle.mjs +4 -4
  75. package/dist-lib/native-app-identity-project.cjs +540 -247
  76. package/dist-lib/native-app-identity-project.mjs +218 -1828
  77. package/dist-lib/native-app-identity.cjs +1 -1
  78. package/dist-lib/native-app-identity.mjs +6 -6
  79. package/dist-lib/native-firebase-metadata.cjs +1 -1
  80. package/dist-lib/native-firebase-metadata.mjs +3 -3
  81. package/dist-lib/pdfium-raster.cjs +1 -1
  82. package/dist-lib/pdfium-raster.mjs +2 -2
  83. package/dist-lib/plist.cjs +327 -15
  84. package/dist-lib/plist.mjs +13 -5
  85. package/dist-lib/profiles.cjs +1 -1
  86. package/dist-lib/public-brand.cjs +1 -1
  87. package/dist-lib/public-origins-lib-esm.json +82 -129
  88. package/dist-lib/public-origins-lib.json +69 -140
  89. package/dist-lib/react-native-host-modules.cjs +1 -1
  90. package/dist-lib/react-native-host-modules.mjs +2 -2
  91. package/dist-lib/reap-browser.cjs +1 -1
  92. package/dist-lib/scripts/dev-server-scanner.cjs +211 -3
  93. package/dist-lib/sdk.cjs +1 -1
  94. package/dist-lib/sdk.mjs +8 -8
  95. package/dist-lib/skills.cjs +1693 -963
  96. package/dist-lib/swift-compile.cjs +812 -673
  97. package/dist-lib/swift-compile.mjs +10 -10
  98. package/dist-lib/swift-package.cjs +1 -1
  99. package/dist-lib/swift-package.mjs +3 -3
  100. package/dist-lib/swift-submit.cjs +1 -1
  101. package/dist-lib/swift-submit.mjs +6 -6
  102. package/dist-lib/swift-svg-raster.cjs +1 -1
  103. package/dist-lib/swift-svg-raster.mjs +2 -2
  104. package/dist-lib/swift-toolchain.cjs +3 -2
  105. package/dist-lib/swift.cjs +1 -1
  106. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  108. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  109. package/dist-lib/vendor/acorn.cjs +1 -1
  110. package/dist-lib/vendor/magic-string.cjs +1 -1
  111. package/dist-lib/vendor/stream-json.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  116. package/dist-lib/vendor/sucrase.cjs +1 -1
  117. package/dist-lib/vendor/terser.cjs +1 -1
  118. package/dist-lib/vendor/valibot.cjs +1 -1
  119. package/dist-lib/vendor/ws.cjs +1 -1
  120. package/dist-lib/vendor/zod.cjs +1 -1
  121. package/dist-lib/worklet-executable.cjs +1 -1
  122. package/dist-lib/worklet-executable.mjs +3 -3
  123. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +38 -2
  124. package/dist-types/packages/peach-globals/src/canvasAgentContract.d.ts +8 -0
  125. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  126. package/package.json +1 -6
  127. package/src/agent-prompt.ts +5 -1
  128. package/src/bazel-project.ts +1 -1
  129. package/src/expo-native-prebuilt.ts +1 -1
  130. package/src/expo-workspace-exclusion.ts +1 -1
  131. package/src/gitignore.ts +175 -0
  132. package/src/intent-definition/plist-reader.ts +22 -168
  133. package/src/one-native-controls-package.ts +143 -1
  134. package/src/oneNativeControlsContract.ts +1 -0
  135. package/src/plist-bytes.ts +144 -2
  136. package/src/plist.ts +359 -2
  137. package/src/swift-compile-budget.ts +28 -7
  138. package/src/swift-compile.ts +972 -809
  139. package/src/swift-guest-compile.ts +3 -0
  140. package/src/swift-toolchain.ts +4 -1
  141. package/src/xcode-project.ts +1 -1
  142. package/dist-lib/esm-chunks/chunk-OW4VRQKO.mjs +0 -10993
  143. package/dist-lib/esm-chunks/chunk-ZSHGFGW7.mjs +0 -65
  144. package/dist-lib/vendor/@xmldom/xmldom.cjs +0 -6481
  145. package/dist-lib/vendor/bplist-parser.cjs +0 -1589
  146. package/dist-lib/vendor/ignore.cjs +0 -455
  147. package/dist-lib/vendor/plist.cjs +0 -10978
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2605 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2607 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2605 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2607 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  NATIVE_APP_IDENTITY_HEADER,
4
4
  applyNativeAppIdentity,
@@ -22,11 +22,11 @@ import {
22
22
  readRootModuleName,
23
23
  readSiriEntitlement,
24
24
  selectNativeAppIdentityReader
25
- } from "./esm-chunks/chunk-3XUIDCBF.mjs";
26
- import "./esm-chunks/chunk-FXONOT2L.mjs";
27
- import "./esm-chunks/chunk-O55DZ2EL.mjs";
28
- import "./esm-chunks/chunk-VRQPEROV.mjs";
29
- import "./esm-chunks/chunk-ZSHGFGW7.mjs";
25
+ } from "./esm-chunks/chunk-MBWWOGI5.mjs";
26
+ import "./esm-chunks/chunk-ACAXWH62.mjs";
27
+ import "./esm-chunks/chunk-QJUAWJDB.mjs";
28
+ import "./esm-chunks/chunk-M4ORY3NH.mjs";
29
+ import "./esm-chunks/chunk-P5Q5QCTP.mjs";
30
30
  export {
31
31
  NATIVE_APP_IDENTITY_HEADER,
32
32
  applyNativeAppIdentity,
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2605 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2607 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,8 +1,8 @@
1
- /*! peach v0.1.2605 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2607 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  findBundleFooter
4
- } from "./esm-chunks/chunk-O55DZ2EL.mjs";
5
- import "./esm-chunks/chunk-ZSHGFGW7.mjs";
4
+ } from "./esm-chunks/chunk-QJUAWJDB.mjs";
5
+ import "./esm-chunks/chunk-P5Q5QCTP.mjs";
6
6
 
7
7
  // src/native-firebase-metadata.ts
8
8
  var PREFIX = "globalThis.__peachNativeFirebaseConfig=";
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2605 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2607 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,5 +1,5 @@
1
- /*! peach v0.1.2605 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
- import "./esm-chunks/chunk-ZSHGFGW7.mjs";
1
+ /*! peach v0.1.2607 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
+ import "./esm-chunks/chunk-P5Q5QCTP.mjs";
3
3
 
4
4
  // src/pdfium-raster.ts
5
5
  import { PDFiumLibrary } from "@hyzyla/pdfium/inline";
@@ -1,11 +1,9 @@
1
- /*! peach v0.1.2605 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2607 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
- var __create = Object.create;
5
4
  var __defProp = Object.defineProperty;
6
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
8
  var __export = (target, all) => {
11
9
  for (var name in all)
@@ -19,27 +17,341 @@ var __copyProps = (to, from, except, desc) => {
19
17
  }
20
18
  return to;
21
19
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
30
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
21
 
32
22
  // src/plist.ts
33
23
  var plist_exports = {};
34
24
  __export(plist_exports, {
35
- parsePlistSource: () => parsePlistSource
25
+ build: () => buildPlist,
26
+ buildPlist: () => buildPlist,
27
+ parse: () => parsePlist,
28
+ parsePlist: () => parsePlist,
29
+ parsePlistSource: () => parsePlistSource,
30
+ parseXmlPlist: () => parseXmlPlist
36
31
  });
37
32
  module.exports = __toCommonJS(plist_exports);
38
- var import_plist = __toESM(require("peachsim/vendor/plist"), 1);
33
+ var NAMED_ENTITIES = {
34
+ amp: "&",
35
+ lt: "<",
36
+ gt: ">",
37
+ quot: '"',
38
+ apos: "'"
39
+ };
40
+ function decodeXmlEntities(text) {
41
+ if (!text.includes("&")) return text;
42
+ return text.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|[a-zA-Z]+);/g, (full, entity) => {
43
+ if (entity.startsWith("#x") || entity.startsWith("#X")) {
44
+ const code = Number.parseInt(entity.slice(2), 16);
45
+ return Number.isFinite(code) ? String.fromCodePoint(code) : full;
46
+ }
47
+ if (entity.startsWith("#")) {
48
+ const code = Number.parseInt(entity.slice(1), 10);
49
+ return Number.isFinite(code) ? String.fromCodePoint(code) : full;
50
+ }
51
+ return NAMED_ENTITIES[entity] ?? full;
52
+ });
53
+ }
54
+ function escapeXmlText(text) {
55
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
56
+ }
57
+ function parseXmlDocument(input) {
58
+ const source = input.startsWith("\uFEFF") ? input.slice(1) : input;
59
+ const len = source.length;
60
+ let pos = 0;
61
+ const skipIgnorable = () => {
62
+ while (pos < len) {
63
+ while (pos < len && /\s/.test(source[pos])) pos++;
64
+ if (source.startsWith("<!--", pos)) {
65
+ const end = source.indexOf("-->", pos + 4);
66
+ if (end === -1) throw new Error("unterminated XML comment");
67
+ pos = end + 3;
68
+ continue;
69
+ }
70
+ if (source.startsWith("<?", pos)) {
71
+ const end = source.indexOf("?>", pos + 2);
72
+ if (end === -1) throw new Error("unterminated XML processing instruction");
73
+ pos = end + 2;
74
+ continue;
75
+ }
76
+ if (source.startsWith("<!DOCTYPE", pos)) {
77
+ pos += 9;
78
+ let depth = 0;
79
+ let quote = "";
80
+ while (pos < len) {
81
+ const ch = source[pos];
82
+ pos++;
83
+ if (quote) {
84
+ if (ch === quote) quote = "";
85
+ } else if (ch === '"' || ch === "'") {
86
+ quote = ch;
87
+ } else if (ch === "[") {
88
+ depth++;
89
+ } else if (ch === "]") {
90
+ depth = Math.max(0, depth - 1);
91
+ } else if (ch === ">" && depth === 0) {
92
+ break;
93
+ }
94
+ }
95
+ continue;
96
+ }
97
+ break;
98
+ }
99
+ };
100
+ const readElement = () => {
101
+ if (source[pos] !== "<") {
102
+ throw new Error(`expected XML tag at offset ${pos}`);
103
+ }
104
+ pos++;
105
+ const nameStart = pos;
106
+ while (pos < len && /[^\s/>]/.test(source[pos])) pos++;
107
+ const tag = source.slice(nameStart, pos);
108
+ if (!tag) throw new Error(`empty XML tag name at offset ${nameStart}`);
109
+ let quote = "";
110
+ let selfClosing = false;
111
+ while (pos < len) {
112
+ const ch = source[pos];
113
+ if (quote) {
114
+ pos++;
115
+ if (ch === quote) quote = "";
116
+ continue;
117
+ }
118
+ if (ch === '"' || ch === "'") {
119
+ quote = ch;
120
+ pos++;
121
+ continue;
122
+ }
123
+ if (ch === "/" && source[pos + 1] === ">") {
124
+ selfClosing = true;
125
+ pos += 2;
126
+ break;
127
+ }
128
+ if (ch === ">") {
129
+ pos++;
130
+ break;
131
+ }
132
+ pos++;
133
+ }
134
+ if (selfClosing) {
135
+ return { tag, children: [], text: "" };
136
+ }
137
+ const children = [];
138
+ let text = "";
139
+ while (pos < len) {
140
+ if (source.startsWith("<!--", pos)) {
141
+ const end2 = source.indexOf("-->", pos + 4);
142
+ if (end2 === -1) throw new Error("unterminated XML comment");
143
+ pos = end2 + 3;
144
+ continue;
145
+ }
146
+ if (source.startsWith("<![CDATA[", pos)) {
147
+ const end2 = source.indexOf("]]>", pos + 9);
148
+ if (end2 === -1) throw new Error("unterminated CDATA section");
149
+ text += source.slice(pos + 9, end2);
150
+ pos = end2 + 3;
151
+ continue;
152
+ }
153
+ if (source.startsWith("</", pos)) {
154
+ pos += 2;
155
+ const closeStart = pos;
156
+ while (pos < len && /[^\s>]/.test(source[pos])) pos++;
157
+ const closeTag = source.slice(closeStart, pos);
158
+ while (pos < len && /\s/.test(source[pos])) pos++;
159
+ if (source[pos] !== ">") throw new Error(`malformed closing tag </${closeTag}>`);
160
+ pos++;
161
+ if (closeTag !== tag) {
162
+ throw new Error(`mismatched XML closing tag </${closeTag}> for <${tag}>`);
163
+ }
164
+ return { tag, children, text };
165
+ }
166
+ if (source[pos] === "<") {
167
+ children.push(readElement());
168
+ continue;
169
+ }
170
+ const nextTag = source.indexOf("<", pos);
171
+ const end = nextTag === -1 ? len : nextTag;
172
+ text += decodeXmlEntities(source.slice(pos, end));
173
+ pos = end;
174
+ }
175
+ throw new Error(`unclosed XML tag <${tag}>`);
176
+ };
177
+ skipIgnorable();
178
+ if (pos >= len) throw new Error("empty XML plist document");
179
+ return readElement();
180
+ }
181
+ function parseXmlPlist(source, options = {}) {
182
+ const root = parseXmlDocument(source);
183
+ if (root.tag !== "plist") {
184
+ throw new Error(`expected <plist> root element, got <${root.tag}>`);
185
+ }
186
+ if (root.children.length === 0) {
187
+ if (options.strict) throw new Error("<plist> element has no root value");
188
+ return void 0;
189
+ }
190
+ if (options.strict && root.children.length !== 1) {
191
+ throw new Error("<plist> element must contain exactly one root value");
192
+ }
193
+ const leafText = (node) => {
194
+ if (options.strict && node.children.length > 0) {
195
+ throw new Error(`<${node.tag}> must not contain child elements`);
196
+ }
197
+ return node.text;
198
+ };
199
+ const visit = (node) => {
200
+ switch (node.tag) {
201
+ case "dict": {
202
+ const result = {};
203
+ if (options.strict && node.children.length % 2 !== 0) {
204
+ throw new Error("<dict> must contain key/value pairs");
205
+ }
206
+ for (let i = 0; i + 1 < node.children.length; i += 2) {
207
+ const keyNode = node.children[i];
208
+ if (keyNode.tag !== "key") {
209
+ throw new Error(`expected <key> in <dict>, got <${keyNode.tag}>`);
210
+ }
211
+ result[leafText(keyNode)] = visit(node.children[i + 1]);
212
+ }
213
+ return result;
214
+ }
215
+ case "array":
216
+ return node.children.map(visit);
217
+ case "string":
218
+ return leafText(node);
219
+ case "integer": {
220
+ const raw = leafText(node).trim();
221
+ if (options.onInteger) return options.onInteger(raw);
222
+ if (!raw) throw new Error("empty <integer> element");
223
+ return Number.parseInt(raw, 10);
224
+ }
225
+ case "real": {
226
+ const raw = leafText(node).trim();
227
+ if (options.onReal) return options.onReal(raw);
228
+ if (!raw) throw new Error("empty <real> element");
229
+ return Number.parseFloat(raw);
230
+ }
231
+ case "true":
232
+ return true;
233
+ case "false":
234
+ return false;
235
+ case "data":
236
+ return Buffer.from(leafText(node).replace(/\s+/g, ""), "base64");
237
+ case "date":
238
+ return new Date(leafText(node).trim());
239
+ default:
240
+ throw new Error(`unsupported plist element ${node.tag}`);
241
+ }
242
+ };
243
+ return visit(root.children[0]);
244
+ }
245
+ function parsePlist(source) {
246
+ const root = parseXmlDocument(source);
247
+ if (root.tag !== "plist") {
248
+ throw new Error(`expected <plist> root element, got <${root.tag}>`);
249
+ }
250
+ if (root.children.length === 0) return {};
251
+ const visit = (node) => {
252
+ switch (node.tag) {
253
+ case "dict": {
254
+ const result = {};
255
+ for (let i = 0; i + 1 < node.children.length; i += 2) {
256
+ const keyNode = node.children[i];
257
+ if (keyNode.tag !== "key") {
258
+ throw new Error(`expected <key> in <dict>, got <${keyNode.tag}>`);
259
+ }
260
+ result[keyNode.text] = visit(node.children[i + 1]);
261
+ }
262
+ return result;
263
+ }
264
+ case "array":
265
+ return node.children.map(visit);
266
+ case "string":
267
+ return node.text;
268
+ case "integer": {
269
+ const raw = node.text.trim();
270
+ if (!raw) throw new Error("empty <integer> element");
271
+ return Number.parseInt(raw, 10);
272
+ }
273
+ case "real": {
274
+ const raw = node.text.trim();
275
+ if (!raw) throw new Error("empty <real> element");
276
+ return Number.parseFloat(raw);
277
+ }
278
+ case "true":
279
+ return true;
280
+ case "false":
281
+ return false;
282
+ case "data":
283
+ return Buffer.from(node.text.replace(/\s+/g, ""), "base64");
284
+ case "date":
285
+ return new Date(node.text.trim());
286
+ default:
287
+ throw new Error(`unsupported plist element ${node.tag}`);
288
+ }
289
+ };
290
+ return visit(root.children[0]);
291
+ }
39
292
  function parsePlistSource(source) {
40
- return import_plist.default.parse(source);
293
+ return parseXmlPlist(source);
294
+ }
295
+ function renderValue(value, indent) {
296
+ if (value === void 0 || value === null) return null;
297
+ if (typeof value === "string") {
298
+ return `${indent}<string>${escapeXmlText(value)}</string>`;
299
+ }
300
+ if (typeof value === "boolean") {
301
+ return `${indent}${value ? "<true/>" : "<false/>"}`;
302
+ }
303
+ if (typeof value === "number") {
304
+ if (Number.isInteger(value) && !Object.is(value, -0)) {
305
+ return `${indent}<integer>${value}</integer>`;
306
+ }
307
+ return `${indent}<real>${value}</real>`;
308
+ }
309
+ if (value instanceof Date) {
310
+ return `${indent}<date>${value.toISOString().replace(/\.\d{3}Z$/, "Z")}</date>`;
311
+ }
312
+ if (Buffer.isBuffer(value) || value instanceof Uint8Array) {
313
+ const encoded = Buffer.from(value).toString("base64");
314
+ return encoded ? `${indent}<data>${encoded}</data>` : `${indent}<data/>`;
315
+ }
316
+ if (Array.isArray(value)) {
317
+ const items = value.map((entry) => renderValue(entry, `${indent} `)).filter((entry) => entry !== null);
318
+ if (items.length === 0) return `${indent}<array/>`;
319
+ return `${indent}<array>
320
+ ${items.join("\n")}
321
+ ${indent}</array>`;
322
+ }
323
+ if (typeof value === "object") {
324
+ const lines = [];
325
+ for (const [key, entry] of Object.entries(value)) {
326
+ const rendered = renderValue(entry, `${indent} `);
327
+ if (rendered === null) continue;
328
+ lines.push(`${indent} <key>${escapeXmlText(key)}</key>`);
329
+ lines.push(rendered);
330
+ }
331
+ if (lines.length === 0) return `${indent}<dict/>`;
332
+ return `${indent}<dict>
333
+ ${lines.join("\n")}
334
+ ${indent}</dict>`;
335
+ }
336
+ throw new Error(`unsupported plist value type: ${typeof value}`);
337
+ }
338
+ function buildPlist(value) {
339
+ const body = renderValue(value, " ");
340
+ return [
341
+ '<?xml version="1.0" encoding="UTF-8"?>',
342
+ '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">',
343
+ '<plist version="1.0">',
344
+ ...body ? [body] : [],
345
+ "</plist>",
346
+ ""
347
+ ].join("\n");
41
348
  }
42
349
  // Annotate the CommonJS export names for ESM import in node:
43
350
  0 && (module.exports = {
44
- parsePlistSource
351
+ build,
352
+ buildPlist,
353
+ parse,
354
+ parsePlist,
355
+ parsePlistSource,
356
+ parseXmlPlist
45
357
  });
@@ -1,8 +1,16 @@
1
- /*! peach v0.1.2605 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2607 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
- parsePlistSource
4
- } from "./esm-chunks/chunk-OW4VRQKO.mjs";
5
- import "./esm-chunks/chunk-ZSHGFGW7.mjs";
3
+ buildPlist,
4
+ parsePlist,
5
+ parsePlistSource,
6
+ parseXmlPlist
7
+ } from "./esm-chunks/chunk-ARYRQJUB.mjs";
8
+ import "./esm-chunks/chunk-P5Q5QCTP.mjs";
6
9
  export {
7
- parsePlistSource
10
+ buildPlist as build,
11
+ buildPlist,
12
+ parsePlist as parse,
13
+ parsePlist,
14
+ parsePlistSource,
15
+ parseXmlPlist
8
16
  };
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2605 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2607 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2605 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2607 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;