@madarco/agentbox 0.32.0 → 0.32.1

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/CHANGELOG.md +11 -0
  2. package/dist/{_cloud-attach-6RKS3MAP.js → _cloud-attach-UXH3VKTM.js} +8 -8
  3. package/dist/{chunk-X6CO4WIX.js → chunk-2W3W3KNR.js} +3 -3
  4. package/dist/{chunk-L4KBYI3I.js → chunk-5D46PE5V.js} +3 -3
  5. package/dist/{chunk-6XMOBI5V.js → chunk-5F5NBZG7.js} +2 -2
  6. package/dist/{chunk-XNZ6UHTM.js → chunk-65G5R2HW.js} +5 -5
  7. package/dist/{chunk-WLEGSKKE.js → chunk-6N7OSMEA.js} +3 -3
  8. package/dist/{chunk-TAZYSVLT.js → chunk-7PTM6JEX.js} +6 -6
  9. package/dist/{chunk-PE5LPD23.js → chunk-B3C6NQB7.js} +10 -4
  10. package/dist/chunk-B3C6NQB7.js.map +1 -0
  11. package/dist/{chunk-CXAWPWGZ.js → chunk-BJLUG6TE.js} +2 -2
  12. package/dist/{chunk-KOTW7QQW.js → chunk-BV2UZ4SG.js} +3 -3
  13. package/dist/{chunk-WTOG3CC6.js → chunk-EAT5IEWA.js} +2 -2
  14. package/dist/{chunk-XLJ4D4FI.js → chunk-GBEV7ETR.js} +2 -2
  15. package/dist/{chunk-RIXW4HSE.js → chunk-GLIWCNFE.js} +3 -3
  16. package/dist/{chunk-EDJ6O6CI.js → chunk-HCKRUAHW.js} +3 -3
  17. package/dist/{chunk-3L2DIPRM.js → chunk-HUVSTEJR.js} +2 -2
  18. package/dist/{chunk-GSMQL4IJ.js → chunk-IL7R2X6B.js} +12 -12
  19. package/dist/{chunk-5OKDSI6M.js → chunk-IQ4WLVXE.js} +21 -21
  20. package/dist/{chunk-MPTE57BZ.js → chunk-JL4EJ4EH.js} +4 -4
  21. package/dist/{chunk-7QTBRHB7.js → chunk-KTB7JGPA.js} +2 -2
  22. package/dist/{chunk-S7LPQXR5.js → chunk-LFBCFWG6.js} +4 -4
  23. package/dist/{chunk-CDRKQ5BH.js → chunk-NGCG3IBH.js} +8 -8
  24. package/dist/{chunk-2APGFWEU.js → chunk-NX27A3F2.js} +18 -18
  25. package/dist/{chunk-JWQYZ6V4.js → chunk-OUHDSEVQ.js} +2 -2
  26. package/dist/{chunk-YSACCMUB.js → chunk-QLZPJIWF.js} +7 -7
  27. package/dist/{chunk-MI3V2MAE.js → chunk-R3XDO4SN.js} +2 -2
  28. package/dist/{chunk-4FOXMGJ7.js → chunk-RF7Q7SHU.js} +2 -2
  29. package/dist/{chunk-ANSPBIYG.js → chunk-SAEZJZ5Z.js} +2 -2
  30. package/dist/{chunk-XTNAIM7X.js → chunk-U5MUWZOS.js} +4 -4
  31. package/dist/{chunk-27S7QLDF.js → chunk-ULQPPQ23.js} +2 -2
  32. package/dist/{chunk-AWI2TSWS.js → chunk-VWSERFTW.js} +2 -2
  33. package/dist/{chunk-MO3QJTVS.js → chunk-XFMCRD2J.js} +3 -3
  34. package/dist/{cli-ZGYSHJP7.js → cli-HFZMZWRM.js} +4 -4
  35. package/dist/{cli-IFXU5XNZ.js → cli-HPYDF5AP.js} +4 -4
  36. package/dist/{cli-RQJUQJEP.js → cli-PWK63DQI.js} +3 -3
  37. package/dist/{cli-MZSWFSTW.js → cli-RC5F6DYP.js} +4 -4
  38. package/dist/{cli-O3WXOFNS.js → cli-S7RGCNHG.js} +3 -3
  39. package/dist/cloud-backends.js +3 -3
  40. package/dist/{control-plane-3TII2JGM.js → control-plane-HRJRAYKV.js} +13 -13
  41. package/dist/{cp-hub-upload-3W7Z4BMT.js → cp-hub-upload-N4PPUZHE.js} +3 -3
  42. package/dist/{deploy-hetzner-EO5PFKBG.js → deploy-hetzner-A42GILM3.js} +5 -5
  43. package/dist/{dist-BFH537FO.js → dist-5OXP2N6H.js} +5 -5
  44. package/dist/{dist-V224SH3Z.js → dist-64QL2Q5L.js} +3 -3
  45. package/dist/{dist-3AR6L5MF.js → dist-D4LLY6JV.js} +4 -4
  46. package/dist/{dist-4GHNQ2AK.js → dist-GS36Y2CW.js} +3 -3
  47. package/dist/{dist-IABCQB5D.js → dist-HGUSK4LL.js} +4 -4
  48. package/dist/{dist-RPBA2EL5.js → dist-JU5COR7Y.js} +3 -3
  49. package/dist/{dist-JJZ3NZRO.js → dist-NJ2U42MZ.js} +2 -2
  50. package/dist/{dist-H2CSUDEI.js → dist-Z4S5EKUS.js} +4 -4
  51. package/dist/{host-reach-drainer-NYN3YXHG.js → host-reach-drainer-WIKLZSLZ.js} +2 -2
  52. package/dist/{hub-OWUC4IGW.js → hub-A6U3YB5D.js} +16 -16
  53. package/dist/{hub-adopt-HYXFUPPO.js → hub-adopt-O4LQLW6N.js} +3 -3
  54. package/dist/{hub-docker-target-6ODSK7ZE.js → hub-docker-target-D67UXZSU.js} +8 -8
  55. package/dist/index.js +49 -49
  56. package/dist/prepare-5Y7DWMZ7.js +45 -0
  57. package/dist/{prepared-custody-WSHX6XTQ.js → prepared-custody-L6PXXLD3.js} +14 -14
  58. package/dist/{publish-credentials-FCEQSIPE.js → publish-credentials-WJ4KLIMW.js} +4 -4
  59. package/dist/{registry-GG23NEBF.js → registry-6VF5VPGD.js} +3 -3
  60. package/dist/{relay-YUOIK3HN.js → relay-732OVYXR.js} +6 -6
  61. package/dist/{remote-docker-share-4Z4VVUPG.js → remote-docker-share-WY5U5USV.js} +5 -5
  62. package/dist/{tool-grant-push-A2JYLJVF.js → tool-grant-push-YQYYNMRQ.js} +3 -3
  63. package/package.json +1 -1
  64. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  65. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  66. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  67. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  68. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  69. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  70. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  71. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  72. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  73. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  74. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  75. package/runtime/hub/apps/hub/{chunk-G2AEPH7C.js → chunk-GGHXBTGL.js} +2 -2
  76. package/runtime/hub/apps/hub/{chunk-JX5JUFSR.js → chunk-LEELYQVR.js} +8 -8
  77. package/runtime/hub/apps/hub/{chunk-BR4WVGWJ.js → chunk-MQ7AJUJJ.js} +1 -1
  78. package/runtime/hub/apps/hub/{chunk-EVB2OTLU.js → chunk-OFJRKISZ.js} +9 -3
  79. package/runtime/hub/apps/hub/{dist-Y2263LMY.js → dist-DENRW6O5.js} +1 -1
  80. package/runtime/hub/apps/hub/{dist-XUNBQ4WM.js → dist-NQYEPZJY.js} +2 -2
  81. package/runtime/hub/apps/hub/{dist-GGLWLMY6.js → dist-RIXE6NHS.js} +3 -3
  82. package/runtime/hub/apps/hub/{dist-HLLYJGIT.js → dist-RK6SSH23.js} +3 -3
  83. package/runtime/hub/apps/hub/{dist-CJ6QFUFV.js → dist-U5SDGYOA.js} +2 -2
  84. package/runtime/hub/apps/hub/{dist-UFMCOK3W.js → dist-U6XVHUNU.js} +2 -2
  85. package/runtime/hub/apps/hub/{dist-YV4M6NJO.js → dist-W4YRUL6E.js} +2 -2
  86. package/runtime/hub/apps/hub/{dist-IIQU4I42.js → dist-Y3Q5YEOC.js} +2 -2
  87. package/runtime/hub/apps/hub/{hub-worker-LJYEEAJL.js → hub-worker-DVATYYST.js} +4 -4
  88. package/runtime/hub/apps/hub/server.js +10 -10
  89. package/dist/chunk-PE5LPD23.js.map +0 -1
  90. package/dist/prepare-MYFNDJPP.js +0 -45
  91. /package/dist/{_cloud-attach-6RKS3MAP.js.map → _cloud-attach-UXH3VKTM.js.map} +0 -0
  92. /package/dist/{chunk-X6CO4WIX.js.map → chunk-2W3W3KNR.js.map} +0 -0
  93. /package/dist/{chunk-L4KBYI3I.js.map → chunk-5D46PE5V.js.map} +0 -0
  94. /package/dist/{chunk-6XMOBI5V.js.map → chunk-5F5NBZG7.js.map} +0 -0
  95. /package/dist/{chunk-XNZ6UHTM.js.map → chunk-65G5R2HW.js.map} +0 -0
  96. /package/dist/{chunk-WLEGSKKE.js.map → chunk-6N7OSMEA.js.map} +0 -0
  97. /package/dist/{chunk-TAZYSVLT.js.map → chunk-7PTM6JEX.js.map} +0 -0
  98. /package/dist/{chunk-CXAWPWGZ.js.map → chunk-BJLUG6TE.js.map} +0 -0
  99. /package/dist/{chunk-KOTW7QQW.js.map → chunk-BV2UZ4SG.js.map} +0 -0
  100. /package/dist/{chunk-WTOG3CC6.js.map → chunk-EAT5IEWA.js.map} +0 -0
  101. /package/dist/{chunk-XLJ4D4FI.js.map → chunk-GBEV7ETR.js.map} +0 -0
  102. /package/dist/{chunk-RIXW4HSE.js.map → chunk-GLIWCNFE.js.map} +0 -0
  103. /package/dist/{chunk-EDJ6O6CI.js.map → chunk-HCKRUAHW.js.map} +0 -0
  104. /package/dist/{chunk-3L2DIPRM.js.map → chunk-HUVSTEJR.js.map} +0 -0
  105. /package/dist/{chunk-GSMQL4IJ.js.map → chunk-IL7R2X6B.js.map} +0 -0
  106. /package/dist/{chunk-5OKDSI6M.js.map → chunk-IQ4WLVXE.js.map} +0 -0
  107. /package/dist/{chunk-MPTE57BZ.js.map → chunk-JL4EJ4EH.js.map} +0 -0
  108. /package/dist/{chunk-7QTBRHB7.js.map → chunk-KTB7JGPA.js.map} +0 -0
  109. /package/dist/{chunk-S7LPQXR5.js.map → chunk-LFBCFWG6.js.map} +0 -0
  110. /package/dist/{chunk-CDRKQ5BH.js.map → chunk-NGCG3IBH.js.map} +0 -0
  111. /package/dist/{chunk-2APGFWEU.js.map → chunk-NX27A3F2.js.map} +0 -0
  112. /package/dist/{chunk-JWQYZ6V4.js.map → chunk-OUHDSEVQ.js.map} +0 -0
  113. /package/dist/{chunk-YSACCMUB.js.map → chunk-QLZPJIWF.js.map} +0 -0
  114. /package/dist/{chunk-MI3V2MAE.js.map → chunk-R3XDO4SN.js.map} +0 -0
  115. /package/dist/{chunk-4FOXMGJ7.js.map → chunk-RF7Q7SHU.js.map} +0 -0
  116. /package/dist/{chunk-ANSPBIYG.js.map → chunk-SAEZJZ5Z.js.map} +0 -0
  117. /package/dist/{chunk-XTNAIM7X.js.map → chunk-U5MUWZOS.js.map} +0 -0
  118. /package/dist/{chunk-27S7QLDF.js.map → chunk-ULQPPQ23.js.map} +0 -0
  119. /package/dist/{chunk-AWI2TSWS.js.map → chunk-VWSERFTW.js.map} +0 -0
  120. /package/dist/{chunk-MO3QJTVS.js.map → chunk-XFMCRD2J.js.map} +0 -0
  121. /package/dist/{cli-IFXU5XNZ.js.map → cli-HFZMZWRM.js.map} +0 -0
  122. /package/dist/{cli-MZSWFSTW.js.map → cli-HPYDF5AP.js.map} +0 -0
  123. /package/dist/{cli-O3WXOFNS.js.map → cli-PWK63DQI.js.map} +0 -0
  124. /package/dist/{cli-RQJUQJEP.js.map → cli-RC5F6DYP.js.map} +0 -0
  125. /package/dist/{cli-ZGYSHJP7.js.map → cli-S7RGCNHG.js.map} +0 -0
  126. /package/dist/{control-plane-3TII2JGM.js.map → control-plane-HRJRAYKV.js.map} +0 -0
  127. /package/dist/{cp-hub-upload-3W7Z4BMT.js.map → cp-hub-upload-N4PPUZHE.js.map} +0 -0
  128. /package/dist/{deploy-hetzner-EO5PFKBG.js.map → deploy-hetzner-A42GILM3.js.map} +0 -0
  129. /package/dist/{dist-3AR6L5MF.js.map → dist-5OXP2N6H.js.map} +0 -0
  130. /package/dist/{dist-BFH537FO.js.map → dist-64QL2Q5L.js.map} +0 -0
  131. /package/dist/{dist-H2CSUDEI.js.map → dist-D4LLY6JV.js.map} +0 -0
  132. /package/dist/{dist-4GHNQ2AK.js.map → dist-GS36Y2CW.js.map} +0 -0
  133. /package/dist/{dist-IABCQB5D.js.map → dist-HGUSK4LL.js.map} +0 -0
  134. /package/dist/{dist-RPBA2EL5.js.map → dist-JU5COR7Y.js.map} +0 -0
  135. /package/dist/{dist-JJZ3NZRO.js.map → dist-NJ2U42MZ.js.map} +0 -0
  136. /package/dist/{dist-V224SH3Z.js.map → dist-Z4S5EKUS.js.map} +0 -0
  137. /package/dist/{host-reach-drainer-NYN3YXHG.js.map → host-reach-drainer-WIKLZSLZ.js.map} +0 -0
  138. /package/dist/{hub-OWUC4IGW.js.map → hub-A6U3YB5D.js.map} +0 -0
  139. /package/dist/{hub-adopt-HYXFUPPO.js.map → hub-adopt-O4LQLW6N.js.map} +0 -0
  140. /package/dist/{hub-docker-target-6ODSK7ZE.js.map → hub-docker-target-D67UXZSU.js.map} +0 -0
  141. /package/dist/{prepare-MYFNDJPP.js.map → prepare-5Y7DWMZ7.js.map} +0 -0
  142. /package/dist/{prepared-custody-WSHX6XTQ.js.map → prepared-custody-L6PXXLD3.js.map} +0 -0
  143. /package/dist/{publish-credentials-FCEQSIPE.js.map → publish-credentials-WJ4KLIMW.js.map} +0 -0
  144. /package/dist/{registry-GG23NEBF.js.map → registry-6VF5VPGD.js.map} +0 -0
  145. /package/dist/{relay-YUOIK3HN.js.map → relay-732OVYXR.js.map} +0 -0
  146. /package/dist/{remote-docker-share-4Z4VVUPG.js.map → remote-docker-share-WY5U5USV.js.map} +0 -0
  147. /package/dist/{tool-grant-push-A2JYLJVF.js.map → tool-grant-push-YQYYNMRQ.js.map} +0 -0
  148. /package/runtime/hub/apps/hub/.next/static/{QDhlg7V_fEVGv_NfM2cEJ → psd9s1F7NglKqhj4_onRN}/_buildManifest.js +0 -0
  149. /package/runtime/hub/apps/hub/.next/static/{QDhlg7V_fEVGv_NfM2cEJ → psd9s1F7NglKqhj4_onRN}/_clientMiddlewareManifest.js +0 -0
  150. /package/runtime/hub/apps/hub/.next/static/{QDhlg7V_fEVGv_NfM2cEJ → psd9s1F7NglKqhj4_onRN}/_ssgManifest.js +0 -0
package/CHANGELOG.md CHANGED
@@ -9,6 +9,17 @@ Entries are generated from the commit history with `/release-notes` and then
9
9
  hand-reviewed — they describe what changed for someone using the `agentbox`
10
10
  CLI, not the raw commits.
11
11
 
12
+ ## [0.32.1] - 2026-09-17
13
+
14
+ ### Fixed
15
+
16
+ - **`install portless` no longer hands `~/.portless` to root.** The elevated
17
+ install never told Portless who you are, so the startup service it wrote took
18
+ ownership of `routes.json` and the proxy state files as `root:wheel` and later
19
+ `portless` commands failed. If you already hit this, run
20
+ `sudo chown -R "$USER" ~/.portless` once and re-run `agentbox install portless`
21
+ to rewrite the service.
22
+
12
23
  ## [0.32.0] - 2026-09-15
13
24
 
14
25
  ### Added
@@ -2,20 +2,20 @@
2
2
  import {
3
3
  cloudAgentAttach,
4
4
  cloudAgentStartDetached
5
- } from "./chunk-GSMQL4IJ.js";
6
- import "./chunk-XNZ6UHTM.js";
7
- import "./chunk-3L2DIPRM.js";
8
- import "./chunk-JWQYZ6V4.js";
5
+ } from "./chunk-IL7R2X6B.js";
6
+ import "./chunk-65G5R2HW.js";
7
+ import "./chunk-HUVSTEJR.js";
8
+ import "./chunk-OUHDSEVQ.js";
9
9
  import "./chunk-QBVRWGXD.js";
10
10
  import "./chunk-MB2K74BI.js";
11
11
  import {
12
12
  buildCloudAttachInnerCommand,
13
13
  verifyDetachedSession
14
- } from "./chunk-WTOG3CC6.js";
15
- import "./chunk-PE5LPD23.js";
14
+ } from "./chunk-EAT5IEWA.js";
15
+ import "./chunk-B3C6NQB7.js";
16
16
  import "./chunk-66GAYIJZ.js";
17
17
  import "./chunk-MNDKP4VS.js";
18
- import "./chunk-CDRKQ5BH.js";
18
+ import "./chunk-NGCG3IBH.js";
19
19
  import "./chunk-YNAJUTYC.js";
20
20
  import "./chunk-ZKOLV4ZN.js";
21
21
  import "./chunk-AWFTAHGF.js";
@@ -28,4 +28,4 @@ export {
28
28
  cloudAgentStartDetached,
29
29
  verifyDetachedSession
30
30
  };
31
- //# sourceMappingURL=_cloud-attach-6RKS3MAP.js.map
31
+ //# sourceMappingURL=_cloud-attach-UXH3VKTM.js.map
@@ -4,7 +4,7 @@ import {
4
4
  destroyControlPlaneOnHetzner,
5
5
  readHetznerCredStatus,
6
6
  updateControlPlaneOnHetzner
7
- } from "./chunk-KOTW7QQW.js";
7
+ } from "./chunk-BV2UZ4SG.js";
8
8
  import {
9
9
  controlPlaneDeployPath,
10
10
  syncAgentboxSshConfig
@@ -133,7 +133,7 @@ async function purgeLocalControlPlaneState(opts) {
133
133
  } catch {
134
134
  }
135
135
  try {
136
- const { removeHubDockerTarget } = await import("./hub-docker-target-6ODSK7ZE.js");
136
+ const { removeHubDockerTarget } = await import("./hub-docker-target-D67UXZSU.js");
137
137
  await removeHubDockerTarget(() => {
138
138
  });
139
139
  } catch {
@@ -150,4 +150,4 @@ export {
150
150
  runHetznerDestroy,
151
151
  purgeLocalControlPlaneState
152
152
  };
153
- //# sourceMappingURL=chunk-X6CO4WIX.js.map
153
+ //# sourceMappingURL=chunk-2W3W3KNR.js.map
@@ -13,12 +13,12 @@ import {
13
13
  renderInnerCommand,
14
14
  resolveCloudCheckpoint,
15
15
  writeCloudCheckpointManifest
16
- } from "./chunk-WTOG3CC6.js";
16
+ } from "./chunk-EAT5IEWA.js";
17
17
  import {
18
18
  detectPortless,
19
19
  portlessDoctorRow,
20
20
  portlessServiceStatus
21
- } from "./chunk-PE5LPD23.js";
21
+ } from "./chunk-B3C6NQB7.js";
22
22
  import {
23
23
  BUILD_CONTEXT_DIR,
24
24
  computeDockerContextFingerprint
@@ -1302,4 +1302,4 @@ export {
1302
1302
  remoteDockerProvider,
1303
1303
  providerModule
1304
1304
  };
1305
- //# sourceMappingURL=chunk-L4KBYI3I.js.map
1305
+ //# sourceMappingURL=chunk-5D46PE5V.js.map
@@ -6,7 +6,7 @@ import {
6
6
  createDockerSyncTransport,
7
7
  ensureVolume,
8
8
  volumeExists
9
- } from "./chunk-PE5LPD23.js";
9
+ } from "./chunk-B3C6NQB7.js";
10
10
  import {
11
11
  AgentInstallError,
12
12
  ensureAgentInstalled,
@@ -523,4 +523,4 @@ export {
523
523
  volumeHasCodexAuth,
524
524
  codexSessionInfo
525
525
  };
526
- //# sourceMappingURL=chunk-6XMOBI5V.js.map
526
+ //# sourceMappingURL=chunk-5F5NBZG7.js.map
@@ -51,7 +51,7 @@ function reportHubError(err, url) {
51
51
  process.exitCode = 1;
52
52
  }
53
53
  async function withHubClient(opts, fn) {
54
- const { resolveHubApiTarget } = await import("./control-plane-3TII2JGM.js");
54
+ const { resolveHubApiTarget } = await import("./control-plane-HRJRAYKV.js");
55
55
  const target = await resolveHubApiTarget(opts.url, { preferLocal: opts.preferLocal });
56
56
  if (!target) {
57
57
  process.exitCode = 1;
@@ -90,7 +90,7 @@ async function withHubClient(opts, fn) {
90
90
  }
91
91
  async function withHubClientQuiet(opts, fn) {
92
92
  try {
93
- const { resolveHubApiTarget } = await import("./control-plane-3TII2JGM.js");
93
+ const { resolveHubApiTarget } = await import("./control-plane-HRJRAYKV.js");
94
94
  const target = await resolveHubApiTarget(opts.url, {
95
95
  quiet: true,
96
96
  preferLocal: opts.preferLocal
@@ -114,7 +114,7 @@ function boxOwningHubIsLocal(box) {
114
114
  return p === "docker" || p === "remote-docker";
115
115
  }
116
116
  async function remoteHubHostFileRefusal(box, what) {
117
- const { resolveHubTarget } = await import("./hub-OWUC4IGW.js");
117
+ const { resolveHubTarget } = await import("./hub-A6U3YB5D.js");
118
118
  const target = await resolveHubTarget(void 0, { preferLocal: boxOwningHubIsLocal(box) });
119
119
  if (target.onThisMachine) return null;
120
120
  return `\`${what}\` reads files from the machine running the hub, and the hub that owns ${box.name} is the control box at ${target.url}. Pushing from here would upload ITS workspace, not yours.
@@ -142,7 +142,7 @@ async function runOpOnOtherHub(box, op, preferLocalOther) {
142
142
  let owner;
143
143
  let other;
144
144
  try {
145
- const { resolveHubApiTarget } = await import("./control-plane-3TII2JGM.js");
145
+ const { resolveHubApiTarget } = await import("./control-plane-HRJRAYKV.js");
146
146
  [owner, other] = await Promise.all([
147
147
  resolveHubApiTarget(void 0, { quiet: true, preferLocal: !preferLocalOther }),
148
148
  // Non-quiet so a stopped LOCAL retry hub is auto-started (it's a candidate owner).
@@ -181,4 +181,4 @@ export {
181
181
  withOwningHub,
182
182
  reportBoxNotOnAnyHub
183
183
  };
184
- //# sourceMappingURL=chunk-XNZ6UHTM.js.map
184
+ //# sourceMappingURL=chunk-65G5R2HW.js.map
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handleLifecycleError
4
- } from "./chunk-S7LPQXR5.js";
4
+ } from "./chunk-LFBCFWG6.js";
5
5
  import {
6
6
  ensureRelay,
7
7
  getRelayStatus,
8
8
  rehydrateRelayRegistry,
9
9
  stopRelay
10
- } from "./chunk-PE5LPD23.js";
10
+ } from "./chunk-B3C6NQB7.js";
11
11
  import {
12
12
  readState
13
13
  } from "./chunk-ZKOLV4ZN.js";
@@ -174,4 +174,4 @@ export {
174
174
  rehydrateFromState,
175
175
  relayCommand
176
176
  };
177
- //# sourceMappingURL=chunk-WLEGSKKE.js.map
177
+ //# sourceMappingURL=chunk-6N7OSMEA.js.map
@@ -9,7 +9,7 @@ import {
9
9
  resolveHubApiTarget,
10
10
  restoreTunnelIfExposed,
11
11
  stopTunnelIfExposed
12
- } from "./chunk-5OKDSI6M.js";
12
+ } from "./chunk-IQ4WLVXE.js";
13
13
  import {
14
14
  CustodyClient
15
15
  } from "./chunk-3ISG5THX.js";
@@ -17,7 +17,7 @@ import {
17
17
  HubBoxNotFoundError,
18
18
  adoptHubBox,
19
19
  pullBoxSshKeys
20
- } from "./chunk-7QTBRHB7.js";
20
+ } from "./chunk-KTB7JGPA.js";
21
21
  import {
22
22
  confirm,
23
23
  intro,
@@ -34,10 +34,10 @@ import {
34
34
  } from "./chunk-QNYGNHM2.js";
35
35
  import {
36
36
  rehydrateFromState
37
- } from "./chunk-WLEGSKKE.js";
37
+ } from "./chunk-6N7OSMEA.js";
38
38
  import {
39
39
  handleLifecycleError
40
- } from "./chunk-S7LPQXR5.js";
40
+ } from "./chunk-LFBCFWG6.js";
41
41
  import {
42
42
  detectPortless,
43
43
  ensurePortlessProxy,
@@ -50,7 +50,7 @@ import {
50
50
  portlessStartHint,
51
51
  resetPortlessCache,
52
52
  uninstallPortlessService
53
- } from "./chunk-PE5LPD23.js";
53
+ } from "./chunk-B3C6NQB7.js";
54
54
  import {
55
55
  controlPlaneDeployPath,
56
56
  ensureHub,
@@ -641,4 +641,4 @@ export {
641
641
  describeRemoteHubBuild,
642
642
  hubCommand
643
643
  };
644
- //# sourceMappingURL=chunk-TAZYSVLT.js.map
644
+ //# sourceMappingURL=chunk-7PTM6JEX.js.map
@@ -1153,7 +1153,7 @@ import { randomBytes } from "crypto";
1153
1153
  import { execa as execa8 } from "execa";
1154
1154
  import { existsSync as existsSync2 } from "fs";
1155
1155
  import { readFile as readFile22, stat as stat2 } from "fs/promises";
1156
- import { homedir as homedir3 } from "os";
1156
+ import { homedir as homedir3, userInfo } from "os";
1157
1157
  import { join as join5 } from "path";
1158
1158
  import { connect } from "net";
1159
1159
  import { execa as execa9 } from "execa";
@@ -3505,12 +3505,17 @@ function escapeForAppleScript(s) {
3505
3505
  function shellSingleQuote(s) {
3506
3506
  return `'${s.replace(/'/g, `'\\''`)}'`;
3507
3507
  }
3508
+ function sudoIdentityEnvPrefix(user = userInfo()) {
3509
+ if (user.uid <= 0 || !user.username || user.username === "root") return "";
3510
+ return `SUDO_USER=${shellSingleQuote(user.username)} SUDO_UID=${user.uid} SUDO_GID=${user.gid} `;
3511
+ }
3508
3512
  async function startPortlessProxyRoot() {
3509
3513
  const bin = await resolvePortlessBin();
3510
3514
  try {
3511
3515
  if (process.platform === "darwin") {
3512
3516
  const q = shellSingleQuote(bin);
3513
- const shellCmd = `${q} proxy start && ${q} trust`;
3517
+ const who = sudoIdentityEnvPrefix();
3518
+ const shellCmd = `${who}${q} proxy start && ${who}${q} trust`;
3514
3519
  const script = `do shell script "${escapeForAppleScript(shellCmd)}" with administrator privileges with prompt "AgentBox wants to start the Portless proxy on port 443."`;
3515
3520
  const r2 = await execa9("osascript", ["-e", script], { reject: false });
3516
3521
  if (r2.exitCode === 0) return "started";
@@ -3562,7 +3567,8 @@ async function installPortlessServiceDetailed() {
3562
3567
  if (process.platform === "darwin") {
3563
3568
  const q = shellSingleQuote(bin);
3564
3569
  const stopListeners = "for p in $(/usr/sbin/lsof -ti tcp:443 -sTCP:LISTEN); do /bin/ps -o command= -p $p | /usr/bin/grep -q portless && /bin/kill $p; done; sleep 1";
3565
- const shellCmd = `${stopListeners}; ${q} ${SUB_SERVICE_INSTALL.join(" ")} && ${q} trust`;
3570
+ const who = sudoIdentityEnvPrefix();
3571
+ const shellCmd = `${stopListeners}; ${who}${q} ${SUB_SERVICE_INSTALL.join(" ")} && ${who}${q} trust`;
3566
3572
  const script = `do shell script "${escapeForAppleScript(shellCmd)}" with administrator privileges with prompt "AgentBox wants to start the Portless proxy at login."`;
3567
3573
  const r2 = await execa9("osascript", ["-e", script], { reject: false });
3568
3574
  if (r2.exitCode === 0) return { result: "started" };
@@ -7150,4 +7156,4 @@ export {
7150
7156
  ensureBoxBrowser,
7151
7157
  ensureBoxBrowserShowingApp
7152
7158
  };
7153
- //# sourceMappingURL=chunk-PE5LPD23.js.map
7159
+ //# sourceMappingURL=chunk-B3C6NQB7.js.map