@jlongo78/agent-spaces 0.4.0 → 0.5.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 (451) hide show
  1. package/.next/standalone/.claude/settings.local.json +11 -0
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/required-server-files.json +19 -19
  6. package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/(desktop)/admin/users/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/(desktop)/analytics/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/(desktop)/network/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/(desktop)/page.js +2 -2
  11. package/.next/standalone/.next/server/app/(desktop)/page.js.nft.json +1 -1
  12. package/.next/standalone/.next/server/app/(desktop)/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/(desktop)/projects/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/(desktop)/sessions/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/(desktop)/settings/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/(desktop)/terminal/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/(desktop)/workspaces/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/_global-error.html +2 -2
  22. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  23. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  24. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  25. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  26. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  27. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  28. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  30. package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
  31. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  32. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  33. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  34. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  35. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  36. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  37. package/.next/standalone/.next/server/app/admin/analytics.html +1 -1
  38. package/.next/standalone/.next/server/app/admin/analytics.rsc +5 -5
  39. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics/__PAGE__.segment.rsc +2 -2
  40. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics.segment.rsc +1 -1
  41. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
  42. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  43. package/.next/standalone/.next/server/app/admin/analytics.segments/_full.segment.rsc +5 -5
  44. package/.next/standalone/.next/server/app/admin/analytics.segments/_head.segment.rsc +1 -1
  45. package/.next/standalone/.next/server/app/admin/analytics.segments/_index.segment.rsc +3 -3
  46. package/.next/standalone/.next/server/app/admin/analytics.segments/_tree.segment.rsc +2 -2
  47. package/.next/standalone/.next/server/app/admin/users.html +1 -1
  48. package/.next/standalone/.next/server/app/admin/users.rsc +5 -5
  49. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users/__PAGE__.segment.rsc +2 -2
  50. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users.segment.rsc +1 -1
  51. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
  52. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  53. package/.next/standalone/.next/server/app/admin/users.segments/_full.segment.rsc +5 -5
  54. package/.next/standalone/.next/server/app/admin/users.segments/_head.segment.rsc +1 -1
  55. package/.next/standalone/.next/server/app/admin/users.segments/_index.segment.rsc +3 -3
  56. package/.next/standalone/.next/server/app/admin/users.segments/_tree.segment.rsc +2 -2
  57. package/.next/standalone/.next/server/app/analytics.html +1 -1
  58. package/.next/standalone/.next/server/app/analytics.rsc +5 -5
  59. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics/__PAGE__.segment.rsc +2 -2
  60. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics.segment.rsc +1 -1
  61. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  62. package/.next/standalone/.next/server/app/analytics.segments/_full.segment.rsc +5 -5
  63. package/.next/standalone/.next/server/app/analytics.segments/_head.segment.rsc +1 -1
  64. package/.next/standalone/.next/server/app/analytics.segments/_index.segment.rsc +3 -3
  65. package/.next/standalone/.next/server/app/analytics.segments/_tree.segment.rsc +2 -2
  66. package/.next/standalone/.next/server/app/api/admin/analytics/route.js +1 -1
  67. package/.next/standalone/.next/server/app/api/admin/analytics/route.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/api/admin/users/[id]/route.js +1 -1
  69. package/.next/standalone/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/api/admin/users/route.js +1 -1
  71. package/.next/standalone/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/api/analytics/overview/route.js +2 -2
  73. package/.next/standalone/.next/server/app/api/analytics/overview/route.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/api/auth/login/route.js +1 -1
  75. package/.next/standalone/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  76. package/.next/standalone/.next/server/app/api/auth/logout/route.js +1 -1
  77. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  78. package/.next/standalone/.next/server/app/api/auth/me/route.js +1 -1
  79. package/.next/standalone/.next/server/app/api/auth/me/route.js.nft.json +1 -1
  80. package/.next/standalone/.next/server/app/api/auth/totp/setup/route.js +1 -1
  81. package/.next/standalone/.next/server/app/api/auth/totp/setup/route.js.nft.json +1 -1
  82. package/.next/standalone/.next/server/app/api/auth/totp/status/route.js +1 -1
  83. package/.next/standalone/.next/server/app/api/auth/totp/status/route.js.nft.json +1 -1
  84. package/.next/standalone/.next/server/app/api/auth/totp/verify/route.js +1 -1
  85. package/.next/standalone/.next/server/app/api/auth/totp/verify/route.js.nft.json +1 -1
  86. package/.next/standalone/.next/server/app/api/bulk/route.js +2 -2
  87. package/.next/standalone/.next/server/app/api/bulk/route.js.nft.json +1 -1
  88. package/.next/standalone/.next/server/app/api/chat/route.js +1 -1
  89. package/.next/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
  90. package/.next/standalone/.next/server/app/api/config/route.js +1 -1
  91. package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
  92. package/.next/standalone/.next/server/app/api/events/route.js +2 -2
  93. package/.next/standalone/.next/server/app/api/events/route.js.nft.json +1 -1
  94. package/.next/standalone/.next/server/app/api/folders/route.js +1 -1
  95. package/.next/standalone/.next/server/app/api/folders/route.js.nft.json +1 -1
  96. package/.next/standalone/.next/server/app/api/network/discovered/route.js +1 -1
  97. package/.next/standalone/.next/server/app/api/network/discovered/route.js.nft.json +1 -1
  98. package/.next/standalone/.next/server/app/api/network/handshake/route.js +1 -1
  99. package/.next/standalone/.next/server/app/api/network/handshake/route.js.nft.json +1 -1
  100. package/.next/standalone/.next/server/app/api/network/health/route.js +1 -1
  101. package/.next/standalone/.next/server/app/api/network/health/route.js.nft.json +1 -1
  102. package/.next/standalone/.next/server/app/api/network/identity/route.js +1 -1
  103. package/.next/standalone/.next/server/app/api/network/identity/route.js.nft.json +1 -1
  104. package/.next/standalone/.next/server/app/api/network/keys/[id]/route.js +1 -1
  105. package/.next/standalone/.next/server/app/api/network/keys/[id]/route.js.nft.json +1 -1
  106. package/.next/standalone/.next/server/app/api/network/keys/route.js +1 -1
  107. package/.next/standalone/.next/server/app/api/network/keys/route.js.nft.json +1 -1
  108. package/.next/standalone/.next/server/app/api/network/nodes/[id]/route.js +1 -1
  109. package/.next/standalone/.next/server/app/api/network/nodes/[id]/route.js.nft.json +1 -1
  110. package/.next/standalone/.next/server/app/api/network/nodes/check/route.js +1 -1
  111. package/.next/standalone/.next/server/app/api/network/nodes/check/route.js.nft.json +1 -1
  112. package/.next/standalone/.next/server/app/api/network/nodes/route.js +1 -1
  113. package/.next/standalone/.next/server/app/api/network/nodes/route.js.nft.json +1 -1
  114. package/.next/standalone/.next/server/app/api/network/projects/route.js +1 -1
  115. package/.next/standalone/.next/server/app/api/network/projects/route.js.nft.json +1 -1
  116. package/.next/standalone/.next/server/app/api/network/proxy/[nodeId]/[...path]/route.js +1 -1
  117. package/.next/standalone/.next/server/app/api/network/proxy/[nodeId]/[...path]/route.js.nft.json +1 -1
  118. package/.next/standalone/.next/server/app/api/network/search/route.js +1 -1
  119. package/.next/standalone/.next/server/app/api/network/search/route.js.nft.json +1 -1
  120. package/.next/standalone/.next/server/app/api/network/sessions/[id]/messages/route.js +1 -1
  121. package/.next/standalone/.next/server/app/api/network/sessions/[id]/messages/route.js.nft.json +1 -1
  122. package/.next/standalone/.next/server/app/api/network/sessions/[id]/route.js +1 -1
  123. package/.next/standalone/.next/server/app/api/network/sessions/[id]/route.js.nft.json +1 -1
  124. package/.next/standalone/.next/server/app/api/network/sessions/route.js +1 -1
  125. package/.next/standalone/.next/server/app/api/network/sessions/route.js.nft.json +1 -1
  126. package/.next/standalone/.next/server/app/api/network/terminal/token/route.js +1 -1
  127. package/.next/standalone/.next/server/app/api/network/terminal/token/route.js.nft.json +1 -1
  128. package/.next/standalone/.next/server/app/api/network/workspaces/[id]/route.js +1 -1
  129. package/.next/standalone/.next/server/app/api/network/workspaces/[id]/route.js.nft.json +1 -1
  130. package/.next/standalone/.next/server/app/api/network/workspaces/route.js +1 -1
  131. package/.next/standalone/.next/server/app/api/network/workspaces/route.js.nft.json +1 -1
  132. package/.next/standalone/.next/server/app/api/panes/[id]/route.js +2 -2
  133. package/.next/standalone/.next/server/app/api/panes/[id]/route.js.nft.json +1 -1
  134. package/.next/standalone/.next/server/app/api/panes/route.js +2 -2
  135. package/.next/standalone/.next/server/app/api/panes/route.js.nft.json +1 -1
  136. package/.next/standalone/.next/server/app/api/projects/route.js +2 -2
  137. package/.next/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  138. package/.next/standalone/.next/server/app/api/search/route.js +2 -2
  139. package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  140. package/.next/standalone/.next/server/app/api/sessions/[id]/chat/route.js +2 -2
  141. package/.next/standalone/.next/server/app/api/sessions/[id]/chat/route.js.nft.json +1 -1
  142. package/.next/standalone/.next/server/app/api/sessions/[id]/messages/route.js +2 -2
  143. package/.next/standalone/.next/server/app/api/sessions/[id]/messages/route.js.nft.json +1 -1
  144. package/.next/standalone/.next/server/app/api/sessions/[id]/route.js +2 -2
  145. package/.next/standalone/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  146. package/.next/standalone/.next/server/app/api/sessions/route.js +2 -2
  147. package/.next/standalone/.next/server/app/api/sessions/route.js.nft.json +1 -1
  148. package/.next/standalone/.next/server/app/api/sync/route.js +3 -3
  149. package/.next/standalone/.next/server/app/api/sync/route.js.nft.json +1 -1
  150. package/.next/standalone/.next/server/app/api/tags/route.js +2 -2
  151. package/.next/standalone/.next/server/app/api/tags/route.js.nft.json +1 -1
  152. package/.next/standalone/.next/server/app/api/tier/route.js +1 -1
  153. package/.next/standalone/.next/server/app/api/tier/route.js.nft.json +1 -1
  154. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js +2 -2
  155. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js.nft.json +1 -1
  156. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js +2 -2
  157. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js.nft.json +1 -1
  158. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js +2 -2
  159. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js.nft.json +1 -1
  160. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js +2 -2
  161. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js.nft.json +1 -1
  162. package/.next/standalone/.next/server/app/api/workspaces/[id]/route.js +2 -2
  163. package/.next/standalone/.next/server/app/api/workspaces/[id]/route.js.nft.json +1 -1
  164. package/.next/standalone/.next/server/app/api/workspaces/[id]/sessions/route.js +2 -2
  165. package/.next/standalone/.next/server/app/api/workspaces/[id]/sessions/route.js.nft.json +1 -1
  166. package/.next/standalone/.next/server/app/api/workspaces/route.js +2 -2
  167. package/.next/standalone/.next/server/app/api/workspaces/route.js.nft.json +1 -1
  168. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  169. package/.next/standalone/.next/server/app/login.html +1 -1
  170. package/.next/standalone/.next/server/app/login.rsc +4 -4
  171. package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +4 -4
  172. package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
  173. package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +3 -3
  174. package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  175. package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  176. package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
  177. package/.next/standalone/.next/server/app/m/page_client-reference-manifest.js +1 -1
  178. package/.next/standalone/.next/server/app/m/projects/page_client-reference-manifest.js +1 -1
  179. package/.next/standalone/.next/server/app/m/projects.html +1 -1
  180. package/.next/standalone/.next/server/app/m/projects.rsc +5 -5
  181. package/.next/standalone/.next/server/app/m/projects.segments/_full.segment.rsc +5 -5
  182. package/.next/standalone/.next/server/app/m/projects.segments/_head.segment.rsc +1 -1
  183. package/.next/standalone/.next/server/app/m/projects.segments/_index.segment.rsc +3 -3
  184. package/.next/standalone/.next/server/app/m/projects.segments/_tree.segment.rsc +2 -2
  185. package/.next/standalone/.next/server/app/m/projects.segments/m/projects/__PAGE__.segment.rsc +2 -2
  186. package/.next/standalone/.next/server/app/m/projects.segments/m/projects.segment.rsc +1 -1
  187. package/.next/standalone/.next/server/app/m/projects.segments/m.segment.rsc +2 -2
  188. package/.next/standalone/.next/server/app/m/sessions/[id]/page_client-reference-manifest.js +1 -1
  189. package/.next/standalone/.next/server/app/m/sessions/page_client-reference-manifest.js +1 -1
  190. package/.next/standalone/.next/server/app/m/sessions.html +1 -1
  191. package/.next/standalone/.next/server/app/m/sessions.rsc +5 -5
  192. package/.next/standalone/.next/server/app/m/sessions.segments/_full.segment.rsc +5 -5
  193. package/.next/standalone/.next/server/app/m/sessions.segments/_head.segment.rsc +1 -1
  194. package/.next/standalone/.next/server/app/m/sessions.segments/_index.segment.rsc +3 -3
  195. package/.next/standalone/.next/server/app/m/sessions.segments/_tree.segment.rsc +2 -2
  196. package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions/__PAGE__.segment.rsc +2 -2
  197. package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions.segment.rsc +1 -1
  198. package/.next/standalone/.next/server/app/m/sessions.segments/m.segment.rsc +2 -2
  199. package/.next/standalone/.next/server/app/m/settings/page_client-reference-manifest.js +1 -1
  200. package/.next/standalone/.next/server/app/m/settings.html +1 -1
  201. package/.next/standalone/.next/server/app/m/settings.rsc +5 -5
  202. package/.next/standalone/.next/server/app/m/settings.segments/_full.segment.rsc +5 -5
  203. package/.next/standalone/.next/server/app/m/settings.segments/_head.segment.rsc +1 -1
  204. package/.next/standalone/.next/server/app/m/settings.segments/_index.segment.rsc +3 -3
  205. package/.next/standalone/.next/server/app/m/settings.segments/_tree.segment.rsc +2 -2
  206. package/.next/standalone/.next/server/app/m/settings.segments/m/settings/__PAGE__.segment.rsc +2 -2
  207. package/.next/standalone/.next/server/app/m/settings.segments/m/settings.segment.rsc +1 -1
  208. package/.next/standalone/.next/server/app/m/settings.segments/m.segment.rsc +2 -2
  209. package/.next/standalone/.next/server/app/m/terminal/page_client-reference-manifest.js +1 -1
  210. package/.next/standalone/.next/server/app/m/terminal.html +1 -1
  211. package/.next/standalone/.next/server/app/m/terminal.rsc +5 -5
  212. package/.next/standalone/.next/server/app/m/terminal.segments/_full.segment.rsc +5 -5
  213. package/.next/standalone/.next/server/app/m/terminal.segments/_head.segment.rsc +1 -1
  214. package/.next/standalone/.next/server/app/m/terminal.segments/_index.segment.rsc +3 -3
  215. package/.next/standalone/.next/server/app/m/terminal.segments/_tree.segment.rsc +2 -2
  216. package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal/__PAGE__.segment.rsc +2 -2
  217. package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal.segment.rsc +1 -1
  218. package/.next/standalone/.next/server/app/m/terminal.segments/m.segment.rsc +2 -2
  219. package/.next/standalone/.next/server/app/m.html +1 -1
  220. package/.next/standalone/.next/server/app/m.rsc +5 -5
  221. package/.next/standalone/.next/server/app/m.segments/_full.segment.rsc +5 -5
  222. package/.next/standalone/.next/server/app/m.segments/_head.segment.rsc +1 -1
  223. package/.next/standalone/.next/server/app/m.segments/_index.segment.rsc +3 -3
  224. package/.next/standalone/.next/server/app/m.segments/_tree.segment.rsc +2 -2
  225. package/.next/standalone/.next/server/app/m.segments/m/__PAGE__.segment.rsc +2 -2
  226. package/.next/standalone/.next/server/app/m.segments/m.segment.rsc +2 -2
  227. package/.next/standalone/.next/server/app/network.html +1 -1
  228. package/.next/standalone/.next/server/app/network.rsc +5 -5
  229. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network/__PAGE__.segment.rsc +2 -2
  230. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network.segment.rsc +1 -1
  231. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  232. package/.next/standalone/.next/server/app/network.segments/_full.segment.rsc +5 -5
  233. package/.next/standalone/.next/server/app/network.segments/_head.segment.rsc +1 -1
  234. package/.next/standalone/.next/server/app/network.segments/_index.segment.rsc +3 -3
  235. package/.next/standalone/.next/server/app/network.segments/_tree.segment.rsc +2 -2
  236. package/.next/standalone/.next/server/app/projects.html +1 -1
  237. package/.next/standalone/.next/server/app/projects.rsc +5 -5
  238. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects/__PAGE__.segment.rsc +2 -2
  239. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects.segment.rsc +1 -1
  240. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  241. package/.next/standalone/.next/server/app/projects.segments/_full.segment.rsc +5 -5
  242. package/.next/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
  243. package/.next/standalone/.next/server/app/projects.segments/_index.segment.rsc +3 -3
  244. package/.next/standalone/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
  245. package/.next/standalone/.next/server/app/sessions.html +1 -1
  246. package/.next/standalone/.next/server/app/sessions.rsc +5 -5
  247. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions/__PAGE__.segment.rsc +2 -2
  248. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions.segment.rsc +1 -1
  249. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  250. package/.next/standalone/.next/server/app/sessions.segments/_full.segment.rsc +5 -5
  251. package/.next/standalone/.next/server/app/sessions.segments/_head.segment.rsc +1 -1
  252. package/.next/standalone/.next/server/app/sessions.segments/_index.segment.rsc +3 -3
  253. package/.next/standalone/.next/server/app/sessions.segments/_tree.segment.rsc +2 -2
  254. package/.next/standalone/.next/server/app/settings.html +1 -1
  255. package/.next/standalone/.next/server/app/settings.rsc +5 -5
  256. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings/__PAGE__.segment.rsc +2 -2
  257. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings.segment.rsc +1 -1
  258. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  259. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +5 -5
  260. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  261. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +3 -3
  262. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  263. package/.next/standalone/.next/server/app/terminal.html +1 -1
  264. package/.next/standalone/.next/server/app/terminal.rsc +5 -5
  265. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal/__PAGE__.segment.rsc +2 -2
  266. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal.segment.rsc +1 -1
  267. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  268. package/.next/standalone/.next/server/app/terminal.segments/_full.segment.rsc +5 -5
  269. package/.next/standalone/.next/server/app/terminal.segments/_head.segment.rsc +1 -1
  270. package/.next/standalone/.next/server/app/terminal.segments/_index.segment.rsc +3 -3
  271. package/.next/standalone/.next/server/app/terminal.segments/_tree.segment.rsc +2 -2
  272. package/.next/standalone/.next/server/app/workspaces.html +1 -1
  273. package/.next/standalone/.next/server/app/workspaces.rsc +5 -5
  274. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces/__PAGE__.segment.rsc +2 -2
  275. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces.segment.rsc +1 -1
  276. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
  277. package/.next/standalone/.next/server/app/workspaces.segments/_full.segment.rsc +5 -5
  278. package/.next/standalone/.next/server/app/workspaces.segments/_head.segment.rsc +1 -1
  279. package/.next/standalone/.next/server/app/workspaces.segments/_index.segment.rsc +3 -3
  280. package/.next/standalone/.next/server/app/workspaces.segments/_tree.segment.rsc +2 -2
  281. package/.next/standalone/.next/server/chunks/[root-of-the-server]__086be15a._.js +3 -0
  282. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0955695e._.js +3 -0
  283. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fac388d._.js +3 -0
  284. package/.next/standalone/.next/server/chunks/[root-of-the-server]__18a58c5f._.js +3 -0
  285. package/.next/standalone/.next/server/chunks/[root-of-the-server]__190b05d8._.js +3 -0
  286. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1a211143._.js +3 -0
  287. package/.next/standalone/.next/server/chunks/[root-of-the-server]__20353b76._.js +3 -0
  288. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2861e096._.js +3 -0
  289. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2a7a798c._.js +3 -0
  290. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2b6758fc._.js +3 -0
  291. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2e9d1d5a._.js +3 -0
  292. package/.next/standalone/.next/server/chunks/[root-of-the-server]__31f028ec._.js +3 -0
  293. package/.next/standalone/.next/server/chunks/[root-of-the-server]__34c34116._.js +3 -0
  294. package/.next/standalone/.next/server/chunks/[root-of-the-server]__3aa57139._.js +3 -0
  295. package/.next/standalone/.next/server/chunks/[root-of-the-server]__3ce30e4e._.js +3 -0
  296. package/.next/standalone/.next/server/chunks/[root-of-the-server]__41ae8be6._.js +3 -0
  297. package/.next/standalone/.next/server/chunks/[root-of-the-server]__41e589ee._.js +3 -0
  298. package/.next/standalone/.next/server/chunks/[root-of-the-server]__43112c34._.js +3 -0
  299. package/.next/standalone/.next/server/chunks/[root-of-the-server]__464db440._.js +3 -0
  300. package/.next/standalone/.next/server/chunks/[root-of-the-server]__466c7e18._.js +3 -0
  301. package/.next/standalone/.next/server/chunks/[root-of-the-server]__47a63195._.js +3 -0
  302. package/.next/standalone/.next/server/chunks/[root-of-the-server]__4ad64489._.js +3 -0
  303. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5bbc73ff._.js +3 -0
  304. package/.next/standalone/.next/server/chunks/[root-of-the-server]__60689e2b._.js +3 -0
  305. package/.next/standalone/.next/server/chunks/[root-of-the-server]__67c4abf3._.js +3 -0
  306. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6b94cc47._.js +3 -0
  307. package/.next/standalone/.next/server/chunks/[root-of-the-server]__6c6cfe82._.js +3 -0
  308. package/.next/standalone/.next/server/chunks/[root-of-the-server]__776b2fd5._.js +3 -0
  309. package/.next/standalone/.next/server/chunks/[root-of-the-server]__7901e2ab._.js +3 -0
  310. package/.next/standalone/.next/server/chunks/[root-of-the-server]__83b9bcf3._.js +11 -0
  311. package/.next/standalone/.next/server/chunks/[root-of-the-server]__89124c96._.js +243 -0
  312. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8c2eee30._.js +3 -0
  313. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8ffcf827._.js +3 -0
  314. package/.next/standalone/.next/server/chunks/[root-of-the-server]__95b7f18e._.js +3 -0
  315. package/.next/standalone/.next/server/chunks/[root-of-the-server]__9e343d64._.js +3 -0
  316. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a2ee9884._.js +13 -0
  317. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a651ede9._.js +3 -0
  318. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a6ce192e._.js +3 -0
  319. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4b692df._.js +3 -0
  320. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4edb4d6._.js +3 -0
  321. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b71497ab._.js +243 -0
  322. package/.next/standalone/.next/server/chunks/[root-of-the-server]__bc97ddc7._.js +3 -0
  323. package/.next/standalone/.next/server/chunks/[root-of-the-server]__bef2ed87._.js +3 -0
  324. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c525457e._.js +19 -0
  325. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c546cf71._.js +3 -0
  326. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ccc27199._.js +3 -0
  327. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ce5edd98._.js +3 -0
  328. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d877df12._.js +3 -0
  329. package/.next/standalone/.next/server/chunks/[root-of-the-server]__dd2e81be._.js +11 -0
  330. package/.next/standalone/.next/server/chunks/[root-of-the-server]__de96c005._.js +3 -0
  331. package/.next/standalone/.next/server/chunks/[root-of-the-server]__df6bc9e9._.js +3 -0
  332. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e2b78951._.js +3 -0
  333. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e742ef33._.js +3 -0
  334. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__63c35e0f._.js +1 -1
  335. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__66aca5d4._.js +3 -0
  336. package/.next/standalone/.next/server/chunks/ssr/_1f12caba._.js +1 -1
  337. package/.next/standalone/.next/server/chunks/ssr/_3b54193d._.js +1 -1
  338. package/.next/standalone/.next/server/chunks/ssr/_43e7e611._.js +1 -1
  339. package/.next/standalone/.next/server/chunks/ssr/_5ac43c5d._.js +1 -1
  340. package/.next/standalone/.next/server/chunks/ssr/_cd50a174._.js +1 -1
  341. package/.next/standalone/.next/server/chunks/ssr/src_app_(desktop)_terminal_page_tsx_de5e8d85._.js +1 -1
  342. package/.next/standalone/.next/server/edge/chunks/[root-of-the-server]__32a0045c._.js +1 -1
  343. package/.next/standalone/.next/server/edge/chunks/_d73df637._.js +3 -0
  344. package/.next/standalone/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_a4434a38.js +6 -0
  345. package/.next/standalone/.next/server/middleware-manifest.json +7 -7
  346. package/.next/standalone/.next/server/pages/404.html +1 -1
  347. package/.next/standalone/.next/server/pages/500.html +2 -2
  348. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  349. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  350. package/.next/standalone/.next/static/chunks/{31f45c67350373f2.js → 10c6424526b53431.js} +2 -2
  351. package/.next/standalone/.next/static/chunks/{8cc07e8d950d6962.js → 27649ec994a696fb.js} +1 -1
  352. package/.next/standalone/.next/static/chunks/{3c4ee171d96760e8.js → 302ce212c690bec4.js} +2 -2
  353. package/.next/standalone/.next/static/chunks/51dacec57c9714c0.js +1 -0
  354. package/.next/standalone/.next/static/chunks/{f2b58d718b34646d.js → 53782d1e41fd7f82.js} +1 -1
  355. package/.next/standalone/.next/static/chunks/{f789a1d0736e1154.js → 58d78765e5140dcb.js} +1 -1
  356. package/.next/standalone/.next/static/chunks/{7c1e6d7f1d3b4173.js → cb442c50eecb758d.js} +2 -2
  357. package/.next/standalone/.next/static/chunks/ff5fac1bd7b518dd.css +3 -0
  358. package/.next/standalone/node_modules/@img/sharp-win32-x64/lib/sharp-win32-x64.node +0 -0
  359. package/.next/standalone/node_modules/@img/{sharp-linux-x64 → sharp-win32-x64}/package.json +39 -46
  360. package/.next/standalone/package.json +89 -91
  361. package/.next/standalone/server.js +1 -1
  362. package/.next/standalone/tsconfig.json +34 -34
  363. package/LICENSE +661 -661
  364. package/README.md +131 -131
  365. package/bin/fix-standalone-externals.js +79 -79
  366. package/bin/lib/auto-setup.js +101 -101
  367. package/bin/mdns-service.js +171 -171
  368. package/bin/postinstall.js +35 -35
  369. package/bin/setup-admin.js +189 -189
  370. package/bin/spaces-dev.js +208 -173
  371. package/bin/spaces-install.js +426 -0
  372. package/bin/spaces-setup.js +242 -242
  373. package/bin/spaces.js +465 -317
  374. package/bin/terminal-server.js +1117 -1051
  375. package/package.json +89 -91
  376. package/.next/standalone/.next/server/chunks/[root-of-the-server]__025cd038._.js +0 -3
  377. package/.next/standalone/.next/server/chunks/[root-of-the-server]__042ba2bc._.js +0 -3
  378. package/.next/standalone/.next/server/chunks/[root-of-the-server]__07cc153d._.js +0 -3
  379. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08e411dd._.js +0 -3
  380. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0add852f._.js +0 -3
  381. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c113ed0._.js +0 -3
  382. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cf032ab._.js +0 -3
  383. package/.next/standalone/.next/server/chunks/[root-of-the-server]__11293532._.js +0 -13
  384. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1194f2c1._.js +0 -3
  385. package/.next/standalone/.next/server/chunks/[root-of-the-server]__19c2d094._.js +0 -3
  386. package/.next/standalone/.next/server/chunks/[root-of-the-server]__19c3ad21._.js +0 -3
  387. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ebc634e._.js +0 -3
  388. package/.next/standalone/.next/server/chunks/[root-of-the-server]__24197539._.js +0 -3
  389. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2891c969._.js +0 -11
  390. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2c6e6625._.js +0 -3
  391. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2fe2b40e._.js +0 -3
  392. package/.next/standalone/.next/server/chunks/[root-of-the-server]__318f12c6._.js +0 -3
  393. package/.next/standalone/.next/server/chunks/[root-of-the-server]__32df12e4._.js +0 -3
  394. package/.next/standalone/.next/server/chunks/[root-of-the-server]__34e7cb21._.js +0 -3
  395. package/.next/standalone/.next/server/chunks/[root-of-the-server]__49c92d87._.js +0 -3
  396. package/.next/standalone/.next/server/chunks/[root-of-the-server]__52bde30c._.js +0 -3
  397. package/.next/standalone/.next/server/chunks/[root-of-the-server]__53090a81._.js +0 -3
  398. package/.next/standalone/.next/server/chunks/[root-of-the-server]__57193cf5._.js +0 -3
  399. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5c33078d._.js +0 -3
  400. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5f8c694a._.js +0 -3
  401. package/.next/standalone/.next/server/chunks/[root-of-the-server]__630b9a6a._.js +0 -3
  402. package/.next/standalone/.next/server/chunks/[root-of-the-server]__727d05f1._.js +0 -3
  403. package/.next/standalone/.next/server/chunks/[root-of-the-server]__75a774f0._.js +0 -233
  404. package/.next/standalone/.next/server/chunks/[root-of-the-server]__7f0bc701._.js +0 -233
  405. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8915603e._.js +0 -3
  406. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8afe4d5e._.js +0 -3
  407. package/.next/standalone/.next/server/chunks/[root-of-the-server]__9d15de27._.js +0 -3
  408. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a1fbc199._.js +0 -3
  409. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a1fe6070._.js +0 -3
  410. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a3f604d6._.js +0 -3
  411. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a5504205._.js +0 -3
  412. package/.next/standalone/.next/server/chunks/[root-of-the-server]__abf53d11._.js +0 -3
  413. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b78eeead._.js +0 -11
  414. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c1b8f8f6._.js +0 -3
  415. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c3c74ca4._.js +0 -3
  416. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c79824d9._.js +0 -3
  417. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c9db5d8a._.js +0 -3
  418. package/.next/standalone/.next/server/chunks/[root-of-the-server]__cbd9cb15._.js +0 -3
  419. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ccb4e920._.js +0 -3
  420. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d15515e3._.js +0 -3
  421. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d490583e._.js +0 -3
  422. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d9c106a9._.js +0 -3
  423. package/.next/standalone/.next/server/chunks/[root-of-the-server]__de2c3bf8._.js +0 -3
  424. package/.next/standalone/.next/server/chunks/[root-of-the-server]__dfbf7bdd._.js +0 -19
  425. package/.next/standalone/.next/server/chunks/[root-of-the-server]__e1e26f47._.js +0 -3
  426. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ee9346bf._.js +0 -3
  427. package/.next/standalone/.next/server/chunks/[root-of-the-server]__fea012d6._.js +0 -3
  428. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ff1b0769._.js +0 -3
  429. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__eac7aeff._.js +0 -3
  430. package/.next/standalone/.next/server/edge/chunks/node_modules_next_dist_esm_build_templates_edge-wrapper_78fa9d6a.js +0 -3
  431. package/.next/standalone/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_a5230bba.js +0 -6
  432. package/.next/standalone/.next/static/chunks/780381483091d8fb.js +0 -1
  433. package/.next/standalone/.next/static/chunks/806334ea0f6ca92a.css +0 -3
  434. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +0 -46
  435. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +0 -221
  436. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +0 -1
  437. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  438. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +0 -42
  439. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
  440. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +0 -221
  441. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
  442. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  443. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -42
  444. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
  445. package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  446. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  447. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -46
  448. /package/.next/standalone/.next/static/{k4gRsS979E-cbl1AWcHhx → U-EFIvMEHFIoGaoj6xBXK}/_buildManifest.js +0 -0
  449. /package/.next/standalone/.next/static/{k4gRsS979E-cbl1AWcHhx → U-EFIvMEHFIoGaoj6xBXK}/_clientMiddlewareManifest.json +0 -0
  450. /package/.next/standalone/.next/static/{k4gRsS979E-cbl1AWcHhx → U-EFIvMEHFIoGaoj6xBXK}/_ssgManifest.js +0 -0
  451. /package/.next/standalone/node_modules/@img/{sharp-libvips-linux-x64 → sharp-win32-x64}/versions.json +0 -0
package/bin/spaces-dev.js CHANGED
@@ -1,173 +1,208 @@
1
- #!/usr/bin/env node
2
-
3
- const http = require('http');
4
- const fs = require('fs');
5
- const { spawn } = require('child_process');
6
- const path = require('path');
7
- const os = require('os');
8
- const SPACES_DIR = path.join(os.homedir(), '.spaces');
9
- const CONFIG_PATH = path.join(SPACES_DIR, 'server.json');
10
- const SESSION_SECRET_PATH = path.join(SPACES_DIR, 'session_secret');
11
-
12
- // ─── Load saved config ────────────────────────────────────
13
- let savedConfig = {};
14
- if (fs.existsSync(CONFIG_PATH)) {
15
- try { savedConfig = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8')); } catch {}
16
- }
17
-
18
- // ─── Resolve settings (env > config > defaults) ──────────
19
- const NEXT_INTERNAL_PORT = parseInt(process.env.SPACES_NEXT_PORT || '3400', 10);
20
- const PORT = parseInt(process.env.SPACES_PORT || '', 10) || savedConfig.port || 3457;
21
-
22
- const basePath = process.env.SPACES_BASE_PATH || savedConfig.basePath || '';
23
- if (basePath) {
24
- process.env.SPACES_BASE_PATH = basePath;
25
- }
26
-
27
- // ─── Auto-detect tier ─────────────────────────────────────
28
- let hasSpacesPro = false;
29
- let hasSpacesTeams = false;
30
- try { require.resolve('@spaces/pro'); hasSpacesPro = true; } catch {}
31
- try { require.resolve('@spaces/teams'); hasSpacesTeams = true; } catch {}
32
-
33
- let tier = process.env.SPACES_TIER || savedConfig.tier || '';
34
- if (!tier) {
35
- if (hasSpacesPro) tier = 'federation';
36
- else if (hasSpacesTeams) tier = 'team';
37
- else tier = 'community';
38
- }
39
- process.env.SPACES_TIER = tier;
40
-
41
- // Require terminal-server AFTER tier is set so it reads the correct SPACES_TIER
42
- const { createTerminalServer } = require('./terminal-server');
43
-
44
- // ─── Federation prerequisites auto-setup if needed ──────
45
- if (tier !== 'community') {
46
- let sessionSecret = process.env.SPACES_SESSION_SECRET || '';
47
- if (!sessionSecret && fs.existsSync(SESSION_SECRET_PATH)) {
48
- sessionSecret = fs.readFileSync(SESSION_SECRET_PATH, 'utf-8').trim();
49
- }
50
-
51
- const adminDbPath = path.join(SPACES_DIR, 'admin.db');
52
- if (!fs.existsSync(adminDbPath) || !sessionSecret) {
53
- const { autoSetup } = require('./lib/auto-setup');
54
- const result = autoSetup({ SPACES_DIR, SESSION_SECRET_PATH, ADMIN_DB_PATH: adminDbPath, CONFIG_PATH, tier, port: PORT, basePath });
55
- sessionSecret = result.sessionSecret;
56
- }
57
-
58
- process.env.SPACES_SESSION_SECRET = sessionSecret;
59
- }
60
-
61
- // Spawn Next.js dev server on an internal port
62
- const childEnv = { ...process.env, PORT: String(NEXT_INTERNAL_PORT) };
63
- const next = spawn('npx', ['next', 'dev', '--port', String(NEXT_INTERNAL_PORT)], {
64
- cwd: path.join(__dirname, '..'),
65
- stdio: ['ignore', 'pipe', 'pipe'],
66
- env: childEnv,
67
- shell: true,
68
- });
69
-
70
- let nextReady = false;
71
-
72
- next.stdout.on('data', (data) => {
73
- const msg = data.toString();
74
- process.stdout.write(msg);
75
- if (msg.includes('Ready') || msg.includes('started server') || msg.includes('Listening') || msg.includes('localhost')) {
76
- nextReady = true;
77
- }
78
- });
79
-
80
- next.stderr.on('data', (data) => {
81
- process.stderr.write(data);
82
- });
83
-
84
- next.on('exit', (code) => {
85
- console.error(`[spaces-dev] Next.js exited with code ${code}`);
86
- process.exit(code || 1);
87
- });
88
-
89
- // Create unified HTTP server
90
- const server = http.createServer((req, res) => {
91
- const proxyReq = http.request(
92
- {
93
- hostname: '127.0.0.1',
94
- port: NEXT_INTERNAL_PORT,
95
- path: req.url,
96
- method: req.method,
97
- headers: req.headers,
98
- },
99
- (proxyRes) => {
100
- res.writeHead(proxyRes.statusCode, proxyRes.headers);
101
- proxyRes.pipe(res);
102
- }
103
- );
104
- proxyReq.on('error', (err) => {
105
- // Next.js not ready yet
106
- if (!res.headersSent) {
107
- res.writeHead(502);
108
- res.end('Next.js dev server not ready yet. Refresh in a moment.');
109
- }
110
- });
111
- req.pipe(proxyReq);
112
- });
113
-
114
- // Attach terminal WebSocket server for /ws upgrades
115
- createTerminalServer(server);
116
-
117
- // Proxy non-/ws upgrades (Next.js HMR WebSocket) to Next.js dev
118
- server.on('upgrade', (req, socket, head) => {
119
- const url = new URL(req.url, 'http://localhost');
120
- if (url.pathname !== '/ws' && !url.pathname.endsWith('/ws')) {
121
- const proxyReq = http.request({
122
- hostname: '127.0.0.1',
123
- port: NEXT_INTERNAL_PORT,
124
- path: req.url,
125
- method: req.method,
126
- headers: req.headers,
127
- });
128
- proxyReq.on('upgrade', (proxyRes, proxySocket, proxyHead) => {
129
- socket.write(
130
- 'HTTP/1.1 101 Switching Protocols\r\n' +
131
- Object.entries(proxyRes.headers).map(([k, v]) => `${k}: ${v}`).join('\r\n') +
132
- '\r\n\r\n'
133
- );
134
- if (proxyHead.length > 0) proxySocket.unshift(proxyHead);
135
- proxySocket.on('error', () => socket.destroy());
136
- socket.on('error', () => proxySocket.destroy());
137
- proxySocket.on('close', () => {
138
- console.log(`[HMR proxy] upstream closed (${url.pathname})`);
139
- });
140
- socket.on('close', () => {
141
- console.log(`[HMR proxy] browser closed (${url.pathname})`);
142
- });
143
- proxySocket.pipe(socket);
144
- socket.pipe(proxySocket);
145
- });
146
- proxyReq.on('response', (res) => {
147
- // Upgrade was rejected — log and clean up
148
- console.log(`[HMR proxy] upgrade rejected: ${res.statusCode} for ${url.pathname}`);
149
- socket.destroy();
150
- });
151
- proxyReq.on('error', (err) => {
152
- console.log(`[HMR proxy] error: ${err.message}`);
153
- socket.destroy();
154
- });
155
- socket.on('error', () => {});
156
- if (head.length > 0) proxyReq.write(head);
157
- proxyReq.end();
158
- }
159
- });
160
-
161
- server.listen(PORT, () => {
162
- console.log(`\n Spaces dev server on http://localhost:${PORT}\n`);
163
- });
164
-
165
- // Cleanup
166
- function cleanup() {
167
- next.kill();
168
- server.close();
169
- process.exit(0);
170
- }
171
-
172
- process.on('SIGINT', cleanup);
173
- process.on('SIGTERM', cleanup);
1
+ #!/usr/bin/env node
2
+
3
+ const http = require('http');
4
+ const fs = require('fs');
5
+ const { spawn } = require('child_process');
6
+ const path = require('path');
7
+ const os = require('os');
8
+ const SPACES_DIR = path.join(os.homedir(), '.spaces');
9
+ const CONFIG_PATH = path.join(SPACES_DIR, 'server.json');
10
+ const SESSION_SECRET_PATH = path.join(SPACES_DIR, 'session_secret');
11
+
12
+ // ─── Load saved config ────────────────────────────────────
13
+ let savedConfig = {};
14
+ if (fs.existsSync(CONFIG_PATH)) {
15
+ try { savedConfig = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8')); } catch {}
16
+ }
17
+
18
+ // ─── Resolve settings (env > config > defaults) ──────────
19
+ const NEXT_INTERNAL_PORT = parseInt(process.env.SPACES_NEXT_PORT || '3400', 10);
20
+ const PORT = parseInt(process.env.SPACES_PORT || '', 10) || savedConfig.port || 3457;
21
+
22
+ const basePath = process.env.SPACES_BASE_PATH || savedConfig.basePath || '';
23
+ if (basePath) {
24
+ process.env.SPACES_BASE_PATH = basePath;
25
+ }
26
+
27
+ const allowedOrigins = process.env.SPACES_ALLOWED_ORIGINS || savedConfig.allowedOrigins || '';
28
+ if (allowedOrigins) {
29
+ process.env.SPACES_ALLOWED_ORIGINS = allowedOrigins;
30
+ }
31
+
32
+ // ─── Managed packages directory ──────────────────────────────
33
+ const MANAGED_PACKAGES = path.join(SPACES_DIR, 'packages');
34
+ const MANAGED_NODE_MODULES = path.join(MANAGED_PACKAGES, 'node_modules');
35
+
36
+ // ─── Auto-detect tier (check managed packages first) ─────────
37
+ function hasManagedPro() {
38
+ return fs.existsSync(path.join(MANAGED_NODE_MODULES, '@spaces', 'pro', 'dist', 'index.js'));
39
+ }
40
+ function hasManagedTeams() {
41
+ return fs.existsSync(path.join(MANAGED_NODE_MODULES, '@spaces', 'teams', 'index.js'));
42
+ }
43
+ function hasRequirePro() {
44
+ try { require.resolve('@spaces/pro'); return true; } catch { return false; }
45
+ }
46
+ function hasRequireTeams() {
47
+ try { require.resolve('@spaces/teams'); return true; } catch { return false; }
48
+ }
49
+
50
+ const hasSpacesPro = hasManagedPro() || hasRequirePro();
51
+ const hasSpacesTeams = hasManagedTeams() || hasRequireTeams();
52
+
53
+ let tier = process.env.SPACES_TIER || savedConfig.tier || '';
54
+ if (!tier) {
55
+ if (hasSpacesPro) tier = 'federation';
56
+ else if (hasSpacesTeams) tier = 'team';
57
+ else tier = 'community';
58
+ }
59
+ process.env.SPACES_TIER = tier;
60
+
61
+ // ─── Resolve NODE_PATH for managed packages ──────────────────
62
+ const nodePaths = [MANAGED_NODE_MODULES];
63
+ // Add each managed package's own node_modules for bundled deps
64
+ for (const pkgName of ['pro', 'teams']) {
65
+ const pkgDir = path.join(MANAGED_PACKAGES, pkgName, 'node_modules');
66
+ if (fs.existsSync(pkgDir)) nodePaths.push(pkgDir);
67
+ }
68
+ for (const dir of nodePaths) {
69
+ const existing = process.env.NODE_PATH || '';
70
+ if (!existing.includes(dir)) {
71
+ process.env.NODE_PATH = existing ? `${dir}${path.delimiter}${existing}` : dir;
72
+ }
73
+ }
74
+ require('module').Module._initPaths();
75
+
76
+ // Require terminal-server AFTER tier is set so it reads the correct SPACES_TIER
77
+ const { createTerminalServer } = require('./terminal-server');
78
+
79
+ // ─── Federation prerequisites — auto-setup if needed ──────
80
+ if (tier !== 'community') {
81
+ let sessionSecret = process.env.SPACES_SESSION_SECRET || '';
82
+ if (!sessionSecret && fs.existsSync(SESSION_SECRET_PATH)) {
83
+ sessionSecret = fs.readFileSync(SESSION_SECRET_PATH, 'utf-8').trim();
84
+ }
85
+
86
+ const adminDbPath = path.join(SPACES_DIR, 'admin.db');
87
+ if (!fs.existsSync(adminDbPath) || !sessionSecret) {
88
+ const { autoSetup } = require('./lib/auto-setup');
89
+ const result = autoSetup({ SPACES_DIR, SESSION_SECRET_PATH, ADMIN_DB_PATH: adminDbPath, CONFIG_PATH, tier, port: PORT, basePath });
90
+ sessionSecret = result.sessionSecret;
91
+ }
92
+
93
+ process.env.SPACES_SESSION_SECRET = sessionSecret;
94
+ }
95
+
96
+ // Spawn Next.js dev server on an internal port
97
+ const childEnv = { ...process.env, PORT: String(NEXT_INTERNAL_PORT) };
98
+ const next = spawn('npx', ['next', 'dev', '--hostname', '0.0.0.0', '--port', String(NEXT_INTERNAL_PORT)], {
99
+ cwd: path.join(__dirname, '..'),
100
+ stdio: ['ignore', 'pipe', 'pipe'],
101
+ env: childEnv,
102
+ shell: true,
103
+ });
104
+
105
+ let nextReady = false;
106
+
107
+ next.stdout.on('data', (data) => {
108
+ const msg = data.toString();
109
+ process.stdout.write(msg);
110
+ if (msg.includes('Ready') || msg.includes('started server') || msg.includes('Listening') || msg.includes('localhost')) {
111
+ nextReady = true;
112
+ }
113
+ });
114
+
115
+ next.stderr.on('data', (data) => {
116
+ process.stderr.write(data);
117
+ });
118
+
119
+ next.on('exit', (code) => {
120
+ console.error(`[spaces-dev] Next.js exited with code ${code}`);
121
+ process.exit(code || 1);
122
+ });
123
+
124
+ // Create unified HTTP server
125
+ const server = http.createServer((req, res) => {
126
+ const proxyReq = http.request(
127
+ {
128
+ hostname: '127.0.0.1',
129
+ port: NEXT_INTERNAL_PORT,
130
+ path: req.url,
131
+ method: req.method,
132
+ headers: req.headers,
133
+ },
134
+ (proxyRes) => {
135
+ res.writeHead(proxyRes.statusCode, proxyRes.headers);
136
+ proxyRes.pipe(res);
137
+ }
138
+ );
139
+ proxyReq.on('error', (err) => {
140
+ // Next.js not ready yet
141
+ if (!res.headersSent) {
142
+ res.writeHead(502);
143
+ res.end('Next.js dev server not ready yet. Refresh in a moment.');
144
+ }
145
+ });
146
+ req.pipe(proxyReq);
147
+ });
148
+
149
+ // Attach terminal WebSocket server for /ws upgrades
150
+ createTerminalServer(server);
151
+
152
+ // Proxy non-/ws upgrades (Next.js HMR WebSocket) to Next.js dev
153
+ server.on('upgrade', (req, socket, head) => {
154
+ const url = new URL(req.url, 'http://localhost');
155
+ if (url.pathname !== '/ws' && !url.pathname.endsWith('/ws')) {
156
+ const proxyReq = http.request({
157
+ hostname: '127.0.0.1',
158
+ port: NEXT_INTERNAL_PORT,
159
+ path: req.url,
160
+ method: req.method,
161
+ headers: req.headers,
162
+ });
163
+ proxyReq.on('upgrade', (proxyRes, proxySocket, proxyHead) => {
164
+ socket.write(
165
+ 'HTTP/1.1 101 Switching Protocols\r\n' +
166
+ Object.entries(proxyRes.headers).map(([k, v]) => `${k}: ${v}`).join('\r\n') +
167
+ '\r\n\r\n'
168
+ );
169
+ if (proxyHead.length > 0) proxySocket.unshift(proxyHead);
170
+ proxySocket.on('error', () => socket.destroy());
171
+ socket.on('error', () => proxySocket.destroy());
172
+ proxySocket.on('close', () => {
173
+ console.log(`[HMR proxy] upstream closed (${url.pathname})`);
174
+ });
175
+ socket.on('close', () => {
176
+ console.log(`[HMR proxy] browser closed (${url.pathname})`);
177
+ });
178
+ proxySocket.pipe(socket);
179
+ socket.pipe(proxySocket);
180
+ });
181
+ proxyReq.on('response', (res) => {
182
+ // Upgrade was rejected — log and clean up
183
+ console.log(`[HMR proxy] upgrade rejected: ${res.statusCode} for ${url.pathname}`);
184
+ socket.destroy();
185
+ });
186
+ proxyReq.on('error', (err) => {
187
+ console.log(`[HMR proxy] error: ${err.message}`);
188
+ socket.destroy();
189
+ });
190
+ socket.on('error', () => {});
191
+ if (head.length > 0) proxyReq.write(head);
192
+ proxyReq.end();
193
+ }
194
+ });
195
+
196
+ server.listen(PORT, () => {
197
+ console.log(`\n Spaces dev server on http://localhost:${PORT}\n`);
198
+ });
199
+
200
+ // Cleanup
201
+ function cleanup() {
202
+ next.kill();
203
+ server.close();
204
+ process.exit(0);
205
+ }
206
+
207
+ process.on('SIGINT', cleanup);
208
+ process.on('SIGTERM', cleanup);