@madarco/agentbox 0.22.2 → 0.23.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 (179) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/{_cloud-attach-Y5WZ7F53.js → _cloud-attach-RFPLNACE.js} +4 -4
  3. package/dist/{chunk-BMCT3LBE.js → chunk-6OQENOJZ.js} +8 -8
  4. package/dist/{chunk-ES2DDCAC.js → chunk-CKC3CP7Y.js} +284 -154
  5. package/dist/chunk-CKC3CP7Y.js.map +1 -0
  6. package/dist/{chunk-AYNGC4Z5.js → chunk-ERMU7RMK.js} +43 -58
  7. package/dist/{chunk-AYNGC4Z5.js.map → chunk-ERMU7RMK.js.map} +1 -1
  8. package/dist/chunk-G3H2L3O2.js +0 -0
  9. package/dist/{chunk-3KAWXDQ4.js → chunk-JXDSSSXS.js} +3 -3
  10. package/dist/{chunk-S4OWE3UD.js → chunk-L5SOSNQI.js} +3 -3
  11. package/dist/{chunk-V2NCCC2B.js → chunk-Q626V2YX.js} +2 -2
  12. package/dist/{chunk-5DZTXHLQ.js → chunk-QGL734YX.js} +169 -52
  13. package/dist/chunk-QGL734YX.js.map +1 -0
  14. package/dist/chunk-QT3SHMLY.js +0 -0
  15. package/dist/{chunk-7HAGPF4X.js → chunk-QVWGQJV6.js} +2 -2
  16. package/dist/chunk-WJFZJZIM.js +0 -0
  17. package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
  18. package/dist/dist-2BTJQUJS.js +0 -0
  19. package/dist/{dist-SJRMFVRV.js → dist-GEHCZJCS.js} +5 -5
  20. package/dist/{dist-AN5NUXA5.js → dist-GJCIKH2C.js} +5 -5
  21. package/dist/{dist-FNAGMTUI.js → dist-JFUUDAI3.js} +17 -3
  22. package/dist/{dist-VOVN64Y2.js → dist-W5476E2U.js} +5 -5
  23. package/dist/{dist-K5GASNBV.js → dist-Z3GSHEFO.js} +7 -6
  24. package/dist/index.js +391 -215
  25. package/dist/index.js.map +1 -1
  26. package/dist/{prepared-state-5FIGV4BE-WPHOEDA6.js → prepared-state-LW2PKTEQ-5YMKG7UN.js} +2 -2
  27. package/package.json +28 -27
  28. package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
  29. package/runtime/_shared/agentbox-dockerd-start +0 -0
  30. package/runtime/_shared/agentbox-open +0 -0
  31. package/runtime/_shared/agentbox-portless-trust +0 -0
  32. package/runtime/_shared/agentbox-vnc-start +0 -0
  33. package/runtime/_shared/ctl.cjs +3 -1
  34. package/runtime/_shared/gh-shim +0 -0
  35. package/runtime/_shared/git-shim +0 -0
  36. package/runtime/_shared/linear-shim +0 -0
  37. package/runtime/_shared/ntn-shim +0 -0
  38. package/runtime/docker/Dockerfile.box +12 -0
  39. package/runtime/docker/packages/ctl/dist/bin.cjs +3 -1
  40. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
  41. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
  42. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
  43. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
  44. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +44 -0
  45. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
  46. package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
  47. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
  48. package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
  49. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
  50. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
  51. package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
  52. package/runtime/e2b/agentbox-dockerd-start +0 -0
  53. package/runtime/e2b/agentbox-open +0 -0
  54. package/runtime/e2b/agentbox-vnc-start +0 -0
  55. package/runtime/e2b/ctl.cjs +3 -1
  56. package/runtime/e2b/gh-shim +0 -0
  57. package/runtime/e2b/git-shim +0 -0
  58. package/runtime/e2b/linear-shim +0 -0
  59. package/runtime/e2b/ntn-shim +0 -0
  60. package/runtime/e2b/scripts/build-template.sh +0 -0
  61. package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
  62. package/runtime/hetzner/agentbox-dockerd-start +0 -0
  63. package/runtime/hetzner/agentbox-open +0 -0
  64. package/runtime/hetzner/agentbox-portless-trust +0 -0
  65. package/runtime/hetzner/agentbox-vnc-start +0 -0
  66. package/runtime/hetzner/ctl.cjs +3 -1
  67. package/runtime/hetzner/gh-shim +0 -0
  68. package/runtime/hetzner/git-shim +0 -0
  69. package/runtime/hetzner/linear-shim +0 -0
  70. package/runtime/hetzner/ntn-shim +0 -0
  71. package/runtime/hetzner/scripts/install-box.sh +0 -0
  72. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  73. package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +2 -0
  74. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  75. package/runtime/hub/apps/hub/.next/routes-manifest.json +14 -0
  76. package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
  77. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/app-paths-manifest.json +3 -0
  78. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/build-manifest.json +9 -0
  79. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/server-reference-manifest.json +4 -0
  80. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +9 -0
  81. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.map +5 -0
  82. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -0
  83. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route_client-reference-manifest.js +3 -0
  84. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/app-paths-manifest.json +3 -0
  85. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/build-manifest.json +9 -0
  86. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/server-reference-manifest.json +4 -0
  87. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js +8 -0
  88. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.map +5 -0
  89. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -0
  90. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route_client-reference-manifest.js +3 -0
  91. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  92. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  93. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  94. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  95. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  96. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  97. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  98. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  99. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  100. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  101. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  102. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  103. package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  104. package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +2 -0
  105. package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_open-targets_route_actions_1z-vd4m.js +3 -0
  106. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_open_route_actions_1agwl8h.js +3 -0
  107. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +1 -1
  108. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ql4fjo._.js +1 -1
  109. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vs8fma._.js +1 -1
  110. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w9ud8u._.js +1 -1
  111. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yhb0gc._.js +1 -1
  112. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-0flwc._.js +3 -0
  113. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1a50b07._.js +3 -0
  114. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bqbkd5._.js +2 -2
  115. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dn_3i1._.js +1 -1
  116. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hqla7-._.js +1 -1
  117. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1js2jdv._.js +1 -1
  118. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1nepkp-._.js +1 -1
  119. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q5bqse._.js +1 -1
  120. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +2 -2
  121. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thipug._.js +3 -0
  122. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9om6g._.js +1 -1
  123. package/runtime/hub/apps/hub/.next/server/chunks/_06f2faq._.js +1 -1
  124. package/runtime/hub/apps/hub/.next/server/chunks/_0f3molr._.js +3 -0
  125. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.js +1 -1
  126. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +1 -1
  127. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
  128. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +1 -1
  129. package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +2 -0
  130. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  131. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  132. package/runtime/hub/apps/hub/.next/static/chunks/1py5tlz57h7ra.js +1 -0
  133. package/runtime/hub/apps/hub/.next/static/chunks/{3y2c7woqhtx9s.js → 23fswvjrabu89.js} +1 -1
  134. package/runtime/hub/apps/hub/.next/static/chunks/3nedwutnzpdis.css +3 -0
  135. package/runtime/hub/apps/hub/.next/static/chunks/3p86ecqhr_7yy.js +1 -0
  136. package/runtime/hub/apps/hub/.next/static/chunks/3qof5hg87qf5n.js +1 -0
  137. package/runtime/hub/apps/hub/{chunk-673QOHSR.js → chunk-6HD4PARX.js} +9 -9
  138. package/runtime/hub/apps/hub/{chunk-7J6ZFTT4.js → chunk-JQFB2CNA.js} +132 -16
  139. package/runtime/hub/apps/hub/{chunk-5XQ3T3W2.js → chunk-K6RA5GJI.js} +231 -126
  140. package/runtime/hub/apps/hub/{dist-GCALYJN7.js → dist-3HR4RIPE.js} +17 -3
  141. package/runtime/hub/apps/hub/{dist-EI54M5DP.js → dist-7GNKBKFV.js} +29 -42
  142. package/runtime/hub/apps/hub/{dist-MOCUH2OC.js → dist-JWVTVHBT.js} +4 -4
  143. package/runtime/hub/apps/hub/{dist-LYTWBTUL.js → dist-OUNL2TCW.js} +4 -4
  144. package/runtime/hub/apps/hub/{dist-K7WHNDZB.js → dist-TOHA4OA5.js} +4 -4
  145. package/runtime/hub/apps/hub/{prepared-state-5FIGV4BE-D2HJEY2L.js → prepared-state-LW2PKTEQ-7BCXARGA.js} +1 -1
  146. package/runtime/hub/apps/hub/server.js +105 -24
  147. package/runtime/relay/bin.cjs +3 -1
  148. package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
  149. package/runtime/vercel/agentbox-dockerd-start +0 -0
  150. package/runtime/vercel/agentbox-open +0 -0
  151. package/runtime/vercel/agentbox-vnc-start +0 -0
  152. package/runtime/vercel/ctl.cjs +3 -1
  153. package/runtime/vercel/gh-shim +0 -0
  154. package/runtime/vercel/git-shim +0 -0
  155. package/runtime/vercel/linear-shim +0 -0
  156. package/runtime/vercel/ntn-shim +0 -0
  157. package/runtime/vercel/scripts/provision.sh +0 -0
  158. package/LICENSE +0 -21
  159. package/dist/chunk-5DZTXHLQ.js.map +0 -1
  160. package/dist/chunk-ES2DDCAC.js.map +0 -1
  161. package/runtime/hub/apps/hub/.next/static/chunks/0dx4alyqu7cq1.css +0 -3
  162. package/runtime/hub/apps/hub/.next/static/chunks/332lo0ac7l2wv.js +0 -1
  163. package/runtime/hub/apps/hub/.next/static/chunks/3gdqmzzl34ilu.js +0 -1
  164. package/runtime/hub/apps/hub/.next/static/chunks/44exu5uemf-ev.js +0 -1
  165. /package/dist/{_cloud-attach-Y5WZ7F53.js.map → _cloud-attach-RFPLNACE.js.map} +0 -0
  166. /package/dist/{chunk-BMCT3LBE.js.map → chunk-6OQENOJZ.js.map} +0 -0
  167. /package/dist/{chunk-3KAWXDQ4.js.map → chunk-JXDSSSXS.js.map} +0 -0
  168. /package/dist/{chunk-S4OWE3UD.js.map → chunk-L5SOSNQI.js.map} +0 -0
  169. /package/dist/{chunk-V2NCCC2B.js.map → chunk-Q626V2YX.js.map} +0 -0
  170. /package/dist/{chunk-7HAGPF4X.js.map → chunk-QVWGQJV6.js.map} +0 -0
  171. /package/dist/{dist-SJRMFVRV.js.map → dist-GEHCZJCS.js.map} +0 -0
  172. /package/dist/{dist-AN5NUXA5.js.map → dist-GJCIKH2C.js.map} +0 -0
  173. /package/dist/{dist-FNAGMTUI.js.map → dist-JFUUDAI3.js.map} +0 -0
  174. /package/dist/{dist-K5GASNBV.js.map → dist-W5476E2U.js.map} +0 -0
  175. /package/dist/{dist-VOVN64Y2.js.map → dist-Z3GSHEFO.js.map} +0 -0
  176. /package/dist/{prepared-state-5FIGV4BE-WPHOEDA6.js.map → prepared-state-LW2PKTEQ-5YMKG7UN.js.map} +0 -0
  177. /package/runtime/hub/apps/hub/.next/static/{zT1paOSXMJpAPsZ1dFK2V → 6WtaFwavHBpin3eT7-HjR}/_buildManifest.js +0 -0
  178. /package/runtime/hub/apps/hub/.next/static/{zT1paOSXMJpAPsZ1dFK2V → 6WtaFwavHBpin3eT7-HjR}/_clientMiddlewareManifest.js +0 -0
  179. /package/runtime/hub/apps/hub/.next/static/{zT1paOSXMJpAPsZ1dFK2V → 6WtaFwavHBpin3eT7-HjR}/_ssgManifest.js +0 -0
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  readE2bCredStatus,
6
6
  readPreparedState as readPreparedState3,
7
7
  secretsPath as secretsPath4
8
- } from "./chunk-V2NCCC2B.js";
8
+ } from "./chunk-Q626V2YX.js";
9
9
  import {
10
10
  ADVANCED_HINT_GROUPS,
11
11
  ALERT_BAND_ROWS,
@@ -49,7 +49,7 @@ import {
49
49
  subscribePrompts,
50
50
  uploadImageFileToBox,
51
51
  withFirewallRepair
52
- } from "./chunk-BMCT3LBE.js";
52
+ } from "./chunk-6OQENOJZ.js";
53
53
  import {
54
54
  daytonaBackend,
55
55
  ensureDaytonaCredentials,
@@ -57,7 +57,7 @@ import {
57
57
  readDaytonaCredStatus,
58
58
  readPreparedDaytonaState,
59
59
  secretsPath
60
- } from "./chunk-7HAGPF4X.js";
60
+ } from "./chunk-QVWGQJV6.js";
61
61
  import {
62
62
  deployControlPlaneToHetzner,
63
63
  detectEgressIp,
@@ -69,7 +69,7 @@ import {
69
69
  readPreparedState,
70
70
  secretsPath as secretsPath2,
71
71
  syncFirewallSource
72
- } from "./chunk-AYNGC4Z5.js";
72
+ } from "./chunk-ERMU7RMK.js";
73
73
  import {
74
74
  createGitDeployment,
75
75
  createGitProject,
@@ -88,7 +88,7 @@ import {
88
88
  resolveVercelApiAuth,
89
89
  secretsPath as secretsPath3,
90
90
  upsertProjectEnv
91
- } from "./chunk-3KAWXDQ4.js";
91
+ } from "./chunk-JXDSSSXS.js";
92
92
  import {
93
93
  agentSpecsForCloud,
94
94
  baseFreshnessFromFingerprints,
@@ -100,7 +100,7 @@ import {
100
100
  probeCloudCheckpoint,
101
101
  resolveCloudCheckpoint,
102
102
  seedAgentVolumesIfFresh
103
- } from "./chunk-S4OWE3UD.js";
103
+ } from "./chunk-L5SOSNQI.js";
104
104
  import {
105
105
  ALL_CONNECTORS,
106
106
  BOX_STATUS_EVENT,
@@ -202,6 +202,7 @@ import {
202
202
  readBoxStatus,
203
203
  readJob,
204
204
  rebuildPluginNativeDeps,
205
+ refreshBoxSshd,
205
206
  refreshExport,
206
207
  registerBoxWithRelay,
207
208
  rehydrateRelayRegistry,
@@ -247,7 +248,7 @@ import {
247
248
  waitForTmuxPaneContent,
248
249
  warmUpClaudeCredentials,
249
250
  writeJob
250
- } from "./chunk-5DZTXHLQ.js";
251
+ } from "./chunk-QGL734YX.js";
251
252
  import {
252
253
  BUILT_IN_DEFAULTS,
253
254
  CLOUD_PROVIDER_NAMES,
@@ -294,6 +295,8 @@ import {
294
295
  boxRestartService,
295
296
  boxRestartServices,
296
297
  boxServicesStatusRaw,
298
+ claudeSettingsPath,
299
+ claudeSshEntryFor,
297
300
  computeDockerContextFingerprint,
298
301
  ensureCloudSshAlias,
299
302
  ensureImage,
@@ -328,8 +331,9 @@ import {
328
331
  setBoxDisplayName,
329
332
  syncAgentboxSshConfig,
330
333
  toQueueKind,
331
- toSyncKind
332
- } from "./chunk-ES2DDCAC.js";
334
+ toSyncKind,
335
+ upsertClaudeSshConfig
336
+ } from "./chunk-CKC3CP7Y.js";
333
337
  import "./chunk-G3H2L3O2.js";
334
338
  import {
335
339
  __export,
@@ -337,8 +341,8 @@ import {
337
341
  } from "./chunk-WJFZJZIM.js";
338
342
 
339
343
  // src/version.ts
340
- var AGENTBOX_VERSION = true ? "0.22.2" : "0.0.0-dev";
341
- var AGENTBOX_COMMIT = true ? "ae2c7503b" : "dev";
344
+ var AGENTBOX_VERSION = true ? "0.23.0" : "0.0.0-dev";
345
+ var AGENTBOX_COMMIT = true ? "0a2aba48e" : "dev";
342
346
 
343
347
  // src/index.ts
344
348
  import { existsSync as _existsSync } from "fs";
@@ -3732,7 +3736,7 @@ async function renderDocker(status) {
3732
3736
  }
3733
3737
  async function daytonaStatus() {
3734
3738
  try {
3735
- const mod = await import("./dist-AN5NUXA5.js");
3739
+ const mod = await import("./dist-GJCIKH2C.js");
3736
3740
  return await mod.getDaytonaStatus();
3737
3741
  } catch (err) {
3738
3742
  return {
@@ -3743,7 +3747,7 @@ async function daytonaStatus() {
3743
3747
  }
3744
3748
  async function e2bStatus() {
3745
3749
  try {
3746
- const mod = await import("./dist-SJRMFVRV.js");
3750
+ const mod = await import("./dist-GEHCZJCS.js");
3747
3751
  const cred = mod.readE2bCredStatus();
3748
3752
  if (cred.auth === "none") {
3749
3753
  return { configured: false, reason: "not configured \u2014 run `agentbox e2b login`" };
@@ -7209,6 +7213,138 @@ var checkpointCommand = new Command9("checkpoint").alias("checkpoints").descript
7209
7213
  import { spawn as spawn4 } from "child_process";
7210
7214
  import { log as log18 } from "@clack/prompts";
7211
7215
  import { Command as Command10, InvalidArgumentError } from "commander";
7216
+
7217
+ // src/commands/_open-in.ts
7218
+ import { existsSync as realExistsSync } from "fs";
7219
+ import { homedir as realHomedir } from "os";
7220
+ import { delimiter, join as join19 } from "path";
7221
+ var OPEN_IN_APPS = [
7222
+ "claude",
7223
+ "codex",
7224
+ "herdr",
7225
+ "cmux",
7226
+ "vscode",
7227
+ "iterm2",
7228
+ "finder"
7229
+ ];
7230
+ var PERSISTENT_SSH_PROVIDERS = ["docker", "hetzner"];
7231
+ var IDE_PROVIDERS = ["docker", "hetzner", "daytona"];
7232
+ var SSH_MOUNT_PROVIDERS = ["docker", "hetzner", "daytona"];
7233
+ function realSeams() {
7234
+ return {
7235
+ env: process.env,
7236
+ platform: process.platform,
7237
+ homedir: realHomedir,
7238
+ existsSync: realExistsSync
7239
+ };
7240
+ }
7241
+ function pathHasBinary(name, seams) {
7242
+ const path = seams.env["PATH"] ?? "";
7243
+ for (const dir of path.split(delimiter)) {
7244
+ if (dir.length === 0) continue;
7245
+ if (seams.existsSync(join19(dir, name))) return true;
7246
+ }
7247
+ return false;
7248
+ }
7249
+ function macAppInstalled(appName, seams) {
7250
+ if (seams.platform !== "darwin") return false;
7251
+ return seams.existsSync(join19("/Applications", appName)) || seams.existsSync(join19(seams.homedir(), "Applications", appName));
7252
+ }
7253
+ function defaultHerdrSocketPath(seams = realSeams()) {
7254
+ const p = join19(seams.homedir(), ".config", "herdr", "herdr.sock");
7255
+ return seams.existsSync(p) ? p : void 0;
7256
+ }
7257
+ var CMUX_APP_CLI_SUFFIX = "cmux.app/Contents/Resources/bin/cmux";
7258
+ var VSCODE_APPS = [
7259
+ {
7260
+ flavor: "vscode",
7261
+ cli: "code",
7262
+ appName: "Visual Studio Code.app",
7263
+ bundleCliSuffix: "Contents/Resources/app/bin/code"
7264
+ },
7265
+ {
7266
+ flavor: "cursor",
7267
+ cli: "cursor",
7268
+ appName: "Cursor.app",
7269
+ bundleCliSuffix: "Contents/Resources/app/bin/cursor"
7270
+ }
7271
+ ];
7272
+ function resolveVscodeCli(cli, seams = realSeams()) {
7273
+ if (pathHasBinary(cli, seams)) return cli;
7274
+ if (seams.platform !== "darwin") return void 0;
7275
+ const app = VSCODE_APPS.find((a) => a.cli === cli);
7276
+ if (!app) return void 0;
7277
+ for (const root of ["/Applications", join19(seams.homedir(), "Applications")]) {
7278
+ const p = join19(root, app.appName, app.bundleCliSuffix);
7279
+ if (seams.existsSync(p)) return p;
7280
+ }
7281
+ return void 0;
7282
+ }
7283
+ function resolveCmuxBinary(seams = realSeams()) {
7284
+ const bundled = seams.env["CMUX_BUNDLED_CLI_PATH"];
7285
+ if (bundled && bundled.length > 0) return bundled;
7286
+ if (pathHasBinary("cmux", seams)) return "cmux";
7287
+ if (seams.platform === "darwin") {
7288
+ for (const root of ["/Applications", join19(seams.homedir(), "Applications")]) {
7289
+ const cli = join19(root, CMUX_APP_CLI_SUFFIX);
7290
+ if (seams.existsSync(cli)) return cli;
7291
+ }
7292
+ }
7293
+ return void 0;
7294
+ }
7295
+ function detectOpenTargets(seams = realSeams()) {
7296
+ return {
7297
+ claude: {
7298
+ // Claude desktop has no add-SSH deep link; `open --in claude` writes the
7299
+ // box into the app's own settings (sshConfigs) instead — same persistent
7300
+ // SSH requirement as codex, since the app connects on its own later.
7301
+ available: macAppInstalled("Claude.app", seams),
7302
+ providers: [...PERSISTENT_SSH_PROVIDERS]
7303
+ },
7304
+ codex: {
7305
+ available: macAppInstalled("Codex.app", seams),
7306
+ providers: [...PERSISTENT_SSH_PROVIDERS]
7307
+ },
7308
+ herdr: {
7309
+ available: pathHasBinary("herdr", seams) || defaultHerdrSocketPath(seams) !== void 0
7310
+ },
7311
+ cmux: {
7312
+ available: pathHasBinary("cmux", seams) || macAppInstalled("cmux.app", seams)
7313
+ },
7314
+ vscode: {
7315
+ // PATH shim OR the .app bundle — a freshly-dragged VS Code/Cursor has no
7316
+ // `code`/`cursor` on PATH until the user runs the "Install 'code' command"
7317
+ // step, but `agentbox open --in vscode` can launch it from the bundle.
7318
+ available: VSCODE_APPS.some(
7319
+ (a) => pathHasBinary(a.cli, seams) || macAppInstalled(a.appName, seams)
7320
+ ),
7321
+ providers: [...IDE_PROVIDERS]
7322
+ },
7323
+ iterm2: {
7324
+ available: macAppInstalled("iTerm.app", seams)
7325
+ },
7326
+ finder: {
7327
+ // The OS file-manager reveal always works (Finder on macOS, xdg-open
7328
+ // elsewhere); provider gating is what limits `open` to SSH-capable boxes.
7329
+ available: true,
7330
+ providers: [...SSH_MOUNT_PROVIDERS]
7331
+ }
7332
+ };
7333
+ }
7334
+ function codexAddUrl(alias) {
7335
+ return `codex://settings/connections/ssh/add?name=${encodeURIComponent(alias)}`;
7336
+ }
7337
+ function renderTargets(report) {
7338
+ const lines = OPEN_IN_APPS.map((app) => {
7339
+ const info = report[app];
7340
+ const status = info.available ? "available" : "not installed";
7341
+ const scope = info.providers ? ` (${info.providers.join(", ")} boxes)` : "";
7342
+ return `${app}: ${status}${info.available ? scope : ""}`;
7343
+ });
7344
+ return lines.join("\n") + "\n";
7345
+ }
7346
+
7347
+ // src/commands/code.ts
7212
7348
  function buildCodeCliOverrides(opts) {
7213
7349
  const code = {};
7214
7350
  if (opts.ide !== void 0) code.ide = opts.ide;
@@ -7365,21 +7501,26 @@ async function launchIde(folderUri, forced) {
7365
7501
  if (code !== null) return code;
7366
7502
  const cursor = await tryCli("cursor", folderUri);
7367
7503
  if (cursor !== null) return cursor;
7368
- log18.warn("neither `code` nor `cursor` found in PATH; falling back to `open vscode://...`");
7504
+ log18.warn("neither `code` nor `cursor` found on PATH or in /Applications; falling back to `open vscode://...`");
7369
7505
  return launchOne("vscode", folderUri);
7370
7506
  }
7371
7507
  async function tryCli(flavor, folderUri) {
7372
7508
  const profile = ideProfile(flavor);
7373
- const code = await spawnCommand(profile.cli, ["--folder-uri", folderUri]);
7509
+ const bin = resolveVscodeCli(profile.cli);
7510
+ if (!bin) return null;
7511
+ const code = await spawnCommand(bin, ["--folder-uri", folderUri]);
7374
7512
  if (code === 127) return null;
7375
7513
  return { code, flavor, via: "cli" };
7376
7514
  }
7377
7515
  async function launchOne(flavor, folderUri) {
7378
7516
  const profile = ideProfile(flavor);
7379
- const cliCode = await spawnCommand(profile.cli, ["--folder-uri", folderUri]);
7380
- if (cliCode !== 127) return { code: cliCode, flavor, via: "cli" };
7517
+ const bin = resolveVscodeCli(profile.cli);
7518
+ if (bin) {
7519
+ const cliCode = await spawnCommand(bin, ["--folder-uri", folderUri]);
7520
+ if (cliCode !== 127) return { code: cliCode, flavor, via: "cli" };
7521
+ }
7381
7522
  log18.warn(
7382
- `\`${profile.cli}\` not found in PATH; falling back to \`${hostOpenCommand()} ${profile.protocolScheme}://...\` (the %2B URL-encoding bug may break attach)`
7523
+ `\`${profile.cli}\` not found on PATH or in /Applications; falling back to \`${hostOpenCommand()} ${profile.protocolScheme}://...\` (the %2B URL-encoding bug may break attach)`
7383
7524
  );
7384
7525
  const url = `${profile.protocolScheme}://${folderUri.replace(/^vscode-remote:\/\//, "vscode-remote/")}`;
7385
7526
  const fallback = await spawnCommand(hostOpenCommand(), [url]);
@@ -8204,7 +8345,7 @@ var createCommand = new Command13("create").description(
8204
8345
  }
8205
8346
  outro7("done");
8206
8347
  if (attachClaudeAfter) {
8207
- const { cloudAgentAttach: cloudAgentAttach2 } = await import("./_cloud-attach-Y5WZ7F53.js");
8348
+ const { cloudAgentAttach: cloudAgentAttach2 } = await import("./_cloud-attach-RFPLNACE.js");
8208
8349
  await cloudAgentAttach2({
8209
8350
  box: result.record,
8210
8351
  binary: "claude",
@@ -11377,7 +11518,7 @@ import { log as log34 } from "@clack/prompts";
11377
11518
  import { Command as Command28 } from "commander";
11378
11519
  import { existsSync as existsSync10, readdirSync as readdirSync3, statSync as statSync2 } from "fs";
11379
11520
  import { homedir as homedir15 } from "os";
11380
- import { join as join19 } from "path";
11521
+ import { join as join20 } from "path";
11381
11522
  var FORK_AGENTS = ["claude", "codex", "opencode"];
11382
11523
  var FORK_PROVIDERS = PROVIDER_NAMES;
11383
11524
  function resolveForkProvider(positional, flag) {
@@ -11417,12 +11558,12 @@ function resolveSessionArgs(agent, opts) {
11417
11558
  }
11418
11559
  if (opts.session) return ["--resume", opts.session];
11419
11560
  if (agent === "codex") return ["--continue"];
11420
- const dir = join19(homedir15(), ".claude", "projects", encodeClaudeProjectsDir(opts.workspace));
11561
+ const dir = join20(homedir15(), ".claude", "projects", encodeClaudeProjectsDir(opts.workspace));
11421
11562
  if (!existsSync10(dir)) return ["--continue"];
11422
11563
  const now = Date.now();
11423
11564
  const recent = readdirSync3(dir).filter((f) => f.endsWith(".jsonl")).map((f) => {
11424
11565
  try {
11425
- return statSync2(join19(dir, f)).mtimeMs;
11566
+ return statSync2(join20(dir, f)).mtimeMs;
11426
11567
  } catch {
11427
11568
  return 0;
11428
11569
  }
@@ -11508,13 +11649,13 @@ var forkCommand = new Command28("fork").description(
11508
11649
  if (agent === "claude") {
11509
11650
  const envId = (process.env.CLAUDE_CODE_SESSION_ID ?? process.env.CLAUDE_SESSION_ID ?? "").trim();
11510
11651
  if (envId) {
11511
- const dir = join19(
11652
+ const dir = join20(
11512
11653
  homedir15(),
11513
11654
  ".claude",
11514
11655
  "projects",
11515
11656
  encodeClaudeProjectsDir(opts.workspace)
11516
11657
  );
11517
- if (existsSync10(join19(dir, `${envId}.jsonl`))) opts.session = envId;
11658
+ if (existsSync10(join20(dir, `${envId}.jsonl`))) opts.session = envId;
11518
11659
  }
11519
11660
  } else if (agent === "codex") {
11520
11661
  const envId = (process.env.CODEX_THREAD_ID ?? "").trim();
@@ -11550,7 +11691,7 @@ var forkCommand = new Command28("fork").description(
11550
11691
  import { Command as Command32 } from "commander";
11551
11692
  import { execa as execa8 } from "execa";
11552
11693
  import {
11553
- existsSync as existsSync17,
11694
+ existsSync as existsSync18,
11554
11695
  lstatSync,
11555
11696
  mkdirSync as mkdirSync12,
11556
11697
  readFileSync as readFileSync10,
@@ -11559,11 +11700,11 @@ import {
11559
11700
  writeFileSync as writeFileSync12
11560
11701
  } from "fs";
11561
11702
  import { homedir as homedir22 } from "os";
11562
- import { dirname as dirname8, join as join27, resolve as resolve5 } from "path";
11703
+ import { dirname as dirname8, join as join28, resolve as resolve5 } from "path";
11563
11704
 
11564
11705
  // src/lib/source-checkout.ts
11565
11706
  import { existsSync as existsSync11 } from "fs";
11566
- import { dirname as dirname2, join as join20, resolve as resolve4, sep } from "path";
11707
+ import { dirname as dirname2, join as join21, resolve as resolve4, sep } from "path";
11567
11708
  import { fileURLToPath } from "url";
11568
11709
  function resolveHostSkillsDir() {
11569
11710
  const here = dirname2(fileURLToPath(import.meta.url));
@@ -11589,15 +11730,15 @@ function resolveDevRepoRoot() {
11589
11730
  }
11590
11731
  if (!isSourceCheckout(hostSkillsDir)) return null;
11591
11732
  const root = resolve4(hostSkillsDir, "..", "..", "..", "..");
11592
- const hasMarketplace = existsSync11(join20(root, ".agents", "plugins", "marketplace.json"));
11593
- const hasPlugin = existsSync11(join20(root, "plugins", "agentbox"));
11733
+ const hasMarketplace = existsSync11(join21(root, ".agents", "plugins", "marketplace.json"));
11734
+ const hasPlugin = existsSync11(join21(root, "plugins", "agentbox"));
11594
11735
  return hasMarketplace && hasPlugin ? root : null;
11595
11736
  }
11596
11737
 
11597
11738
  // src/lib/doctor-checks.ts
11598
- import { accessSync, constants as fsConstants, mkdirSync as mkdirSync6 } from "fs";
11739
+ import { accessSync, constants as fsConstants, existsSync as existsSync12, mkdirSync as mkdirSync6 } from "fs";
11599
11740
  import { homedir as homedir16 } from "os";
11600
- import { join as join21 } from "path";
11741
+ import { join as join22 } from "path";
11601
11742
  import { execa as execa7 } from "execa";
11602
11743
  var NODE_MIN_MAJOR = 20;
11603
11744
  var NODE_MIN_MINOR = 10;
@@ -11637,7 +11778,7 @@ function checkPlatform() {
11637
11778
  };
11638
11779
  }
11639
11780
  function checkAgentboxHome() {
11640
- const dir = join21(homedir16(), ".agentbox");
11781
+ const dir = join22(homedir16(), ".agentbox");
11641
11782
  try {
11642
11783
  mkdirSync6(dir, { recursive: true });
11643
11784
  accessSync(dir, fsConstants.W_OK);
@@ -11669,9 +11810,32 @@ async function checkSsh() {
11669
11810
  hint: "install ssh \u2014 required for hetzner and cloud attach"
11670
11811
  };
11671
11812
  }
11813
+ async function onPath(bin) {
11814
+ const r = await execa7("which", [bin], { reject: false });
11815
+ if (r.exitCode !== 0) return null;
11816
+ const p = (r.stdout ?? "").trim();
11817
+ return p.length > 0 ? p : null;
11818
+ }
11819
+ async function checkSshfs() {
11820
+ const path = await onPath("sshfs");
11821
+ if (path) return { label: "sshfs", status: "ok", detail: path };
11822
+ const hint = process.platform === "darwin" ? "optional: `brew install macfuse sshfs` \u2014 needed for `agentbox open` (sshfs mount)" : "optional: install sshfs (e.g. `apt install sshfs`) \u2014 needed for `agentbox open` (sshfs mount)";
11823
+ return { label: "sshfs", status: "warn", detail: "not found", hint };
11824
+ }
11825
+ function checkMacfuse() {
11826
+ const present = existsSync12("/Library/Filesystems/macfuse.fs") || existsSync12("/Library/Filesystems/osxfuse.fs");
11827
+ return present ? { label: "macfuse", status: "ok", detail: "/Library/Filesystems/macfuse.fs" } : {
11828
+ label: "macfuse",
11829
+ status: "warn",
11830
+ detail: "not installed",
11831
+ hint: "optional: `brew install macfuse` \u2014 the FUSE backend `agentbox open` mounts through"
11832
+ };
11833
+ }
11672
11834
  async function runSystemChecks() {
11673
- const [git, ssh] = await Promise.all([checkGit(), checkSsh()]);
11674
- return [checkNode(), checkPlatform(), checkAgentboxHome(), git, ssh];
11835
+ const [git, ssh, sshfs] = await Promise.all([checkGit(), checkSsh(), checkSshfs()]);
11836
+ const results = [checkNode(), checkPlatform(), checkAgentboxHome(), git, ssh, sshfs];
11837
+ if (process.platform === "darwin") results.push(checkMacfuse());
11838
+ return results;
11675
11839
  }
11676
11840
  var INTEGRATION_PROBE_TIMEOUT_MS = 1e4;
11677
11841
  async function probeIntegrationBin(bin, args) {
@@ -11891,15 +12055,15 @@ function formatDetailed(groups) {
11891
12055
  }
11892
12056
 
11893
12057
  // src/lib/first-run.ts
11894
- import { existsSync as existsSync12, mkdirSync as mkdirSync7, writeFileSync as writeFileSync7 } from "fs";
12058
+ import { existsSync as existsSync13, mkdirSync as mkdirSync7, writeFileSync as writeFileSync7 } from "fs";
11895
12059
  import { homedir as homedir17 } from "os";
11896
- import { dirname as dirname3, join as join22 } from "path";
12060
+ import { dirname as dirname3, join as join23 } from "path";
11897
12061
  var MARKER_VERSION = 1;
11898
12062
  function setupMarkerPath() {
11899
- return join22(homedir17(), ".agentbox", "setup-complete.json");
12063
+ return join23(homedir17(), ".agentbox", "setup-complete.json");
11900
12064
  }
11901
12065
  function isFirstRun() {
11902
- return !existsSync12(setupMarkerPath());
12066
+ return !existsSync13(setupMarkerPath());
11903
12067
  }
11904
12068
  function markSetupComplete(provider) {
11905
12069
  const path = setupMarkerPath();
@@ -11914,19 +12078,19 @@ function markSetupComplete(provider) {
11914
12078
 
11915
12079
  // src/lib/star-prompt.ts
11916
12080
  import { spawnSync as spawnSync3 } from "child_process";
11917
- import { existsSync as existsSync13, mkdirSync as mkdirSync8, readFileSync as readFileSync6, writeFileSync as writeFileSync8 } from "fs";
12081
+ import { existsSync as existsSync14, mkdirSync as mkdirSync8, readFileSync as readFileSync6, writeFileSync as writeFileSync8 } from "fs";
11918
12082
  import { homedir as homedir18 } from "os";
11919
- import { dirname as dirname4, join as join23 } from "path";
12083
+ import { dirname as dirname4, join as join24 } from "path";
11920
12084
  var STATE_VERSION2 = 1;
11921
12085
  var REPO = "madarco/agentbox";
11922
12086
  var REPO_URL = `https://github.com/${REPO}`;
11923
12087
  var DEFAULT_STATE = { version: STATE_VERSION2, installCount: 0, starred: false };
11924
12088
  function starStatePath() {
11925
- return join23(homedir18(), ".agentbox", "star-prompt.json");
12089
+ return join24(homedir18(), ".agentbox", "star-prompt.json");
11926
12090
  }
11927
12091
  function readStarState() {
11928
12092
  const path = starStatePath();
11929
- if (!existsSync13(path)) return { ...DEFAULT_STATE };
12093
+ if (!existsSync14(path)) return { ...DEFAULT_STATE };
11930
12094
  try {
11931
12095
  const parsed = JSON.parse(readFileSync6(path, "utf8"));
11932
12096
  return {
@@ -11989,14 +12153,14 @@ async function maybePromptStar(opts) {
11989
12153
  // src/commands/install-cmux.ts
11990
12154
  import { intro as intro9, log as log36, note as note3, outro as outro8 } from "@clack/prompts";
11991
12155
  import { Command as Command29 } from "commander";
11992
- import { existsSync as existsSync14, mkdirSync as mkdirSync9, readFileSync as readFileSync7, renameSync as renameSync3, writeFileSync as writeFileSync9 } from "fs";
12156
+ import { existsSync as existsSync15, mkdirSync as mkdirSync9, readFileSync as readFileSync7, renameSync as renameSync3, writeFileSync as writeFileSync9 } from "fs";
11993
12157
  import { homedir as homedir19 } from "os";
11994
- import { dirname as dirname5, join as join24 } from "path";
12158
+ import { dirname as dirname5, join as join25 } from "path";
11995
12159
  var CONTROL_ID = "agentbox";
11996
12160
  function cmuxDockPath(env = process.env) {
11997
12161
  const xdg = env["XDG_CONFIG_HOME"];
11998
- const base = xdg && xdg.length > 0 ? xdg : join24(homedir19(), ".config");
11999
- return join24(base, "cmux", "dock.json");
12162
+ const base = xdg && xdg.length > 0 ? xdg : join25(homedir19(), ".config");
12163
+ return join25(base, "cmux", "dock.json");
12000
12164
  }
12001
12165
  function upsertAgentboxControl(doc, opts) {
12002
12166
  const controls = Array.isArray(doc.controls) ? doc.controls : [];
@@ -12026,7 +12190,7 @@ var installCmuxCommand = new Command29("cmux").description(
12026
12190
  height: parseHeight(opts.height)
12027
12191
  };
12028
12192
  let doc = { controls: [] };
12029
- if (existsSync14(dockPath)) {
12193
+ if (existsSync15(dockPath)) {
12030
12194
  const raw = readFileSync7(dockPath, "utf8");
12031
12195
  try {
12032
12196
  const parsed = JSON.parse(raw);
@@ -12073,20 +12237,20 @@ To see it:
12073
12237
  import { intro as intro10, log as log37, note as note4, outro as outro9 } from "@clack/prompts";
12074
12238
  import { Command as Command30, Option } from "commander";
12075
12239
  import { spawnSync as spawnSync4 } from "child_process";
12076
- import { chmodSync, existsSync as existsSync15, mkdirSync as mkdirSync10, readFileSync as readFileSync8, writeFileSync as writeFileSync10 } from "fs";
12240
+ import { chmodSync, existsSync as existsSync16, mkdirSync as mkdirSync10, readFileSync as readFileSync8, writeFileSync as writeFileSync10 } from "fs";
12077
12241
  import { homedir as homedir20 } from "os";
12078
- import { dirname as dirname6, join as join25 } from "path";
12242
+ import { dirname as dirname6, join as join26 } from "path";
12079
12243
  var PLUGIN_VERSION = "0.2.0";
12080
12244
  function herdrPluginDir(env = process.env) {
12081
- const home = env["AGENTBOX_HOME"] ?? join25(homedir20(), ".agentbox");
12082
- return join25(home, "herdr", "plugin");
12245
+ const home = env["AGENTBOX_HOME"] ?? join26(homedir20(), ".agentbox");
12246
+ return join26(home, "herdr", "plugin");
12083
12247
  }
12084
12248
  function herdrConfigPath(env = process.env) {
12085
12249
  const override = env["HERDR_CONFIG_PATH"];
12086
12250
  if (override && override.length > 0) return override;
12087
12251
  const xdg = env["XDG_CONFIG_HOME"];
12088
- const base = xdg && xdg.length > 0 ? xdg : join25(homedir20(), ".config");
12089
- return join25(base, "herdr", "config.toml");
12252
+ const base = xdg && xdg.length > 0 ? xdg : join26(homedir20(), ".config");
12253
+ return join26(base, "herdr", "config.toml");
12090
12254
  }
12091
12255
  function herdrBinary(env = process.env) {
12092
12256
  const b = env["HERDR_BIN_PATH"];
@@ -12202,13 +12366,13 @@ function escapeRe(s) {
12202
12366
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
12203
12367
  }
12204
12368
  function writeShim(dir) {
12205
- const p = join25(dir, "agentbox-shim.sh");
12369
+ const p = join26(dir, "agentbox-shim.sh");
12206
12370
  writeFileSync10(p, herdrShimContent(process.execPath, process.argv[1] ?? "agentbox"));
12207
12371
  chmodSync(p, 493);
12208
12372
  }
12209
12373
  function applyKeybindings() {
12210
12374
  const cfg = herdrConfigPath();
12211
- const existing = existsSync15(cfg) ? readFileSync8(cfg, "utf8") : "";
12375
+ const existing = existsSync16(cfg) ? readFileSync8(cfg, "utf8") : "";
12212
12376
  mkdirSync10(dirname6(cfg), { recursive: true });
12213
12377
  writeFileSync10(cfg, upsertHerdrKeybindings(existing, herdrKeybindingsBlock()));
12214
12378
  spawnSync4(herdrBinary(), ["server", "reload-config"], { stdio: "ignore" });
@@ -12227,18 +12391,18 @@ var installHerdrCommand = new Command30("herdr").description(
12227
12391
  return;
12228
12392
  }
12229
12393
  const dir = herdrPluginDir();
12230
- const file = join25(dir, "herdr-plugin.toml");
12394
+ const file = join26(dir, "herdr-plugin.toml");
12231
12395
  const cfgPath = herdrConfigPath();
12232
12396
  if (opts.dryRun) {
12233
12397
  intro10("agentbox install herdr (dry run)");
12234
12398
  process.stdout.write(`# --- ${file} ---
12235
12399
  ${buildHerdrManifest()}
12236
12400
  `);
12237
- process.stdout.write(`# --- ${join25(dir, "build.sh")} ---
12401
+ process.stdout.write(`# --- ${join26(dir, "build.sh")} ---
12238
12402
  ${herdrBuildScript()}
12239
12403
  `);
12240
12404
  process.stdout.write(
12241
- `# --- ${join25(dir, "agentbox-shim.sh")} ---
12405
+ `# --- ${join26(dir, "agentbox-shim.sh")} ---
12242
12406
  ${herdrShimContent(process.execPath, process.argv[1] ?? "agentbox")}
12243
12407
  `
12244
12408
  );
@@ -12250,7 +12414,7 @@ ${herdrKeybindingsBlock()}
12250
12414
  }
12251
12415
  mkdirSync10(dir, { recursive: true });
12252
12416
  writeFileSync10(file, buildHerdrManifest());
12253
- const buildPath = join25(dir, "build.sh");
12417
+ const buildPath = join26(dir, "build.sh");
12254
12418
  writeFileSync10(buildPath, herdrBuildScript());
12255
12419
  chmodSync(buildPath, 493);
12256
12420
  writeShim(dir);
@@ -12284,7 +12448,7 @@ Added shortcuts to ${cfg}
12284
12448
  import { Command as Command31 } from "commander";
12285
12449
  import { spawnSync as spawnSync5 } from "child_process";
12286
12450
  import {
12287
- existsSync as existsSync16,
12451
+ existsSync as existsSync17,
12288
12452
  mkdirSync as mkdirSync11,
12289
12453
  readFileSync as readFileSync9,
12290
12454
  readdirSync as readdirSync4,
@@ -12293,43 +12457,43 @@ import {
12293
12457
  writeFileSync as writeFileSync11
12294
12458
  } from "fs";
12295
12459
  import { homedir as homedir21 } from "os";
12296
- import { dirname as dirname7, join as join26 } from "path";
12460
+ import { dirname as dirname7, join as join27 } from "path";
12297
12461
  import { parse as parseToml } from "smol-toml";
12298
12462
  var MARKETPLACE_SOURCE = "madarco/agentbox";
12299
12463
  var MARKETPLACE_NAME = "agentbox";
12300
12464
  var PLUGIN_NAME = "agentbox";
12301
12465
  var PLUGIN_ID = `${PLUGIN_NAME}@${MARKETPLACE_NAME}`;
12302
- var PLUGIN_BUNDLE_REL = join26("plugins", "agentbox");
12466
+ var PLUGIN_BUNDLE_REL = join27("plugins", "agentbox");
12303
12467
  function marketplaceSource(opts = {}) {
12304
12468
  const devRoot = opts.noDev ? null : resolveDevRepoRoot();
12305
12469
  return { source: devRoot ?? MARKETPLACE_SOURCE, devRoot };
12306
12470
  }
12307
12471
  function symlinkStagedSkills(devRoot, env = process.env) {
12308
12472
  try {
12309
- const pluginRoot = join26(codexHomeDir(env), "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME);
12310
- const bundle = join26(devRoot, PLUGIN_BUNDLE_REL);
12473
+ const pluginRoot = join27(codexHomeDir(env), "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME);
12474
+ const bundle = join27(devRoot, PLUGIN_BUNDLE_REL);
12311
12475
  let versionDir;
12312
12476
  try {
12313
12477
  const manifest = JSON.parse(
12314
- readFileSync9(join26(bundle, ".codex-plugin", "plugin.json"), "utf8")
12478
+ readFileSync9(join27(bundle, ".codex-plugin", "plugin.json"), "utf8")
12315
12479
  );
12316
- if (manifest.version) versionDir = join26(pluginRoot, manifest.version);
12480
+ if (manifest.version) versionDir = join27(pluginRoot, manifest.version);
12317
12481
  } catch {
12318
12482
  }
12319
- if (!versionDir || !existsSync16(versionDir)) {
12320
- const children = existsSync16(pluginRoot) ? readdirSync4(pluginRoot) : [];
12321
- versionDir = children.length === 1 ? join26(pluginRoot, children[0]) : void 0;
12483
+ if (!versionDir || !existsSync17(versionDir)) {
12484
+ const children = existsSync17(pluginRoot) ? readdirSync4(pluginRoot) : [];
12485
+ versionDir = children.length === 1 ? join27(pluginRoot, children[0]) : void 0;
12322
12486
  }
12323
- if (!versionDir || !existsSync16(versionDir)) {
12487
+ if (!versionDir || !existsSync17(versionDir)) {
12324
12488
  return { linked: 0, error: "staged plugin dir not found" };
12325
12489
  }
12326
- const skillsDir = join26(bundle, "skills");
12327
- if (!existsSync16(skillsDir)) return { linked: 0 };
12490
+ const skillsDir = join27(bundle, "skills");
12491
+ if (!existsSync17(skillsDir)) return { linked: 0 };
12328
12492
  let linked = 0;
12329
12493
  for (const name of readdirSync4(skillsDir)) {
12330
- const repoSkill = join26(skillsDir, name, "SKILL.md");
12331
- if (!existsSync16(repoSkill)) continue;
12332
- const stagedSkill = join26(versionDir, "skills", name, "SKILL.md");
12494
+ const repoSkill = join27(skillsDir, name, "SKILL.md");
12495
+ if (!existsSync17(repoSkill)) continue;
12496
+ const stagedSkill = join27(versionDir, "skills", name, "SKILL.md");
12333
12497
  mkdirSync11(dirname7(stagedSkill), { recursive: true });
12334
12498
  rmSync3(stagedSkill, { force: true });
12335
12499
  symlinkSync2(repoSkill, stagedSkill);
@@ -12341,14 +12505,14 @@ function symlinkStagedSkills(devRoot, env = process.env) {
12341
12505
  }
12342
12506
  }
12343
12507
  function syncBundleSkill(devRoot) {
12344
- spawnSync5("node", [join26(devRoot, "scripts", "check-plugin-skill-sync.mjs"), "--fix"], {
12508
+ spawnSync5("node", [join27(devRoot, "scripts", "check-plugin-skill-sync.mjs"), "--fix"], {
12345
12509
  cwd: devRoot,
12346
12510
  stdio: "ignore"
12347
12511
  });
12348
12512
  }
12349
12513
  function codexHomeDir(env = process.env) {
12350
12514
  const override = env["CODEX_HOME"];
12351
- return override && override.length > 0 ? override : join26(homedir21(), ".codex");
12515
+ return override && override.length > 0 ? override : join27(homedir21(), ".codex");
12352
12516
  }
12353
12517
  function currentMarketplaceType(env = process.env) {
12354
12518
  try {
@@ -12361,7 +12525,7 @@ function currentMarketplaceType(env = process.env) {
12361
12525
  }
12362
12526
  }
12363
12527
  function codexConfigPath(env = process.env) {
12364
- return join26(codexHomeDir(env), "config.toml");
12528
+ return join27(codexHomeDir(env), "config.toml");
12365
12529
  }
12366
12530
  function codexBinary(env = process.env) {
12367
12531
  const b = env["CODEX_BIN_PATH"];
@@ -12437,7 +12601,7 @@ async function installCodexPlugin(opts = {}) {
12437
12601
  configPath: cfgPath,
12438
12602
  dev: devRoot !== null
12439
12603
  };
12440
- if (!existsSync16(codexHomeDir(env)) || !codexCliAvailable(env)) {
12604
+ if (!existsSync17(codexHomeDir(env)) || !codexCliAvailable(env)) {
12441
12605
  return result;
12442
12606
  }
12443
12607
  result.ran = true;
@@ -12447,7 +12611,7 @@ async function installCodexPlugin(opts = {}) {
12447
12611
  process.stdout.write(
12448
12612
  `# would run: ${bin} plugin marketplace add ${source}
12449
12613
  # would run: ${bin} plugin add ${PLUGIN_ID}
12450
- ` + (devRoot ? `# would symlink the staged skills/*/SKILL.md -> ${join26(devRoot, PLUGIN_BUNDLE_REL, "skills")}/*
12614
+ ` + (devRoot ? `# would symlink the staged skills/*/SKILL.md -> ${join27(devRoot, PLUGIN_BUNDLE_REL, "skills")}/*
12451
12615
  ` : "") + `# --- appended to ${cfgPath} (only if not already configured) ---
12452
12616
  ${codexPluginEnableTable()}
12453
12617
  `
@@ -12488,7 +12652,7 @@ ${codexPluginEnableTable()}
12488
12652
  }
12489
12653
  }
12490
12654
  }
12491
- const existing = existsSync16(cfgPath) ? readFileSync9(cfgPath, "utf8") : "";
12655
+ const existing = existsSync17(cfgPath) ? readFileSync9(cfgPath, "utf8") : "";
12492
12656
  const { text: text3, status } = upsertCodexPluginEnable(existing, { force: opts.force });
12493
12657
  result.enableStatus = status;
12494
12658
  if (text3 !== existing) {
@@ -12609,21 +12773,21 @@ ${LOGO_L2}\x1B[0m` + SYNC_END2);
12609
12773
  var LEGACY_INFO_MARKER = "Drive AgentBox from the host:";
12610
12774
  function installTargets() {
12611
12775
  const home = homedir22();
12612
- const claudeSkills = join27(home, ".claude", "skills");
12776
+ const claudeSkills = join28(home, ".claude", "skills");
12613
12777
  return [
12614
12778
  {
12615
- src: join27("agentbox-info", "SKILL.md"),
12616
- dest: join27(claudeSkills, "agentbox-info", "SKILL.md")
12779
+ src: join28("agentbox-info", "SKILL.md"),
12780
+ dest: join28(claudeSkills, "agentbox-info", "SKILL.md")
12617
12781
  },
12618
12782
  {
12619
- src: join27("codex", "agentbox.md"),
12620
- dest: join27(home, ".codex", "prompts", "agentbox.md"),
12621
- gateDir: join27(home, ".codex")
12783
+ src: join28("codex", "agentbox.md"),
12784
+ dest: join28(home, ".codex", "prompts", "agentbox.md"),
12785
+ gateDir: join28(home, ".codex")
12622
12786
  },
12623
12787
  {
12624
- src: join27("opencode", "agentbox.md"),
12625
- dest: join27(home, ".config", "opencode", "commands", "agentbox.md"),
12626
- gateDir: join27(home, ".config", "opencode")
12788
+ src: join28("opencode", "agentbox.md"),
12789
+ dest: join28(home, ".config", "opencode", "commands", "agentbox.md"),
12790
+ gateDir: join28(home, ".config", "opencode")
12627
12791
  }
12628
12792
  ];
12629
12793
  }
@@ -12635,7 +12799,7 @@ function isSymlink(target) {
12635
12799
  }
12636
12800
  }
12637
12801
  function writableReason(target, force) {
12638
- if (!existsSync17(target)) {
12802
+ if (!existsSync18(target)) {
12639
12803
  if (isSymlink(target)) return "managed";
12640
12804
  return "new";
12641
12805
  }
@@ -12655,13 +12819,13 @@ function installHostSkills(opts = {}) {
12655
12819
  const blocked = [];
12656
12820
  let skipped = 0;
12657
12821
  for (const t of installTargets()) {
12658
- const src = join27(srcDir, t.src);
12659
- if (!existsSync17(src)) {
12822
+ const src = join28(srcDir, t.src);
12823
+ if (!existsSync18(src)) {
12660
12824
  if (!quiet) prompt_exports.log.warn(`bundled file missing (skipped): ${src}`);
12661
12825
  skipped++;
12662
12826
  continue;
12663
12827
  }
12664
- if (t.gateDir && !existsSync17(t.gateDir)) continue;
12828
+ if (t.gateDir && !existsSync18(t.gateDir)) continue;
12665
12829
  const reason = writableReason(t.dest, force);
12666
12830
  if (reason === "skip") {
12667
12831
  if (!quiet) prompt_exports.log.warn(`user-modified file at ${t.dest}, skipping; pass --force to overwrite`);
@@ -12692,9 +12856,9 @@ async function installForkSkill(opts = {}) {
12692
12856
  const dryRun = opts.dryRun === true;
12693
12857
  const quiet = opts.quiet === true;
12694
12858
  const srcDir = resolveHostSkillsDir();
12695
- const src = join27(srcDir, "agentbox", "SKILL.md");
12696
- const dest = join27(homedir22(), ".claude", "skills", "agentbox", "SKILL.md");
12697
- if (!existsSync17(src)) {
12859
+ const src = join28(srcDir, "agentbox", "SKILL.md");
12860
+ const dest = join28(homedir22(), ".claude", "skills", "agentbox", "SKILL.md");
12861
+ if (!existsSync18(src)) {
12698
12862
  if (!quiet) prompt_exports.log.warn(`bundled file missing (skipped): ${src}`);
12699
12863
  return { written: [], skipped: 1, blocked: [], method: "skip" };
12700
12864
  }
@@ -12732,7 +12896,7 @@ async function installForkSkill(opts = {}) {
12732
12896
  ],
12733
12897
  { timeout: 12e4 }
12734
12898
  );
12735
- if (existsSync17(dest)) return { written: [dest], skipped: 0, blocked: [], method: "npx" };
12899
+ if (existsSync18(dest)) return { written: [dest], skipped: 0, blocked: [], method: "npx" };
12736
12900
  throw new Error("`skills add` reported success but wrote no skill file");
12737
12901
  } catch (err) {
12738
12902
  if (!quiet) {
@@ -12956,7 +13120,7 @@ installCommand.addCommand(installTrayCommand);
12956
13120
 
12957
13121
  // src/commands/plugin.ts
12958
13122
  import { execFileSync } from "child_process";
12959
- import { existsSync as existsSync18, readFileSync as readFileSync11, statSync as statSync3 } from "fs";
13123
+ import { existsSync as existsSync19, readFileSync as readFileSync11, statSync as statSync3 } from "fs";
12960
13124
  import { createRequire } from "module";
12961
13125
  import { dirname as dirname9, isAbsolute as isAbsolute3, resolve as resolve6 } from "path";
12962
13126
  import { pathToFileURL } from "url";
@@ -12974,7 +13138,7 @@ function resolutionPaths() {
12974
13138
  }
12975
13139
  function resolvePackage(arg) {
12976
13140
  let pkgDir;
12977
- if ((arg.startsWith(".") || arg.startsWith("/") || isAbsolute3(arg)) && existsSync18(arg)) {
13141
+ if ((arg.startsWith(".") || arg.startsWith("/") || isAbsolute3(arg)) && existsSync19(arg)) {
12978
13142
  pkgDir = statSync3(arg).isDirectory() ? resolve6(arg) : dirname9(resolve6(arg));
12979
13143
  } else {
12980
13144
  const req = createRequire(pathToFileURL(resolve6(process.cwd(), "noop.js")).href);
@@ -13925,7 +14089,7 @@ var logsCommand = new Command37("logs").description("Print recent log lines from
13925
14089
  // src/commands/open.ts
13926
14090
  import { log as log43 } from "@clack/prompts";
13927
14091
  import { execa as execa9 } from "execa";
13928
- import { existsSync as existsSync19, mkdirSync as mkdirSync13 } from "fs";
14092
+ import { existsSync as existsSync20, mkdirSync as mkdirSync13 } from "fs";
13929
14093
  import { homedir as homedir23 } from "os";
13930
14094
  import { join as join29 } from "path";
13931
14095
  import { Command as Command38, InvalidArgumentError as InvalidArgumentError3 } from "commander";
@@ -13949,104 +14113,26 @@ async function runPath(box, opts) {
13949
14113
  }
13950
14114
  }
13951
14115
 
13952
- // src/commands/_open-in.ts
13953
- import { existsSync as realExistsSync } from "fs";
13954
- import { homedir as realHomedir } from "os";
13955
- import { delimiter, join as join28 } from "path";
13956
- var OPEN_IN_APPS = ["codex", "herdr", "cmux", "vscode", "iterm2"];
13957
- var PERSISTENT_SSH_PROVIDERS = ["hetzner"];
13958
- var IDE_PROVIDERS = ["docker", "hetzner", "daytona"];
13959
- function realSeams() {
13960
- return {
13961
- env: process.env,
13962
- platform: process.platform,
13963
- homedir: realHomedir,
13964
- existsSync: realExistsSync
13965
- };
13966
- }
13967
- function pathHasBinary(name, seams) {
13968
- const path = seams.env["PATH"] ?? "";
13969
- for (const dir of path.split(delimiter)) {
13970
- if (dir.length === 0) continue;
13971
- if (seams.existsSync(join28(dir, name))) return true;
13972
- }
13973
- return false;
13974
- }
13975
- function macAppInstalled(appName, seams) {
13976
- if (seams.platform !== "darwin") return false;
13977
- return seams.existsSync(join28("/Applications", appName)) || seams.existsSync(join28(seams.homedir(), "Applications", appName));
13978
- }
13979
- function defaultHerdrSocketPath(seams = realSeams()) {
13980
- const p = join28(seams.homedir(), ".config", "herdr", "herdr.sock");
13981
- return seams.existsSync(p) ? p : void 0;
13982
- }
13983
- var CMUX_APP_CLI_SUFFIX = "cmux.app/Contents/Resources/bin/cmux";
13984
- function resolveCmuxBinary(seams = realSeams()) {
13985
- const bundled = seams.env["CMUX_BUNDLED_CLI_PATH"];
13986
- if (bundled && bundled.length > 0) return bundled;
13987
- if (pathHasBinary("cmux", seams)) return "cmux";
13988
- if (seams.platform === "darwin") {
13989
- for (const root of ["/Applications", join28(seams.homedir(), "Applications")]) {
13990
- const cli = join28(root, CMUX_APP_CLI_SUFFIX);
13991
- if (seams.existsSync(cli)) return cli;
13992
- }
13993
- }
13994
- return void 0;
13995
- }
13996
- function detectOpenTargets(seams = realSeams()) {
13997
- return {
13998
- codex: {
13999
- available: macAppInstalled("Codex.app", seams),
14000
- providers: [...PERSISTENT_SSH_PROVIDERS]
14001
- },
14002
- herdr: {
14003
- available: pathHasBinary("herdr", seams) || defaultHerdrSocketPath(seams) !== void 0
14004
- },
14005
- cmux: {
14006
- available: pathHasBinary("cmux", seams) || macAppInstalled("cmux.app", seams)
14007
- },
14008
- vscode: {
14009
- available: pathHasBinary("code", seams) || pathHasBinary("cursor", seams),
14010
- providers: [...IDE_PROVIDERS]
14011
- },
14012
- iterm2: {
14013
- available: macAppInstalled("iTerm.app", seams)
14014
- }
14015
- };
14016
- }
14017
- function codexAddUrl(alias) {
14018
- return `codex://settings/connections/ssh/add?name=${encodeURIComponent(alias)}`;
14019
- }
14020
- function renderTargets(report) {
14021
- const lines = OPEN_IN_APPS.map((app) => {
14022
- const info = report[app];
14023
- const status = info.available ? "available" : "not installed";
14024
- const scope = info.providers ? ` (${info.providers.join(", ")} boxes)` : "";
14025
- return `${app}: ${status}${info.available ? scope : ""}`;
14026
- });
14027
- return lines.join("\n") + "\n";
14028
- }
14029
-
14030
14116
  // src/commands/open.ts
14031
14117
  function parseOpenTarget(value) {
14032
- if (value === "codex" || value === "herdr" || value === "cmux" || value === "vscode" || value === "iterm2" || value === "finder") {
14118
+ if (value === "claude" || value === "codex" || value === "herdr" || value === "cmux" || value === "vscode" || value === "iterm2" || value === "finder") {
14033
14119
  return value;
14034
14120
  }
14035
14121
  throw new InvalidArgumentError3(
14036
- `expected one of: codex, herdr, cmux, vscode, iterm2, finder (got "${value}")`
14122
+ `expected one of: claude, codex, herdr, cmux, vscode, iterm2, finder (got "${value}")`
14037
14123
  );
14038
14124
  }
14039
14125
  var openCommand = new Command38("open").description(
14040
- "Open a box in Finder (default; docker: rsync'd snapshot; cloud: sshfs mount) or in a host app via --in"
14126
+ "Mount a box /workspace via sshfs and reveal in Finder (default), or open it in a host app via --in"
14041
14127
  ).argument(
14042
14128
  "[box]",
14043
14129
  "box ref: project index, id, id prefix, name, or container (default: the only box in this project)"
14044
- ).option("--no-refresh", "skip the rsync; open whatever's already on disk (docker only)").option(
14130
+ ).option("--no-refresh", "legacy docker (no sshd) only: skip the rsync; open what's on disk").option(
14045
14131
  "--include-node-modules",
14046
- "include /workspace/node_modules in the merged export (docker only; off by default)"
14047
- ).option("--path", "print the host workspace / mount path instead of launching Finder").option("--print", "alias of --path").option(
14132
+ "legacy docker (no sshd) only: include /workspace/node_modules in the export"
14133
+ ).option("--path", "print the host mount path instead of launching Finder").option("--print", "alias of --path").option(
14048
14134
  "--unmount",
14049
- "cloud only: unmount any existing sshfs mount for the box and exit"
14135
+ "unmount any existing sshfs mount for the box and exit"
14050
14136
  ).option(
14051
14137
  "--in <app>",
14052
14138
  "open the box in a host app instead of Finder: codex | herdr | cmux | vscode | iterm2 | finder",
@@ -14059,7 +14145,19 @@ var openCommand = new Command38("open").description(
14059
14145
  return;
14060
14146
  }
14061
14147
  const box = await resolveBoxOrExit(idOrName);
14148
+ if (opts.unmount) {
14149
+ const mountRoot = join29(homedir23(), ".agentbox", "mounts", box.name);
14150
+ const ok = await tryUnmount(mountRoot);
14151
+ process.stdout.write(ok ? `unmounted ${mountRoot}
14152
+ ` : `nothing mounted at ${mountRoot}
14153
+ `);
14154
+ return;
14155
+ }
14062
14156
  const app = opts.in ?? "finder";
14157
+ if (app === "claude") {
14158
+ await openInClaude(box);
14159
+ return;
14160
+ }
14063
14161
  if (app === "codex") {
14064
14162
  await openInCodex(box);
14065
14163
  return;
@@ -14072,11 +14170,16 @@ var openCommand = new Command38("open").description(
14072
14170
  await runCodeOpen(box, {});
14073
14171
  return;
14074
14172
  }
14075
- const isCloud = (box.provider ?? "docker") !== "docker";
14076
- if (isCloud) {
14077
- await runCloudOpen(box, opts);
14173
+ const providerName = box.provider ?? "docker";
14174
+ if (SSH_MOUNT_PROVIDERS.includes(providerName) && (providerName !== "docker" || box.sshEnabled)) {
14175
+ await runSshfsMount(box, opts);
14078
14176
  return;
14079
14177
  }
14178
+ if (providerName !== "docker") {
14179
+ throw new Error(
14180
+ `'agentbox open' live-mounts /workspace over sshfs, which ${providerName} boxes don't support (no SSH). Use 'agentbox download ${box.name}' to copy files to your host, or 'agentbox open ${box.name} --in vscode'.`
14181
+ );
14182
+ }
14080
14183
  if (opts.path || opts.print) {
14081
14184
  await runPath(box, {
14082
14185
  refresh: opts.refresh,
@@ -14097,18 +14200,34 @@ var openCommand = new Command38("open").description(
14097
14200
  handleLifecycleError(err);
14098
14201
  }
14099
14202
  });
14100
- async function openInCodex(box) {
14203
+ async function ensurePersistentSshAlias(box, appLabel) {
14101
14204
  const providerName = box.provider ?? "docker";
14102
14205
  if (!PERSISTENT_SSH_PROVIDERS.includes(providerName)) {
14103
14206
  throw new Error(
14104
- `'--in codex' needs a box with a persistent SSH key \u2014 only Hetzner cloud boxes qualify (this box is '${providerName}'). Docker boxes aren't reachable over SSH and Daytona uses a 60-min token that expires. Try 'agentbox open ${box.name} --in vscode' instead.`
14207
+ `'--in ${appLabel.toLowerCase()}' needs a box with a persistent SSH key \u2014 docker (localhost sshd) and Hetzner cloud boxes qualify (this box is '${providerName}'). Daytona uses a 60-min token that expires; Vercel/E2B have no SSH. Try 'agentbox open ${box.name} --in vscode'.`
14208
+ );
14209
+ }
14210
+ if (providerName === "docker" && !box.sshEnabled) {
14211
+ throw new Error(
14212
+ `box '${box.name}' predates the in-box sshd, so it can't be added to ${appLabel} over SSH. Recreate the box (new docker boxes run sshd), or use 'agentbox open ${box.name} --in vscode'.`
14105
14213
  );
14106
14214
  }
14215
+ if (providerName === "docker") {
14216
+ let online = await bringDockerBoxOnline(box);
14217
+ if (!online.ssh) online = await resolveBoxOrExit(online.id);
14218
+ if (!online.ssh?.identityFile) {
14219
+ throw new Error(
14220
+ `box '${box.name}' has no SSH key on disk \u2014 its in-box sshd may have failed to start. Try 'agentbox start ${box.name}' and retry.`
14221
+ );
14222
+ }
14223
+ await syncAgentboxSshConfig();
14224
+ return agentboxAliasFor(online.name);
14225
+ }
14107
14226
  const provider = await providerForBox(box);
14108
14227
  const conn = await resolveCloudSshTarget(box, provider);
14109
14228
  if (!conn.identityFile) {
14110
14229
  throw new Error(
14111
- `box '${box.name}' (provider '${providerName}') has no persistent SSH key, so it can't be added to Codex over SSH.`
14230
+ `box '${box.name}' (provider '${providerName}') has no persistent SSH key, so it can't be added to ${appLabel} over SSH.`
14112
14231
  );
14113
14232
  }
14114
14233
  await recordBoxSsh(box.id, {
@@ -14117,23 +14236,47 @@ async function openInCodex(box) {
14117
14236
  identityFile: conn.identityFile
14118
14237
  });
14119
14238
  await syncAgentboxSshConfig();
14120
- log43.info(`ssh alias '${conn.alias}' written (Include'd from ~/.ssh/config)`);
14121
- const url = codexAddUrl(conn.alias);
14239
+ return conn.alias;
14240
+ }
14241
+ async function openInCodex(box) {
14242
+ const alias = await ensurePersistentSshAlias(box, "Codex");
14243
+ log43.info(`ssh alias '${alias}' written (Include'd from ~/.ssh/config)`);
14244
+ const url = codexAddUrl(alias);
14122
14245
  const opened = await execa9(hostOpenCommand(), [url], { reject: false });
14123
14246
  if (opened.exitCode !== 0) {
14124
14247
  log43.warn(
14125
14248
  `could not auto-open the Codex link (is Codex.app installed?): ${opened.stderr || `exit ${String(opened.exitCode)}`}`
14126
14249
  );
14127
- const link = hyperlink(`Add ${conn.alias} to Codex SSH`, url, process.stdout);
14250
+ const link = hyperlink(`Add ${alias} to Codex SSH`, url, process.stdout);
14128
14251
  process.stdout.write(`open manually: ${link}
14129
14252
  ${url}
14130
14253
  `);
14131
14254
  process.exitCode = 1;
14132
14255
  return;
14133
14256
  }
14134
- log43.success(`opening Codex \u2014 the SSH connection form is pre-filled with '${conn.alias}'`);
14257
+ log43.success(`opening Codex \u2014 the SSH connection form is pre-filled with '${alias}'`);
14135
14258
  process.stdout.write(url + "\n");
14136
14259
  }
14260
+ async function openInClaude(box) {
14261
+ const alias = await ensurePersistentSshAlias(box, "Claude");
14262
+ log43.info(`ssh alias '${alias}' written (Include'd from ~/.ssh/config)`);
14263
+ const entry = claudeSshEntryFor(alias, box.name);
14264
+ upsertClaudeSshConfig(entry);
14265
+ log43.info(`added '${entry.name}' to Claude desktop's SSH connections (${claudeSettingsPath()})`);
14266
+ const opened = await execa9(hostOpenCommand(), ["-a", "Claude"], { reject: false });
14267
+ if (opened.exitCode !== 0) {
14268
+ log43.warn(
14269
+ `could not launch Claude (is Claude.app installed?): ${opened.stderr || `exit ${String(opened.exitCode)}`}`
14270
+ );
14271
+ process.stdout.write(
14272
+ `the SSH connection '${entry.name}' is saved \u2014 open Claude manually and pick it from the Environment dropdown
14273
+ `
14274
+ );
14275
+ process.exitCode = 1;
14276
+ return;
14277
+ }
14278
+ log43.success(`opening Claude \u2014 pick '${entry.name}' from the Environment dropdown`);
14279
+ }
14137
14280
  async function openInTerminalApp(box, host) {
14138
14281
  if ((box.provider ?? "docker") === "docker") {
14139
14282
  const insp = await inspectBox(box.id);
@@ -14202,16 +14345,22 @@ ${r.error ?? ""}`
14202
14345
  }
14203
14346
  log43.success(`opened ${box.name} in a new ${host} ${host === "iterm2" ? "window" : "workspace"} (agentbox attach)`);
14204
14347
  }
14205
- async function runCloudOpen(box, opts) {
14206
- const mountRoot = join29(homedir23(), ".agentbox", "mounts", box.name);
14207
- if (opts.unmount) {
14208
- const ok = await tryUnmount(mountRoot);
14209
- if (ok) process.stdout.write(`unmounted ${mountRoot}
14210
- `);
14211
- else process.stdout.write(`nothing mounted at ${mountRoot}
14212
- `);
14213
- return;
14348
+ async function bringDockerBoxOnline(box) {
14349
+ const insp = await inspectBox(box.id);
14350
+ if (insp.state === "paused") {
14351
+ log43.info("box is paused; unpausing");
14352
+ await unpauseBox(box.id);
14353
+ } else if (insp.state === "stopped") {
14354
+ log43.info("box is stopped; starting");
14355
+ const started = await startBox(box.id);
14356
+ return started.record;
14357
+ } else if (insp.state === "missing") {
14358
+ throw new Error(`box ${box.name} has no container; was it destroyed?`);
14214
14359
  }
14360
+ return await refreshBoxSshd(box);
14361
+ }
14362
+ async function runSshfsMount(box, opts) {
14363
+ const mountRoot = join29(homedir23(), ".agentbox", "mounts", box.name);
14215
14364
  if (opts.path || opts.print) {
14216
14365
  process.stdout.write(`${mountRoot}
14217
14366
  `);
@@ -14220,12 +14369,25 @@ async function runCloudOpen(box, opts) {
14220
14369
  const sshfsBin = await locateBinary("sshfs");
14221
14370
  if (!sshfsBin) {
14222
14371
  throw new Error(
14223
- "sshfs not found on PATH. Install with `brew install macfuse sshfs` (macOS) or your distro's package manager, then retry. Cloud `agentbox open` mounts the sandbox /workspace via sshfs."
14372
+ "sshfs not found on PATH. Install with `brew install macfuse sshfs` (macOS) or your distro's package manager, then retry. `agentbox open` mounts the box /workspace via sshfs."
14224
14373
  );
14225
14374
  }
14226
- const provider = await providerForBox(box);
14227
- const { alias } = await ensureCloudSshAlias(box, provider);
14228
- if (!existsSync19(mountRoot)) {
14375
+ let alias;
14376
+ if ((box.provider ?? "docker") === "docker") {
14377
+ let online = await bringDockerBoxOnline(box);
14378
+ if (!online.ssh) online = await resolveBoxOrExit(online.id);
14379
+ if (!online.ssh) {
14380
+ throw new Error(
14381
+ `box '${box.name}' has no SSH endpoint \u2014 its in-box sshd may have failed to start. Try 'agentbox start ${box.name}' and retry, or 'agentbox open ${box.name} --in vscode'.`
14382
+ );
14383
+ }
14384
+ await syncAgentboxSshConfig();
14385
+ alias = agentboxAliasFor(online.name);
14386
+ } else {
14387
+ const provider = await providerForBox(box);
14388
+ ({ alias } = await ensureCloudSshAlias(box, provider));
14389
+ }
14390
+ if (!existsSync20(mountRoot)) {
14229
14391
  mkdirSync13(mountRoot, { recursive: true, mode: 493 });
14230
14392
  } else if (await isMounted(mountRoot)) {
14231
14393
  log43.info(`re-mounting (stale mount detected at ${mountRoot})`);
@@ -14249,7 +14411,9 @@ async function runCloudOpen(box, opts) {
14249
14411
  { reject: false }
14250
14412
  );
14251
14413
  if (mount.exitCode !== 0) {
14252
- throw new Error(`sshfs mount failed (exit ${String(mount.exitCode)}): ${mount.stderr || mount.stdout}`);
14414
+ const err = `${mount.stderr || ""}${mount.stdout || ""}`;
14415
+ const macfuseHint = process.platform === "darwin" && /fuse|macfuse|load|not permitted|mount_macfuse/i.test(err) ? ` \u2014 is macFUSE installed and approved? Run 'brew install macfuse' (may need a reboot and approving the system extension in System Settings \u203A Privacy & Security), then retry.` : "";
14416
+ throw new Error(`sshfs mount failed (exit ${String(mount.exitCode)}): ${err}${macfuseHint}`);
14253
14417
  }
14254
14418
  await execa9(hostOpenCommand(), [mountRoot], { reject: false });
14255
14419
  process.stdout.write(`opened ${mountRoot}
@@ -14914,7 +15078,7 @@ var hubCommand = new Command43("hub").description(
14914
15078
  import { isCancel as isCancel5, log as log48, note as note7, select as select3, spinner as spinner12 } from "@clack/prompts";
14915
15079
  import { Command as Command44 } from "commander";
14916
15080
  import { spawn as spawn10 } from "child_process";
14917
- import { existsSync as existsSync20, readFileSync as readFileSync12 } from "fs";
15081
+ import { existsSync as existsSync21, readFileSync as readFileSync12 } from "fs";
14918
15082
  import { chmod, mkdir as mkdir2, rm, writeFile as writeFile5 } from "fs/promises";
14919
15083
  import { hostname, homedir as homedir25, tmpdir as tmpdir6 } from "os";
14920
15084
  import { join as join32 } from "path";
@@ -15524,7 +15688,7 @@ var unsetUrlSub = new Command44("unset-url").description("Stop using a control p
15524
15688
  `Removed relay.controlPlaneUrl (${where}). New cloud boxes now push through the host relay (your laptop must be on), and the GitHub-App repo-authorization prompt no longer fires.`
15525
15689
  );
15526
15690
  }
15527
- if (existsSync20(CP_DIR2)) {
15691
+ if (existsSync21(CP_DIR2)) {
15528
15692
  if (opts.purge) {
15529
15693
  await rm(CP_DIR2, { recursive: true, force: true });
15530
15694
  log48.success(`Purged this machine's control-plane credentials (${CP_DIR2}).`);
@@ -15604,7 +15768,7 @@ var addSub = new Command44("add").description("Authorize the current project's g
15604
15768
  });
15605
15769
  function loadControlPlaneEnv() {
15606
15770
  if (process.env.GITHUB_APP_ID && process.env.GITHUB_APP_PRIVATE_KEY) return;
15607
- if (!existsSync20(ENV_PATH2)) return;
15771
+ if (!existsSync21(ENV_PATH2)) return;
15608
15772
  for (const line of readFileSync12(ENV_PATH2, "utf8").split("\n")) {
15609
15773
  const m = /^([A-Z_]+)=(.*)$/.exec(line.trim());
15610
15774
  if (m && !process.env[m[1]]) process.env[m[1]] = m[2];
@@ -16393,6 +16557,7 @@ var postUpdateRefreshCommand = new Command48("_post-update-refresh").description
16393
16557
  import { readFile as readFile8 } from "fs/promises";
16394
16558
 
16395
16559
  // src/exec-method.ts
16560
+ import { realpathSync } from "fs";
16396
16561
  function detectExecutionMethod(input) {
16397
16562
  const ua = input.userAgent ?? "";
16398
16563
  const argv1 = input.argv1 ?? "";
@@ -16405,6 +16570,17 @@ function detectExecutionMethod(input) {
16405
16570
  if (/\bnpm\//.test(ua)) {
16406
16571
  return "npm";
16407
16572
  }
16573
+ let real = argv1;
16574
+ try {
16575
+ real = realpathSync(argv1);
16576
+ } catch {
16577
+ }
16578
+ if (real.includes("/pnpm/global/")) {
16579
+ return "pnpm";
16580
+ }
16581
+ if (real.includes("/lib/node_modules/")) {
16582
+ return "npm";
16583
+ }
16408
16584
  return "direct";
16409
16585
  }
16410
16586
 
@@ -16436,7 +16612,7 @@ function isNewer(latest, current) {
16436
16612
  var PKG = "@madarco/agentbox";
16437
16613
  var REGISTRY_URL = `https://registry.npmjs.org/${PKG}/latest`;
16438
16614
  function nudgeEligible(method, version) {
16439
- return version !== "0.0.0-dev" && method !== "npx";
16615
+ return version !== "0.0.0-dev" && (method === "npm" || method === "pnpm");
16440
16616
  }
16441
16617
  async function updateCheckEnabled() {
16442
16618
  try {
@@ -18404,7 +18580,7 @@ if (AGENTBOX_VERSION !== "0.0.0-dev") {
18404
18580
  versionPromptShown = true;
18405
18581
  try {
18406
18582
  const yes = await confirm({
18407
- message: `agentbox was updated (${state.lastRunVersion} \u2192 ${AGENTBOX_VERSION}) \u2014 refresh skills, box image, relay, and the menu-bar app now?`,
18583
+ message: `agentbox was updated (${state.lastRunVersion} \u2192 ${AGENTBOX_VERSION}) \u2014 download new version now?`,
18408
18584
  initialValue: true
18409
18585
  });
18410
18586
  if (yes) {