stim 1.17.2 → 1.18.0

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 (150) hide show
  1. package/README.md +50 -1
  2. package/dist/{activity-IRvJY_ru.mjs → activity-BxnkDZDi.mjs} +4 -4
  3. package/dist/{agent-device-usage-output-BK41vnzN.mjs → agent-device-usage-output-CZ66YA4T.mjs} +8 -8
  4. package/dist/android-BKA16DTf.mjs +4 -0
  5. package/dist/{android-B9yaNKwa.mjs → android-BvwuMUJ9.mjs} +192 -98
  6. package/dist/{android-DE4v59Mb.mjs → android-CBwCNicO.mjs} +2 -2
  7. package/dist/{android-B_YNZy61.mjs → android-DC3ZLuw0.mjs} +9 -9
  8. package/dist/{android-cas-ZFpjJBL_.mjs → android-cas-BBFyr9CA.mjs} +5 -5
  9. package/dist/android-cas-compiler.mjs +2 -2
  10. package/dist/api-D0VtFhqk.mjs +152 -0
  11. package/dist/api-run.d.mts +1 -0
  12. package/dist/api-run.mjs +145 -0
  13. package/dist/api.d.mts +212 -0
  14. package/dist/api.mjs +2 -0
  15. package/dist/{app-install-VPkI5WEg.mjs → app-install-D-PUENug.mjs} +3 -3
  16. package/dist/{attempt-Bk2ouQVL.mjs → attempt-DW-mQqM7.mjs} +14 -4
  17. package/dist/{budget-DfcgFdQB.mjs → budget-DIhL2BKx.mjs} +1578 -58
  18. package/dist/build-facts-DcLv2HSd.d.mts +111 -0
  19. package/dist/{cache-manifest-DnUHBJaU.mjs → cache-manifest-BI7ozfmH.mjs} +3 -3
  20. package/dist/cache-manifest.mjs +1 -1
  21. package/dist/{chrome-BrcVWQyD.mjs → chrome-DJnmnS5q.mjs} +1 -1
  22. package/dist/cli-DNJMwADx.mjs +68 -0
  23. package/dist/cli.mjs +1 -1
  24. package/dist/{client-SvBdgObD.mjs → client-DzhapoMB.mjs} +139 -32
  25. package/dist/collector-run.mjs +9 -9
  26. package/dist/{command-output-CDAIFD-8.mjs → command-output-CBtzyIgF.mjs} +2 -2
  27. package/dist/{config-D0DbpZtM.mjs → config-CgYMahz7.mjs} +5 -5
  28. package/dist/{created-devices-CpvzBL25.mjs → created-devices-DKbeWsiK.mjs} +2 -2
  29. package/dist/{dependency-state-CLcBHH2M.mjs → dependency-state-xKoOypBm.mjs} +2 -2
  30. package/dist/{detached-entry-CiTEgMR1.mjs → detached-entry-BLfcgc4O.mjs} +1 -1
  31. package/dist/{dev-client-B-XC4uRH.mjs → dev-client-CLnIH02x.mjs} +2 -2
  32. package/dist/{device-C8IOoJPv.mjs → device-D7oCHGWi.mjs} +8 -8
  33. package/dist/{device-capacity-ZC4XSZ4R.mjs → device-capacity-EUOOYr8T.mjs} +13 -13
  34. package/dist/device-host-worker.mjs +19 -19
  35. package/dist/{device-ios-C2Um-XUR.mjs → device-ios-6MewKKnc.mjs} +13 -13
  36. package/dist/{device-lease-DpoS36_u.mjs → device-lease-Co-EwifR.mjs} +9 -9
  37. package/dist/{device-lease-run-B8YltIH_.mjs → device-lease-run-w1xhCqIW.mjs} +4 -4
  38. package/dist/{device-pool-3o7s5lo4.mjs → device-pool-F5WvRPtD.mjs} +3 -3
  39. package/dist/{device-remote-hFSkpfQu.mjs → device-remote-tHbd1fKy.mjs} +15 -15
  40. package/dist/{doctor-CFv1fCrF.mjs → doctor-B9ckYUoU.mjs} +33 -30
  41. package/dist/{error-diagnostics-C-NMnhrk.mjs → error-diagnostics-BRXOqDzG.mjs} +11 -11
  42. package/dist/{exec-CaErVv7t.mjs → exec-DWhCZDGm.mjs} +65 -2
  43. package/dist/{gc-DEmkg3Xh.mjs → gc-Dh6mXOKC.mjs} +23 -469
  44. package/dist/{gradle-dJpre3Yn.mjs → gradle-C6GKnunQ.mjs} +6 -6
  45. package/dist/{guide-status-Du-ZQ3FD.mjs → guide-status-Bhf9SJXc.mjs} +3 -3
  46. package/dist/{guide-CSmhMTf8.mjs → guide-tm6igAaa.mjs} +290 -53
  47. package/dist/{hosted-android-E1Heoqnv.mjs → hosted-android-Bv285t_t.mjs} +3 -3
  48. package/dist/{hosted-client-Bp4knSwu.mjs → hosted-client-C-rMtppF.mjs} +2 -2
  49. package/dist/{hosted-ios-BnbeYOUD.mjs → hosted-ios-D5mNmtj4.mjs} +1 -1
  50. package/dist/{hosted-logs-OcgIBvCT.mjs → hosted-logs-DN8Iz4mJ.mjs} +9 -9
  51. package/dist/{hosted-macos-DcxKjtfH.mjs → hosted-macos-B-wEjlwG.mjs} +5 -5
  52. package/dist/{hosted-native-1Ebbig4w.mjs → hosted-native-DeeOG8xZ.mjs} +6 -6
  53. package/dist/{idle-shutdown-IGyNV8Cr.mjs → idle-shutdown-jjtxAn5C.mjs} +7 -8
  54. package/dist/{ios-DSfnPfse.mjs → ios-B3SbOWdw.mjs} +19 -7
  55. package/dist/{ios-Cr1h5gnO.mjs → ios-Bvbf0SGY.mjs} +1 -1
  56. package/dist/{ios-BJ4XUSe1.mjs → ios-CPdkoKaa.mjs} +181 -95
  57. package/dist/ios-DNpdygiv.mjs +7 -0
  58. package/dist/{ios-device-Ee7sDXfp.mjs → ios-device-Bn7jWDB1.mjs} +1 -1
  59. package/dist/{ios-device-pAN4t54-.mjs → ios-device-vOaByMhw.mjs} +3 -3
  60. package/dist/{ios-state-8L3lgum6.mjs → ios-state-B2pES6Vs.mjs} +1 -1
  61. package/dist/{launch-verify-lTnWZikR.mjs → launch-verify-hskNcWkZ.mjs} +5 -5
  62. package/dist/{logs-BAaS7gS2.mjs → logs-1Ylc1Ri6.mjs} +13 -13
  63. package/dist/macos-Ck7OBMNY.mjs +2 -0
  64. package/dist/{macos-BIRQS90f.mjs → macos-DF6C7wUU.mjs} +118 -34
  65. package/dist/macos-run.mjs +1 -1
  66. package/dist/maintenance-run.mjs +349 -47
  67. package/dist/{metro-g8NqiJp-.mjs → metro-Dh8T4Ytd.mjs} +5 -5
  68. package/dist/{metro-gateway-C-ijGI2F.mjs → metro-gateway-CEUw9RMH.mjs} +4 -4
  69. package/dist/{metro-store-CDDZHtPl.mjs → metro-store-BAHFcJm6.mjs} +16 -2
  70. package/dist/{named-ports-C8m8EQs2.mjs → named-ports-BFIz1Shz.mjs} +61 -6
  71. package/dist/{native-run-D1Q56rAD.mjs → native-run-B06FkmZx.mjs} +4 -4
  72. package/dist/{native-runtime-BEK171xQ.mjs → native-runtime-D_603JiC.mjs} +6 -6
  73. package/dist/{ndjson-PclOIwVY.mjs → ndjson-LGZAMsqa.mjs} +8 -4
  74. package/dist/offload-worker.d.mts +3 -17
  75. package/dist/offload-worker.mjs +10 -11
  76. package/dist/{ownership-DyRQru0q.mjs → ownership-D6Se7gg_.mjs} +3 -3
  77. package/dist/{page-QF_Ke10s.mjs → page-Bv9s2KwY.mjs} +1 -1
  78. package/dist/placement-log-BcPhRwR4.mjs +84 -0
  79. package/dist/{build-plan-BDsSi09V.mjs → plan-placement-CtxkCO54.mjs} +122 -48
  80. package/dist/{ports-4nYqxPWC.mjs → ports-BLTtfBq-.mjs} +3 -3
  81. package/dist/{prebuild-D7RUMkwN.mjs → prebuild-juCyreaR.mjs} +5 -5
  82. package/dist/preview-D5V07Nrl.mjs +987 -0
  83. package/dist/{rolldown-runtime-BsOwBuO_.mjs → process-identity-Biv3arCO.mjs} +11 -1
  84. package/dist/{project-D47Rh0ly.mjs → project-C3ChRLZy.mjs} +4 -68
  85. package/dist/projects-DD7dBTCj.mjs +92 -0
  86. package/dist/{pull-request-pxnDCQzn.mjs → pull-request-u4vp7zmK.mjs} +1 -1
  87. package/dist/pull-requests.mjs +1 -1
  88. package/dist/{recordings-BNgsD1Tr.mjs → recordings-BAWltsVt.mjs} +1 -1
  89. package/dist/{reload-DcRxj3qG.mjs → reload-DvyWzVjJ.mjs} +15 -15
  90. package/dist/{remote-cache-Ci4DQYYj.mjs → remote-cache-BGg7aGIZ.mjs} +5 -5
  91. package/dist/{run-CkE9y0nc.mjs → run-vhtDgpHO.mjs} +5 -5
  92. package/dist/{server-bare-BkrSxSsZ.mjs → server-bare-B9E7S1aR.mjs} +4 -5
  93. package/dist/server-expo-Db9HBUoa.mjs +2 -0
  94. package/dist/{server-expo-CHTyXD0G.mjs → server-expo-DoBHhuzK.mjs} +5 -6
  95. package/dist/{settings-SR9OmW9h.mjs → settings-Byp2AQ_E.mjs} +6 -5
  96. package/dist/{settings-Cfd-0r2d.mjs → settings-CQyMElEP.mjs} +24 -763
  97. package/dist/{settings-BBpMcDbD.mjs → settings-Djl-mpjX.mjs} +1 -1
  98. package/dist/settings.schema.json +126 -3
  99. package/dist/{simslim-BWNrc3M3.mjs → simslim-EHBQ2R4G.mjs} +7 -7
  100. package/dist/{slot-launch-DmjBmpQV.mjs → slot-launch-C1nqh4mu.mjs} +6 -6
  101. package/dist/{spawn-claims-D0XfSe8u.mjs → spawn-claims-Kqiifsk2.mjs} +1 -1
  102. package/dist/{spawn-entry-jw19m8Nl.mjs → spawn-entry-Dcb7sDUz.mjs} +1 -0
  103. package/dist/{stage-CzaiwFsI.mjs → stage-g_WqWeaE.mjs} +14 -3
  104. package/dist/{start-DUz3mYdb.mjs → start-D-IeOyoK.mjs} +19 -19
  105. package/dist/{start-AlfCPRVU.mjs → start-NTc1Ifqs.mjs} +1 -1
  106. package/dist/{state-PeQiJuIu.mjs → state-BG-aAk4k.mjs} +4 -4
  107. package/dist/{state-B4PQFXMW.d.mts → state-lKh8shBp.d.mts} +2 -3
  108. package/dist/{state-DyaNTgfR.mjs → state-xnqpx3AD.mjs} +2 -2
  109. package/dist/{stats-Bq4fJOdB.mjs → stats-DY6ekz8F.mjs} +5 -5
  110. package/dist/{status-DlKvVJBE.mjs → status-BEeL6IKz.mjs} +6 -4
  111. package/dist/{status-BA2pehwf.mjs → status-DCjZeE-K.mjs} +33 -34
  112. package/dist/{status-CzS4bPO9.mjs → status-Dcr0Qexd.mjs} +5 -5
  113. package/dist/{stim-desktop-Cnz8CPnl.mjs → stim-desktop-Behws_fi.mjs} +1 -1
  114. package/dist/{stim-installations-QMEI32v1.mjs → stim-installations-aR_WsNOA.mjs} +1 -1
  115. package/dist/{stop-BIiM49EY.mjs → stop-BGhKMOuH.mjs} +5 -5
  116. package/dist/{stop-DQIasgKp.mjs → stop-BTjs3xbc.mjs} +17 -18
  117. package/dist/{stop-zF1y04f2.mjs → stop-DIJtD2GL.mjs} +2 -2
  118. package/dist/supervisor-run.d.mts +24 -22
  119. package/dist/supervisor-run.mjs +21 -22
  120. package/dist/{support-CsJNVfOc.mjs → support-BaayeYCf.mjs} +7 -7
  121. package/dist/{support-WvD__tSV.mjs → support-Bwvbrq5-.mjs} +5 -5
  122. package/dist/{toolchain-DNyR3NPq.mjs → toolchain-Bnyd_K3A.mjs} +471 -22
  123. package/dist/{trigger-Bemu8ytw.mjs → trigger-CJMhwXe8.mjs} +5 -5
  124. package/dist/trigger-DWAq9hkw.mjs +2 -0
  125. package/dist/{warm-progress-DF4JRvYI.mjs → warm-progress-CjB-MP6H.mjs} +7 -7
  126. package/dist/web-B6_bFDn7.mjs +2 -0
  127. package/dist/{web-Dl0KSRHf.mjs → web-DTU0uiWj.mjs} +22 -22
  128. package/dist/web-run.mjs +10 -10
  129. package/dist/{workspace-state-DqcCbpE7.mjs → workspace-state-C59dqG-Z.mjs} +3 -3
  130. package/dist/{ownership-BMLqyBgJ.mjs → workspaces-xXItD8Dj.mjs} +577 -23
  131. package/dist/{worktree-j3IcFAI5.mjs → worktree-BJfnU6r5.mjs} +1 -1
  132. package/dist/{worktree-Be_7NLKy.mjs → worktree-BSYlofkq.mjs} +234 -35
  133. package/dist/worktree-CsKYexJM.mjs +753 -0
  134. package/package.json +10 -5
  135. package/dist/build-progress-D0WkjCPd.mjs +0 -1036
  136. package/dist/build-slots-41v_d2x9.mjs +0 -142
  137. package/dist/cli-CYXb29oE.mjs +0 -51
  138. package/dist/deps-iKw0eD4P.mjs +0 -438
  139. package/dist/errors-B6W7FkxQ.mjs +0 -15
  140. package/dist/idle-BXG__1BA.mjs +0 -176
  141. package/dist/in-use-CvGOUn-x.mjs +0 -130
  142. package/dist/preview-B-g9d7kV.mjs +0 -318
  143. package/dist/process-identity-BmRm1qV0.mjs +0 -12
  144. package/dist/server-expo-CeakhI8P.mjs +0 -2
  145. package/dist/state-BKa8wNN5.mjs +0 -148
  146. package/dist/stop-cause-rhmGfwvt.mjs +0 -97
  147. package/dist/trigger-CXts6qt1.mjs +0 -2
  148. package/dist/watchman-APYjXSQa.mjs +0 -48
  149. package/dist/workspace-process-lock-2mNzOlaB.mjs +0 -58
  150. package/dist/workspaces-Bcib97-6.mjs +0 -306
@@ -0,0 +1,753 @@
1
+ import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
2
+ import { _ as loadConfig, d as getConfigDir } from "./config-CgYMahz7.mjs";
3
+ import { accessSync, chmodSync, constants, lstatSync, mkdirSync, mkdtempSync, readdirSync, realpathSync, rmSync, statSync } from "node:fs";
4
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
5
+ import { dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, relative as relative$1, resolve as resolve$1, sep as sep$1 } from "path";
6
+ import { tmpdir } from "node:os";
7
+ import { chmodSync as chmodSync$1, existsSync as existsSync$1, lstatSync as lstatSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, statSync as statSync$1, utimesSync as utimesSync$1 } from "fs";
8
+ import { buildCacheRoot } from "@stim-cli/core";
9
+ //#region src/temporary.ts
10
+ function existingPath(path) {
11
+ const missing = [];
12
+ let current = resolve(path);
13
+ while (!lstatSync(current, { throwIfNoEntry: false })) {
14
+ missing.unshift(basename(current));
15
+ current = dirname(current);
16
+ }
17
+ const existing = realpathSync(current);
18
+ return {
19
+ existing,
20
+ resolved: join(existing, ...missing)
21
+ };
22
+ }
23
+ function filesystemDevice(path) {
24
+ return statSync(existingPath(path).existing).dev;
25
+ }
26
+ function outsideWorkingTree(path) {
27
+ let current = path;
28
+ while (true) {
29
+ if (lstatSync(join(current, ".git"), { throwIfNoEntry: false })) return false;
30
+ const parent = dirname(current);
31
+ if (parent === current) return true;
32
+ current = parent;
33
+ }
34
+ }
35
+ function inside(parent, path) {
36
+ const rel = relative(parent, path);
37
+ return rel === "" || rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
38
+ }
39
+ function temporaryRoot(near) {
40
+ const reference = existingPath(near);
41
+ const insideReference = (path) => inside(reference.resolved, path);
42
+ const override = process.env.STIM_TMPDIR ?? loadConfig()?.tempDir;
43
+ if (override !== void 0) {
44
+ if (typeof override !== "string" || !isAbsolute(override)) throw new Error("STIM_TMPDIR / tempDir must be an absolute directory path.");
45
+ const { existing, resolved } = existingPath(override);
46
+ if (!statSync(existing).isDirectory() || !outsideWorkingTree(existing)) throw new Error(`Temporary directory ${override} must be outside Git working trees.`);
47
+ if (insideReference(resolved)) throw new Error(`Temporary directory ${override} must not be inside ${near}.`);
48
+ accessSync(existing, constants.W_OK);
49
+ return resolved;
50
+ }
51
+ const { existing } = reference;
52
+ const cache = existingPath(buildCacheRoot()).resolved;
53
+ const device = statSync(existing).dev;
54
+ const candidates = [tmpdir()];
55
+ let current = existing === reference.resolved || !statSync(existing).isDirectory() ? dirname(existing) : existing;
56
+ while (statSync(current).dev === device) {
57
+ candidates.push(current);
58
+ const parent = dirname(current);
59
+ if (parent === current) break;
60
+ current = parent;
61
+ }
62
+ for (const candidate of candidates) try {
63
+ const path = realpathSync(candidate);
64
+ if (statSync(path).dev !== device || insideReference(path) || inside(cache, path) || !outsideWorkingTree(path)) continue;
65
+ accessSync(path, constants.W_OK);
66
+ return path;
67
+ } catch {}
68
+ throw new Error(`No writable temporary directory on the filesystem containing ${near}. Set STIM_TMPDIR or tempDir in ${join(getConfigDir(), "config.json")} to a directory outside Git working trees.`);
69
+ }
70
+ function makeTemporaryDirectory(near, prefix) {
71
+ const root = temporaryRoot(near);
72
+ mkdirSync(root, {
73
+ recursive: true,
74
+ mode: 448
75
+ });
76
+ return mkdtempSync(join(root, prefix));
77
+ }
78
+ function removeTemporaryEntry(path) {
79
+ const stat = lstatSync(path, { throwIfNoEntry: false });
80
+ if (stat?.isDirectory()) {
81
+ chmodSync(path, stat.mode | 448);
82
+ for (const entry of readdirSync(path, { withFileTypes: true })) if (entry.isDirectory()) removeTemporaryEntry(join(path, entry.name));
83
+ }
84
+ rmSync(path, {
85
+ recursive: true,
86
+ force: true
87
+ });
88
+ }
89
+ //#endregion
90
+ //#region src/workspace/worktree.ts
91
+ const CARRY_SKIP_BASENAMES = /* @__PURE__ */ new Set([
92
+ ".DerivedData",
93
+ ".DS_Store",
94
+ ".idea",
95
+ ".jj"
96
+ ]);
97
+ function isCarrySkipped(rel) {
98
+ return /(^|\/)android\/build\/generated\/autolinking(\/|$)/.test(rel) || String(rel).split("/").some((seg) => CARRY_SKIP_BASENAMES.has(seg));
99
+ }
100
+ function nativePath(path) {
101
+ return sep$1 === "/" ? path : path.replaceAll("/", sep$1);
102
+ }
103
+ function gitCommonDir(cwd) {
104
+ const out = getExecutor().runFileQuiet("git", [
105
+ "-C",
106
+ cwd,
107
+ "rev-parse",
108
+ "--path-format=absolute",
109
+ "--git-common-dir"
110
+ ]);
111
+ return out ? nativePath(out.trim()) : null;
112
+ }
113
+ function repoRoot(cwd) {
114
+ const out = getExecutor().runFileQuiet("git", [
115
+ "-C",
116
+ cwd,
117
+ "rev-parse",
118
+ "--show-toplevel"
119
+ ]);
120
+ return out ? nativePath(out.trim()) : null;
121
+ }
122
+ function locallyKnownUpstream(projectRoot) {
123
+ try {
124
+ const name = getExecutor().runFile("git", [
125
+ "-C",
126
+ projectRoot,
127
+ "rev-parse",
128
+ "--abbrev-ref",
129
+ "--symbolic-full-name",
130
+ "@{upstream}"
131
+ ], { timeoutMs: 5e3 });
132
+ const counts = getExecutor().runFile("git", [
133
+ "-C",
134
+ projectRoot,
135
+ "rev-list",
136
+ "--left-right",
137
+ "--count",
138
+ "HEAD...@{upstream}"
139
+ ], { timeoutMs: 5e3 }).trim().split(/\s+/).map(Number);
140
+ const ahead = counts[0] ?? NaN;
141
+ const behind = counts[1] ?? NaN;
142
+ if (!name || !Number.isInteger(ahead) || !Number.isInteger(behind)) return null;
143
+ return {
144
+ name,
145
+ ahead,
146
+ behind
147
+ };
148
+ } catch {
149
+ return null;
150
+ }
151
+ }
152
+ function warmWorktreePaths(cwd) {
153
+ const currentRoot = repoRoot(cwd);
154
+ if (!currentRoot) throw new Error("Not a git repository.");
155
+ const target = realpathSync$1(currentRoot);
156
+ const source = resolveSourceCheckout(target);
157
+ if ("refusal" in source) throw new Error(source.refusal);
158
+ if (!source.entries.find((entry) => canonicalPath(entry.path) === target)) throw new Error("Could not identify the linked worktree and its source checkout.");
159
+ const root = realpathSync$1(source.path);
160
+ if (root === target) throw new Error("Run stim worktree warm from a linked worktree, not the source checkout.");
161
+ const sourceRoot = repoRoot(root);
162
+ const sourceCommon = gitCommonDir(root);
163
+ const targetCommon = gitCommonDir(target);
164
+ if (!sourceRoot || realpathSync$1(sourceRoot) !== root || !sourceCommon || !targetCommon || realpathSync$1(sourceCommon) !== realpathSync$1(targetCommon)) throw new Error("Could not verify that the source checkout belongs to this linked worktree.");
165
+ return {
166
+ root,
167
+ target,
168
+ common: realpathSync$1(targetCommon)
169
+ };
170
+ }
171
+ function matchesInclude(path, patterns) {
172
+ for (const pattern of patterns || []) {
173
+ const rooted = pattern.startsWith("/");
174
+ const escaped = (rooted ? pattern.slice(1) : pattern).replace(/[.+^${}()|[\]\\?]/g, "\\$&").replace(/\*\*\//g, "::GLOBSTAR::").replace(/\*/g, "[^/]+").replace(/::GLOBSTAR::/g, "(?:.*/)?").replace(/\\\?/g, "[^/]");
175
+ if (new RegExp(`${rooted ? "^" : "(^|/)"}${escaped}$`).test(path)) return true;
176
+ }
177
+ return false;
178
+ }
179
+ function readWorktreeExclude(root) {
180
+ return readPatternFile(join$1(root, ".worktreeexclude"));
181
+ }
182
+ function readPatternFile(p) {
183
+ if (!existsSync$1(p)) return null;
184
+ return readFileSync$1(p, "utf-8").split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("#"));
185
+ }
186
+ function canonicalPath(path) {
187
+ try {
188
+ return realpathSync$1(path);
189
+ } catch {
190
+ return resolve$1(path);
191
+ }
192
+ }
193
+ function nestedWorktreePaths(root) {
194
+ const source = canonicalPath(root);
195
+ const paths = /* @__PURE__ */ new Set();
196
+ const out = getExecutor().runFileQuiet("git", [
197
+ "-C",
198
+ root,
199
+ "worktree",
200
+ "list",
201
+ "--porcelain"
202
+ ]);
203
+ if (out === null) throw new Error("Could not list Git worktrees. Refusing to carry ignored files.");
204
+ for (const entry of parseWorktrees(out)) {
205
+ const rel = relative$1(source, canonicalPath(entry.path));
206
+ if (!rel || rel === ".." || rel.startsWith(`..${sep$1}`) || isAbsolute$1(rel)) continue;
207
+ paths.add(rel.split(sep$1).join("/"));
208
+ }
209
+ return [...paths];
210
+ }
211
+ function overlapsNestedWorktree(rel, nestedPaths) {
212
+ const path = String(rel).replaceAll("\\", "/").replace(/^\.\//, "").replace(/\/$/, "");
213
+ return nestedPaths.some((nested) => path === nested || path.startsWith(`${nested}/`) || nested.startsWith(`${path}/`));
214
+ }
215
+ function listTrackedPaths(dir) {
216
+ const out = getExecutor().runFileQuiet("git", [
217
+ "-C",
218
+ dir,
219
+ "ls-files",
220
+ "-z"
221
+ ]);
222
+ if (out === null) return null;
223
+ return out.split("\0").filter(Boolean);
224
+ }
225
+ function trackedGuard(dir) {
226
+ const paths = listTrackedPaths(dir);
227
+ if (paths === null) return {
228
+ known: false,
229
+ covers: () => false
230
+ };
231
+ const entries = new Set(paths);
232
+ const covered = new Set(paths);
233
+ for (const p of paths) for (let i = p.indexOf("/"); i !== -1; i = p.indexOf("/", i + 1)) covered.add(p.slice(0, i));
234
+ return {
235
+ known: true,
236
+ covers: (rel) => {
237
+ if (covered.has(rel)) return true;
238
+ for (let i = rel.indexOf("/"); i !== -1; i = rel.indexOf("/", i + 1)) if (entries.has(rel.slice(0, i))) return true;
239
+ return false;
240
+ }
241
+ };
242
+ }
243
+ function listGitignoredEntries(root) {
244
+ const args = [
245
+ "-C",
246
+ root,
247
+ "ls-files",
248
+ "--others",
249
+ "--ignored",
250
+ "--exclude-standard",
251
+ "--directory",
252
+ "--no-empty-directory",
253
+ "-z"
254
+ ];
255
+ const out = getExecutor().runFile("git", args);
256
+ if (!out) return [];
257
+ return out.split("\0").filter(Boolean).map((e) => e.endsWith("/") ? e.slice(0, -1) : e);
258
+ }
259
+ function listCarryableIgnoredEntries(root, patterns) {
260
+ const nested = nestedWorktreePaths(root);
261
+ return listGitignoredEntries(root).filter((rel) => !isCarrySkipped(rel) && !overlapsNestedWorktree(rel, nested) && !matchesInclude(rel, patterns));
262
+ }
263
+ function missingDestinationReason(target, rel) {
264
+ const parts = rel.split("/");
265
+ for (let i = 1; i < parts.length; i++) {
266
+ const parent = parts.slice(0, i).join("/");
267
+ const stat = lstatSync$1(join$1(target, parent), { throwIfNoEntry: false });
268
+ if (stat?.isSymbolicLink()) return `symlink ancestor: ${parent}`;
269
+ if (stat && !stat.isDirectory()) return `non-directory ancestor: ${parent}`;
270
+ }
271
+ return lstatSync$1(join$1(target, rel), { throwIfNoEntry: false }) ? "exists" : null;
272
+ }
273
+ function removeCopiedExclusions(path, rel) {
274
+ const entries = readdirSync$1(path, { withFileTypes: true });
275
+ const excluded = entries.filter((entry) => isCarrySkipped(`${rel}/${entry.name}`));
276
+ if (excluded.length > 0) {
277
+ const stat = lstatSync$1(path);
278
+ chmodSync$1(path, stat.mode | 448);
279
+ try {
280
+ for (const entry of excluded) removeTemporaryEntry(join$1(path, entry.name));
281
+ } finally {
282
+ utimesSync$1(path, stat.atime, stat.mtime);
283
+ chmodSync$1(path, stat.mode);
284
+ }
285
+ }
286
+ for (const entry of entries) {
287
+ const child = `${rel}/${entry.name}`;
288
+ if (entry.isDirectory() && !isCarrySkipped(child)) removeCopiedExclusions(join$1(path, entry.name), child);
289
+ }
290
+ }
291
+ function cloneIgnoredEntries({ root, target, patterns }) {
292
+ const copied = [];
293
+ const skipped = [];
294
+ const failed = [];
295
+ let cloned = true;
296
+ const guard = trackedGuard(target);
297
+ if (!guard.known) throw new Error("Could not list the destination's tracked files.");
298
+ const nested = nestedWorktreePaths(target);
299
+ for (const rel of listCarryableIgnoredEntries(root, patterns)) {
300
+ const from = join$1(root, rel);
301
+ const to = join$1(target, rel);
302
+ try {
303
+ const reason = guard.covers(rel) ? "tracked" : overlapsNestedWorktree(rel, nested) ? "nested worktree" : missingDestinationReason(target, rel);
304
+ if (reason) {
305
+ skipped.push({
306
+ file: rel,
307
+ reason
308
+ });
309
+ continue;
310
+ }
311
+ mkdirSync$1(dirname$1(to), { recursive: true });
312
+ try {
313
+ getExecutor().runFile("cp", [
314
+ "-Rc",
315
+ from,
316
+ to
317
+ ]);
318
+ } catch {
319
+ removeTemporaryEntry(to);
320
+ getExecutor().runFile("cp", [
321
+ "-R",
322
+ from,
323
+ to
324
+ ]);
325
+ cloned = false;
326
+ }
327
+ if (lstatSync$1(to).isDirectory()) removeCopiedExclusions(to, rel);
328
+ copied.push(rel);
329
+ } catch (e) {
330
+ failed.push({
331
+ file: rel,
332
+ error: String(e?.message || e)
333
+ });
334
+ }
335
+ }
336
+ return {
337
+ copied,
338
+ skipped,
339
+ failed,
340
+ cloned
341
+ };
342
+ }
343
+ function podsOutOfSync(target, copiedEntries, { read = readFileSync$1 } = {}) {
344
+ const problems = [];
345
+ for (const rel of copiedEntries || []) {
346
+ if (rel !== "Pods" && !rel.endsWith("/Pods")) continue;
347
+ const iosDir = rel === "Pods" ? "" : rel.slice(0, -5);
348
+ const manifest = join$1(target, rel, "Manifest.lock");
349
+ const podfileLock = join$1(target, iosDir, "Podfile.lock");
350
+ if (!existsSync$1(manifest)) continue;
351
+ if (!existsSync$1(podfileLock)) {
352
+ problems.push({
353
+ dir: iosDir || ".",
354
+ reason: "missing"
355
+ });
356
+ continue;
357
+ }
358
+ try {
359
+ if (read(manifest, "utf-8") !== read(podfileLock, "utf-8")) problems.push({
360
+ dir: iosDir || ".",
361
+ reason: "mismatch"
362
+ });
363
+ } catch {}
364
+ }
365
+ return problems;
366
+ }
367
+ const LOCKFILE_NAMES = [
368
+ "pnpm-lock.yaml",
369
+ "yarn.lock",
370
+ "bun.lock",
371
+ "bun.lockb",
372
+ "package-lock.json"
373
+ ];
374
+ function npmInstallMatches(wanted, installed) {
375
+ if (!wanted.packages || !installed.packages) return null;
376
+ for (const [key, entry] of Object.entries(wanted.packages)) {
377
+ if (!key.includes("node_modules/") || entry.link) continue;
378
+ const present = installed.packages[key];
379
+ if (!present && (entry.optional || entry.devOptional)) continue;
380
+ if (present?.version !== entry.version) return false;
381
+ }
382
+ return true;
383
+ }
384
+ function lastYamlDocument(text) {
385
+ return (text.split(/^---$/m).at(-1) ?? "").trim();
386
+ }
387
+ function yarnClassicInstallMatches(lockfile, integrity) {
388
+ if (!integrity.lockfileEntries) return null;
389
+ const wanted = [...lockfile.matchAll(/^ {2}resolved "([^"]+)"$/gm)].flatMap((m) => m[1] ?? []);
390
+ if (wanted.length === 0) return null;
391
+ const installed = new Set(Object.values(integrity.lockfileEntries));
392
+ return wanted.every((url) => installed.has(url));
393
+ }
394
+ function yarnBerryInstallMatches(lockfile, state) {
395
+ const installed = new Set([...state.matchAll(/^"?([^\s"#][^"]*?)"?:$/gm)].flatMap((m) => m[1]?.replace(/@virtual:[^#]+#/, "@") ?? []));
396
+ let entries = 0;
397
+ for (const entry of lockfile.split(/\n(?=\S)/)) {
398
+ const resolution = /^ {2}resolution: "([^"]+)"$/m.exec(entry)?.[1];
399
+ if (!resolution) continue;
400
+ entries += 1;
401
+ if (installed.has(resolution) || /^ {2}conditions: /m.test(entry)) continue;
402
+ return false;
403
+ }
404
+ return entries === 0 ? null : true;
405
+ }
406
+ function installedMatchesLockfile(dir, lockfile, { read = readFileSync$1 } = {}) {
407
+ const text = (rel) => {
408
+ try {
409
+ return read(join$1(dir, rel), "utf-8").replaceAll("\r\n", "\n");
410
+ } catch {
411
+ return null;
412
+ }
413
+ };
414
+ const wanted = text(lockfile);
415
+ if (wanted === null) return null;
416
+ try {
417
+ if (lockfile === "package-lock.json") {
418
+ const installed = text("node_modules/.package-lock.json");
419
+ return installed === null ? null : npmInstallMatches(JSON.parse(wanted), JSON.parse(installed));
420
+ }
421
+ if (lockfile === "pnpm-lock.yaml") {
422
+ const installed = text("node_modules/.pnpm/lock.yaml");
423
+ return installed === null ? null : lastYamlDocument(wanted) === lastYamlDocument(installed);
424
+ }
425
+ if (lockfile === "yarn.lock") {
426
+ if (/^__metadata:$/m.test(wanted)) {
427
+ const berry = text("node_modules/.yarn-state.yml");
428
+ return berry === null ? null : yarnBerryInstallMatches(wanted, berry);
429
+ }
430
+ const classic = text("node_modules/.yarn-integrity");
431
+ return classic === null ? null : yarnClassicInstallMatches(wanted, JSON.parse(classic));
432
+ }
433
+ } catch {}
434
+ return null;
435
+ }
436
+ function depsOutOfSync(root, target, copiedEntries, { read = readFileSync$1 } = {}) {
437
+ const problems = [];
438
+ for (const rel of copiedEntries || []) {
439
+ if (rel !== "node_modules" && !rel.endsWith("/node_modules")) continue;
440
+ const dir = rel === "node_modules" ? "" : rel.slice(0, -13);
441
+ const name = LOCKFILE_NAMES.find((candidate) => existsSync$1(join$1(target, dir, candidate)));
442
+ if (!name) continue;
443
+ const installed = installedMatchesLockfile(join$1(target, dir), name, { read });
444
+ if (installed === false) {
445
+ problems.push({
446
+ dir: dir || ".",
447
+ lockfile: name,
448
+ reason: "installed"
449
+ });
450
+ continue;
451
+ }
452
+ const source = join$1(root, dir, name);
453
+ if (installed === true || !existsSync$1(source)) continue;
454
+ try {
455
+ if (read(source, "utf-8") !== read(join$1(target, dir, name), "utf-8")) problems.push({
456
+ dir: dir || ".",
457
+ lockfile: name,
458
+ reason: "lockfile"
459
+ });
460
+ } catch {}
461
+ }
462
+ return problems;
463
+ }
464
+ const FINGERPRINT_INPUT_FILES = [
465
+ "app.json",
466
+ "app.config.ts",
467
+ "app.config.js",
468
+ "app.config.mjs",
469
+ "package.json"
470
+ ];
471
+ function dirtyFingerprintFiles(root) {
472
+ const out = getExecutor().runFileQuiet("git", [
473
+ "-C",
474
+ root,
475
+ "status",
476
+ "--porcelain",
477
+ "--",
478
+ ...FINGERPRINT_INPUT_FILES
479
+ ]);
480
+ if (out === null || out.trim() === "") return [];
481
+ return out.split("\n").map((line) => normalizePorcelainLine(line.trimEnd())).filter((line) => line !== "").map((line) => line.slice(3).trim()).filter((path) => path !== "");
482
+ }
483
+ function hasUncommittedWork(dir) {
484
+ const out = getExecutor().runFileQuiet("git", [
485
+ "--no-optional-locks",
486
+ "-C",
487
+ dir,
488
+ "status",
489
+ "--porcelain"
490
+ ]);
491
+ if (out === null) return null;
492
+ return out.trim().length > 0;
493
+ }
494
+ function dirtyPaths(dir, { limit = 10 } = {}) {
495
+ const out = getExecutor().runFileQuiet("git", [
496
+ "--no-optional-locks",
497
+ "-C",
498
+ dir,
499
+ "status",
500
+ "--porcelain"
501
+ ]);
502
+ if (out === null) return [];
503
+ return out.split("\n").map((l) => normalizePorcelainLine(l.trimEnd())).filter(Boolean).slice(0, limit);
504
+ }
505
+ function normalizePorcelainLine(line) {
506
+ if (line === "" || line[2] === " ") return line;
507
+ return ` ${line}`;
508
+ }
509
+ function restoreFile(dir, file) {
510
+ return getExecutor().runFileQuiet("git", [
511
+ "-C",
512
+ dir,
513
+ "checkout",
514
+ "--",
515
+ file
516
+ ]) !== null;
517
+ }
518
+ function isPodInstallChurn(paths) {
519
+ if (!paths || paths.length === 0) return false;
520
+ return paths.every((line) => /(?:^|\/)(?:Podfile\.lock|project\.pbxproj)$/.test(line.slice(3).trim()));
521
+ }
522
+ const SAFE_BRANCH_NAME = /^[A-Za-z0-9@._/-]+$/;
523
+ function unpushedCommits(dir) {
524
+ const exec = getExecutor();
525
+ const branch = exec.runFileQuiet("git", [
526
+ "-C",
527
+ dir,
528
+ "symbolic-ref",
529
+ "--quiet",
530
+ "--short",
531
+ "HEAD"
532
+ ]);
533
+ const own = branch === null ? "" : branch.trim();
534
+ const protection = own && SAFE_BRANCH_NAME.test(own) ? [
535
+ "--remotes",
536
+ `--exclude=${own}`,
537
+ "--branches"
538
+ ] : ["--remotes"];
539
+ if (!own && exec.runFileQuiet("git", [
540
+ "-C",
541
+ dir,
542
+ "rev-parse",
543
+ "--abbrev-ref",
544
+ "HEAD"
545
+ ]) === "HEAD") protection.push("--branches");
546
+ const out = exec.runFileQuiet("git", [
547
+ "-C",
548
+ dir,
549
+ "log",
550
+ "--oneline",
551
+ "HEAD",
552
+ "--not",
553
+ ...protection
554
+ ]);
555
+ if (out === null) return null;
556
+ return out.split("\n").map((l) => l.trim()).filter(Boolean);
557
+ }
558
+ function hasRemote(dir) {
559
+ const out = getExecutor().runFileQuiet("git", [
560
+ "-C",
561
+ dir,
562
+ "remote"
563
+ ]);
564
+ return Boolean(out && out.trim().length > 0);
565
+ }
566
+ function branchExists(cwd, branch) {
567
+ const out = getExecutor().runFileQuiet("git", [
568
+ "-C",
569
+ cwd,
570
+ "rev-parse",
571
+ "--verify",
572
+ "--quiet",
573
+ `refs/heads/${branch}`
574
+ ]);
575
+ return Boolean(out);
576
+ }
577
+ function resolveFullRef(cwd, ref) {
578
+ try {
579
+ const out = getExecutor().runFile("git", [
580
+ "-C",
581
+ cwd,
582
+ "rev-parse",
583
+ "--verify",
584
+ "--quiet",
585
+ "--end-of-options",
586
+ `${ref}^{commit}`
587
+ ]);
588
+ return out && out.trim() ? out.trim() : null;
589
+ } catch {
590
+ return null;
591
+ }
592
+ }
593
+ function removeWorktree(path, { from, force = false, platform = process.platform }) {
594
+ const args = [
595
+ ...platform === "win32" ? ["-c", "core.longpaths=true"] : [],
596
+ "-C",
597
+ from,
598
+ "worktree",
599
+ "remove",
600
+ ...force ? ["--force"] : [],
601
+ "--",
602
+ path
603
+ ];
604
+ getExecutor().runFile("git", args);
605
+ }
606
+ function deleteBranch(cwd, branch, expectedSha) {
607
+ if (!SAFE_BRANCH_NAME.test(branch) || branch.startsWith("-")) throw new Error(`Refusing branch ${JSON.stringify(branch)}: it is not a safe local branch name.`);
608
+ getExecutor().runFile("git", [
609
+ "-C",
610
+ cwd,
611
+ "update-ref",
612
+ "-d",
613
+ `refs/heads/${branch}`,
614
+ expectedSha
615
+ ]);
616
+ }
617
+ function parseWorktrees(out) {
618
+ const entries = [];
619
+ let current = {};
620
+ for (const line of out.split("\n")) if (line.startsWith("worktree ")) {
621
+ if (current.path) entries.push(current);
622
+ current = { path: nativePath(line.slice(9)) };
623
+ } else if (line.startsWith("branch ")) current.branch = line.slice(7).replace("refs/heads/", "");
624
+ else if (line === "prunable" || line.startsWith("prunable ")) current.prunable = true;
625
+ else if (line === "locked" || line.startsWith("locked ")) current.locked = true;
626
+ else if (line === "bare") current.bare = true;
627
+ if (current.path) entries.push(current);
628
+ return entries;
629
+ }
630
+ function hasPopulatedSubmodules(worktree) {
631
+ const modules = getExecutor().runFileQuiet("git", [
632
+ "-C",
633
+ worktree,
634
+ "rev-parse",
635
+ "--git-path",
636
+ "modules"
637
+ ]);
638
+ if (modules && existsSync$1(resolve$1(worktree, nativePath(modules)))) return true;
639
+ return (getExecutor().runFileQuiet("git", [
640
+ "-C",
641
+ worktree,
642
+ "ls-files",
643
+ "--stage",
644
+ "-z"
645
+ ]) ?? "").split("\0").some((line) => line.startsWith("160000 ") && existsSync$1(join$1(worktree, line.slice(line.indexOf(" ") + 1), ".git")));
646
+ }
647
+ function listWorktrees(cwd) {
648
+ const out = getExecutor().runFileQuiet("git", [
649
+ "-C",
650
+ cwd,
651
+ "worktree",
652
+ "list",
653
+ "--porcelain"
654
+ ]);
655
+ return out ? parseWorktrees(out) : [];
656
+ }
657
+ function branchOf(head) {
658
+ return head.startsWith("ref: refs/heads/") ? head.slice(16) : void 0;
659
+ }
660
+ /**
661
+ * The linked worktrees recorded under a git common dir, read from `worktrees/<id>/gitdir` and `HEAD` without running
662
+ * git or touching the worktree directories, sorted by path. The worktree with the branch the common dir's own `HEAD`
663
+ * names (the main checkout's branch, or a bare repository's source checkout) is left out.
664
+ */
665
+ function linkedWorktreesOnDisk(commonDir) {
666
+ const admin = join$1(commonDir, "worktrees");
667
+ let ids;
668
+ let sourceBranch;
669
+ try {
670
+ ids = readdirSync$1(admin);
671
+ sourceBranch = branchOf(readFileSync$1(join$1(commonDir, "HEAD"), "utf-8").trim());
672
+ } catch {
673
+ return [];
674
+ }
675
+ return ids.flatMap((id) => {
676
+ try {
677
+ const gitdir = readFileSync$1(join$1(admin, id, "gitdir"), "utf-8").trim();
678
+ const branch = branchOf(readFileSync$1(join$1(admin, id, "HEAD"), "utf-8").trim());
679
+ if (branch && branch === sourceBranch) return [];
680
+ const path = dirname$1(resolve$1(admin, id, nativePath(gitdir)));
681
+ return [branch ? {
682
+ path,
683
+ branch
684
+ } : { path }];
685
+ } catch {
686
+ return [];
687
+ }
688
+ }).toSorted((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
689
+ }
690
+ /**
691
+ * The git common dir of the repository containing `start`, read from `.git` and `commondir` files without running
692
+ * git. Returns null when `start` is missing, unreadable, or not inside a repository.
693
+ */
694
+ function gitCommonDirOnDisk(start) {
695
+ try {
696
+ for (let dir = realpathSync$1.native(start);; dir = dirname$1(dir)) {
697
+ const dotGit = join$1(dir, ".git");
698
+ if (existsSync$1(dotGit)) {
699
+ if (statSync$1(dotGit).isDirectory()) return realpathSync$1.native(dotGit);
700
+ const gitdir = /^gitdir: (.+)$/m.exec(readFileSync$1(dotGit, "utf-8"))?.[1]?.trim();
701
+ if (!gitdir) return null;
702
+ const linked = resolve$1(dir, gitdir);
703
+ const commondir = join$1(linked, "commondir");
704
+ return realpathSync$1.native(existsSync$1(commondir) ? resolve$1(linked, readFileSync$1(commondir, "utf-8").trim()) : linked);
705
+ }
706
+ if (dirname$1(dir) === dir) return null;
707
+ }
708
+ } catch {
709
+ return null;
710
+ }
711
+ }
712
+ function selectSourceCheckout(entries, bareHead) {
713
+ const first = entries[0];
714
+ if (!first) return { refusal: "Git lists no worktrees for this repository." };
715
+ if (!first.bare) return { path: first.path };
716
+ const bare = first.path;
717
+ const checkouts = entries.filter((entry) => !entry.bare && !entry.prunable);
718
+ const listed = checkouts.map((entry) => `${entry.branch ?? "detached"} (${entry.path})`).join(", ") || "none";
719
+ const pointHead = ` git -C ${bare} symbolic-ref HEAD refs/heads/<branch>`;
720
+ if (!bareHead) return { refusal: `The bare repository at ${bare} has a detached HEAD, so Stim cannot tell which worktree is the source checkout. Point HEAD at the source branch, then retry:\n${pointHead}\nChecked-out branches: ${listed}` };
721
+ const matches = checkouts.filter((entry) => entry.branch === bareHead);
722
+ const [only] = matches;
723
+ if (only && matches.length === 1) return { path: only.path };
724
+ if (!only) {
725
+ const stale = entries.find((entry) => entry.prunable && entry.branch === bareHead);
726
+ const beside = checkouts[0] ? dirname$1(checkouts[0].path) : bare;
727
+ return { refusal: `The bare repository at ${bare} points HEAD at ${bareHead}, but no worktree has ${bareHead} checked out, so Stim has no source checkout to copy from. ${stale ? `Its worktree at ${stale.path} is missing. Recreate it, then retry:\n git -C ${bare} worktree prune\n git -C ${bare} worktree add ${stale.path} ${bareHead}\n` : `Create one, then retry:\n git -C ${bare} worktree add ${join$1(beside, bareHead)} ${bareHead}\n`}Or point HEAD at a branch that is checked out (${listed}):\n${pointHead}` };
728
+ }
729
+ return { refusal: `The bare repository at ${bare} points HEAD at ${bareHead}, which is checked out in more than one worktree: ${matches.map((entry) => entry.path).join(", ")}. Remove the extra worktrees, or point HEAD at a branch checked out once, then retry:\n${pointHead}` };
730
+ }
731
+ function bareHeadBranch(bare) {
732
+ const out = getExecutor().runFileQuiet("git", [
733
+ "-C",
734
+ bare,
735
+ "symbolic-ref",
736
+ "--quiet",
737
+ "HEAD"
738
+ ])?.trim();
739
+ return out?.startsWith("refs/heads/") ? out.slice(11) : null;
740
+ }
741
+ function sourceCheckoutOf(entries) {
742
+ const first = entries[0];
743
+ return selectSourceCheckout(entries, first?.bare ? bareHeadBranch(first.path) : null);
744
+ }
745
+ function resolveSourceCheckout(cwd) {
746
+ const entries = listWorktrees(cwd);
747
+ return {
748
+ entries,
749
+ ...sourceCheckoutOf(entries)
750
+ };
751
+ }
752
+ //#endregion
753
+ export { sourceCheckoutOf as C, makeTemporaryDirectory as D, filesystemDevice as E, removeTemporaryEntry as O, restoreFile as S, warmWorktreePaths as T, readWorktreeExclude as _, dirtyFingerprintFiles as a, resolveFullRef as b, gitCommonDirOnDisk as c, hasUncommittedWork as d, isPodInstallChurn as f, podsOutOfSync as g, locallyKnownUpstream as h, depsOutOfSync as i, temporaryRoot as k, hasPopulatedSubmodules as l, listWorktrees as m, cloneIgnoredEntries as n, dirtyPaths as o, linkedWorktreesOnDisk as p, deleteBranch as r, gitCommonDir as s, branchExists as t, hasRemote as u, removeWorktree as v, unpushedCommits as w, resolveSourceCheckout as x, repoRoot as y };