@madarco/agentbox 0.22.2 → 0.23.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 (181) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/{_cloud-attach-Y5WZ7F53.js → _cloud-attach-HGP3MQEG.js} +4 -4
  3. package/dist/{chunk-BMCT3LBE.js → chunk-4AV2L2KY.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-FNAGMTUI.js → dist-JFUUDAI3.js} +17 -3
  21. package/dist/{dist-VOVN64Y2.js → dist-W5476E2U.js} +5 -5
  22. package/dist/{dist-AN5NUXA5.js → dist-X3O3HEYD.js} +8 -6
  23. package/dist/{dist-AN5NUXA5.js.map → dist-X3O3HEYD.js.map} +1 -1
  24. package/dist/{dist-K5GASNBV.js → dist-Z3GSHEFO.js} +7 -6
  25. package/dist/index.js +427 -227
  26. package/dist/index.js.map +1 -1
  27. package/dist/{prepared-state-5FIGV4BE-WPHOEDA6.js → prepared-state-LW2PKTEQ-5YMKG7UN.js} +2 -2
  28. package/package.json +28 -27
  29. package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
  30. package/runtime/_shared/agentbox-dockerd-start +0 -0
  31. package/runtime/_shared/agentbox-open +0 -0
  32. package/runtime/_shared/agentbox-portless-trust +0 -0
  33. package/runtime/_shared/agentbox-vnc-start +0 -0
  34. package/runtime/_shared/ctl.cjs +3 -1
  35. package/runtime/_shared/gh-shim +0 -0
  36. package/runtime/_shared/git-shim +0 -0
  37. package/runtime/_shared/linear-shim +0 -0
  38. package/runtime/_shared/ntn-shim +0 -0
  39. package/runtime/docker/Dockerfile.box +12 -0
  40. package/runtime/docker/packages/ctl/dist/bin.cjs +3 -1
  41. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
  42. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
  43. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
  44. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
  45. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +44 -0
  46. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
  47. package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
  48. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
  49. package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
  50. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
  51. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
  52. package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
  53. package/runtime/e2b/agentbox-dockerd-start +0 -0
  54. package/runtime/e2b/agentbox-open +0 -0
  55. package/runtime/e2b/agentbox-vnc-start +0 -0
  56. package/runtime/e2b/ctl.cjs +3 -1
  57. package/runtime/e2b/gh-shim +0 -0
  58. package/runtime/e2b/git-shim +0 -0
  59. package/runtime/e2b/linear-shim +0 -0
  60. package/runtime/e2b/ntn-shim +0 -0
  61. package/runtime/e2b/scripts/build-template.sh +0 -0
  62. package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
  63. package/runtime/hetzner/agentbox-dockerd-start +0 -0
  64. package/runtime/hetzner/agentbox-open +0 -0
  65. package/runtime/hetzner/agentbox-portless-trust +0 -0
  66. package/runtime/hetzner/agentbox-vnc-start +0 -0
  67. package/runtime/hetzner/ctl.cjs +3 -1
  68. package/runtime/hetzner/gh-shim +0 -0
  69. package/runtime/hetzner/git-shim +0 -0
  70. package/runtime/hetzner/linear-shim +0 -0
  71. package/runtime/hetzner/ntn-shim +0 -0
  72. package/runtime/hetzner/scripts/install-box.sh +0 -0
  73. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  74. package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +2 -0
  75. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  76. package/runtime/hub/apps/hub/.next/routes-manifest.json +14 -0
  77. package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
  78. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/app-paths-manifest.json +3 -0
  79. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/build-manifest.json +9 -0
  80. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/server-reference-manifest.json +4 -0
  81. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +9 -0
  82. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.map +5 -0
  83. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -0
  84. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route_client-reference-manifest.js +3 -0
  85. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/app-paths-manifest.json +3 -0
  86. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/build-manifest.json +9 -0
  87. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/server-reference-manifest.json +4 -0
  88. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js +8 -0
  89. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.map +5 -0
  90. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -0
  91. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route_client-reference-manifest.js +3 -0
  92. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  93. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  94. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  95. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  96. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  97. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  98. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  99. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  100. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  101. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  102. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  103. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  104. package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  105. package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +2 -0
  106. 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
  107. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_open_route_actions_1agwl8h.js +3 -0
  108. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +1 -1
  109. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ql4fjo._.js +1 -1
  110. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vs8fma._.js +1 -1
  111. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w9ud8u._.js +1 -1
  112. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yhb0gc._.js +1 -1
  113. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-0flwc._.js +3 -0
  114. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1a50b07._.js +3 -0
  115. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bqbkd5._.js +2 -2
  116. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d6mtlk._.js +1 -1
  117. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dn_3i1._.js +1 -1
  118. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hqla7-._.js +1 -1
  119. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1js2jdv._.js +1 -1
  120. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1nepkp-._.js +1 -1
  121. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q5bqse._.js +1 -1
  122. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +2 -2
  123. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thipug._.js +3 -0
  124. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9om6g._.js +1 -1
  125. package/runtime/hub/apps/hub/.next/server/chunks/_06f2faq._.js +1 -1
  126. package/runtime/hub/apps/hub/.next/server/chunks/_0f3molr._.js +3 -0
  127. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.js +1 -1
  128. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +1 -1
  129. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
  130. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +1 -1
  131. package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +2 -0
  132. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  133. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  134. package/runtime/hub/apps/hub/.next/static/chunks/0joh_xsiowfc4.js +1 -0
  135. package/runtime/hub/apps/hub/.next/static/chunks/1py5tlz57h7ra.js +1 -0
  136. package/runtime/hub/apps/hub/.next/static/chunks/3p86ecqhr_7yy.js +1 -0
  137. package/runtime/hub/apps/hub/.next/static/chunks/3qof5hg87qf5n.js +1 -0
  138. package/runtime/hub/apps/hub/.next/static/chunks/3rm29i8e-lb25.css +3 -0
  139. package/runtime/hub/apps/hub/{chunk-673QOHSR.js → chunk-6HD4PARX.js} +9 -9
  140. package/runtime/hub/apps/hub/{chunk-7J6ZFTT4.js → chunk-JQFB2CNA.js} +132 -16
  141. package/runtime/hub/apps/hub/{chunk-5XQ3T3W2.js → chunk-K6RA5GJI.js} +231 -126
  142. package/runtime/hub/apps/hub/{dist-GCALYJN7.js → dist-3HR4RIPE.js} +17 -3
  143. package/runtime/hub/apps/hub/{dist-EI54M5DP.js → dist-7GNKBKFV.js} +29 -42
  144. package/runtime/hub/apps/hub/{dist-MOCUH2OC.js → dist-JWVTVHBT.js} +4 -4
  145. package/runtime/hub/apps/hub/{dist-K7WHNDZB.js → dist-L2MMBH7P.js} +7 -5
  146. package/runtime/hub/apps/hub/{dist-LYTWBTUL.js → dist-OUNL2TCW.js} +4 -4
  147. package/runtime/hub/apps/hub/{prepared-state-5FIGV4BE-D2HJEY2L.js → prepared-state-LW2PKTEQ-7BCXARGA.js} +1 -1
  148. package/runtime/hub/apps/hub/server.js +105 -24
  149. package/runtime/relay/bin.cjs +3 -1
  150. package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
  151. package/runtime/vercel/agentbox-dockerd-start +0 -0
  152. package/runtime/vercel/agentbox-open +0 -0
  153. package/runtime/vercel/agentbox-vnc-start +0 -0
  154. package/runtime/vercel/ctl.cjs +3 -1
  155. package/runtime/vercel/gh-shim +0 -0
  156. package/runtime/vercel/git-shim +0 -0
  157. package/runtime/vercel/linear-shim +0 -0
  158. package/runtime/vercel/ntn-shim +0 -0
  159. package/runtime/vercel/scripts/provision.sh +0 -0
  160. package/LICENSE +0 -21
  161. package/dist/chunk-5DZTXHLQ.js.map +0 -1
  162. package/dist/chunk-ES2DDCAC.js.map +0 -1
  163. package/runtime/hub/apps/hub/.next/static/chunks/0dx4alyqu7cq1.css +0 -3
  164. package/runtime/hub/apps/hub/.next/static/chunks/332lo0ac7l2wv.js +0 -1
  165. package/runtime/hub/apps/hub/.next/static/chunks/3gdqmzzl34ilu.js +0 -1
  166. package/runtime/hub/apps/hub/.next/static/chunks/3y2c7woqhtx9s.js +0 -1
  167. package/runtime/hub/apps/hub/.next/static/chunks/44exu5uemf-ev.js +0 -1
  168. /package/dist/{_cloud-attach-Y5WZ7F53.js.map → _cloud-attach-HGP3MQEG.js.map} +0 -0
  169. /package/dist/{chunk-BMCT3LBE.js.map → chunk-4AV2L2KY.js.map} +0 -0
  170. /package/dist/{chunk-3KAWXDQ4.js.map → chunk-JXDSSSXS.js.map} +0 -0
  171. /package/dist/{chunk-S4OWE3UD.js.map → chunk-L5SOSNQI.js.map} +0 -0
  172. /package/dist/{chunk-V2NCCC2B.js.map → chunk-Q626V2YX.js.map} +0 -0
  173. /package/dist/{chunk-7HAGPF4X.js.map → chunk-QVWGQJV6.js.map} +0 -0
  174. /package/dist/{dist-SJRMFVRV.js.map → dist-GEHCZJCS.js.map} +0 -0
  175. /package/dist/{dist-FNAGMTUI.js.map → dist-JFUUDAI3.js.map} +0 -0
  176. /package/dist/{dist-K5GASNBV.js.map → dist-W5476E2U.js.map} +0 -0
  177. /package/dist/{dist-VOVN64Y2.js.map → dist-Z3GSHEFO.js.map} +0 -0
  178. /package/dist/{prepared-state-5FIGV4BE-WPHOEDA6.js.map → prepared-state-LW2PKTEQ-5YMKG7UN.js.map} +0 -0
  179. /package/runtime/hub/apps/hub/.next/static/{zT1paOSXMJpAPsZ1dFK2V → mcWRLSGubwKk9p3RFz2-Q}/_buildManifest.js +0 -0
  180. /package/runtime/hub/apps/hub/.next/static/{zT1paOSXMJpAPsZ1dFK2V → mcWRLSGubwKk9p3RFz2-Q}/_clientMiddlewareManifest.js +0 -0
  181. /package/runtime/hub/apps/hub/.next/static/{zT1paOSXMJpAPsZ1dFK2V → mcWRLSGubwKk9p3RFz2-Q}/_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-4AV2L2KY.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.1" : "0.0.0-dev";
345
+ var AGENTBOX_COMMIT = true ? "fa4b68e43" : "dev";
342
346
 
343
347
  // src/index.ts
344
348
  import { existsSync as _existsSync } from "fs";
@@ -1107,7 +1111,7 @@ import { homedir as homedir2 } from "os";
1107
1111
  import { join as join3 } from "path";
1108
1112
  import { setTimeout as delay2 } from "timers/promises";
1109
1113
 
1110
- // src/commands/install-tray.ts
1114
+ // src/commands/install-app.ts
1111
1115
  import { intro, log as log4, outro } from "@clack/prompts";
1112
1116
  import { Command as Command2 } from "commander";
1113
1117
  import { execa } from "execa";
@@ -1165,7 +1169,7 @@ function remoteCheckFresh(state, now = /* @__PURE__ */ new Date()) {
1165
1169
  return now.getTime() - t < DAY_MS && t - now.getTime() < DAY_MS;
1166
1170
  }
1167
1171
 
1168
- // src/commands/install-tray.ts
1172
+ // src/commands/install-app.ts
1169
1173
  var APP_NAME = "AgentBox";
1170
1174
  var APP_PATH = `/Applications/${APP_NAME}.app`;
1171
1175
  var APP_BUNDLE_ID = "com.madarco.agentbox-tray";
@@ -1278,8 +1282,8 @@ async function downloadAndVerify(tag2, dir, say) {
1278
1282
  }
1279
1283
  return { zipPath, sha: actual };
1280
1284
  }
1281
- var installTrayCommand = new Command2("tray").description("Download and install the AgentBox Tray macOS menu-bar app into /Applications").option("--uninstall", "quit and remove the menu-bar app").option("--tag <tag>", "release tag to install from (default: tray-latest)").option("--zip <path>", "install a local AgentBox.zip instead of downloading").action(async (opts) => {
1282
- intro(opts.uninstall ? "Removing AgentBox Tray\u2026" : "Installing AgentBox Tray\u2026");
1285
+ var installAppCommand = new Command2("app").description("Download and install the AgentBox macOS menu-bar app into /Applications").option("--uninstall", "quit and remove the menu-bar app").option("--tag <tag>", "release tag to install from (default: tray-latest)").option("--zip <path>", "install a local AgentBox.zip instead of downloading").action(async (opts) => {
1286
+ intro(opts.uninstall ? "Removing the AgentBox app\u2026" : "Installing the AgentBox app\u2026");
1283
1287
  const res = await installTray(opts);
1284
1288
  outro(res.ran ? "Done" : `Skipped (${res.reason ?? "nothing to do"})`);
1285
1289
  if (!res.ran && res.reason && res.reason !== "not-macos") process.exitCode = 1;
@@ -1384,7 +1388,7 @@ var statusSub = new Command3("status").description("Show whether the AgentBox ap
1384
1388
  } else if (installed) {
1385
1389
  log5.info("AgentBox is installed but not running.");
1386
1390
  } else {
1387
- log5.warn("AgentBox is not installed. Run `agentbox install tray`.");
1391
+ log5.warn("AgentBox is not installed. Run `agentbox install app`.");
1388
1392
  }
1389
1393
  });
1390
1394
  var startSub = new Command3("start").description("Launch the AgentBox app if it is not already running").action(async () => {
@@ -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-X3O3HEYD.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-HGP3MQEG.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) {
@@ -11835,7 +11999,14 @@ function summaryToken(group) {
11835
11999
  const worst = worstInResults(group.results);
11836
12000
  if (group.title === "system") {
11837
12001
  if (worst === "fail") return "system FAIL";
11838
- if (worst === "warn") return "system warn";
12002
+ if (worst === "warn") {
12003
+ const warns = group.results.filter((r) => r.status === "warn");
12004
+ const required = warns.filter((r) => !r.hint?.startsWith("optional")).map((r) => r.label);
12005
+ const optional = warns.filter((r) => r.hint?.startsWith("optional")).map((r) => r.label);
12006
+ const parts = [...required];
12007
+ if (optional.length > 0) parts.push(`optional ${optional.join(", ")}`);
12008
+ return `system warn: ${parts.join(", ")}`;
12009
+ }
11839
12010
  return "system ok";
11840
12011
  }
11841
12012
  if (group.title === "integrations") {
@@ -11891,15 +12062,15 @@ function formatDetailed(groups) {
11891
12062
  }
11892
12063
 
11893
12064
  // src/lib/first-run.ts
11894
- import { existsSync as existsSync12, mkdirSync as mkdirSync7, writeFileSync as writeFileSync7 } from "fs";
12065
+ import { existsSync as existsSync13, mkdirSync as mkdirSync7, writeFileSync as writeFileSync7 } from "fs";
11895
12066
  import { homedir as homedir17 } from "os";
11896
- import { dirname as dirname3, join as join22 } from "path";
12067
+ import { dirname as dirname3, join as join23 } from "path";
11897
12068
  var MARKER_VERSION = 1;
11898
12069
  function setupMarkerPath() {
11899
- return join22(homedir17(), ".agentbox", "setup-complete.json");
12070
+ return join23(homedir17(), ".agentbox", "setup-complete.json");
11900
12071
  }
11901
12072
  function isFirstRun() {
11902
- return !existsSync12(setupMarkerPath());
12073
+ return !existsSync13(setupMarkerPath());
11903
12074
  }
11904
12075
  function markSetupComplete(provider) {
11905
12076
  const path = setupMarkerPath();
@@ -11914,25 +12085,31 @@ function markSetupComplete(provider) {
11914
12085
 
11915
12086
  // src/lib/star-prompt.ts
11916
12087
  import { spawnSync as spawnSync3 } from "child_process";
11917
- import { existsSync as existsSync13, mkdirSync as mkdirSync8, readFileSync as readFileSync6, writeFileSync as writeFileSync8 } from "fs";
12088
+ import { existsSync as existsSync14, mkdirSync as mkdirSync8, readFileSync as readFileSync6, writeFileSync as writeFileSync8 } from "fs";
11918
12089
  import { homedir as homedir18 } from "os";
11919
- import { dirname as dirname4, join as join23 } from "path";
12090
+ import { dirname as dirname4, join as join24 } from "path";
11920
12091
  var STATE_VERSION2 = 1;
11921
12092
  var REPO = "madarco/agentbox";
11922
12093
  var REPO_URL = `https://github.com/${REPO}`;
11923
- var DEFAULT_STATE = { version: STATE_VERSION2, installCount: 0, starred: false };
12094
+ var DEFAULT_STATE = {
12095
+ version: STATE_VERSION2,
12096
+ installCount: 0,
12097
+ starred: false,
12098
+ answered: false
12099
+ };
11924
12100
  function starStatePath() {
11925
- return join23(homedir18(), ".agentbox", "star-prompt.json");
12101
+ return join24(homedir18(), ".agentbox", "star-prompt.json");
11926
12102
  }
11927
12103
  function readStarState() {
11928
12104
  const path = starStatePath();
11929
- if (!existsSync13(path)) return { ...DEFAULT_STATE };
12105
+ if (!existsSync14(path)) return { ...DEFAULT_STATE };
11930
12106
  try {
11931
12107
  const parsed = JSON.parse(readFileSync6(path, "utf8"));
11932
12108
  return {
11933
12109
  version: STATE_VERSION2,
11934
12110
  installCount: typeof parsed.installCount === "number" ? parsed.installCount : 0,
11935
- starred: parsed.starred === true
12111
+ starred: parsed.starred === true,
12112
+ answered: parsed.answered === true
11936
12113
  };
11937
12114
  } catch {
11938
12115
  return { ...DEFAULT_STATE };
@@ -11950,7 +12127,7 @@ function ghReady() {
11950
12127
  async function maybePromptStar(opts) {
11951
12128
  if (!process.stdout.isTTY) return;
11952
12129
  const state = readStarState();
11953
- if (state.starred) return;
12130
+ if (state.starred || state.answered) return;
11954
12131
  let shouldPrompt;
11955
12132
  if (opts.trigger === "install") {
11956
12133
  state.installCount += 1;
@@ -11964,6 +12141,8 @@ async function maybePromptStar(opts) {
11964
12141
  message: "Help support this open source project \u2014 would you like to star it on GitHub? Thanks!",
11965
12142
  initialValue: true
11966
12143
  });
12144
+ state.answered = true;
12145
+ writeStarState(state);
11967
12146
  if (!yes) return;
11968
12147
  try {
11969
12148
  if (ghReady()) {
@@ -11989,14 +12168,14 @@ async function maybePromptStar(opts) {
11989
12168
  // src/commands/install-cmux.ts
11990
12169
  import { intro as intro9, log as log36, note as note3, outro as outro8 } from "@clack/prompts";
11991
12170
  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";
12171
+ import { existsSync as existsSync15, mkdirSync as mkdirSync9, readFileSync as readFileSync7, renameSync as renameSync3, writeFileSync as writeFileSync9 } from "fs";
11993
12172
  import { homedir as homedir19 } from "os";
11994
- import { dirname as dirname5, join as join24 } from "path";
12173
+ import { dirname as dirname5, join as join25 } from "path";
11995
12174
  var CONTROL_ID = "agentbox";
11996
12175
  function cmuxDockPath(env = process.env) {
11997
12176
  const xdg = env["XDG_CONFIG_HOME"];
11998
- const base = xdg && xdg.length > 0 ? xdg : join24(homedir19(), ".config");
11999
- return join24(base, "cmux", "dock.json");
12177
+ const base = xdg && xdg.length > 0 ? xdg : join25(homedir19(), ".config");
12178
+ return join25(base, "cmux", "dock.json");
12000
12179
  }
12001
12180
  function upsertAgentboxControl(doc, opts) {
12002
12181
  const controls = Array.isArray(doc.controls) ? doc.controls : [];
@@ -12026,7 +12205,7 @@ var installCmuxCommand = new Command29("cmux").description(
12026
12205
  height: parseHeight(opts.height)
12027
12206
  };
12028
12207
  let doc = { controls: [] };
12029
- if (existsSync14(dockPath)) {
12208
+ if (existsSync15(dockPath)) {
12030
12209
  const raw = readFileSync7(dockPath, "utf8");
12031
12210
  try {
12032
12211
  const parsed = JSON.parse(raw);
@@ -12073,20 +12252,20 @@ To see it:
12073
12252
  import { intro as intro10, log as log37, note as note4, outro as outro9 } from "@clack/prompts";
12074
12253
  import { Command as Command30, Option } from "commander";
12075
12254
  import { spawnSync as spawnSync4 } from "child_process";
12076
- import { chmodSync, existsSync as existsSync15, mkdirSync as mkdirSync10, readFileSync as readFileSync8, writeFileSync as writeFileSync10 } from "fs";
12255
+ import { chmodSync, existsSync as existsSync16, mkdirSync as mkdirSync10, readFileSync as readFileSync8, writeFileSync as writeFileSync10 } from "fs";
12077
12256
  import { homedir as homedir20 } from "os";
12078
- import { dirname as dirname6, join as join25 } from "path";
12257
+ import { dirname as dirname6, join as join26 } from "path";
12079
12258
  var PLUGIN_VERSION = "0.2.0";
12080
12259
  function herdrPluginDir(env = process.env) {
12081
- const home = env["AGENTBOX_HOME"] ?? join25(homedir20(), ".agentbox");
12082
- return join25(home, "herdr", "plugin");
12260
+ const home = env["AGENTBOX_HOME"] ?? join26(homedir20(), ".agentbox");
12261
+ return join26(home, "herdr", "plugin");
12083
12262
  }
12084
12263
  function herdrConfigPath(env = process.env) {
12085
12264
  const override = env["HERDR_CONFIG_PATH"];
12086
12265
  if (override && override.length > 0) return override;
12087
12266
  const xdg = env["XDG_CONFIG_HOME"];
12088
- const base = xdg && xdg.length > 0 ? xdg : join25(homedir20(), ".config");
12089
- return join25(base, "herdr", "config.toml");
12267
+ const base = xdg && xdg.length > 0 ? xdg : join26(homedir20(), ".config");
12268
+ return join26(base, "herdr", "config.toml");
12090
12269
  }
12091
12270
  function herdrBinary(env = process.env) {
12092
12271
  const b = env["HERDR_BIN_PATH"];
@@ -12202,13 +12381,13 @@ function escapeRe(s) {
12202
12381
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
12203
12382
  }
12204
12383
  function writeShim(dir) {
12205
- const p = join25(dir, "agentbox-shim.sh");
12384
+ const p = join26(dir, "agentbox-shim.sh");
12206
12385
  writeFileSync10(p, herdrShimContent(process.execPath, process.argv[1] ?? "agentbox"));
12207
12386
  chmodSync(p, 493);
12208
12387
  }
12209
12388
  function applyKeybindings() {
12210
12389
  const cfg = herdrConfigPath();
12211
- const existing = existsSync15(cfg) ? readFileSync8(cfg, "utf8") : "";
12390
+ const existing = existsSync16(cfg) ? readFileSync8(cfg, "utf8") : "";
12212
12391
  mkdirSync10(dirname6(cfg), { recursive: true });
12213
12392
  writeFileSync10(cfg, upsertHerdrKeybindings(existing, herdrKeybindingsBlock()));
12214
12393
  spawnSync4(herdrBinary(), ["server", "reload-config"], { stdio: "ignore" });
@@ -12227,18 +12406,18 @@ var installHerdrCommand = new Command30("herdr").description(
12227
12406
  return;
12228
12407
  }
12229
12408
  const dir = herdrPluginDir();
12230
- const file = join25(dir, "herdr-plugin.toml");
12409
+ const file = join26(dir, "herdr-plugin.toml");
12231
12410
  const cfgPath = herdrConfigPath();
12232
12411
  if (opts.dryRun) {
12233
12412
  intro10("agentbox install herdr (dry run)");
12234
12413
  process.stdout.write(`# --- ${file} ---
12235
12414
  ${buildHerdrManifest()}
12236
12415
  `);
12237
- process.stdout.write(`# --- ${join25(dir, "build.sh")} ---
12416
+ process.stdout.write(`# --- ${join26(dir, "build.sh")} ---
12238
12417
  ${herdrBuildScript()}
12239
12418
  `);
12240
12419
  process.stdout.write(
12241
- `# --- ${join25(dir, "agentbox-shim.sh")} ---
12420
+ `# --- ${join26(dir, "agentbox-shim.sh")} ---
12242
12421
  ${herdrShimContent(process.execPath, process.argv[1] ?? "agentbox")}
12243
12422
  `
12244
12423
  );
@@ -12250,7 +12429,7 @@ ${herdrKeybindingsBlock()}
12250
12429
  }
12251
12430
  mkdirSync10(dir, { recursive: true });
12252
12431
  writeFileSync10(file, buildHerdrManifest());
12253
- const buildPath = join25(dir, "build.sh");
12432
+ const buildPath = join26(dir, "build.sh");
12254
12433
  writeFileSync10(buildPath, herdrBuildScript());
12255
12434
  chmodSync(buildPath, 493);
12256
12435
  writeShim(dir);
@@ -12284,7 +12463,7 @@ Added shortcuts to ${cfg}
12284
12463
  import { Command as Command31 } from "commander";
12285
12464
  import { spawnSync as spawnSync5 } from "child_process";
12286
12465
  import {
12287
- existsSync as existsSync16,
12466
+ existsSync as existsSync17,
12288
12467
  mkdirSync as mkdirSync11,
12289
12468
  readFileSync as readFileSync9,
12290
12469
  readdirSync as readdirSync4,
@@ -12293,43 +12472,43 @@ import {
12293
12472
  writeFileSync as writeFileSync11
12294
12473
  } from "fs";
12295
12474
  import { homedir as homedir21 } from "os";
12296
- import { dirname as dirname7, join as join26 } from "path";
12475
+ import { dirname as dirname7, join as join27 } from "path";
12297
12476
  import { parse as parseToml } from "smol-toml";
12298
12477
  var MARKETPLACE_SOURCE = "madarco/agentbox";
12299
12478
  var MARKETPLACE_NAME = "agentbox";
12300
12479
  var PLUGIN_NAME = "agentbox";
12301
12480
  var PLUGIN_ID = `${PLUGIN_NAME}@${MARKETPLACE_NAME}`;
12302
- var PLUGIN_BUNDLE_REL = join26("plugins", "agentbox");
12481
+ var PLUGIN_BUNDLE_REL = join27("plugins", "agentbox");
12303
12482
  function marketplaceSource(opts = {}) {
12304
12483
  const devRoot = opts.noDev ? null : resolveDevRepoRoot();
12305
12484
  return { source: devRoot ?? MARKETPLACE_SOURCE, devRoot };
12306
12485
  }
12307
12486
  function symlinkStagedSkills(devRoot, env = process.env) {
12308
12487
  try {
12309
- const pluginRoot = join26(codexHomeDir(env), "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME);
12310
- const bundle = join26(devRoot, PLUGIN_BUNDLE_REL);
12488
+ const pluginRoot = join27(codexHomeDir(env), "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME);
12489
+ const bundle = join27(devRoot, PLUGIN_BUNDLE_REL);
12311
12490
  let versionDir;
12312
12491
  try {
12313
12492
  const manifest = JSON.parse(
12314
- readFileSync9(join26(bundle, ".codex-plugin", "plugin.json"), "utf8")
12493
+ readFileSync9(join27(bundle, ".codex-plugin", "plugin.json"), "utf8")
12315
12494
  );
12316
- if (manifest.version) versionDir = join26(pluginRoot, manifest.version);
12495
+ if (manifest.version) versionDir = join27(pluginRoot, manifest.version);
12317
12496
  } catch {
12318
12497
  }
12319
- if (!versionDir || !existsSync16(versionDir)) {
12320
- const children = existsSync16(pluginRoot) ? readdirSync4(pluginRoot) : [];
12321
- versionDir = children.length === 1 ? join26(pluginRoot, children[0]) : void 0;
12498
+ if (!versionDir || !existsSync17(versionDir)) {
12499
+ const children = existsSync17(pluginRoot) ? readdirSync4(pluginRoot) : [];
12500
+ versionDir = children.length === 1 ? join27(pluginRoot, children[0]) : void 0;
12322
12501
  }
12323
- if (!versionDir || !existsSync16(versionDir)) {
12502
+ if (!versionDir || !existsSync17(versionDir)) {
12324
12503
  return { linked: 0, error: "staged plugin dir not found" };
12325
12504
  }
12326
- const skillsDir = join26(bundle, "skills");
12327
- if (!existsSync16(skillsDir)) return { linked: 0 };
12505
+ const skillsDir = join27(bundle, "skills");
12506
+ if (!existsSync17(skillsDir)) return { linked: 0 };
12328
12507
  let linked = 0;
12329
12508
  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");
12509
+ const repoSkill = join27(skillsDir, name, "SKILL.md");
12510
+ if (!existsSync17(repoSkill)) continue;
12511
+ const stagedSkill = join27(versionDir, "skills", name, "SKILL.md");
12333
12512
  mkdirSync11(dirname7(stagedSkill), { recursive: true });
12334
12513
  rmSync3(stagedSkill, { force: true });
12335
12514
  symlinkSync2(repoSkill, stagedSkill);
@@ -12341,14 +12520,14 @@ function symlinkStagedSkills(devRoot, env = process.env) {
12341
12520
  }
12342
12521
  }
12343
12522
  function syncBundleSkill(devRoot) {
12344
- spawnSync5("node", [join26(devRoot, "scripts", "check-plugin-skill-sync.mjs"), "--fix"], {
12523
+ spawnSync5("node", [join27(devRoot, "scripts", "check-plugin-skill-sync.mjs"), "--fix"], {
12345
12524
  cwd: devRoot,
12346
12525
  stdio: "ignore"
12347
12526
  });
12348
12527
  }
12349
12528
  function codexHomeDir(env = process.env) {
12350
12529
  const override = env["CODEX_HOME"];
12351
- return override && override.length > 0 ? override : join26(homedir21(), ".codex");
12530
+ return override && override.length > 0 ? override : join27(homedir21(), ".codex");
12352
12531
  }
12353
12532
  function currentMarketplaceType(env = process.env) {
12354
12533
  try {
@@ -12361,7 +12540,7 @@ function currentMarketplaceType(env = process.env) {
12361
12540
  }
12362
12541
  }
12363
12542
  function codexConfigPath(env = process.env) {
12364
- return join26(codexHomeDir(env), "config.toml");
12543
+ return join27(codexHomeDir(env), "config.toml");
12365
12544
  }
12366
12545
  function codexBinary(env = process.env) {
12367
12546
  const b = env["CODEX_BIN_PATH"];
@@ -12437,7 +12616,7 @@ async function installCodexPlugin(opts = {}) {
12437
12616
  configPath: cfgPath,
12438
12617
  dev: devRoot !== null
12439
12618
  };
12440
- if (!existsSync16(codexHomeDir(env)) || !codexCliAvailable(env)) {
12619
+ if (!existsSync17(codexHomeDir(env)) || !codexCliAvailable(env)) {
12441
12620
  return result;
12442
12621
  }
12443
12622
  result.ran = true;
@@ -12447,7 +12626,7 @@ async function installCodexPlugin(opts = {}) {
12447
12626
  process.stdout.write(
12448
12627
  `# would run: ${bin} plugin marketplace add ${source}
12449
12628
  # would run: ${bin} plugin add ${PLUGIN_ID}
12450
- ` + (devRoot ? `# would symlink the staged skills/*/SKILL.md -> ${join26(devRoot, PLUGIN_BUNDLE_REL, "skills")}/*
12629
+ ` + (devRoot ? `# would symlink the staged skills/*/SKILL.md -> ${join27(devRoot, PLUGIN_BUNDLE_REL, "skills")}/*
12451
12630
  ` : "") + `# --- appended to ${cfgPath} (only if not already configured) ---
12452
12631
  ${codexPluginEnableTable()}
12453
12632
  `
@@ -12488,7 +12667,7 @@ ${codexPluginEnableTable()}
12488
12667
  }
12489
12668
  }
12490
12669
  }
12491
- const existing = existsSync16(cfgPath) ? readFileSync9(cfgPath, "utf8") : "";
12670
+ const existing = existsSync17(cfgPath) ? readFileSync9(cfgPath, "utf8") : "";
12492
12671
  const { text: text3, status } = upsertCodexPluginEnable(existing, { force: opts.force });
12493
12672
  result.enableStatus = status;
12494
12673
  if (text3 !== existing) {
@@ -12609,21 +12788,21 @@ ${LOGO_L2}\x1B[0m` + SYNC_END2);
12609
12788
  var LEGACY_INFO_MARKER = "Drive AgentBox from the host:";
12610
12789
  function installTargets() {
12611
12790
  const home = homedir22();
12612
- const claudeSkills = join27(home, ".claude", "skills");
12791
+ const claudeSkills = join28(home, ".claude", "skills");
12613
12792
  return [
12614
12793
  {
12615
- src: join27("agentbox-info", "SKILL.md"),
12616
- dest: join27(claudeSkills, "agentbox-info", "SKILL.md")
12794
+ src: join28("agentbox-info", "SKILL.md"),
12795
+ dest: join28(claudeSkills, "agentbox-info", "SKILL.md")
12617
12796
  },
12618
12797
  {
12619
- src: join27("codex", "agentbox.md"),
12620
- dest: join27(home, ".codex", "prompts", "agentbox.md"),
12621
- gateDir: join27(home, ".codex")
12798
+ src: join28("codex", "agentbox.md"),
12799
+ dest: join28(home, ".codex", "prompts", "agentbox.md"),
12800
+ gateDir: join28(home, ".codex")
12622
12801
  },
12623
12802
  {
12624
- src: join27("opencode", "agentbox.md"),
12625
- dest: join27(home, ".config", "opencode", "commands", "agentbox.md"),
12626
- gateDir: join27(home, ".config", "opencode")
12803
+ src: join28("opencode", "agentbox.md"),
12804
+ dest: join28(home, ".config", "opencode", "commands", "agentbox.md"),
12805
+ gateDir: join28(home, ".config", "opencode")
12627
12806
  }
12628
12807
  ];
12629
12808
  }
@@ -12635,7 +12814,7 @@ function isSymlink(target) {
12635
12814
  }
12636
12815
  }
12637
12816
  function writableReason(target, force) {
12638
- if (!existsSync17(target)) {
12817
+ if (!existsSync18(target)) {
12639
12818
  if (isSymlink(target)) return "managed";
12640
12819
  return "new";
12641
12820
  }
@@ -12655,13 +12834,13 @@ function installHostSkills(opts = {}) {
12655
12834
  const blocked = [];
12656
12835
  let skipped = 0;
12657
12836
  for (const t of installTargets()) {
12658
- const src = join27(srcDir, t.src);
12659
- if (!existsSync17(src)) {
12837
+ const src = join28(srcDir, t.src);
12838
+ if (!existsSync18(src)) {
12660
12839
  if (!quiet) prompt_exports.log.warn(`bundled file missing (skipped): ${src}`);
12661
12840
  skipped++;
12662
12841
  continue;
12663
12842
  }
12664
- if (t.gateDir && !existsSync17(t.gateDir)) continue;
12843
+ if (t.gateDir && !existsSync18(t.gateDir)) continue;
12665
12844
  const reason = writableReason(t.dest, force);
12666
12845
  if (reason === "skip") {
12667
12846
  if (!quiet) prompt_exports.log.warn(`user-modified file at ${t.dest}, skipping; pass --force to overwrite`);
@@ -12692,9 +12871,9 @@ async function installForkSkill(opts = {}) {
12692
12871
  const dryRun = opts.dryRun === true;
12693
12872
  const quiet = opts.quiet === true;
12694
12873
  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)) {
12874
+ const src = join28(srcDir, "agentbox", "SKILL.md");
12875
+ const dest = join28(homedir22(), ".claude", "skills", "agentbox", "SKILL.md");
12876
+ if (!existsSync18(src)) {
12698
12877
  if (!quiet) prompt_exports.log.warn(`bundled file missing (skipped): ${src}`);
12699
12878
  return { written: [], skipped: 1, blocked: [], method: "skip" };
12700
12879
  }
@@ -12732,7 +12911,7 @@ async function installForkSkill(opts = {}) {
12732
12911
  ],
12733
12912
  { timeout: 12e4 }
12734
12913
  );
12735
- if (existsSync17(dest)) return { written: [dest], skipped: 0, blocked: [], method: "npx" };
12914
+ if (existsSync18(dest)) return { written: [dest], skipped: 0, blocked: [], method: "npx" };
12736
12915
  throw new Error("`skills add` reported success but wrote no skill file");
12737
12916
  } catch (err) {
12738
12917
  if (!quiet) {
@@ -12913,7 +13092,16 @@ var installCommand = new Command32("install").description(
12913
13092
  ).option("--force", "overwrite existing skill files even if not AgentBox-managed").option("--dry-run", "print what would be written without changing anything").option(
12914
13093
  "-p, --provider <name>",
12915
13094
  "pre-select the provider to set up (docker | daytona | hetzner | vercel)"
12916
- ).option("-y, --yes", "auto-confirm the prepare step").action(async (opts) => {
13095
+ ).option("-y, --yes", "auto-confirm the prepare step").action(async (opts, cmd) => {
13096
+ const stray = cmd.args[0];
13097
+ if (stray !== void 0) {
13098
+ const targets = cmd.commands.map((c) => c.name()).join(", ");
13099
+ process.stderr.write(
13100
+ `error: unknown install target '${stray}'. Valid targets: ${targets} \u2014 or run \`agentbox install\` with no target for the setup wizard.
13101
+ `
13102
+ );
13103
+ process.exit(1);
13104
+ }
12917
13105
  if (opts.skillsOnly) {
12918
13106
  (0, prompt_exports.intro)("Installing AgentBox host commands...");
12919
13107
  let res;
@@ -12952,11 +13140,11 @@ installCommand.enablePositionalOptions();
12952
13140
  installCommand.addCommand(installCmuxCommand);
12953
13141
  installCommand.addCommand(installHerdrCommand);
12954
13142
  installCommand.addCommand(installCodexCommand);
12955
- installCommand.addCommand(installTrayCommand);
13143
+ installCommand.addCommand(installAppCommand);
12956
13144
 
12957
13145
  // src/commands/plugin.ts
12958
13146
  import { execFileSync } from "child_process";
12959
- import { existsSync as existsSync18, readFileSync as readFileSync11, statSync as statSync3 } from "fs";
13147
+ import { existsSync as existsSync19, readFileSync as readFileSync11, statSync as statSync3 } from "fs";
12960
13148
  import { createRequire } from "module";
12961
13149
  import { dirname as dirname9, isAbsolute as isAbsolute3, resolve as resolve6 } from "path";
12962
13150
  import { pathToFileURL } from "url";
@@ -12974,7 +13162,7 @@ function resolutionPaths() {
12974
13162
  }
12975
13163
  function resolvePackage(arg) {
12976
13164
  let pkgDir;
12977
- if ((arg.startsWith(".") || arg.startsWith("/") || isAbsolute3(arg)) && existsSync18(arg)) {
13165
+ if ((arg.startsWith(".") || arg.startsWith("/") || isAbsolute3(arg)) && existsSync19(arg)) {
12978
13166
  pkgDir = statSync3(arg).isDirectory() ? resolve6(arg) : dirname9(resolve6(arg));
12979
13167
  } else {
12980
13168
  const req = createRequire(pathToFileURL(resolve6(process.cwd(), "noop.js")).href);
@@ -13925,7 +14113,7 @@ var logsCommand = new Command37("logs").description("Print recent log lines from
13925
14113
  // src/commands/open.ts
13926
14114
  import { log as log43 } from "@clack/prompts";
13927
14115
  import { execa as execa9 } from "execa";
13928
- import { existsSync as existsSync19, mkdirSync as mkdirSync13 } from "fs";
14116
+ import { existsSync as existsSync20, mkdirSync as mkdirSync13 } from "fs";
13929
14117
  import { homedir as homedir23 } from "os";
13930
14118
  import { join as join29 } from "path";
13931
14119
  import { Command as Command38, InvalidArgumentError as InvalidArgumentError3 } from "commander";
@@ -13949,104 +14137,26 @@ async function runPath(box, opts) {
13949
14137
  }
13950
14138
  }
13951
14139
 
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
14140
  // src/commands/open.ts
14031
14141
  function parseOpenTarget(value) {
14032
- if (value === "codex" || value === "herdr" || value === "cmux" || value === "vscode" || value === "iterm2" || value === "finder") {
14142
+ if (value === "claude" || value === "codex" || value === "herdr" || value === "cmux" || value === "vscode" || value === "iterm2" || value === "finder") {
14033
14143
  return value;
14034
14144
  }
14035
14145
  throw new InvalidArgumentError3(
14036
- `expected one of: codex, herdr, cmux, vscode, iterm2, finder (got "${value}")`
14146
+ `expected one of: claude, codex, herdr, cmux, vscode, iterm2, finder (got "${value}")`
14037
14147
  );
14038
14148
  }
14039
14149
  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"
14150
+ "Mount a box /workspace via sshfs and reveal in Finder (default), or open it in a host app via --in"
14041
14151
  ).argument(
14042
14152
  "[box]",
14043
14153
  "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(
14154
+ ).option("--no-refresh", "legacy docker (no sshd) only: skip the rsync; open what's on disk").option(
14045
14155
  "--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(
14156
+ "legacy docker (no sshd) only: include /workspace/node_modules in the export"
14157
+ ).option("--path", "print the host mount path instead of launching Finder").option("--print", "alias of --path").option(
14048
14158
  "--unmount",
14049
- "cloud only: unmount any existing sshfs mount for the box and exit"
14159
+ "unmount any existing sshfs mount for the box and exit"
14050
14160
  ).option(
14051
14161
  "--in <app>",
14052
14162
  "open the box in a host app instead of Finder: codex | herdr | cmux | vscode | iterm2 | finder",
@@ -14059,7 +14169,19 @@ var openCommand = new Command38("open").description(
14059
14169
  return;
14060
14170
  }
14061
14171
  const box = await resolveBoxOrExit(idOrName);
14172
+ if (opts.unmount) {
14173
+ const mountRoot = join29(homedir23(), ".agentbox", "mounts", box.name);
14174
+ const ok = await tryUnmount(mountRoot);
14175
+ process.stdout.write(ok ? `unmounted ${mountRoot}
14176
+ ` : `nothing mounted at ${mountRoot}
14177
+ `);
14178
+ return;
14179
+ }
14062
14180
  const app = opts.in ?? "finder";
14181
+ if (app === "claude") {
14182
+ await openInClaude(box);
14183
+ return;
14184
+ }
14063
14185
  if (app === "codex") {
14064
14186
  await openInCodex(box);
14065
14187
  return;
@@ -14072,11 +14194,16 @@ var openCommand = new Command38("open").description(
14072
14194
  await runCodeOpen(box, {});
14073
14195
  return;
14074
14196
  }
14075
- const isCloud = (box.provider ?? "docker") !== "docker";
14076
- if (isCloud) {
14077
- await runCloudOpen(box, opts);
14197
+ const providerName = box.provider ?? "docker";
14198
+ if (SSH_MOUNT_PROVIDERS.includes(providerName) && (providerName !== "docker" || box.sshEnabled)) {
14199
+ await runSshfsMount(box, opts);
14078
14200
  return;
14079
14201
  }
14202
+ if (providerName !== "docker") {
14203
+ throw new Error(
14204
+ `'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'.`
14205
+ );
14206
+ }
14080
14207
  if (opts.path || opts.print) {
14081
14208
  await runPath(box, {
14082
14209
  refresh: opts.refresh,
@@ -14097,18 +14224,34 @@ var openCommand = new Command38("open").description(
14097
14224
  handleLifecycleError(err);
14098
14225
  }
14099
14226
  });
14100
- async function openInCodex(box) {
14227
+ async function ensurePersistentSshAlias(box, appLabel) {
14101
14228
  const providerName = box.provider ?? "docker";
14102
14229
  if (!PERSISTENT_SSH_PROVIDERS.includes(providerName)) {
14103
14230
  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.`
14231
+ `'--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'.`
14105
14232
  );
14106
14233
  }
14234
+ if (providerName === "docker" && !box.sshEnabled) {
14235
+ throw new Error(
14236
+ `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'.`
14237
+ );
14238
+ }
14239
+ if (providerName === "docker") {
14240
+ let online = await bringDockerBoxOnline(box);
14241
+ if (!online.ssh) online = await resolveBoxOrExit(online.id);
14242
+ if (!online.ssh?.identityFile) {
14243
+ throw new Error(
14244
+ `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.`
14245
+ );
14246
+ }
14247
+ await syncAgentboxSshConfig();
14248
+ return agentboxAliasFor(online.name);
14249
+ }
14107
14250
  const provider = await providerForBox(box);
14108
14251
  const conn = await resolveCloudSshTarget(box, provider);
14109
14252
  if (!conn.identityFile) {
14110
14253
  throw new Error(
14111
- `box '${box.name}' (provider '${providerName}') has no persistent SSH key, so it can't be added to Codex over SSH.`
14254
+ `box '${box.name}' (provider '${providerName}') has no persistent SSH key, so it can't be added to ${appLabel} over SSH.`
14112
14255
  );
14113
14256
  }
14114
14257
  await recordBoxSsh(box.id, {
@@ -14117,23 +14260,47 @@ async function openInCodex(box) {
14117
14260
  identityFile: conn.identityFile
14118
14261
  });
14119
14262
  await syncAgentboxSshConfig();
14120
- log43.info(`ssh alias '${conn.alias}' written (Include'd from ~/.ssh/config)`);
14121
- const url = codexAddUrl(conn.alias);
14263
+ return conn.alias;
14264
+ }
14265
+ async function openInCodex(box) {
14266
+ const alias = await ensurePersistentSshAlias(box, "Codex");
14267
+ log43.info(`ssh alias '${alias}' written (Include'd from ~/.ssh/config)`);
14268
+ const url = codexAddUrl(alias);
14122
14269
  const opened = await execa9(hostOpenCommand(), [url], { reject: false });
14123
14270
  if (opened.exitCode !== 0) {
14124
14271
  log43.warn(
14125
14272
  `could not auto-open the Codex link (is Codex.app installed?): ${opened.stderr || `exit ${String(opened.exitCode)}`}`
14126
14273
  );
14127
- const link = hyperlink(`Add ${conn.alias} to Codex SSH`, url, process.stdout);
14274
+ const link = hyperlink(`Add ${alias} to Codex SSH`, url, process.stdout);
14128
14275
  process.stdout.write(`open manually: ${link}
14129
14276
  ${url}
14130
14277
  `);
14131
14278
  process.exitCode = 1;
14132
14279
  return;
14133
14280
  }
14134
- log43.success(`opening Codex \u2014 the SSH connection form is pre-filled with '${conn.alias}'`);
14281
+ log43.success(`opening Codex \u2014 the SSH connection form is pre-filled with '${alias}'`);
14135
14282
  process.stdout.write(url + "\n");
14136
14283
  }
14284
+ async function openInClaude(box) {
14285
+ const alias = await ensurePersistentSshAlias(box, "Claude");
14286
+ log43.info(`ssh alias '${alias}' written (Include'd from ~/.ssh/config)`);
14287
+ const entry = claudeSshEntryFor(alias, box.name);
14288
+ upsertClaudeSshConfig(entry);
14289
+ log43.info(`added '${entry.name}' to Claude desktop's SSH connections (${claudeSettingsPath()})`);
14290
+ const opened = await execa9(hostOpenCommand(), ["-a", "Claude"], { reject: false });
14291
+ if (opened.exitCode !== 0) {
14292
+ log43.warn(
14293
+ `could not launch Claude (is Claude.app installed?): ${opened.stderr || `exit ${String(opened.exitCode)}`}`
14294
+ );
14295
+ process.stdout.write(
14296
+ `the SSH connection '${entry.name}' is saved \u2014 open Claude manually and pick it from the Environment dropdown
14297
+ `
14298
+ );
14299
+ process.exitCode = 1;
14300
+ return;
14301
+ }
14302
+ log43.success(`opening Claude \u2014 pick '${entry.name}' from the Environment dropdown`);
14303
+ }
14137
14304
  async function openInTerminalApp(box, host) {
14138
14305
  if ((box.provider ?? "docker") === "docker") {
14139
14306
  const insp = await inspectBox(box.id);
@@ -14202,16 +14369,22 @@ ${r.error ?? ""}`
14202
14369
  }
14203
14370
  log43.success(`opened ${box.name} in a new ${host} ${host === "iterm2" ? "window" : "workspace"} (agentbox attach)`);
14204
14371
  }
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;
14372
+ async function bringDockerBoxOnline(box) {
14373
+ const insp = await inspectBox(box.id);
14374
+ if (insp.state === "paused") {
14375
+ log43.info("box is paused; unpausing");
14376
+ await unpauseBox(box.id);
14377
+ } else if (insp.state === "stopped") {
14378
+ log43.info("box is stopped; starting");
14379
+ const started = await startBox(box.id);
14380
+ return started.record;
14381
+ } else if (insp.state === "missing") {
14382
+ throw new Error(`box ${box.name} has no container; was it destroyed?`);
14214
14383
  }
14384
+ return await refreshBoxSshd(box);
14385
+ }
14386
+ async function runSshfsMount(box, opts) {
14387
+ const mountRoot = join29(homedir23(), ".agentbox", "mounts", box.name);
14215
14388
  if (opts.path || opts.print) {
14216
14389
  process.stdout.write(`${mountRoot}
14217
14390
  `);
@@ -14220,12 +14393,25 @@ async function runCloudOpen(box, opts) {
14220
14393
  const sshfsBin = await locateBinary("sshfs");
14221
14394
  if (!sshfsBin) {
14222
14395
  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."
14396
+ "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
14397
  );
14225
14398
  }
14226
- const provider = await providerForBox(box);
14227
- const { alias } = await ensureCloudSshAlias(box, provider);
14228
- if (!existsSync19(mountRoot)) {
14399
+ let alias;
14400
+ if ((box.provider ?? "docker") === "docker") {
14401
+ let online = await bringDockerBoxOnline(box);
14402
+ if (!online.ssh) online = await resolveBoxOrExit(online.id);
14403
+ if (!online.ssh) {
14404
+ throw new Error(
14405
+ `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'.`
14406
+ );
14407
+ }
14408
+ await syncAgentboxSshConfig();
14409
+ alias = agentboxAliasFor(online.name);
14410
+ } else {
14411
+ const provider = await providerForBox(box);
14412
+ ({ alias } = await ensureCloudSshAlias(box, provider));
14413
+ }
14414
+ if (!existsSync20(mountRoot)) {
14229
14415
  mkdirSync13(mountRoot, { recursive: true, mode: 493 });
14230
14416
  } else if (await isMounted(mountRoot)) {
14231
14417
  log43.info(`re-mounting (stale mount detected at ${mountRoot})`);
@@ -14249,7 +14435,9 @@ async function runCloudOpen(box, opts) {
14249
14435
  { reject: false }
14250
14436
  );
14251
14437
  if (mount.exitCode !== 0) {
14252
- throw new Error(`sshfs mount failed (exit ${String(mount.exitCode)}): ${mount.stderr || mount.stdout}`);
14438
+ const err = `${mount.stderr || ""}${mount.stdout || ""}`;
14439
+ 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.` : "";
14440
+ throw new Error(`sshfs mount failed (exit ${String(mount.exitCode)}): ${err}${macfuseHint}`);
14253
14441
  }
14254
14442
  await execa9(hostOpenCommand(), [mountRoot], { reject: false });
14255
14443
  process.stdout.write(`opened ${mountRoot}
@@ -14914,7 +15102,7 @@ var hubCommand = new Command43("hub").description(
14914
15102
  import { isCancel as isCancel5, log as log48, note as note7, select as select3, spinner as spinner12 } from "@clack/prompts";
14915
15103
  import { Command as Command44 } from "commander";
14916
15104
  import { spawn as spawn10 } from "child_process";
14917
- import { existsSync as existsSync20, readFileSync as readFileSync12 } from "fs";
15105
+ import { existsSync as existsSync21, readFileSync as readFileSync12 } from "fs";
14918
15106
  import { chmod, mkdir as mkdir2, rm, writeFile as writeFile5 } from "fs/promises";
14919
15107
  import { hostname, homedir as homedir25, tmpdir as tmpdir6 } from "os";
14920
15108
  import { join as join32 } from "path";
@@ -15524,7 +15712,7 @@ var unsetUrlSub = new Command44("unset-url").description("Stop using a control p
15524
15712
  `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
15713
  );
15526
15714
  }
15527
- if (existsSync20(CP_DIR2)) {
15715
+ if (existsSync21(CP_DIR2)) {
15528
15716
  if (opts.purge) {
15529
15717
  await rm(CP_DIR2, { recursive: true, force: true });
15530
15718
  log48.success(`Purged this machine's control-plane credentials (${CP_DIR2}).`);
@@ -15604,7 +15792,7 @@ var addSub = new Command44("add").description("Authorize the current project's g
15604
15792
  });
15605
15793
  function loadControlPlaneEnv() {
15606
15794
  if (process.env.GITHUB_APP_ID && process.env.GITHUB_APP_PRIVATE_KEY) return;
15607
- if (!existsSync20(ENV_PATH2)) return;
15795
+ if (!existsSync21(ENV_PATH2)) return;
15608
15796
  for (const line of readFileSync12(ENV_PATH2, "utf8").split("\n")) {
15609
15797
  const m = /^([A-Z_]+)=(.*)$/.exec(line.trim());
15610
15798
  if (m && !process.env[m[1]]) process.env[m[1]] = m[2];
@@ -16331,7 +16519,7 @@ async function maybeUpdateTray(say) {
16331
16519
  }
16332
16520
  const res = await installTray({ quiet: true });
16333
16521
  say(
16334
- res.ran ? "menu-bar app updated" : `menu-bar app not updated (${res.reason ?? "unknown"}) \u2014 run \`agentbox install tray\` manually`
16522
+ res.ran ? "menu-bar app updated" : `menu-bar app not updated (${res.reason ?? "unknown"}) \u2014 run \`agentbox install app\` manually`
16335
16523
  );
16336
16524
  }
16337
16525
  async function runPostUpdateRefresh(opts = {}) {
@@ -16393,6 +16581,7 @@ var postUpdateRefreshCommand = new Command48("_post-update-refresh").description
16393
16581
  import { readFile as readFile8 } from "fs/promises";
16394
16582
 
16395
16583
  // src/exec-method.ts
16584
+ import { realpathSync } from "fs";
16396
16585
  function detectExecutionMethod(input) {
16397
16586
  const ua = input.userAgent ?? "";
16398
16587
  const argv1 = input.argv1 ?? "";
@@ -16405,6 +16594,17 @@ function detectExecutionMethod(input) {
16405
16594
  if (/\bnpm\//.test(ua)) {
16406
16595
  return "npm";
16407
16596
  }
16597
+ let real = argv1;
16598
+ try {
16599
+ real = realpathSync(argv1);
16600
+ } catch {
16601
+ }
16602
+ if (real.includes("/pnpm/global/")) {
16603
+ return "pnpm";
16604
+ }
16605
+ if (real.includes("/lib/node_modules/")) {
16606
+ return "npm";
16607
+ }
16408
16608
  return "direct";
16409
16609
  }
16410
16610
 
@@ -16436,7 +16636,7 @@ function isNewer(latest, current) {
16436
16636
  var PKG = "@madarco/agentbox";
16437
16637
  var REGISTRY_URL = `https://registry.npmjs.org/${PKG}/latest`;
16438
16638
  function nudgeEligible(method, version) {
16439
- return version !== "0.0.0-dev" && method !== "npx";
16639
+ return version !== "0.0.0-dev" && (method === "npm" || method === "pnpm");
16440
16640
  }
16441
16641
  async function updateCheckEnabled() {
16442
16642
  try {
@@ -18404,7 +18604,7 @@ if (AGENTBOX_VERSION !== "0.0.0-dev") {
18404
18604
  versionPromptShown = true;
18405
18605
  try {
18406
18606
  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?`,
18607
+ message: `agentbox was updated (${state.lastRunVersion} \u2192 ${AGENTBOX_VERSION}) \u2014 download new version now?`,
18408
18608
  initialValue: true
18409
18609
  });
18410
18610
  if (yes) {