privateer-agent 0.15.4 → 0.15.6

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 (229) hide show
  1. package/README.md +11 -0
  2. package/bin/boot-bundle.d.mts +2 -0
  3. package/bin/boot-bundle.mjs +44 -0
  4. package/bin/fresh-supervisor.d.mts +5 -1
  5. package/bin/fresh-supervisor.mjs +47 -10
  6. package/bin/privateer-launch.mjs +27 -3
  7. package/bin/privateer-subagent.mjs +5 -2
  8. package/bin/privateer-verify.mjs +12 -0
  9. package/bin/session-recovery.d.mts +53 -0
  10. package/bin/session-recovery.mjs +240 -0
  11. package/bin/session-seal-preload.mjs +17 -0
  12. package/bin/session-seal.d.mts +25 -0
  13. package/bin/session-seal.mjs +242 -0
  14. package/dist-boot/boot.mjs +3 -0
  15. package/dist-boot/c-27JKSMWL.mjs +1460 -0
  16. package/dist-boot/c-2BMRFV24.mjs +269 -0
  17. package/dist-boot/c-2CTF6JA3.mjs +166 -0
  18. package/dist-boot/c-2G3BBHRJ.mjs +84 -0
  19. package/dist-boot/c-2IDLKXX6.mjs +250 -0
  20. package/dist-boot/c-2NJD5VYM.mjs +8 -0
  21. package/dist-boot/c-2S5EEQPW.mjs +1602 -0
  22. package/dist-boot/c-2WRDCUVI.mjs +25 -0
  23. package/dist-boot/c-2YN3M256.mjs +14 -0
  24. package/dist-boot/c-37GM3GMU.mjs +187 -0
  25. package/dist-boot/c-3STKRSVO.mjs +2480 -0
  26. package/dist-boot/c-3TPV6TQQ.mjs +2320 -0
  27. package/dist-boot/c-3UVHLQDJ.mjs +225 -0
  28. package/dist-boot/c-42PUUZYC.mjs +697 -0
  29. package/dist-boot/c-4D5UMWVW.mjs +683 -0
  30. package/dist-boot/c-4ETZRMTA.mjs +46 -0
  31. package/dist-boot/c-4QT25BD5.mjs +1482 -0
  32. package/dist-boot/c-4WVR32AP.mjs +2579 -0
  33. package/dist-boot/c-5EMM567G.mjs +152 -0
  34. package/dist-boot/c-5FA4CV63.mjs +145 -0
  35. package/dist-boot/c-5GV3X3RB.mjs +14 -0
  36. package/dist-boot/c-5JCEPRIY.mjs +52 -0
  37. package/dist-boot/c-5NDKIIWT.mjs +16 -0
  38. package/dist-boot/c-5QL3AR26.mjs +4665 -0
  39. package/dist-boot/c-5XY6MFKN.mjs +5142 -0
  40. package/dist-boot/c-65UZIZC7.mjs +2897 -0
  41. package/dist-boot/c-6FUXKHOK.mjs +1969 -0
  42. package/dist-boot/c-6JHWQE4V.mjs +18242 -0
  43. package/dist-boot/c-6LOBR4I6.mjs +5280 -0
  44. package/dist-boot/c-6QHOZXKQ.mjs +14394 -0
  45. package/dist-boot/c-6ZO2SADQ.mjs +178 -0
  46. package/dist-boot/c-6ZORVVZP.mjs +1449 -0
  47. package/dist-boot/c-76QH4UCP.mjs +2441 -0
  48. package/dist-boot/c-77GO5L5Y.mjs +20982 -0
  49. package/dist-boot/c-7M23XFTN.mjs +5052 -0
  50. package/dist-boot/c-7TC367E2.mjs +32 -0
  51. package/dist-boot/c-7UOG7POX.mjs +1524 -0
  52. package/dist-boot/c-7VHP3FLN.mjs +376 -0
  53. package/dist-boot/c-A73JHZP2.mjs +13207 -0
  54. package/dist-boot/c-ABXULAFL.mjs +71 -0
  55. package/dist-boot/c-ANDD2AQO.mjs +74 -0
  56. package/dist-boot/c-AOY77AZL.mjs +1430 -0
  57. package/dist-boot/c-AXEPZ22I.mjs +108 -0
  58. package/dist-boot/c-B2Y7VNHU.mjs +427 -0
  59. package/dist-boot/c-B7VJUH73.mjs +77 -0
  60. package/dist-boot/c-BFW6CDVL.mjs +24 -0
  61. package/dist-boot/c-BHNIF2AR.mjs +188 -0
  62. package/dist-boot/c-BKF2O6BL.mjs +23 -0
  63. package/dist-boot/c-BOZXFTZN.mjs +8 -0
  64. package/dist-boot/c-BRNYJWZL.mjs +28 -0
  65. package/dist-boot/c-C3N4Z2HO.mjs +93 -0
  66. package/dist-boot/c-C4IV7ZFG.mjs +717 -0
  67. package/dist-boot/c-C5NK6UYV.mjs +793 -0
  68. package/dist-boot/c-C67644MB.mjs +1659 -0
  69. package/dist-boot/c-C6S2YB53.mjs +620 -0
  70. package/dist-boot/c-CDBEJSBF.mjs +37 -0
  71. package/dist-boot/c-CG47HBKU.mjs +435 -0
  72. package/dist-boot/c-CKCTWCT5.mjs +51 -0
  73. package/dist-boot/c-CN77DCGF.mjs +60 -0
  74. package/dist-boot/c-CRBXNKFO.mjs +1795 -0
  75. package/dist-boot/c-CRIHASQ6.mjs +973 -0
  76. package/dist-boot/c-CU4NGAUO.mjs +3786 -0
  77. package/dist-boot/c-CWRFLGQU.mjs +1883 -0
  78. package/dist-boot/c-CYQB2USO.mjs +32 -0
  79. package/dist-boot/c-DEE67DJO.mjs +379 -0
  80. package/dist-boot/c-DIFDBYOP.mjs +1258 -0
  81. package/dist-boot/c-DOSGVXDZ.mjs +34879 -0
  82. package/dist-boot/c-DR7XQI32.mjs +381 -0
  83. package/dist-boot/c-DTGPSB46.mjs +14666 -0
  84. package/dist-boot/c-DTHDNA4P.mjs +320 -0
  85. package/dist-boot/c-E4Z3Y5B5.mjs +3864 -0
  86. package/dist-boot/c-E66Z2TI7.mjs +203 -0
  87. package/dist-boot/c-EBU6RLRV.mjs +1527 -0
  88. package/dist-boot/c-EBZZNGSF.mjs +432 -0
  89. package/dist-boot/c-EC3LJ2KF.mjs +1032 -0
  90. package/dist-boot/c-EQBKXWNX.mjs +15829 -0
  91. package/dist-boot/c-EUEPIW4S.mjs +574 -0
  92. package/dist-boot/c-EX4YVWAT.mjs +378 -0
  93. package/dist-boot/c-EYZGSAJU.mjs +98 -0
  94. package/dist-boot/c-F75VRKY4.mjs +172 -0
  95. package/dist-boot/c-FH4NXKHV.mjs +177 -0
  96. package/dist-boot/c-FHNUCTEM.mjs +140 -0
  97. package/dist-boot/c-FJ5T42DS.mjs +5349 -0
  98. package/dist-boot/c-FPCNRL7G.mjs +1728 -0
  99. package/dist-boot/c-G4DLN7Q4.mjs +8 -0
  100. package/dist-boot/c-G56GYQFZ.mjs +2507 -0
  101. package/dist-boot/c-GLIOERDQ.mjs +1200 -0
  102. package/dist-boot/c-GMJ5HUBM.mjs +14 -0
  103. package/dist-boot/c-H3HSGMAQ.mjs +461 -0
  104. package/dist-boot/c-HIKTO6P7.mjs +275 -0
  105. package/dist-boot/c-I2MCJ34O.mjs +464 -0
  106. package/dist-boot/c-I3C6LBW4.mjs +765 -0
  107. package/dist-boot/c-I54OKQHW.mjs +387 -0
  108. package/dist-boot/c-IFSP3R4D.mjs +80 -0
  109. package/dist-boot/c-IZK77VB7.mjs +171 -0
  110. package/dist-boot/c-J3Y25UGE.mjs +54 -0
  111. package/dist-boot/c-J5IESS7W.mjs +27750 -0
  112. package/dist-boot/c-JJWZBY7L.mjs +254 -0
  113. package/dist-boot/c-JKTFXTGF.mjs +463 -0
  114. package/dist-boot/c-JN57AXQ4.mjs +77 -0
  115. package/dist-boot/c-KFIO6LUW.mjs +1096 -0
  116. package/dist-boot/c-KIEMEFWW.mjs +478 -0
  117. package/dist-boot/c-KIVXWBYD.mjs +28 -0
  118. package/dist-boot/c-KP6CRIP4.mjs +580 -0
  119. package/dist-boot/c-L26VOJX4.mjs +11558 -0
  120. package/dist-boot/c-L5GHWG5G.mjs +5988 -0
  121. package/dist-boot/c-M7NSQAKK.mjs +353 -0
  122. package/dist-boot/c-MCEWOPBW.mjs +56 -0
  123. package/dist-boot/c-MGPIEG7I.mjs +20 -0
  124. package/dist-boot/c-NREXJV3M.mjs +393 -0
  125. package/dist-boot/c-O5PP6CTX.mjs +162 -0
  126. package/dist-boot/c-OBQDHSXM.mjs +1774 -0
  127. package/dist-boot/c-OLQHHDD4.mjs +21 -0
  128. package/dist-boot/c-OXW4JQQH.mjs +319 -0
  129. package/dist-boot/c-P3D7ZUWN.mjs +1288 -0
  130. package/dist-boot/c-P4PQZVV5.mjs +948 -0
  131. package/dist-boot/c-P63T3XL2.mjs +26373 -0
  132. package/dist-boot/c-P6N5DQGZ.mjs +194 -0
  133. package/dist-boot/c-P7MLKQFC.mjs +58 -0
  134. package/dist-boot/c-PB3PZJL5.mjs +1276 -0
  135. package/dist-boot/c-PTN4S6G2.mjs +1259 -0
  136. package/dist-boot/c-PYCE5J7U.mjs +1083 -0
  137. package/dist-boot/c-Q4HYCRLB.mjs +19410 -0
  138. package/dist-boot/c-QUXMETGG.mjs +68 -0
  139. package/dist-boot/c-RDMJZCOX.mjs +356 -0
  140. package/dist-boot/c-ROGJK76M.mjs +17 -0
  141. package/dist-boot/c-RQJJ26T4.mjs +708 -0
  142. package/dist-boot/c-RSKCUPJF.mjs +7559 -0
  143. package/dist-boot/c-RVJU4O6P.mjs +37 -0
  144. package/dist-boot/c-S2RVHR3M.mjs +165 -0
  145. package/dist-boot/c-SKMK3PEE.mjs +91120 -0
  146. package/dist-boot/c-TI7SM4EG.mjs +20 -0
  147. package/dist-boot/c-TILJ6GXD.mjs +1235 -0
  148. package/dist-boot/c-TT6BCUJD.mjs +114 -0
  149. package/dist-boot/c-U4ITOXAN.mjs +2107 -0
  150. package/dist-boot/c-UGERXVO2.mjs +7120 -0
  151. package/dist-boot/c-UPBH5AXY.mjs +1363 -0
  152. package/dist-boot/c-US2PUNZL.mjs +597 -0
  153. package/dist-boot/c-UU4WZPPE.mjs +20 -0
  154. package/dist-boot/c-UWVIYPQS.mjs +39 -0
  155. package/dist-boot/c-V4RHQBPQ.mjs +17683 -0
  156. package/dist-boot/c-V5MRVK47.mjs +351 -0
  157. package/dist-boot/c-V6CL266R.mjs +1755 -0
  158. package/dist-boot/c-VJTMFKYE.mjs +14975 -0
  159. package/dist-boot/c-VJTRUKIB.mjs +773 -0
  160. package/dist-boot/c-W4IFSHPW.mjs +43 -0
  161. package/dist-boot/c-WETGB2CF.mjs +113 -0
  162. package/dist-boot/c-WO3QSZUU.mjs +1337 -0
  163. package/dist-boot/c-WQLH73TY.mjs +242 -0
  164. package/dist-boot/c-XL735JW5.mjs +500 -0
  165. package/dist-boot/c-Y7HADL5B.mjs +1107 -0
  166. package/dist-boot/c-YGQHSVSK.mjs +41 -0
  167. package/dist-boot/c-YMP2AMEB.mjs +10350 -0
  168. package/dist-boot/c-YRDO2WEF.mjs +12012 -0
  169. package/dist-boot/c-YUSTRATJ.mjs +8 -0
  170. package/dist-boot/c-Z2262R22.mjs +2697 -0
  171. package/dist-boot/c-Z4ALQMJC.mjs +709 -0
  172. package/dist-boot/c-Z5ZUQVUY.mjs +62 -0
  173. package/dist-boot/c-ZDZUKXF7.mjs +874 -0
  174. package/dist-boot/c-ZJYLGIC3.mjs +32 -0
  175. package/dist-boot/c-ZNA5CDMI.mjs +77 -0
  176. package/dist-boot/c-ZSO6DI3M.mjs +204 -0
  177. package/dist-boot/c-ZWUVHKMK.mjs +100 -0
  178. package/dist-boot/c-ZY4MESEW.mjs +832 -0
  179. package/dist-boot/c-ZZ5REI4L.mjs +329 -0
  180. package/dist-boot/cli.mjs +51 -0
  181. package/dist-boot/ext-anthropic-attribution.mjs +207 -0
  182. package/dist-boot/ext-pi-background-tasks.mjs +7234 -0
  183. package/dist-boot/ext-pi-subagents.mjs +37 -0
  184. package/dist-boot/ext-privateer-account.mjs +4426 -0
  185. package/dist-boot/ext-privateer-brand.mjs +5274 -0
  186. package/dist-boot/ext-privateer-codemode.mjs +37 -0
  187. package/dist-boot/ext-privateer-computer.mjs +626 -0
  188. package/dist-boot/ext-privateer-connect.mjs +1862 -0
  189. package/dist-boot/ext-privateer-context.mjs +323 -0
  190. package/dist-boot/ext-privateer-desktop.mjs +92 -0
  191. package/dist-boot/ext-privateer-final-audit.mjs +48 -0
  192. package/dist-boot/ext-privateer-fresh.mjs +81 -0
  193. package/dist-boot/ext-privateer-gate.mjs +5959 -0
  194. package/dist-boot/ext-privateer-hints.mjs +236 -0
  195. package/dist-boot/ext-privateer-media.mjs +2626 -0
  196. package/dist-boot/ext-privateer-models.mjs +3397 -0
  197. package/dist-boot/ext-privateer-posture.mjs +3006 -0
  198. package/dist-boot/ext-privateer-privacy.mjs +4578 -0
  199. package/dist-boot/ext-privateer-recovery.mjs +287 -0
  200. package/dist-boot/ext-privateer-speak.mjs +4754 -0
  201. package/dist-boot/ext-privateer-terminals.mjs +725 -0
  202. package/dist-boot/ext-privateer-tools.mjs +528 -0
  203. package/dist-boot/ext-privateer-truncation.mjs +74 -0
  204. package/dist-boot/ext-privateer-update.mjs +210 -0
  205. package/dist-boot/ext-privateer-vision.mjs +148 -0
  206. package/dist-boot/ext-privateer-web.mjs +543 -0
  207. package/dist-boot/ext-rpiv-ask-user-question.mjs +710 -0
  208. package/dist-boot/manifest.json +9 -0
  209. package/extensions/privateer-brand.ts +3 -1
  210. package/extensions/privateer-context.ts +4 -2
  211. package/extensions/privateer-final-audit.ts +17 -0
  212. package/extensions/privateer-gate.ts +55 -9
  213. package/extensions/privateer-recovery.ts +175 -0
  214. package/extensions/privateer-web.ts +4 -4
  215. package/package.json +3 -1
  216. package/patches/@earendil-works+pi-coding-agent+1.3.0.patch +199 -2
  217. package/patches/pi-background-tasks+2.6.10.patch +91 -7
  218. package/src/cli/chat.ts +7 -1
  219. package/src/config/moatManifest.json +2 -0
  220. package/src/config/whatsNew.json +4 -4
  221. package/src/context.ts +33 -5
  222. package/src/engine/finalAudit.ts +38 -0
  223. package/src/engine/stallWatchdog.ts +8 -1
  224. package/src/providers/account.ts +34 -3
  225. package/src/remote/attentionPush.ts +40 -0
  226. package/src/remote/liveTaskSession.ts +7 -1
  227. package/src/remote/relayClient.ts +38 -4
  228. package/src/remote/remoteBridge.ts +17 -0
  229. package/src/remote/transcriptSnapshot.ts +104 -0
@@ -0,0 +1,1259 @@
1
+ import{createRequire as __pvCR}from"node:module";import{fileURLToPath as __pvF}from"node:url";import{dirname as __pvD}from"node:path";const require=__pvCR(import.meta.url);const __pvUrl=(r)=>new URL(r,import.meta.url).href;const __pvFile=(r)=>__pvF(new URL(r,import.meta.url));
2
+ import {
3
+ __commonJS,
4
+ __name,
5
+ __require,
6
+ __toESM
7
+ } from "./c-CN77DCGF.mjs";
8
+
9
+ // node_modules/isexe/windows.js
10
+ var require_windows = __commonJS({
11
+ "node_modules/isexe/windows.js"(exports, module) {
12
+ module.exports = isexe;
13
+ isexe.sync = sync;
14
+ var fs = __require("fs");
15
+ function checkPathExt(path, options) {
16
+ var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
17
+ if (!pathext) {
18
+ return true;
19
+ }
20
+ pathext = pathext.split(";");
21
+ if (pathext.indexOf("") !== -1) {
22
+ return true;
23
+ }
24
+ for (var i = 0; i < pathext.length; i++) {
25
+ var p = pathext[i].toLowerCase();
26
+ if (p && path.substr(-p.length).toLowerCase() === p) {
27
+ return true;
28
+ }
29
+ }
30
+ return false;
31
+ }
32
+ __name(checkPathExt, "checkPathExt");
33
+ function checkStat(stat, path, options) {
34
+ if (!stat.isSymbolicLink() && !stat.isFile()) {
35
+ return false;
36
+ }
37
+ return checkPathExt(path, options);
38
+ }
39
+ __name(checkStat, "checkStat");
40
+ function isexe(path, options, cb) {
41
+ fs.stat(path, function(er, stat) {
42
+ cb(er, er ? false : checkStat(stat, path, options));
43
+ });
44
+ }
45
+ __name(isexe, "isexe");
46
+ function sync(path, options) {
47
+ return checkStat(fs.statSync(path), path, options);
48
+ }
49
+ __name(sync, "sync");
50
+ }
51
+ });
52
+
53
+ // node_modules/isexe/mode.js
54
+ var require_mode = __commonJS({
55
+ "node_modules/isexe/mode.js"(exports, module) {
56
+ module.exports = isexe;
57
+ isexe.sync = sync;
58
+ var fs = __require("fs");
59
+ function isexe(path, options, cb) {
60
+ fs.stat(path, function(er, stat) {
61
+ cb(er, er ? false : checkStat(stat, options));
62
+ });
63
+ }
64
+ __name(isexe, "isexe");
65
+ function sync(path, options) {
66
+ return checkStat(fs.statSync(path), options);
67
+ }
68
+ __name(sync, "sync");
69
+ function checkStat(stat, options) {
70
+ return stat.isFile() && checkMode(stat, options);
71
+ }
72
+ __name(checkStat, "checkStat");
73
+ function checkMode(stat, options) {
74
+ var mod = stat.mode;
75
+ var uid = stat.uid;
76
+ var gid = stat.gid;
77
+ var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
78
+ var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
79
+ var u = parseInt("100", 8);
80
+ var g = parseInt("010", 8);
81
+ var o = parseInt("001", 8);
82
+ var ug = u | g;
83
+ var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
84
+ return ret;
85
+ }
86
+ __name(checkMode, "checkMode");
87
+ }
88
+ });
89
+
90
+ // node_modules/isexe/index.js
91
+ var require_isexe = __commonJS({
92
+ "node_modules/isexe/index.js"(exports, module) {
93
+ var fs = __require("fs");
94
+ var core;
95
+ if (process.platform === "win32" || global.TESTING_WINDOWS) {
96
+ core = require_windows();
97
+ } else {
98
+ core = require_mode();
99
+ }
100
+ module.exports = isexe;
101
+ isexe.sync = sync;
102
+ function isexe(path, options, cb) {
103
+ if (typeof options === "function") {
104
+ cb = options;
105
+ options = {};
106
+ }
107
+ if (!cb) {
108
+ if (typeof Promise !== "function") {
109
+ throw new TypeError("callback not provided");
110
+ }
111
+ return new Promise(function(resolve2, reject) {
112
+ isexe(path, options || {}, function(er, is) {
113
+ if (er) {
114
+ reject(er);
115
+ } else {
116
+ resolve2(is);
117
+ }
118
+ });
119
+ });
120
+ }
121
+ core(path, options || {}, function(er, is) {
122
+ if (er) {
123
+ if (er.code === "EACCES" || options && options.ignoreErrors) {
124
+ er = null;
125
+ is = false;
126
+ }
127
+ }
128
+ cb(er, is);
129
+ });
130
+ }
131
+ __name(isexe, "isexe");
132
+ function sync(path, options) {
133
+ try {
134
+ return core.sync(path, options || {});
135
+ } catch (er) {
136
+ if (options && options.ignoreErrors || er.code === "EACCES") {
137
+ return false;
138
+ } else {
139
+ throw er;
140
+ }
141
+ }
142
+ }
143
+ __name(sync, "sync");
144
+ }
145
+ });
146
+
147
+ // node_modules/which/which.js
148
+ var require_which = __commonJS({
149
+ "node_modules/which/which.js"(exports, module) {
150
+ var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
151
+ var path = __require("path");
152
+ var COLON = isWindows ? ";" : ":";
153
+ var isexe = require_isexe();
154
+ var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError");
155
+ var getPathInfo = /* @__PURE__ */ __name((cmd, opt) => {
156
+ const colon = opt.colon || COLON;
157
+ const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
158
+ // windows always checks the cwd first
159
+ ...isWindows ? [process.cwd()] : [],
160
+ ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
161
+ "").split(colon)
162
+ ];
163
+ const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
164
+ const pathExt = isWindows ? pathExtExe.split(colon) : [""];
165
+ if (isWindows) {
166
+ if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
167
+ pathExt.unshift("");
168
+ }
169
+ return {
170
+ pathEnv,
171
+ pathExt,
172
+ pathExtExe
173
+ };
174
+ }, "getPathInfo");
175
+ var which = /* @__PURE__ */ __name((cmd, opt, cb) => {
176
+ if (typeof opt === "function") {
177
+ cb = opt;
178
+ opt = {};
179
+ }
180
+ if (!opt)
181
+ opt = {};
182
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
183
+ const found = [];
184
+ const step = /* @__PURE__ */ __name((i) => new Promise((resolve2, reject) => {
185
+ if (i === pathEnv.length)
186
+ return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
187
+ const ppRaw = pathEnv[i];
188
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
189
+ const pCmd = path.join(pathPart, cmd);
190
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
191
+ resolve2(subStep(p, i, 0));
192
+ }), "step");
193
+ const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve2, reject) => {
194
+ if (ii === pathExt.length)
195
+ return resolve2(step(i + 1));
196
+ const ext = pathExt[ii];
197
+ isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
198
+ if (!er && is) {
199
+ if (opt.all)
200
+ found.push(p + ext);
201
+ else
202
+ return resolve2(p + ext);
203
+ }
204
+ return resolve2(subStep(p, i, ii + 1));
205
+ });
206
+ }), "subStep");
207
+ return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
208
+ }, "which");
209
+ var whichSync = /* @__PURE__ */ __name((cmd, opt) => {
210
+ opt = opt || {};
211
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
212
+ const found = [];
213
+ for (let i = 0; i < pathEnv.length; i++) {
214
+ const ppRaw = pathEnv[i];
215
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
216
+ const pCmd = path.join(pathPart, cmd);
217
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
218
+ for (let j = 0; j < pathExt.length; j++) {
219
+ const cur = p + pathExt[j];
220
+ try {
221
+ const is = isexe.sync(cur, { pathExt: pathExtExe });
222
+ if (is) {
223
+ if (opt.all)
224
+ found.push(cur);
225
+ else
226
+ return cur;
227
+ }
228
+ } catch (ex) {
229
+ }
230
+ }
231
+ }
232
+ if (opt.all && found.length)
233
+ return found;
234
+ if (opt.nothrow)
235
+ return null;
236
+ throw getNotFoundError(cmd);
237
+ }, "whichSync");
238
+ module.exports = which;
239
+ which.sync = whichSync;
240
+ }
241
+ });
242
+
243
+ // node_modules/path-key/index.js
244
+ var require_path_key = __commonJS({
245
+ "node_modules/path-key/index.js"(exports, module) {
246
+ "use strict";
247
+ var pathKey = /* @__PURE__ */ __name((options = {}) => {
248
+ const environment = options.env || process.env;
249
+ const platform = options.platform || process.platform;
250
+ if (platform !== "win32") {
251
+ return "PATH";
252
+ }
253
+ return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
254
+ }, "pathKey");
255
+ module.exports = pathKey;
256
+ module.exports.default = pathKey;
257
+ }
258
+ });
259
+
260
+ // node_modules/cross-spawn/lib/util/resolveCommand.js
261
+ var require_resolveCommand = __commonJS({
262
+ "node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
263
+ "use strict";
264
+ var path = __require("path");
265
+ var which = require_which();
266
+ var getPathKey = require_path_key();
267
+ function resolveCommandAttempt(parsed, withoutPathExt) {
268
+ const env = parsed.options.env || process.env;
269
+ const cwd = process.cwd();
270
+ const hasCustomCwd = parsed.options.cwd != null;
271
+ const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
272
+ if (shouldSwitchCwd) {
273
+ try {
274
+ process.chdir(parsed.options.cwd);
275
+ } catch (err) {
276
+ }
277
+ }
278
+ let resolved;
279
+ try {
280
+ resolved = which.sync(parsed.command, {
281
+ path: env[getPathKey({ env })],
282
+ pathExt: withoutPathExt ? path.delimiter : void 0
283
+ });
284
+ } catch (e) {
285
+ } finally {
286
+ if (shouldSwitchCwd) {
287
+ process.chdir(cwd);
288
+ }
289
+ }
290
+ if (resolved) {
291
+ resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
292
+ }
293
+ return resolved;
294
+ }
295
+ __name(resolveCommandAttempt, "resolveCommandAttempt");
296
+ function resolveCommand(parsed) {
297
+ return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
298
+ }
299
+ __name(resolveCommand, "resolveCommand");
300
+ module.exports = resolveCommand;
301
+ }
302
+ });
303
+
304
+ // node_modules/cross-spawn/lib/util/escape.js
305
+ var require_escape = __commonJS({
306
+ "node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
307
+ "use strict";
308
+ var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
309
+ function escapeCommand(arg) {
310
+ arg = arg.replace(metaCharsRegExp, "^$1");
311
+ return arg;
312
+ }
313
+ __name(escapeCommand, "escapeCommand");
314
+ function escapeArgument(arg, doubleEscapeMetaChars) {
315
+ arg = `${arg}`;
316
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
317
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
318
+ arg = `"${arg}"`;
319
+ arg = arg.replace(metaCharsRegExp, "^$1");
320
+ if (doubleEscapeMetaChars) {
321
+ arg = arg.replace(metaCharsRegExp, "^$1");
322
+ }
323
+ return arg;
324
+ }
325
+ __name(escapeArgument, "escapeArgument");
326
+ module.exports.command = escapeCommand;
327
+ module.exports.argument = escapeArgument;
328
+ }
329
+ });
330
+
331
+ // node_modules/shebang-regex/index.js
332
+ var require_shebang_regex = __commonJS({
333
+ "node_modules/shebang-regex/index.js"(exports, module) {
334
+ "use strict";
335
+ module.exports = /^#!(.*)/;
336
+ }
337
+ });
338
+
339
+ // node_modules/shebang-command/index.js
340
+ var require_shebang_command = __commonJS({
341
+ "node_modules/shebang-command/index.js"(exports, module) {
342
+ "use strict";
343
+ var shebangRegex = require_shebang_regex();
344
+ module.exports = (string = "") => {
345
+ const match = string.match(shebangRegex);
346
+ if (!match) {
347
+ return null;
348
+ }
349
+ const [path, argument] = match[0].replace(/#! ?/, "").split(" ");
350
+ const binary = path.split("/").pop();
351
+ if (binary === "env") {
352
+ return argument;
353
+ }
354
+ return argument ? `${binary} ${argument}` : binary;
355
+ };
356
+ }
357
+ });
358
+
359
+ // node_modules/cross-spawn/lib/util/readShebang.js
360
+ var require_readShebang = __commonJS({
361
+ "node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
362
+ "use strict";
363
+ var fs = __require("fs");
364
+ var shebangCommand = require_shebang_command();
365
+ function readShebang(command) {
366
+ const size = 150;
367
+ const buffer = Buffer.alloc(size);
368
+ let fd;
369
+ try {
370
+ fd = fs.openSync(command, "r");
371
+ fs.readSync(fd, buffer, 0, size, 0);
372
+ fs.closeSync(fd);
373
+ } catch (e) {
374
+ }
375
+ return shebangCommand(buffer.toString());
376
+ }
377
+ __name(readShebang, "readShebang");
378
+ module.exports = readShebang;
379
+ }
380
+ });
381
+
382
+ // node_modules/cross-spawn/lib/parse.js
383
+ var require_parse = __commonJS({
384
+ "node_modules/cross-spawn/lib/parse.js"(exports, module) {
385
+ "use strict";
386
+ var path = __require("path");
387
+ var resolveCommand = require_resolveCommand();
388
+ var escape = require_escape();
389
+ var readShebang = require_readShebang();
390
+ var isWin = process.platform === "win32";
391
+ var isExecutableRegExp = /\.(?:com|exe)$/i;
392
+ var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
393
+ function detectShebang(parsed) {
394
+ parsed.file = resolveCommand(parsed);
395
+ const shebang = parsed.file && readShebang(parsed.file);
396
+ if (shebang) {
397
+ parsed.args.unshift(parsed.file);
398
+ parsed.command = shebang;
399
+ return resolveCommand(parsed);
400
+ }
401
+ return parsed.file;
402
+ }
403
+ __name(detectShebang, "detectShebang");
404
+ function parseNonShell(parsed) {
405
+ if (!isWin) {
406
+ return parsed;
407
+ }
408
+ const commandFile = detectShebang(parsed);
409
+ const needsShell = !isExecutableRegExp.test(commandFile);
410
+ if (parsed.options.forceShell || needsShell) {
411
+ const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
412
+ parsed.command = path.normalize(parsed.command);
413
+ parsed.command = escape.command(parsed.command);
414
+ parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
415
+ const shellCommand = [parsed.command].concat(parsed.args).join(" ");
416
+ parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
417
+ parsed.command = process.env.comspec || "cmd.exe";
418
+ parsed.options.windowsVerbatimArguments = true;
419
+ }
420
+ return parsed;
421
+ }
422
+ __name(parseNonShell, "parseNonShell");
423
+ function parse(command, args, options) {
424
+ if (args && !Array.isArray(args)) {
425
+ options = args;
426
+ args = null;
427
+ }
428
+ args = args ? args.slice(0) : [];
429
+ options = Object.assign({}, options);
430
+ const parsed = {
431
+ command,
432
+ args,
433
+ options,
434
+ file: void 0,
435
+ original: {
436
+ command,
437
+ args
438
+ }
439
+ };
440
+ return options.shell ? parsed : parseNonShell(parsed);
441
+ }
442
+ __name(parse, "parse");
443
+ module.exports = parse;
444
+ }
445
+ });
446
+
447
+ // node_modules/cross-spawn/lib/enoent.js
448
+ var require_enoent = __commonJS({
449
+ "node_modules/cross-spawn/lib/enoent.js"(exports, module) {
450
+ "use strict";
451
+ var isWin = process.platform === "win32";
452
+ function notFoundError(original, syscall) {
453
+ return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
454
+ code: "ENOENT",
455
+ errno: "ENOENT",
456
+ syscall: `${syscall} ${original.command}`,
457
+ path: original.command,
458
+ spawnargs: original.args
459
+ });
460
+ }
461
+ __name(notFoundError, "notFoundError");
462
+ function hookChildProcess(cp, parsed) {
463
+ if (!isWin) {
464
+ return;
465
+ }
466
+ const originalEmit = cp.emit;
467
+ cp.emit = function(name, arg1) {
468
+ if (name === "exit") {
469
+ const err = verifyENOENT(arg1, parsed);
470
+ if (err) {
471
+ return originalEmit.call(cp, "error", err);
472
+ }
473
+ }
474
+ return originalEmit.apply(cp, arguments);
475
+ };
476
+ }
477
+ __name(hookChildProcess, "hookChildProcess");
478
+ function verifyENOENT(status, parsed) {
479
+ if (isWin && status === 1 && !parsed.file) {
480
+ return notFoundError(parsed.original, "spawn");
481
+ }
482
+ return null;
483
+ }
484
+ __name(verifyENOENT, "verifyENOENT");
485
+ function verifyENOENTSync(status, parsed) {
486
+ if (isWin && status === 1 && !parsed.file) {
487
+ return notFoundError(parsed.original, "spawnSync");
488
+ }
489
+ return null;
490
+ }
491
+ __name(verifyENOENTSync, "verifyENOENTSync");
492
+ module.exports = {
493
+ hookChildProcess,
494
+ verifyENOENT,
495
+ verifyENOENTSync,
496
+ notFoundError
497
+ };
498
+ }
499
+ });
500
+
501
+ // node_modules/cross-spawn/index.js
502
+ var require_cross_spawn = __commonJS({
503
+ "node_modules/cross-spawn/index.js"(exports, module) {
504
+ "use strict";
505
+ var cp = __require("child_process");
506
+ var parse = require_parse();
507
+ var enoent = require_enoent();
508
+ function spawn(command, args, options) {
509
+ const parsed = parse(command, args, options);
510
+ const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
511
+ enoent.hookChildProcess(spawned, parsed);
512
+ return spawned;
513
+ }
514
+ __name(spawn, "spawn");
515
+ function spawnSync(command, args, options) {
516
+ const parsed = parse(command, args, options);
517
+ const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
518
+ result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
519
+ return result;
520
+ }
521
+ __name(spawnSync, "spawnSync");
522
+ module.exports = spawn;
523
+ module.exports.spawn = spawn;
524
+ module.exports.sync = spawnSync;
525
+ module.exports._parse = parse;
526
+ module.exports._enoent = enoent;
527
+ }
528
+ });
529
+
530
+ // node_modules/@earendil-works/pi-coding-agent/dist/config.js
531
+ import { accessSync, constants, existsSync, readFileSync, realpathSync as realpathSync2 } from "fs";
532
+ import { createRequire } from "module";
533
+ import { homedir as homedir2 } from "os";
534
+ import { basename, dirname, join as join2, resolve, sep as sep2, win32 } from "path";
535
+ import { fileURLToPath as fileURLToPath2 } from "url";
536
+
537
+ // node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js
538
+ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
539
+ import { spawn as nodeSpawn, spawnSync as nodeSpawnSync } from "node:child_process";
540
+ var EXIT_STDIO_GRACE_MS = 100;
541
+ function spawnProcess(command, args, options) {
542
+ return process.platform === "win32" ? (0, import_cross_spawn.default)(command, args, options) : nodeSpawn(command, args, options);
543
+ }
544
+ __name(spawnProcess, "spawnProcess");
545
+ function spawnProcessSync(command, args, options) {
546
+ return process.platform === "win32" ? import_cross_spawn.default.sync(command, args, options) : nodeSpawnSync(command, args, options);
547
+ }
548
+ __name(spawnProcessSync, "spawnProcessSync");
549
+ function waitForChildProcess(child) {
550
+ return new Promise((resolve2, reject) => {
551
+ let settled = false;
552
+ let exited = false;
553
+ let exitCode = null;
554
+ let postExitTimer;
555
+ let stdoutEnded = child.stdout === null;
556
+ let stderrEnded = child.stderr === null;
557
+ const cleanup = /* @__PURE__ */ __name(() => {
558
+ if (postExitTimer) {
559
+ clearTimeout(postExitTimer);
560
+ postExitTimer = void 0;
561
+ }
562
+ child.removeListener("error", onError);
563
+ child.removeListener("exit", onExit);
564
+ child.removeListener("close", onClose);
565
+ child.stdout?.removeListener("end", onStdoutEnd);
566
+ child.stderr?.removeListener("end", onStderrEnd);
567
+ child.stdout?.removeListener("data", onData);
568
+ child.stderr?.removeListener("data", onData);
569
+ }, "cleanup");
570
+ const finalize = /* @__PURE__ */ __name((code) => {
571
+ if (settled)
572
+ return;
573
+ settled = true;
574
+ cleanup();
575
+ child.stdout?.destroy();
576
+ child.stderr?.destroy();
577
+ resolve2(code);
578
+ }, "finalize");
579
+ const maybeFinalizeAfterExit = /* @__PURE__ */ __name(() => {
580
+ if (!exited || settled)
581
+ return;
582
+ if (stdoutEnded && stderrEnded) {
583
+ finalize(exitCode);
584
+ }
585
+ }, "maybeFinalizeAfterExit");
586
+ const armIdleTimer = /* @__PURE__ */ __name(() => {
587
+ if (postExitTimer)
588
+ clearTimeout(postExitTimer);
589
+ postExitTimer = setTimeout(() => finalize(exitCode), EXIT_STDIO_GRACE_MS);
590
+ }, "armIdleTimer");
591
+ const onData = /* @__PURE__ */ __name(() => {
592
+ if (exited && !settled)
593
+ armIdleTimer();
594
+ }, "onData");
595
+ const onStdoutEnd = /* @__PURE__ */ __name(() => {
596
+ stdoutEnded = true;
597
+ maybeFinalizeAfterExit();
598
+ }, "onStdoutEnd");
599
+ const onStderrEnd = /* @__PURE__ */ __name(() => {
600
+ stderrEnded = true;
601
+ maybeFinalizeAfterExit();
602
+ }, "onStderrEnd");
603
+ const onError = /* @__PURE__ */ __name((err) => {
604
+ if (settled)
605
+ return;
606
+ settled = true;
607
+ cleanup();
608
+ reject(err);
609
+ }, "onError");
610
+ const onExit = /* @__PURE__ */ __name((code) => {
611
+ exited = true;
612
+ exitCode = code;
613
+ maybeFinalizeAfterExit();
614
+ if (!settled) {
615
+ armIdleTimer();
616
+ }
617
+ }, "onExit");
618
+ const onClose = /* @__PURE__ */ __name((code) => {
619
+ finalize(code);
620
+ }, "onClose");
621
+ child.stdout?.once("end", onStdoutEnd);
622
+ child.stderr?.once("end", onStderrEnd);
623
+ child.stdout?.on("data", onData);
624
+ child.stderr?.on("data", onData);
625
+ child.once("error", onError);
626
+ child.once("exit", onExit);
627
+ child.once("close", onClose);
628
+ });
629
+ }
630
+ __name(waitForChildProcess, "waitForChildProcess");
631
+
632
+ // node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js
633
+ import { realpathSync, statSync } from "node:fs";
634
+ import { homedir } from "node:os";
635
+ import { isAbsolute, join, resolve as nodeResolvePath, relative, sep } from "node:path";
636
+ import { fileURLToPath } from "node:url";
637
+ var UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;
638
+ function canonicalizePath(path) {
639
+ try {
640
+ return realpathSync(path);
641
+ } catch {
642
+ return path;
643
+ }
644
+ }
645
+ __name(canonicalizePath, "canonicalizePath");
646
+ function getFileRevision(path) {
647
+ try {
648
+ const stats = statSync(path, { bigint: true });
649
+ return `${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeNs}:${stats.ctimeNs}`;
650
+ } catch {
651
+ return void 0;
652
+ }
653
+ }
654
+ __name(getFileRevision, "getFileRevision");
655
+ function isLocalPath(value) {
656
+ const trimmed = value.trim();
657
+ if (trimmed.startsWith("npm:") || trimmed.startsWith("git:") || trimmed.startsWith("github:") || trimmed.startsWith("http:") || trimmed.startsWith("https:") || trimmed.startsWith("ssh:") || trimmed.startsWith("builtin:")) {
658
+ return false;
659
+ }
660
+ return true;
661
+ }
662
+ __name(isLocalPath, "isLocalPath");
663
+ function normalizeWindowsShellPath(filePath) {
664
+ if (!filePath.startsWith("/") || filePath.startsWith("//") || filePath.includes("\\"))
665
+ return filePath;
666
+ const match = filePath.match(/^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i);
667
+ if (!match)
668
+ return filePath;
669
+ const suffix = match[2]?.replaceAll("/", "\\");
670
+ return `${match[1].toUpperCase()}:\\${suffix ?? ""}`;
671
+ }
672
+ __name(normalizeWindowsShellPath, "normalizeWindowsShellPath");
673
+ function normalizePath(input, options = {}) {
674
+ let normalized = options.trim ? input.trim() : input;
675
+ if (options.normalizeUnicodeSpaces) {
676
+ normalized = normalized.replace(UNICODE_SPACES, " ");
677
+ }
678
+ if (options.stripAtPrefix && normalized.startsWith("@")) {
679
+ normalized = normalized.slice(1);
680
+ }
681
+ if (process.platform === "win32") {
682
+ normalized = normalizeWindowsShellPath(normalized);
683
+ }
684
+ if (options.expandTilde ?? true) {
685
+ const home = options.homeDir ?? homedir();
686
+ if (normalized === "~")
687
+ return home;
688
+ if (normalized.startsWith("~/") || process.platform === "win32" && normalized.startsWith("~\\")) {
689
+ return join(home, normalized.slice(2));
690
+ }
691
+ }
692
+ if (/^file:\/\//.test(normalized)) {
693
+ return fileURLToPath(normalized);
694
+ }
695
+ return normalized;
696
+ }
697
+ __name(normalizePath, "normalizePath");
698
+ function resolvePath(input, baseDir = process.cwd(), options = {}) {
699
+ const normalized = normalizePath(input, options);
700
+ const normalizedBaseDir = normalizePath(baseDir);
701
+ return isAbsolute(normalized) ? nodeResolvePath(normalized) : nodeResolvePath(normalizedBaseDir, normalized);
702
+ }
703
+ __name(resolvePath, "resolvePath");
704
+ function getCwdRelativePath(filePath, cwd) {
705
+ const resolvedCwd = resolvePath(cwd);
706
+ const resolvedPath = resolvePath(filePath, resolvedCwd);
707
+ const relativePath = relative(resolvedCwd, resolvedPath);
708
+ const isInsideCwd = relativePath === "" || relativePath !== ".." && !relativePath.startsWith(`..${sep}`) && !isAbsolute(relativePath);
709
+ return isInsideCwd ? relativePath || "." : void 0;
710
+ }
711
+ __name(getCwdRelativePath, "getCwdRelativePath");
712
+ function formatPathRelativeToCwdOrAbsolute(filePath, cwd) {
713
+ const absolutePath = resolvePath(filePath, cwd);
714
+ return (getCwdRelativePath(absolutePath, cwd) ?? absolutePath).split(sep).join("/");
715
+ }
716
+ __name(formatPathRelativeToCwdOrAbsolute, "formatPathRelativeToCwdOrAbsolute");
717
+ function markPathIgnoredByCloudSync(path) {
718
+ const attrs = process.platform === "darwin" ? ["com.dropbox.ignored", "com.apple.fileprovider.ignore#P"] : process.platform === "linux" ? ["user.com.dropbox.ignored"] : [];
719
+ for (const attr of attrs) {
720
+ if (process.platform === "darwin") {
721
+ spawnProcessSync("xattr", ["-w", attr, "1", path], { encoding: "utf-8", stdio: "ignore" });
722
+ } else {
723
+ spawnProcessSync("setfattr", ["-n", attr, "-v", "1", path], { encoding: "utf-8", stdio: "ignore" });
724
+ }
725
+ }
726
+ }
727
+ __name(markPathIgnoredByCloudSync, "markPathIgnoredByCloudSync");
728
+
729
+ // node_modules/@earendil-works/pi-coding-agent/dist/utils/text.js
730
+ function splitBom(content) {
731
+ return content.startsWith("\uFEFF") ? { bom: "\uFEFF", text: content.slice(1) } : { bom: "", text: content };
732
+ }
733
+ __name(splitBom, "splitBom");
734
+ function stripBom(content) {
735
+ return splitBom(content).text;
736
+ }
737
+ __name(stripBom, "stripBom");
738
+
739
+ // node_modules/@earendil-works/pi-coding-agent/dist/config.js
740
+ var __pvMetaUrl = __pvUrl("../node_modules/@earendil-works/pi-coding-agent/dist/config.js");
741
+ var __filename = fileURLToPath2(__pvMetaUrl);
742
+ var __dirname = dirname(__filename);
743
+ var isBunBinary = __pvMetaUrl.includes("$bunfs") || __pvMetaUrl.includes("~BUN") || __pvMetaUrl.includes("%7EBUN");
744
+ var isBunRuntime = !!process.versions.bun;
745
+ var isBundledNode = typeof PI_BUNDLED_NODE !== "undefined" && PI_BUNDLED_NODE;
746
+ function normalizeSelfUpdatePackageTarget(target) {
747
+ if (typeof target === "string") {
748
+ return { packageName: target, installSpec: target };
749
+ }
750
+ return { packageName: target.packageName, installSpec: target.installSpec ?? target.packageName };
751
+ }
752
+ __name(normalizeSelfUpdatePackageTarget, "normalizeSelfUpdatePackageTarget");
753
+ function makeSelfUpdateCommand(installStep, uninstallStep) {
754
+ if (!uninstallStep)
755
+ return installStep;
756
+ return {
757
+ ...installStep,
758
+ display: `${uninstallStep.display} && ${installStep.display}`,
759
+ steps: [uninstallStep, installStep]
760
+ };
761
+ }
762
+ __name(makeSelfUpdateCommand, "makeSelfUpdateCommand");
763
+ function makeSelfUpdateCommandStep(command, args) {
764
+ return {
765
+ command,
766
+ args,
767
+ display: [command, ...args].map((arg) => /\s/.test(arg) ? `"${arg}"` : arg).join(" ")
768
+ };
769
+ }
770
+ __name(makeSelfUpdateCommandStep, "makeSelfUpdateCommandStep");
771
+ function detectInstallMethod() {
772
+ if (isBunBinary) {
773
+ return "bun-binary";
774
+ }
775
+ const resolvedPath = `${__dirname}\0${process.execPath || ""}`.toLowerCase().replace(/\\/g, "/");
776
+ if (resolvedPath.includes("/pnpm/") || resolvedPath.includes("/.pnpm/")) {
777
+ return "pnpm";
778
+ }
779
+ if (resolvedPath.includes("/yarn/") || resolvedPath.includes("/.yarn/")) {
780
+ return "yarn";
781
+ }
782
+ if (isBunRuntime || resolvedPath.includes("/install/global/node_modules/")) {
783
+ return "bun";
784
+ }
785
+ if (resolvedPath.includes("/npm/") || resolvedPath.includes("/node_modules/")) {
786
+ return "npm";
787
+ }
788
+ return "unknown";
789
+ }
790
+ __name(detectInstallMethod, "detectInstallMethod");
791
+ function getInferredNpmInstall() {
792
+ const packageDir = getPackageDir();
793
+ const path = process.platform === "win32" || packageDir.includes("\\") ? win32 : { basename, dirname };
794
+ const parent = path.dirname(packageDir);
795
+ let root;
796
+ if (path.basename(parent).startsWith("@") && path.basename(path.dirname(parent)) === "node_modules") {
797
+ root = path.dirname(parent);
798
+ } else if (path.basename(parent) === "node_modules") {
799
+ root = parent;
800
+ }
801
+ if (!root)
802
+ return void 0;
803
+ const rootParent = path.dirname(root);
804
+ if (path.basename(rootParent) === "lib")
805
+ return { root, prefix: path.dirname(rootParent) };
806
+ return void 0;
807
+ }
808
+ __name(getInferredNpmInstall, "getInferredNpmInstall");
809
+ function getSelfUpdateCommandForMethod(method, installedPackageName, updatePackageTarget = installedPackageName, npmCommand) {
810
+ const target = normalizeSelfUpdatePackageTarget(updatePackageTarget);
811
+ switch (method) {
812
+ case "bun-binary":
813
+ return void 0;
814
+ case "pnpm": {
815
+ const match = readCommandOutput("pnpm", ["root", "-g"]) ? void 0 : /^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(getPackageDir());
816
+ const binDirArgs = match ? [`--config.global-bin-dir=${process.env.PNPM_HOME || dirname(dirname(match[1]))}`] : [];
817
+ return makeSelfUpdateCommand(makeSelfUpdateCommandStep("pnpm", [
818
+ "install",
819
+ "-g",
820
+ "--ignore-scripts",
821
+ "--config.minimumReleaseAge=0",
822
+ ...binDirArgs,
823
+ target.installSpec
824
+ ]), target.packageName === installedPackageName ? void 0 : makeSelfUpdateCommandStep("pnpm", ["remove", "-g", ...binDirArgs, installedPackageName]));
825
+ }
826
+ case "yarn":
827
+ return makeSelfUpdateCommand(makeSelfUpdateCommandStep("yarn", ["global", "add", "--ignore-scripts", target.installSpec]), target.packageName === installedPackageName ? void 0 : makeSelfUpdateCommandStep("yarn", ["global", "remove", installedPackageName]));
828
+ case "bun":
829
+ return makeSelfUpdateCommand(makeSelfUpdateCommandStep("bun", [
830
+ "install",
831
+ "-g",
832
+ "--ignore-scripts",
833
+ "--minimum-release-age=0",
834
+ target.installSpec
835
+ ]), target.packageName === installedPackageName ? void 0 : makeSelfUpdateCommandStep("bun", ["uninstall", "-g", installedPackageName]));
836
+ case "npm": {
837
+ const [command = "npm", ...npmArgs] = npmCommand ?? [];
838
+ const inferred = npmCommand?.length ? void 0 : getInferredNpmInstall();
839
+ const prefixArgs = [...npmArgs, ...inferred ? ["--prefix", inferred.prefix] : []];
840
+ const installStep = makeSelfUpdateCommandStep(command, [
841
+ ...prefixArgs,
842
+ "install",
843
+ "-g",
844
+ "--ignore-scripts",
845
+ "--min-release-age=0",
846
+ target.installSpec
847
+ ]);
848
+ const uninstallStep = target.packageName === installedPackageName ? void 0 : makeSelfUpdateCommandStep(command, [...prefixArgs, "uninstall", "-g", installedPackageName]);
849
+ return makeSelfUpdateCommand(installStep, uninstallStep);
850
+ }
851
+ case "unknown":
852
+ return void 0;
853
+ }
854
+ }
855
+ __name(getSelfUpdateCommandForMethod, "getSelfUpdateCommandForMethod");
856
+ function readCommandOutput(command, args, options = {}) {
857
+ const result = spawnProcessSync(command, args, {
858
+ encoding: "utf-8",
859
+ stdio: ["ignore", "pipe", "pipe"]
860
+ });
861
+ if (result.status === 0)
862
+ return result.stdout.trim() || void 0;
863
+ if (options.requireSuccess) {
864
+ const reason = result.error?.message || result.stderr.trim() || `exit code ${result.status ?? "unknown"}`;
865
+ throw new Error(`Failed to run ${[command, ...args].join(" ")}: ${reason}`);
866
+ }
867
+ return void 0;
868
+ }
869
+ __name(readCommandOutput, "readCommandOutput");
870
+ function getGlobalPackageRoots(method, _packageName, npmCommand) {
871
+ switch (method) {
872
+ case "npm": {
873
+ const configured = !!npmCommand?.length;
874
+ const [command = "npm", ...npmArgs] = npmCommand ?? [];
875
+ if (configured && command === "bun") {
876
+ const bunBin = readCommandOutput(command, [...npmArgs, "pm", "bin", "-g"], {
877
+ requireSuccess: true
878
+ });
879
+ const roots = [join2(homedir2(), ".bun", "install", "global", "node_modules")];
880
+ if (bunBin) {
881
+ roots.push(join2(dirname(bunBin), "install", "global", "node_modules"));
882
+ }
883
+ return roots;
884
+ }
885
+ const root = readCommandOutput(command, [...npmArgs, "root", "-g"], {
886
+ requireSuccess: configured
887
+ });
888
+ const inferred = configured ? void 0 : getInferredNpmInstall();
889
+ return [root, inferred?.root].filter((x) => !!x);
890
+ }
891
+ case "pnpm": {
892
+ const root = readCommandOutput("pnpm", ["root", "-g"]);
893
+ if (root)
894
+ return [root, dirname(root)];
895
+ const match = /^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(getPackageDir());
896
+ return match ? [match[1]] : [];
897
+ }
898
+ case "yarn": {
899
+ const dir = readCommandOutput("yarn", ["global", "dir"]);
900
+ return dir ? [dir, join2(dir, "node_modules")] : [];
901
+ }
902
+ case "bun": {
903
+ const bunBin = readCommandOutput("bun", ["pm", "bin", "-g"]);
904
+ const roots = [join2(homedir2(), ".bun", "install", "global", "node_modules")];
905
+ if (bunBin) {
906
+ roots.push(join2(dirname(bunBin), "install", "global", "node_modules"));
907
+ }
908
+ return roots;
909
+ }
910
+ case "bun-binary":
911
+ case "unknown":
912
+ return [];
913
+ }
914
+ }
915
+ __name(getGlobalPackageRoots, "getGlobalPackageRoots");
916
+ function normalizeExistingPathForComparison(path, resolveSymlinks) {
917
+ const resolvedPath = resolve(path);
918
+ if (!existsSync(resolvedPath)) {
919
+ return void 0;
920
+ }
921
+ let normalizedPath = resolvedPath;
922
+ if (resolveSymlinks) {
923
+ try {
924
+ normalizedPath = realpathSync2(resolvedPath);
925
+ } catch {
926
+ return void 0;
927
+ }
928
+ }
929
+ if (process.platform === "win32") {
930
+ normalizedPath = normalizedPath.toLowerCase();
931
+ }
932
+ return normalizedPath;
933
+ }
934
+ __name(normalizeExistingPathForComparison, "normalizeExistingPathForComparison");
935
+ function getPathComparisonCandidates(path) {
936
+ return Array.from(new Set([normalizeExistingPathForComparison(path, false), normalizeExistingPathForComparison(path, true)].filter((candidate) => !!candidate)));
937
+ }
938
+ __name(getPathComparisonCandidates, "getPathComparisonCandidates");
939
+ function getEntrypointPackageDir() {
940
+ const entrypoint = process.argv[1];
941
+ if (!entrypoint)
942
+ return void 0;
943
+ let dir = dirname(entrypoint);
944
+ while (dir !== dirname(dir)) {
945
+ if (existsSync(join2(dir, "package.json"))) {
946
+ return dir;
947
+ }
948
+ dir = dirname(dir);
949
+ }
950
+ return void 0;
951
+ }
952
+ __name(getEntrypointPackageDir, "getEntrypointPackageDir");
953
+ function isSelfUpdatePathWritable() {
954
+ const packageDir = getPackageDir();
955
+ try {
956
+ accessSync(packageDir, constants.W_OK);
957
+ accessSync(dirname(packageDir), constants.W_OK);
958
+ return true;
959
+ } catch {
960
+ return false;
961
+ }
962
+ }
963
+ __name(isSelfUpdatePathWritable, "isSelfUpdatePathWritable");
964
+ function isManagedByGlobalPackageManager(method, packageName, npmCommand) {
965
+ const packageDirs = [getPackageDir(), getEntrypointPackageDir()].filter((dir) => !!dir);
966
+ const packageDirCandidates = packageDirs.flatMap((dir) => getPathComparisonCandidates(dir));
967
+ return getGlobalPackageRoots(method, packageName, npmCommand).some((root) => {
968
+ return getPathComparisonCandidates(root).some((normalizedRoot) => {
969
+ const rootPrefix = normalizedRoot.endsWith(sep2) ? normalizedRoot : `${normalizedRoot}${sep2}`;
970
+ return packageDirCandidates.some((packageDir) => packageDir.startsWith(rootPrefix));
971
+ });
972
+ });
973
+ }
974
+ __name(isManagedByGlobalPackageManager, "isManagedByGlobalPackageManager");
975
+ function getSelfUpdateCommand(packageName, npmCommand, updatePackageTarget = packageName) {
976
+ const method = detectInstallMethod();
977
+ const command = getSelfUpdateCommandForMethod(method, packageName, updatePackageTarget, npmCommand);
978
+ if (!command || !isManagedByGlobalPackageManager(method, packageName, npmCommand) || !isSelfUpdatePathWritable()) {
979
+ return void 0;
980
+ }
981
+ return command;
982
+ }
983
+ __name(getSelfUpdateCommand, "getSelfUpdateCommand");
984
+ function getSelfUpdateUnavailableInstruction(packageName, npmCommand, updatePackageTarget = packageName) {
985
+ const method = detectInstallMethod();
986
+ const target = normalizeSelfUpdatePackageTarget(updatePackageTarget);
987
+ if (method === "bun-binary") {
988
+ return `Download from: https://github.com/earendil-works/pi/releases/latest`;
989
+ }
990
+ const command = getSelfUpdateCommandForMethod(method, packageName, target, npmCommand);
991
+ if (command) {
992
+ if (isManagedByGlobalPackageManager(method, packageName, npmCommand) && !isSelfUpdatePathWritable()) {
993
+ return `This installation is managed by a global ${method} install, but the install path is not writable. Update it yourself with: ${command.display}`;
994
+ }
995
+ return `This installation is not managed by a global ${method} install. Update it with the package manager, wrapper, or source checkout that provides it.`;
996
+ }
997
+ return `Update ${target.installSpec} using the package manager, wrapper, or source checkout that provides this installation.`;
998
+ }
999
+ __name(getSelfUpdateUnavailableInstruction, "getSelfUpdateUnavailableInstruction");
1000
+ function findNodePackageDir(startDir) {
1001
+ let dir = startDir;
1002
+ while (dir !== dirname(dir)) {
1003
+ if (existsSync(join2(dir, "package.json"))) {
1004
+ const parent = dirname(dir);
1005
+ if (basename(dir) === "dist" && existsSync(join2(parent, "package.json"))) {
1006
+ return parent;
1007
+ }
1008
+ return dir;
1009
+ }
1010
+ dir = dirname(dir);
1011
+ }
1012
+ return startDir;
1013
+ }
1014
+ __name(findNodePackageDir, "findNodePackageDir");
1015
+ function getPackageDir() {
1016
+ const envDir = process.env.PI_PACKAGE_DIR;
1017
+ if (envDir) {
1018
+ return normalizePath(envDir);
1019
+ }
1020
+ if (isBunBinary) {
1021
+ return dirname(process.execPath);
1022
+ }
1023
+ return findNodePackageDir(__dirname);
1024
+ }
1025
+ __name(getPackageDir, "getPackageDir");
1026
+ function getThemesDir() {
1027
+ if (isBunBinary) {
1028
+ return join2(getPackageDir(), "theme");
1029
+ }
1030
+ const packageDir = getPackageDir();
1031
+ const srcOrDist = existsSync(join2(packageDir, "src")) ? "src" : "dist";
1032
+ return join2(packageDir, srcOrDist, "modes", "interactive", "theme");
1033
+ }
1034
+ __name(getThemesDir, "getThemesDir");
1035
+ function getExportTemplateDir() {
1036
+ if (isBunBinary) {
1037
+ return join2(getPackageDir(), "export-html");
1038
+ }
1039
+ const packageDir = getPackageDir();
1040
+ const srcOrDist = existsSync(join2(packageDir, "src")) ? "src" : "dist";
1041
+ return join2(packageDir, srcOrDist, "core", "export-html");
1042
+ }
1043
+ __name(getExportTemplateDir, "getExportTemplateDir");
1044
+ function getPackageJsonPath() {
1045
+ return join2(getPackageDir(), "package.json");
1046
+ }
1047
+ __name(getPackageJsonPath, "getPackageJsonPath");
1048
+ function getReadmePath() {
1049
+ return resolve(join2(getPackageDir(), "README.md"));
1050
+ }
1051
+ __name(getReadmePath, "getReadmePath");
1052
+ function getDocsPath() {
1053
+ return resolve(join2(getPackageDir(), "docs"));
1054
+ }
1055
+ __name(getDocsPath, "getDocsPath");
1056
+ function getExamplesPath() {
1057
+ return resolve(join2(getPackageDir(), "examples"));
1058
+ }
1059
+ __name(getExamplesPath, "getExamplesPath");
1060
+ function getChangelogPath() {
1061
+ return resolve(join2(getPackageDir(), "CHANGELOG.md"));
1062
+ }
1063
+ __name(getChangelogPath, "getChangelogPath");
1064
+ function getInteractiveAssetsDir() {
1065
+ if (isBunBinary) {
1066
+ return join2(getPackageDir(), "assets");
1067
+ }
1068
+ const packageDir = getPackageDir();
1069
+ const srcOrDist = existsSync(join2(packageDir, "src")) ? "src" : "dist";
1070
+ return join2(packageDir, srcOrDist, "modes", "interactive", "assets");
1071
+ }
1072
+ __name(getInteractiveAssetsDir, "getInteractiveAssetsDir");
1073
+ function getBundledInteractiveAssetPath(name) {
1074
+ return join2(getInteractiveAssetsDir(), name);
1075
+ }
1076
+ __name(getBundledInteractiveAssetPath, "getBundledInteractiveAssetPath");
1077
+ var quickJSWasmPath;
1078
+ function getQuickJSWasmPath() {
1079
+ quickJSWasmPath ??= createRequire(__pvMetaUrl).resolve("quickjs-wasi/quickjs.wasm");
1080
+ return quickJSWasmPath;
1081
+ }
1082
+ __name(getQuickJSWasmPath, "getQuickJSWasmPath");
1083
+ function resolveCodemodeWorkerSpecifier(runtime, moduleUrl) {
1084
+ if (runtime === "bun-binary")
1085
+ return "./src/extensions/codemode/worker.ts";
1086
+ if (runtime === "bundled-node")
1087
+ return new URL("./codemode-worker.js", moduleUrl);
1088
+ return void 0;
1089
+ }
1090
+ __name(resolveCodemodeWorkerSpecifier, "resolveCodemodeWorkerSpecifier");
1091
+ var codemodeWorkerDataUrl;
1092
+ function getCodemodeWorkerSpecifier() {
1093
+ const runtime = isBunBinary ? "bun-binary" : isBundledNode ? "bundled-node" : "unbundled";
1094
+ const specifier = resolveCodemodeWorkerSpecifier(runtime, __pvMetaUrl);
1095
+ if (runtime !== "bundled-node" || !(specifier instanceof URL))
1096
+ return specifier;
1097
+ codemodeWorkerDataUrl ??= new URL(`data:text/javascript;base64,${readFileSync(specifier).toString("base64")}`);
1098
+ return codemodeWorkerDataUrl;
1099
+ }
1100
+ __name(getCodemodeWorkerSpecifier, "getCodemodeWorkerSpecifier");
1101
+ function detectInstallChange(packageJsonPath = startupPackageJsonPath) {
1102
+ if (isBunBinary || !packageJsonPath)
1103
+ return void 0;
1104
+ let installed;
1105
+ try {
1106
+ installed = JSON.parse(stripBom(readFileSync(packageJsonPath, "utf-8")));
1107
+ } catch (error) {
1108
+ return error.code === "ENOENT" ? { kind: "removed" } : void 0;
1109
+ }
1110
+ return installed.version && installed.version !== VERSION ? { kind: "updated", version: installed.version } : void 0;
1111
+ }
1112
+ __name(detectInstallChange, "detectInstallChange");
1113
+ var pkg = {};
1114
+ var startupPackageJsonPath;
1115
+ try {
1116
+ const packageJsonPath = getPackageJsonPath();
1117
+ pkg = JSON.parse(stripBom(readFileSync(packageJsonPath, "utf-8")));
1118
+ startupPackageJsonPath = packageJsonPath;
1119
+ } catch (e) {
1120
+ const err = e;
1121
+ if (err.code !== "ENOENT")
1122
+ throw e;
1123
+ }
1124
+ var piConfigName = pkg.piConfig?.name;
1125
+ var PACKAGE_NAME = pkg.name || "@earendil-works/pi-coding-agent";
1126
+ var APP_NAME = piConfigName || "pi";
1127
+ var APP_TITLE = piConfigName ? APP_NAME : "\u2693 Privateer";
1128
+ var CONFIG_DIR_NAME = pkg.piConfig?.configDir || ".pi";
1129
+ var VERSION = pkg.version || "0.0.0";
1130
+ var PROJECT_CONFIG_DIR_NAMES = [".privateer", CONFIG_DIR_NAME].filter((name, i, all) => all.indexOf(name) === i);
1131
+ function projectConfigDirCandidates(cwd) {
1132
+ return PROJECT_CONFIG_DIR_NAMES.map((name) => join2(cwd, name));
1133
+ }
1134
+ __name(projectConfigDirCandidates, "projectConfigDirCandidates");
1135
+ function projectConfigDirs(cwd) {
1136
+ return projectConfigDirCandidates(cwd).filter((dir) => existsSync(dir));
1137
+ }
1138
+ __name(projectConfigDirs, "projectConfigDirs");
1139
+ function projectConfigWriteDir(cwd) {
1140
+ return join2(cwd, PROJECT_CONFIG_DIR_NAMES[0]);
1141
+ }
1142
+ __name(projectConfigWriteDir, "projectConfigWriteDir");
1143
+ function findProjectConfigPath(cwd, ...rel) {
1144
+ for (const dir of projectConfigDirCandidates(cwd)) {
1145
+ const candidate = join2(dir, ...rel);
1146
+ if (existsSync(candidate))
1147
+ return candidate;
1148
+ }
1149
+ return void 0;
1150
+ }
1151
+ __name(findProjectConfigPath, "findProjectConfigPath");
1152
+ function resolveProjectConfigPath(cwd, ...rel) {
1153
+ return findProjectConfigPath(cwd, ...rel) ?? join2(projectConfigWriteDir(cwd), ...rel);
1154
+ }
1155
+ __name(resolveProjectConfigPath, "resolveProjectConfigPath");
1156
+ function formatProjectConfigDirNames() {
1157
+ return PROJECT_CONFIG_DIR_NAMES.map((n) => `${n}/`).join(" or ");
1158
+ }
1159
+ __name(formatProjectConfigDirNames, "formatProjectConfigDirNames");
1160
+ var ENV_AGENT_DIR = `${APP_NAME.toUpperCase()}_CODING_AGENT_DIR`;
1161
+ var ENV_SESSION_DIR = `${APP_NAME.toUpperCase()}_CODING_AGENT_SESSION_DIR`;
1162
+ function expandTildePath(path) {
1163
+ return normalizePath(path);
1164
+ }
1165
+ __name(expandTildePath, "expandTildePath");
1166
+ var DEFAULT_SHARE_VIEWER_URL = "https://pi.dev/session/";
1167
+ function getShareViewerUrl(gistId) {
1168
+ const baseUrl = process.env.PI_SHARE_VIEWER_URL || DEFAULT_SHARE_VIEWER_URL;
1169
+ return `${baseUrl}#${gistId}`;
1170
+ }
1171
+ __name(getShareViewerUrl, "getShareViewerUrl");
1172
+ function getAgentDir() {
1173
+ const envDir = process.env[ENV_AGENT_DIR];
1174
+ if (envDir) {
1175
+ return expandTildePath(envDir);
1176
+ }
1177
+ return join2(homedir2(), CONFIG_DIR_NAME, "agent");
1178
+ }
1179
+ __name(getAgentDir, "getAgentDir");
1180
+ function getCustomThemesDir() {
1181
+ return join2(getAgentDir(), "themes");
1182
+ }
1183
+ __name(getCustomThemesDir, "getCustomThemesDir");
1184
+ function getAuthPath() {
1185
+ return join2(getAgentDir(), "auth.json");
1186
+ }
1187
+ __name(getAuthPath, "getAuthPath");
1188
+ function getSettingsPath() {
1189
+ return join2(getAgentDir(), "settings.json");
1190
+ }
1191
+ __name(getSettingsPath, "getSettingsPath");
1192
+ function getBinDir() {
1193
+ return join2(getAgentDir(), "bin");
1194
+ }
1195
+ __name(getBinDir, "getBinDir");
1196
+ function getSessionsDir() {
1197
+ return join2(getAgentDir(), "sessions");
1198
+ }
1199
+ __name(getSessionsDir, "getSessionsDir");
1200
+ function getDebugLogPath() {
1201
+ return join2(getAgentDir(), `${APP_NAME}-debug.log`);
1202
+ }
1203
+ __name(getDebugLogPath, "getDebugLogPath");
1204
+
1205
+ export {
1206
+ require_cross_spawn,
1207
+ spawnProcess,
1208
+ spawnProcessSync,
1209
+ waitForChildProcess,
1210
+ canonicalizePath,
1211
+ getFileRevision,
1212
+ isLocalPath,
1213
+ normalizePath,
1214
+ resolvePath,
1215
+ getCwdRelativePath,
1216
+ formatPathRelativeToCwdOrAbsolute,
1217
+ markPathIgnoredByCloudSync,
1218
+ splitBom,
1219
+ stripBom,
1220
+ isBunBinary,
1221
+ isBundledNode,
1222
+ detectInstallMethod,
1223
+ getSelfUpdateCommand,
1224
+ getSelfUpdateUnavailableInstruction,
1225
+ getPackageDir,
1226
+ getThemesDir,
1227
+ getExportTemplateDir,
1228
+ getReadmePath,
1229
+ getDocsPath,
1230
+ getExamplesPath,
1231
+ getChangelogPath,
1232
+ getBundledInteractiveAssetPath,
1233
+ getQuickJSWasmPath,
1234
+ getCodemodeWorkerSpecifier,
1235
+ detectInstallChange,
1236
+ PACKAGE_NAME,
1237
+ APP_NAME,
1238
+ APP_TITLE,
1239
+ CONFIG_DIR_NAME,
1240
+ VERSION,
1241
+ PROJECT_CONFIG_DIR_NAMES,
1242
+ projectConfigDirCandidates,
1243
+ projectConfigDirs,
1244
+ projectConfigWriteDir,
1245
+ findProjectConfigPath,
1246
+ resolveProjectConfigPath,
1247
+ formatProjectConfigDirNames,
1248
+ ENV_AGENT_DIR,
1249
+ ENV_SESSION_DIR,
1250
+ expandTildePath,
1251
+ getShareViewerUrl,
1252
+ getAgentDir,
1253
+ getCustomThemesDir,
1254
+ getAuthPath,
1255
+ getSettingsPath,
1256
+ getBinDir,
1257
+ getSessionsDir,
1258
+ getDebugLogPath
1259
+ };