@jlongo78/agent-spaces 0.5.1 → 0.5.3

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 (317) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +2 -2
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +19 -19
  5. package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page_client-reference-manifest.js +1 -1
  6. package/.next/standalone/.next/server/app/(desktop)/admin/users/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/(desktop)/analytics/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/(desktop)/network/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/(desktop)/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/(desktop)/projects/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page_client-reference-manifest.js +1 -1
  12. package/.next/standalone/.next/server/app/(desktop)/sessions/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/(desktop)/settings/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/.next/server/app/(desktop)/terminal/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/(desktop)/workspaces/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/_global-error.html +2 -2
  19. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  20. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  21. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  22. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  23. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  24. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  25. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  27. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  28. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  29. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  30. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  31. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  32. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  33. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  34. package/.next/standalone/.next/server/app/admin/analytics.html +1 -1
  35. package/.next/standalone/.next/server/app/admin/analytics.rsc +2 -2
  36. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics/__PAGE__.segment.rsc +1 -1
  37. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics.segment.rsc +1 -1
  38. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
  39. package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +1 -1
  40. package/.next/standalone/.next/server/app/admin/analytics.segments/_full.segment.rsc +2 -2
  41. package/.next/standalone/.next/server/app/admin/analytics.segments/_head.segment.rsc +1 -1
  42. package/.next/standalone/.next/server/app/admin/analytics.segments/_index.segment.rsc +2 -2
  43. package/.next/standalone/.next/server/app/admin/analytics.segments/_tree.segment.rsc +2 -2
  44. package/.next/standalone/.next/server/app/admin/users.html +1 -1
  45. package/.next/standalone/.next/server/app/admin/users.rsc +2 -2
  46. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users/__PAGE__.segment.rsc +1 -1
  47. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users.segment.rsc +1 -1
  48. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
  49. package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap.segment.rsc +1 -1
  50. package/.next/standalone/.next/server/app/admin/users.segments/_full.segment.rsc +2 -2
  51. package/.next/standalone/.next/server/app/admin/users.segments/_head.segment.rsc +1 -1
  52. package/.next/standalone/.next/server/app/admin/users.segments/_index.segment.rsc +2 -2
  53. package/.next/standalone/.next/server/app/admin/users.segments/_tree.segment.rsc +2 -2
  54. package/.next/standalone/.next/server/app/analytics.html +1 -1
  55. package/.next/standalone/.next/server/app/analytics.rsc +2 -2
  56. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics/__PAGE__.segment.rsc +1 -1
  57. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics.segment.rsc +1 -1
  58. package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +1 -1
  59. package/.next/standalone/.next/server/app/analytics.segments/_full.segment.rsc +2 -2
  60. package/.next/standalone/.next/server/app/analytics.segments/_head.segment.rsc +1 -1
  61. package/.next/standalone/.next/server/app/analytics.segments/_index.segment.rsc +2 -2
  62. package/.next/standalone/.next/server/app/analytics.segments/_tree.segment.rsc +2 -2
  63. package/.next/standalone/.next/server/app/api/analytics/overview/route.js +2 -2
  64. package/.next/standalone/.next/server/app/api/analytics/overview/route.js.nft.json +1 -1
  65. package/.next/standalone/.next/server/app/api/bulk/route.js +2 -2
  66. package/.next/standalone/.next/server/app/api/bulk/route.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/api/events/route.js +2 -2
  69. package/.next/standalone/.next/server/app/api/events/route.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/api/folders/route.js.nft.json +1 -1
  71. package/.next/standalone/.next/server/app/api/network/handshake/route.js +1 -1
  72. package/.next/standalone/.next/server/app/api/network/handshake/route.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/api/panes/[id]/route.js +2 -2
  74. package/.next/standalone/.next/server/app/api/panes/[id]/route.js.nft.json +1 -1
  75. package/.next/standalone/.next/server/app/api/panes/route.js +2 -2
  76. package/.next/standalone/.next/server/app/api/panes/route.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/api/projects/route.js +2 -2
  78. package/.next/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/api/search/route.js +2 -2
  80. package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  81. package/.next/standalone/.next/server/app/api/sessions/[id]/chat/route.js +2 -2
  82. package/.next/standalone/.next/server/app/api/sessions/[id]/chat/route.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/api/sessions/[id]/messages/route.js +2 -2
  84. package/.next/standalone/.next/server/app/api/sessions/[id]/messages/route.js.nft.json +1 -1
  85. package/.next/standalone/.next/server/app/api/sessions/[id]/route.js +2 -2
  86. package/.next/standalone/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  87. package/.next/standalone/.next/server/app/api/sessions/route.js +2 -2
  88. package/.next/standalone/.next/server/app/api/sessions/route.js.nft.json +1 -1
  89. package/.next/standalone/.next/server/app/api/sync/route.js +3 -3
  90. package/.next/standalone/.next/server/app/api/sync/route.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/api/tags/route.js +2 -2
  92. package/.next/standalone/.next/server/app/api/tags/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/api/tier/route.js +1 -1
  94. package/.next/standalone/.next/server/app/api/tier/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js +2 -2
  96. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js.nft.json +1 -1
  97. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js +2 -2
  98. package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js +2 -2
  100. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js.nft.json +1 -1
  101. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js +2 -2
  102. package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/api/workspaces/[id]/route.js +2 -2
  104. package/.next/standalone/.next/server/app/api/workspaces/[id]/route.js.nft.json +1 -1
  105. package/.next/standalone/.next/server/app/api/workspaces/[id]/sessions/route.js +2 -2
  106. package/.next/standalone/.next/server/app/api/workspaces/[id]/sessions/route.js.nft.json +1 -1
  107. package/.next/standalone/.next/server/app/api/workspaces/route.js +2 -2
  108. package/.next/standalone/.next/server/app/api/workspaces/route.js.nft.json +1 -1
  109. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/login.html +1 -1
  111. package/.next/standalone/.next/server/app/login.rsc +2 -2
  112. package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +2 -2
  113. package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
  114. package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +2 -2
  115. package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  116. package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  117. package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
  118. package/.next/standalone/.next/server/app/m/page_client-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/app/m/projects/page_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/m/projects.html +1 -1
  121. package/.next/standalone/.next/server/app/m/projects.rsc +2 -2
  122. package/.next/standalone/.next/server/app/m/projects.segments/_full.segment.rsc +2 -2
  123. package/.next/standalone/.next/server/app/m/projects.segments/_head.segment.rsc +1 -1
  124. package/.next/standalone/.next/server/app/m/projects.segments/_index.segment.rsc +2 -2
  125. package/.next/standalone/.next/server/app/m/projects.segments/_tree.segment.rsc +2 -2
  126. package/.next/standalone/.next/server/app/m/projects.segments/m/projects/__PAGE__.segment.rsc +1 -1
  127. package/.next/standalone/.next/server/app/m/projects.segments/m/projects.segment.rsc +1 -1
  128. package/.next/standalone/.next/server/app/m/projects.segments/m.segment.rsc +1 -1
  129. package/.next/standalone/.next/server/app/m/sessions/[id]/page_client-reference-manifest.js +1 -1
  130. package/.next/standalone/.next/server/app/m/sessions/page_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/app/m/sessions.html +1 -1
  132. package/.next/standalone/.next/server/app/m/sessions.rsc +2 -2
  133. package/.next/standalone/.next/server/app/m/sessions.segments/_full.segment.rsc +2 -2
  134. package/.next/standalone/.next/server/app/m/sessions.segments/_head.segment.rsc +1 -1
  135. package/.next/standalone/.next/server/app/m/sessions.segments/_index.segment.rsc +2 -2
  136. package/.next/standalone/.next/server/app/m/sessions.segments/_tree.segment.rsc +2 -2
  137. package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions/__PAGE__.segment.rsc +1 -1
  138. package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions.segment.rsc +1 -1
  139. package/.next/standalone/.next/server/app/m/sessions.segments/m.segment.rsc +1 -1
  140. package/.next/standalone/.next/server/app/m/settings/page_client-reference-manifest.js +1 -1
  141. package/.next/standalone/.next/server/app/m/settings.html +1 -1
  142. package/.next/standalone/.next/server/app/m/settings.rsc +2 -2
  143. package/.next/standalone/.next/server/app/m/settings.segments/_full.segment.rsc +2 -2
  144. package/.next/standalone/.next/server/app/m/settings.segments/_head.segment.rsc +1 -1
  145. package/.next/standalone/.next/server/app/m/settings.segments/_index.segment.rsc +2 -2
  146. package/.next/standalone/.next/server/app/m/settings.segments/_tree.segment.rsc +2 -2
  147. package/.next/standalone/.next/server/app/m/settings.segments/m/settings/__PAGE__.segment.rsc +1 -1
  148. package/.next/standalone/.next/server/app/m/settings.segments/m/settings.segment.rsc +1 -1
  149. package/.next/standalone/.next/server/app/m/settings.segments/m.segment.rsc +1 -1
  150. package/.next/standalone/.next/server/app/m/terminal/page_client-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/app/m/terminal.html +1 -1
  152. package/.next/standalone/.next/server/app/m/terminal.rsc +2 -2
  153. package/.next/standalone/.next/server/app/m/terminal.segments/_full.segment.rsc +2 -2
  154. package/.next/standalone/.next/server/app/m/terminal.segments/_head.segment.rsc +1 -1
  155. package/.next/standalone/.next/server/app/m/terminal.segments/_index.segment.rsc +2 -2
  156. package/.next/standalone/.next/server/app/m/terminal.segments/_tree.segment.rsc +2 -2
  157. package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal/__PAGE__.segment.rsc +1 -1
  158. package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal.segment.rsc +1 -1
  159. package/.next/standalone/.next/server/app/m/terminal.segments/m.segment.rsc +1 -1
  160. package/.next/standalone/.next/server/app/m.html +1 -1
  161. package/.next/standalone/.next/server/app/m.rsc +2 -2
  162. package/.next/standalone/.next/server/app/m.segments/_full.segment.rsc +2 -2
  163. package/.next/standalone/.next/server/app/m.segments/_head.segment.rsc +1 -1
  164. package/.next/standalone/.next/server/app/m.segments/_index.segment.rsc +2 -2
  165. package/.next/standalone/.next/server/app/m.segments/_tree.segment.rsc +2 -2
  166. package/.next/standalone/.next/server/app/m.segments/m/__PAGE__.segment.rsc +1 -1
  167. package/.next/standalone/.next/server/app/m.segments/m.segment.rsc +1 -1
  168. package/.next/standalone/.next/server/app/network.html +1 -1
  169. package/.next/standalone/.next/server/app/network.rsc +2 -2
  170. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network/__PAGE__.segment.rsc +1 -1
  171. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network.segment.rsc +1 -1
  172. package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap.segment.rsc +1 -1
  173. package/.next/standalone/.next/server/app/network.segments/_full.segment.rsc +2 -2
  174. package/.next/standalone/.next/server/app/network.segments/_head.segment.rsc +1 -1
  175. package/.next/standalone/.next/server/app/network.segments/_index.segment.rsc +2 -2
  176. package/.next/standalone/.next/server/app/network.segments/_tree.segment.rsc +2 -2
  177. package/.next/standalone/.next/server/app/projects.html +1 -1
  178. package/.next/standalone/.next/server/app/projects.rsc +2 -2
  179. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects/__PAGE__.segment.rsc +1 -1
  180. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects.segment.rsc +1 -1
  181. package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap.segment.rsc +1 -1
  182. package/.next/standalone/.next/server/app/projects.segments/_full.segment.rsc +2 -2
  183. package/.next/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
  184. package/.next/standalone/.next/server/app/projects.segments/_index.segment.rsc +2 -2
  185. package/.next/standalone/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
  186. package/.next/standalone/.next/server/app/sessions.html +1 -1
  187. package/.next/standalone/.next/server/app/sessions.rsc +2 -2
  188. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions/__PAGE__.segment.rsc +1 -1
  189. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions.segment.rsc +1 -1
  190. package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap.segment.rsc +1 -1
  191. package/.next/standalone/.next/server/app/sessions.segments/_full.segment.rsc +2 -2
  192. package/.next/standalone/.next/server/app/sessions.segments/_head.segment.rsc +1 -1
  193. package/.next/standalone/.next/server/app/sessions.segments/_index.segment.rsc +2 -2
  194. package/.next/standalone/.next/server/app/sessions.segments/_tree.segment.rsc +2 -2
  195. package/.next/standalone/.next/server/app/settings.html +1 -1
  196. package/.next/standalone/.next/server/app/settings.rsc +2 -2
  197. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings/__PAGE__.segment.rsc +1 -1
  198. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings.segment.rsc +1 -1
  199. package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap.segment.rsc +1 -1
  200. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +2 -2
  201. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  202. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  203. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  204. package/.next/standalone/.next/server/app/terminal.html +1 -1
  205. package/.next/standalone/.next/server/app/terminal.rsc +2 -2
  206. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal/__PAGE__.segment.rsc +1 -1
  207. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal.segment.rsc +1 -1
  208. package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap.segment.rsc +1 -1
  209. package/.next/standalone/.next/server/app/terminal.segments/_full.segment.rsc +2 -2
  210. package/.next/standalone/.next/server/app/terminal.segments/_head.segment.rsc +1 -1
  211. package/.next/standalone/.next/server/app/terminal.segments/_index.segment.rsc +2 -2
  212. package/.next/standalone/.next/server/app/terminal.segments/_tree.segment.rsc +2 -2
  213. package/.next/standalone/.next/server/app/workspaces.html +1 -1
  214. package/.next/standalone/.next/server/app/workspaces.rsc +2 -2
  215. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces/__PAGE__.segment.rsc +1 -1
  216. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces.segment.rsc +1 -1
  217. package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap.segment.rsc +1 -1
  218. package/.next/standalone/.next/server/app/workspaces.segments/_full.segment.rsc +2 -2
  219. package/.next/standalone/.next/server/app/workspaces.segments/_head.segment.rsc +1 -1
  220. package/.next/standalone/.next/server/app/workspaces.segments/_index.segment.rsc +2 -2
  221. package/.next/standalone/.next/server/app/workspaces.segments/_tree.segment.rsc +2 -2
  222. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__e742ef33._.js → [root-of-the-server]__0e4c2d35._.js} +2 -2
  223. package/.next/standalone/.next/server/chunks/[root-of-the-server]__130dee4b._.js +98 -0
  224. package/.next/standalone/.next/server/chunks/[root-of-the-server]__142c2f41._.js +98 -0
  225. package/.next/standalone/.next/server/chunks/[root-of-the-server]__160e7c73._.js +148 -0
  226. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2861e096._.js +1 -1
  227. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2d3d8d52._.js +98 -0
  228. package/.next/standalone/.next/server/chunks/[root-of-the-server]__57b966d5._.js +98 -0
  229. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5a0020ba._.js +106 -0
  230. package/.next/standalone/.next/server/chunks/[root-of-the-server]__5bd0f118._.js +98 -0
  231. package/.next/standalone/.next/server/chunks/[root-of-the-server]__64f5810e._.js +98 -0
  232. package/.next/standalone/.next/server/chunks/[root-of-the-server]__74c48d65._.js +98 -0
  233. package/.next/standalone/.next/server/chunks/[root-of-the-server]__7d6610c4._.js +98 -0
  234. package/.next/standalone/.next/server/chunks/[root-of-the-server]__84f3af14._.js +98 -0
  235. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8765f2fc._.js +98 -0
  236. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a2ee9884._.js +1 -1
  237. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a6eb742d._.js +98 -0
  238. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4c83e91._.js +114 -0
  239. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c546cf71._.js +1 -1
  240. package/.next/standalone/.next/server/chunks/[root-of-the-server]__cae0486f._.js +106 -0
  241. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d5615808._.js +98 -0
  242. package/.next/standalone/.next/server/chunks/[root-of-the-server]__d877df12._.js +1 -1
  243. package/.next/standalone/.next/server/chunks/[root-of-the-server]__f66ceeb8._.js +98 -0
  244. package/.next/standalone/.next/server/chunks/[root-of-the-server]__f84e3cf3._.js +98 -0
  245. package/.next/standalone/.next/server/chunks/[root-of-the-server]__f893957c._.js +98 -0
  246. package/.next/standalone/.next/server/chunks/[root-of-the-server]__fcd26315._.js +98 -0
  247. package/.next/standalone/.next/server/chunks/[root-of-the-server]__fd505913._.js +98 -0
  248. package/.next/standalone/.next/server/chunks/[root-of-the-server]__feff7b91._.js +98 -0
  249. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__66aca5d4._.js +1 -1
  250. package/.next/standalone/.next/server/edge/chunks/_d73df637._.js +1 -1
  251. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  252. package/.next/standalone/.next/server/pages/404.html +1 -1
  253. package/.next/standalone/.next/server/pages/500.html +2 -2
  254. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  255. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  256. package/.next/standalone/.next/static/chunks/67c7bf5024309fca.css +3 -0
  257. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +46 -0
  258. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  259. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +1 -0
  260. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  261. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +42 -0
  262. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +46 -0
  263. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  264. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
  265. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  266. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
  267. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
  268. package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  269. package/.next/standalone/node_modules/@img/{sharp-win32-x64 → sharp-linux-x64}/package.json +46 -39
  270. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  271. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
  272. package/.next/standalone/package.json +89 -89
  273. package/.next/standalone/server.js +1 -1
  274. package/.next/standalone/tsconfig.json +34 -34
  275. package/LICENSE +661 -661
  276. package/README.md +131 -131
  277. package/bin/fix-standalone-externals.js +79 -79
  278. package/bin/lib/auto-setup.js +101 -101
  279. package/bin/mdns-service.js +171 -171
  280. package/bin/postinstall.js +35 -35
  281. package/bin/setup-admin.js +189 -189
  282. package/bin/spaces-dev.js +208 -208
  283. package/bin/spaces-install.js +483 -426
  284. package/bin/spaces-setup.js +247 -242
  285. package/bin/spaces.js +465 -465
  286. package/bin/terminal-server.js +1117 -1117
  287. package/package.json +89 -89
  288. package/.next/standalone/.claude/settings.local.json +0 -11
  289. package/.next/standalone/.next/server/chunks/[root-of-the-server]__086be15a._.js +0 -3
  290. package/.next/standalone/.next/server/chunks/[root-of-the-server]__20353b76._.js +0 -3
  291. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2b6758fc._.js +0 -3
  292. package/.next/standalone/.next/server/chunks/[root-of-the-server]__2e9d1d5a._.js +0 -3
  293. package/.next/standalone/.next/server/chunks/[root-of-the-server]__34c34116._.js +0 -3
  294. package/.next/standalone/.next/server/chunks/[root-of-the-server]__3ce30e4e._.js +0 -3
  295. package/.next/standalone/.next/server/chunks/[root-of-the-server]__43112c34._.js +0 -3
  296. package/.next/standalone/.next/server/chunks/[root-of-the-server]__47a63195._.js +0 -3
  297. package/.next/standalone/.next/server/chunks/[root-of-the-server]__60689e2b._.js +0 -3
  298. package/.next/standalone/.next/server/chunks/[root-of-the-server]__83b9bcf3._.js +0 -11
  299. package/.next/standalone/.next/server/chunks/[root-of-the-server]__89124c96._.js +0 -243
  300. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8c2eee30._.js +0 -3
  301. package/.next/standalone/.next/server/chunks/[root-of-the-server]__8ffcf827._.js +0 -3
  302. package/.next/standalone/.next/server/chunks/[root-of-the-server]__9e343d64._.js +0 -3
  303. package/.next/standalone/.next/server/chunks/[root-of-the-server]__a651ede9._.js +0 -3
  304. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4b692df._.js +0 -3
  305. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4edb4d6._.js +0 -3
  306. package/.next/standalone/.next/server/chunks/[root-of-the-server]__b71497ab._.js +0 -243
  307. package/.next/standalone/.next/server/chunks/[root-of-the-server]__bef2ed87._.js +0 -3
  308. package/.next/standalone/.next/server/chunks/[root-of-the-server]__c525457e._.js +0 -19
  309. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ccc27199._.js +0 -3
  310. package/.next/standalone/.next/server/chunks/[root-of-the-server]__ce5edd98._.js +0 -3
  311. package/.next/standalone/.next/server/chunks/[root-of-the-server]__dd2e81be._.js +0 -11
  312. package/.next/standalone/.next/static/chunks/ff5fac1bd7b518dd.css +0 -3
  313. package/.next/standalone/node_modules/@img/sharp-win32-x64/lib/sharp-win32-x64.node +0 -0
  314. /package/.next/standalone/.next/static/{U-EFIvMEHFIoGaoj6xBXK → nbYSIjUtkSwSvTgyR5p00}/_buildManifest.js +0 -0
  315. /package/.next/standalone/.next/static/{U-EFIvMEHFIoGaoj6xBXK → nbYSIjUtkSwSvTgyR5p00}/_clientMiddlewareManifest.json +0 -0
  316. /package/.next/standalone/.next/static/{U-EFIvMEHFIoGaoj6xBXK → nbYSIjUtkSwSvTgyR5p00}/_ssgManifest.js +0 -0
  317. /package/.next/standalone/node_modules/@img/{sharp-win32-x64 → sharp-libvips-linux-x64}/versions.json +0 -0
@@ -1,426 +1,483 @@
1
- #!/usr/bin/env node
2
-
3
- 'use strict';
4
-
5
- const { execFileSync } = require('child_process');
6
- const path = require('path');
7
- const os = require('os');
8
- const fs = require('fs');
9
-
10
- const PACKAGES_DIR = path.join(os.homedir(), '.spaces', 'packages');
11
- const NODE_MODULES_DIR = path.join(PACKAGES_DIR, 'node_modules', '@spaces');
12
-
13
- // ─── Package definitions ─────────────────────────────────────
14
- const PACKAGES = {
15
- teams: {
16
- name: '@spaces/teams',
17
- dir: path.join(PACKAGES_DIR, 'teams'),
18
- repo: 'jlongo78/spaces-teams',
19
- private: false,
20
- verify: (dir) => fs.existsSync(path.join(dir, 'dist', 'index.js')),
21
- verifyLabel: 'dist/index.js',
22
- },
23
- pro: {
24
- name: '@spaces/pro',
25
- dir: path.join(PACKAGES_DIR, 'pro'),
26
- repo: 'jlongo78/spaces-pro',
27
- private: true,
28
- verify: (dir) => fs.existsSync(path.join(dir, 'dist', 'index.js')),
29
- verifyLabel: 'dist/index.js',
30
- },
31
- };
32
-
33
- // ─── Helpers ──────────────────────────────────────────────────
34
- function log(msg) { console.log(` ${msg}`); }
35
- function logOk(msg) { console.log(` ✓ ${msg}`); }
36
- function logErr(msg) { console.error(` ✗ ${msg}`); }
37
- function logWarn(msg) { console.log(` ! ${msg}`); }
38
-
39
- function run(cmd, args, opts = {}) {
40
- return execFileSync(cmd, args, {
41
- encoding: 'utf-8',
42
- stdio: opts.quiet ? ['pipe', 'pipe', 'pipe'] : 'inherit',
43
- shell: process.platform === 'win32',
44
- ...opts,
45
- });
46
- }
47
-
48
- /**
49
- * Clone a repo, trying SSH first then HTTPS (with optional PAT).
50
- */
51
- function gitClone(repo, dest, isPrivate) {
52
- const sshUrl = `git@github.com:${repo}.git`;
53
- const httpsUrl = `https://github.com/${repo}.git`;
54
-
55
- // Try SSH first
56
- try {
57
- log(`Cloning ${repo} (SSH)...`);
58
- run('git', ['clone', '--depth', '1', sshUrl, dest]);
59
- return;
60
- } catch {
61
- // SSH failed, try HTTPS
62
- }
63
-
64
- // HTTPS — check for PAT if private
65
- if (isPrivate) {
66
- const pat = process.env.GH_PAT || process.env.GITHUB_TOKEN || '';
67
- if (pat) {
68
- log(`Cloning ${repo} (HTTPS + token)...`);
69
- const authedUrl = `https://${pat}@github.com/${repo}.git`;
70
- run('git', ['clone', '--depth', '1', authedUrl, dest]);
71
- return;
72
- }
73
- }
74
-
75
- log(`Cloning ${repo} (HTTPS)...`);
76
- run('git', ['clone', '--depth', '1', httpsUrl, dest]);
77
- }
78
-
79
- /**
80
- * Pull latest changes in a repo directory.
81
- */
82
- function gitPull(dir) {
83
- log('Pulling latest...');
84
- run('git', ['pull', '--ff-only'], { cwd: dir });
85
- }
86
-
87
- /**
88
- * Create the symlink from node_modules/@spaces/<name> -> ../../<name>
89
- */
90
- function createSymlink(pkgKey) {
91
- const linkPath = path.join(NODE_MODULES_DIR, pkgKey);
92
- const targetPath = path.join('..', '..', pkgKey); // relative symlink
93
-
94
- fs.mkdirSync(NODE_MODULES_DIR, { recursive: true });
95
-
96
- // Remove existing link/dir
97
- try {
98
- const stat = fs.lstatSync(linkPath);
99
- if (stat.isSymbolicLink() || stat.isFile()) {
100
- fs.unlinkSync(linkPath);
101
- } else if (stat.isDirectory()) {
102
- fs.rmSync(linkPath, { recursive: true });
103
- }
104
- } catch {}
105
-
106
- fs.symlinkSync(targetPath, linkPath, process.platform === 'win32' ? 'junction' : 'dir');
107
- logOk(`Symlink: @spaces/${pkgKey} -> packages/${pkgKey}`);
108
- }
109
-
110
- /**
111
- * Check if a native module loads correctly from a package directory.
112
- */
113
- function checkNativeModule(moduleName, searchDir) {
114
- try {
115
- const nodePath = path.join(searchDir, 'node_modules');
116
- const result = run(process.execPath, [
117
- '-e',
118
- `try { require('${moduleName}'); console.log('ok'); } catch(e) { console.log(e.message); }`,
119
- ], {
120
- quiet: true,
121
- cwd: searchDir,
122
- env: { ...process.env, NODE_PATH: nodePath },
123
- });
124
- return result.trim() === 'ok';
125
- } catch {
126
- return false;
127
- }
128
- }
129
-
130
- // ─── Install command ──────────────────────────────────────────
131
- function installPackage(pkgKey) {
132
- const pkg = PACKAGES[pkgKey];
133
- if (!pkg) {
134
- logErr(`Unknown package: ${pkgKey}`);
135
- log(`Available: ${Object.keys(PACKAGES).join(', ')}`);
136
- process.exit(1);
137
- }
138
-
139
- console.log(`\n Installing ${pkg.name}...\n`);
140
-
141
- // 1. Clone or pull
142
- if (fs.existsSync(path.join(pkg.dir, '.git'))) {
143
- gitPull(pkg.dir);
144
- } else {
145
- fs.mkdirSync(PACKAGES_DIR, { recursive: true });
146
- gitClone(pkg.repo, pkg.dir, pkg.private);
147
- }
148
-
149
- // 2. Install dependencies
150
- // Both teams and pro need TypeScript build
151
- log('Installing dependencies...');
152
- run('npm', ['install'], { cwd: pkg.dir });
153
-
154
- log('Building TypeScript...');
155
- run('npm', ['run', 'build'], { cwd: pkg.dir });
156
-
157
- log('Pruning dev dependencies...');
158
- run('npm', ['prune', '--omit=dev'], { cwd: pkg.dir });
159
-
160
- // 5. Create symlink
161
- createSymlink(pkgKey);
162
-
163
- // 6. Verify
164
- if (pkg.verify(pkg.dir)) {
165
- logOk(`${pkg.name} installed successfully`);
166
- } else {
167
- logErr(`${pkg.name} installed but ${pkg.verifyLabel} not found`);
168
- process.exit(1);
169
- }
170
-
171
- // 7. Verify require() works
172
- try {
173
- const result = run(process.execPath, [
174
- '-e',
175
- `const p = require.resolve('${pkg.name}'); console.log('resolved: ' + p);`,
176
- ], {
177
- quiet: true,
178
- env: { ...process.env, NODE_PATH: path.join(PACKAGES_DIR, 'node_modules') },
179
- });
180
- logOk(`require('${pkg.name}') -> ${result.trim().replace('resolved: ', '')}`);
181
- } catch {
182
- logWarn(`require('${pkg.name}') failed this may be OK if peer deps aren't available yet`);
183
- }
184
-
185
- console.log('');
186
- }
187
-
188
- // ─── Verify command ───────────────────────────────────────────
189
- function verifyAll() {
190
- console.log('\n Spaces Package Verification\n');
191
-
192
- let allOk = true;
193
-
194
- for (const [key, pkg] of Object.entries(PACKAGES)) {
195
- log(`─── ${pkg.name} ───`);
196
-
197
- // Check if installed
198
- if (!fs.existsSync(pkg.dir)) {
199
- logWarn('Not installed');
200
- log('');
201
- continue;
202
- }
203
-
204
- // Check git status
205
- try {
206
- const branch = run('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: pkg.dir, quiet: true }).trim();
207
- const hash = run('git', ['rev-parse', '--short', 'HEAD'], { cwd: pkg.dir, quiet: true }).trim();
208
- logOk(`Git: ${branch} @ ${hash}`);
209
- } catch {
210
- logErr('Git status check failed');
211
- allOk = false;
212
- }
213
-
214
- // Check entry point
215
- if (pkg.verify(pkg.dir)) {
216
- logOk(`Entry: ${pkg.verifyLabel} exists`);
217
- } else {
218
- logErr(`Entry: ${pkg.verifyLabel} missing`);
219
- allOk = false;
220
- }
221
-
222
- // Check node_modules
223
- if (fs.existsSync(path.join(pkg.dir, 'node_modules'))) {
224
- logOk('Dependencies: node_modules present');
225
- } else {
226
- logErr('Dependencies: node_modules missing');
227
- allOk = false;
228
- }
229
-
230
- // Check symlink
231
- const linkPath = path.join(NODE_MODULES_DIR, key);
232
- try {
233
- const stat = fs.lstatSync(linkPath);
234
- if (stat.isSymbolicLink()) {
235
- const target = fs.readlinkSync(linkPath);
236
- logOk(`Symlink: @spaces/${key} -> ${target}`);
237
- } else {
238
- logWarn(`@spaces/${key} exists but is not a symlink`);
239
- }
240
- } catch {
241
- logErr(`Symlink: @spaces/${key} missing`);
242
- allOk = false;
243
- }
244
-
245
- // Check native modules
246
- const nativeOk = checkNativeModule('better-sqlite3', pkg.dir);
247
- if (nativeOk) {
248
- logOk('Native: better-sqlite3 loads OK');
249
- } else {
250
- logErr('Native: better-sqlite3 failed (ABI mismatch? Run: spaces upgrade)');
251
- allOk = false;
252
- }
253
-
254
- // Check require() resolution
255
- try {
256
- run(process.execPath, [
257
- '-e',
258
- `require.resolve('${pkg.name}')`,
259
- ], {
260
- quiet: true,
261
- env: { ...process.env, NODE_PATH: path.join(PACKAGES_DIR, 'node_modules') },
262
- });
263
- logOk(`require('${pkg.name}') resolves OK`);
264
- } catch {
265
- logErr(`require('${pkg.name}') fails`);
266
- allOk = false;
267
- }
268
-
269
- log('');
270
- }
271
-
272
- if (allOk) {
273
- logOk('All checks passed');
274
- } else {
275
- logErr('Some checks failed — run "spaces upgrade" to fix');
276
- }
277
- console.log('');
278
- }
279
-
280
- // ─── Upgrade command ──────────────────────────────────────────
281
- function upgradePackage(pkgKey) {
282
- if (pkgKey) {
283
- // Upgrade specific package
284
- const pkg = PACKAGES[pkgKey];
285
- if (!pkg) {
286
- logErr(`Unknown package: ${pkgKey}`);
287
- process.exit(1);
288
- }
289
- if (!fs.existsSync(pkg.dir)) {
290
- log(`${pkg.name} not installed — running install instead`);
291
- installPackage(pkgKey);
292
- return;
293
- }
294
- console.log(`\n Upgrading ${pkg.name}...\n`);
295
- doUpgrade(pkgKey, pkg);
296
- } else {
297
- // Upgrade all installed packages
298
- console.log('\n Upgrading all installed packages...\n');
299
- for (const [key, pkg] of Object.entries(PACKAGES)) {
300
- if (fs.existsSync(pkg.dir)) {
301
- log(`─── ${pkg.name} ───`);
302
- doUpgrade(key, pkg);
303
- log('');
304
- }
305
- }
306
- }
307
- console.log('');
308
- }
309
-
310
- function doUpgrade(pkgKey, pkg) {
311
- // Pull latest
312
- gitPull(pkg.dir);
313
-
314
- run('npm', ['install'], { cwd: pkg.dir });
315
- log('Building TypeScript...');
316
- run('npm', ['run', 'build'], { cwd: pkg.dir });
317
- run('npm', ['prune', '--omit=dev'], { cwd: pkg.dir });
318
-
319
- // Re-create symlink
320
- createSymlink(pkgKey);
321
-
322
- if (pkg.verify(pkg.dir)) {
323
- logOk(`${pkg.name} upgraded successfully`);
324
- } else {
325
- logErr(`${pkg.name} upgrade failed — ${pkg.verifyLabel} not found`);
326
- }
327
- }
328
-
329
- // ─── Uninstall command ────────────────────────────────────────
330
- function uninstallOne(pkgKey) {
331
- const pkg = PACKAGES[pkgKey];
332
-
333
- // Remove symlink
334
- const linkPath = path.join(NODE_MODULES_DIR, pkgKey);
335
- try {
336
- const stat = fs.lstatSync(linkPath);
337
- if (stat.isSymbolicLink() || stat.isFile()) {
338
- fs.unlinkSync(linkPath);
339
- } else if (stat.isDirectory()) {
340
- fs.rmSync(linkPath, { recursive: true });
341
- }
342
- logOk(`Removed symlink @spaces/${pkgKey}`);
343
- } catch {
344
- logWarn(`Symlink @spaces/${pkgKey} not found`);
345
- }
346
-
347
- // Remove package directory
348
- if (fs.existsSync(pkg.dir)) {
349
- fs.rmSync(pkg.dir, { recursive: true });
350
- logOk(`Removed ${pkg.dir}`);
351
- } else {
352
- logWarn(`${pkg.dir} not found`);
353
- }
354
- }
355
-
356
- function uninstallPackage(pkgKey) {
357
- if (pkgKey) {
358
- const pkg = PACKAGES[pkgKey];
359
- if (!pkg) {
360
- logErr(`Unknown package: ${pkgKey}`);
361
- log(`Available: ${Object.keys(PACKAGES).join(', ')}`);
362
- process.exit(1);
363
- }
364
- console.log(`\n Uninstalling ${pkg.name}...\n`);
365
- uninstallOne(pkgKey);
366
- logOk(`${pkg.name} uninstalled`);
367
- } else {
368
- console.log('\n Uninstalling everything...\n');
369
-
370
- // Remove tier packages
371
- for (const [key, pkg] of Object.entries(PACKAGES)) {
372
- if (fs.existsSync(pkg.dir) || fs.existsSync(path.join(NODE_MODULES_DIR, key))) {
373
- log(`─── ${pkg.name} ───`);
374
- uninstallOne(key);
375
- }
376
- }
377
- // Clean up packages dir
378
- try { fs.rmdirSync(NODE_MODULES_DIR); } catch {}
379
- try { fs.rmdirSync(path.join(PACKAGES_DIR, 'node_modules')); } catch {}
380
- try { fs.rmdirSync(PACKAGES_DIR); } catch {}
381
-
382
- // Remove the global spaces CLI
383
- log('─── @jlongo78/agent-spaces ───');
384
- try {
385
- run('npm', ['uninstall', '-g', '@jlongo78/agent-spaces'], { quiet: true });
386
- logOk('Removed global spaces CLI');
387
- } catch {
388
- logWarn('Global spaces CLI not found or already removed');
389
- }
390
-
391
- logOk('Spaces fully uninstalled');
392
- log('User data remains at ~/.spaces/ — remove manually if desired');
393
- }
394
- console.log('');
395
- }
396
-
397
- // ─── CLI ──────────────────────────────────────────────────────
398
- const command = process.argv[2];
399
- const target = process.argv[3];
400
-
401
- switch (command) {
402
- case 'install':
403
- if (!target) {
404
- logErr('Usage: spaces install <teams|pro>');
405
- process.exit(1);
406
- }
407
- installPackage(target);
408
- break;
409
-
410
- case 'uninstall':
411
- uninstallPackage(target || null);
412
- break;
413
-
414
- case 'verify':
415
- verifyAll();
416
- break;
417
-
418
- case 'upgrade':
419
- upgradePackage(target || null);
420
- break;
421
-
422
- default:
423
- logErr(`Unknown command: ${command}`);
424
- log('Usage: spaces <install|uninstall|verify|upgrade> [package]');
425
- process.exit(1);
426
- }
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict';
4
+
5
+ const { execFileSync } = require('child_process');
6
+ const path = require('path');
7
+ const os = require('os');
8
+ const fs = require('fs');
9
+
10
+ const PACKAGES_DIR = path.join(os.homedir(), '.spaces', 'packages');
11
+ const NODE_MODULES_DIR = path.join(PACKAGES_DIR, 'node_modules', '@spaces');
12
+
13
+ // ─── Package definitions ─────────────────────────────────────
14
+ const PACKAGES = {
15
+ teams: {
16
+ name: '@spaces/teams',
17
+ dir: path.join(PACKAGES_DIR, 'teams'),
18
+ repo: 'jlongo78/spaces-teams',
19
+ private: false,
20
+ verify: (dir) => fs.existsSync(path.join(dir, 'dist', 'index.js')),
21
+ verifyLabel: 'dist/index.js',
22
+ },
23
+ pro: {
24
+ name: '@spaces/pro',
25
+ dir: path.join(PACKAGES_DIR, 'pro'),
26
+ repo: 'jlongo78/spaces-pro',
27
+ private: true,
28
+ verify: (dir) => fs.existsSync(path.join(dir, 'dist', 'index.js')),
29
+ verifyLabel: 'dist/index.js',
30
+ },
31
+ };
32
+
33
+ // ─── Helpers ──────────────────────────────────────────────────
34
+ function log(msg) { console.log(` ${msg}`); }
35
+ function logOk(msg) { console.log(` ✓ ${msg}`); }
36
+ function logErr(msg) { console.error(` ✗ ${msg}`); }
37
+ function logWarn(msg) { console.log(` ! ${msg}`); }
38
+
39
+ function run(cmd, args, opts = {}) {
40
+ const isWin = process.platform === 'win32';
41
+ const safeArgs = isWin
42
+ ? args.map(a => (a.includes(' ') ? '"' + a + '"' : a))
43
+ : args;
44
+ return execFileSync(cmd, safeArgs, {
45
+ encoding: 'utf-8',
46
+ stdio: opts.quiet ? ['pipe', 'pipe', 'pipe'] : 'inherit',
47
+ shell: isWin,
48
+ ...opts,
49
+ });
50
+ }
51
+
52
+ /**
53
+ * Clone a repo, trying SSH first then HTTPS (with optional PAT).
54
+ */
55
+ function gitClone(repo, dest, isPrivate) {
56
+ const sshUrl = `git@github.com:${repo}.git`;
57
+ const httpsUrl = `https://github.com/${repo}.git`;
58
+
59
+ // Try SSH first
60
+ try {
61
+ log(`Cloning ${repo} (SSH)...`);
62
+ run('git', ['clone', '--depth', '1', sshUrl, dest]);
63
+ return;
64
+ } catch {
65
+ // SSH failed, try HTTPS
66
+ }
67
+
68
+ // HTTPS check for PAT if private
69
+ if (isPrivate) {
70
+ const pat = process.env.GH_PAT || process.env.GITHUB_TOKEN || '';
71
+ if (pat) {
72
+ log(`Cloning ${repo} (HTTPS + token)...`);
73
+ const authedUrl = `https://${pat}@github.com/${repo}.git`;
74
+ run('git', ['clone', '--depth', '1', authedUrl, dest]);
75
+ return;
76
+ }
77
+ }
78
+
79
+ log(`Cloning ${repo} (HTTPS)...`);
80
+ run('git', ['clone', '--depth', '1', httpsUrl, dest]);
81
+ }
82
+
83
+ /**
84
+ * Pull latest changes in a repo directory.
85
+ */
86
+ function gitPull(dir) {
87
+ log('Pulling latest...');
88
+ run('git', ['pull', '--ff-only'], { cwd: dir });
89
+ }
90
+
91
+ /**
92
+ * Create the symlink from node_modules/@spaces/<name> -> ../../<name>
93
+ */
94
+ function createSymlink(pkgKey) {
95
+ const linkPath = path.join(NODE_MODULES_DIR, pkgKey);
96
+ const targetPath = path.join('..', '..', pkgKey); // relative symlink
97
+
98
+ fs.mkdirSync(NODE_MODULES_DIR, { recursive: true });
99
+
100
+ // Remove existing link/dir
101
+ try {
102
+ const stat = fs.lstatSync(linkPath);
103
+ if (stat.isSymbolicLink() || stat.isFile()) {
104
+ fs.unlinkSync(linkPath);
105
+ } else if (stat.isDirectory()) {
106
+ fs.rmSync(linkPath, { recursive: true });
107
+ }
108
+ } catch {}
109
+
110
+ fs.symlinkSync(targetPath, linkPath, process.platform === 'win32' ? 'junction' : 'dir');
111
+ logOk(`Symlink: @spaces/${pkgKey} -> packages/${pkgKey}`);
112
+ }
113
+
114
+ /**
115
+ * Check if a native module loads correctly from a package directory.
116
+ */
117
+ function checkNativeModule(moduleName, searchDir) {
118
+ try {
119
+ const nodePath = path.join(searchDir, 'node_modules');
120
+ const result = run(process.execPath, [
121
+ '-e',
122
+ `try { require('${moduleName}'); console.log('ok'); } catch(e) { console.log(e.message); }`,
123
+ ], {
124
+ quiet: true,
125
+ cwd: searchDir,
126
+ env: { ...process.env, NODE_PATH: nodePath },
127
+ });
128
+ return result.trim() === 'ok';
129
+ } catch {
130
+ return false;
131
+ }
132
+ }
133
+
134
+ // ─── Install command ──────────────────────────────────────────
135
+ function installPackage(pkgKey) {
136
+ const pkg = PACKAGES[pkgKey];
137
+ if (!pkg) {
138
+ logErr(`Unknown package: ${pkgKey}`);
139
+ log(`Available: ${Object.keys(PACKAGES).join(', ')}`);
140
+ process.exit(1);
141
+ }
142
+
143
+ console.log(`\n Installing ${pkg.name}...\n`);
144
+
145
+ // Pro requires teams as a prerequisite
146
+ if (pkgKey === "pro") {
147
+ const teamsDir = PACKAGES.teams.dir;
148
+ if (!fs.existsSync(path.join(teamsDir, "dist", "index.js"))) {
149
+ log("@spaces/pro requires @spaces/teams -- installing teams first...");
150
+ console.log("");
151
+ installPackage("teams");
152
+ console.log("");
153
+ }
154
+ }
155
+
156
+ // 1. Clone or pull
157
+ if (fs.existsSync(path.join(pkg.dir, '.git'))) {
158
+ gitPull(pkg.dir);
159
+ } else {
160
+ fs.mkdirSync(PACKAGES_DIR, { recursive: true });
161
+ gitClone(pkg.repo, pkg.dir, pkg.private);
162
+ }
163
+
164
+ // 2. Install dependencies
165
+ // Both teams and pro need TypeScript build
166
+ log('Installing dependencies...');
167
+ run('npm', ['install'], { cwd: pkg.dir });
168
+
169
+ log('Building TypeScript...');
170
+ run('npm', ['run', 'build'], { cwd: pkg.dir });
171
+
172
+ log('Pruning dev dependencies...');
173
+ run('npm', ['prune', '--omit=dev'], { cwd: pkg.dir });
174
+
175
+ // 5. Create symlink
176
+ createSymlink(pkgKey);
177
+
178
+ // 6. Verify
179
+ if (pkg.verify(pkg.dir)) {
180
+ logOk(`${pkg.name} installed successfully`);
181
+ } else {
182
+ logErr(`${pkg.name} installed but ${pkg.verifyLabel} not found`);
183
+ process.exit(1);
184
+ }
185
+
186
+ // 7. Update tier in server.json
187
+ const configPath = path.join(os.homedir(), '.spaces', 'server.json');
188
+ try {
189
+ const config = fs.existsSync(configPath)
190
+ ? JSON.parse(fs.readFileSync(configPath, 'utf-8'))
191
+ : { port: 3457, basePath: '' };
192
+ // teams team tier, pro → federation tier (upgrade only, don't downgrade)
193
+ const tierMap = { teams: 'team', pro: 'federation' };
194
+ const tierRank = { community: 0, team: 1, federation: 2 };
195
+ const newTier = tierMap[pkgKey] || config.tier || 'community';
196
+ if ((tierRank[newTier] || 0) >= (tierRank[config.tier] || 0)) {
197
+ config.tier = newTier;
198
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
199
+ logOk(`Tier set to ${newTier}`);
200
+ }
201
+ } catch {}
202
+
203
+ // 8. Verify require() works
204
+ try {
205
+ const result = run(process.execPath, [
206
+ '-e',
207
+ `const p = require.resolve('${pkg.name}'); console.log('resolved: ' + p);`,
208
+ ], {
209
+ quiet: true,
210
+ env: { ...process.env, NODE_PATH: path.join(PACKAGES_DIR, 'node_modules') },
211
+ });
212
+ logOk(`require('${pkg.name}') -> ${result.trim().replace('resolved: ', '')}`);
213
+ } catch {
214
+ logWarn(`require('${pkg.name}') failed this may be OK if peer deps aren't available yet`);
215
+ }
216
+
217
+ console.log('');
218
+ }
219
+
220
+ // ─── Verify command ───────────────────────────────────────────
221
+ function verifyAll() {
222
+ console.log('\n Spaces Package Verification\n');
223
+
224
+ let allOk = true;
225
+
226
+ for (const [key, pkg] of Object.entries(PACKAGES)) {
227
+ log(`─── ${pkg.name} ───`);
228
+
229
+ // Check if installed
230
+ if (!fs.existsSync(pkg.dir)) {
231
+ logWarn('Not installed');
232
+ log('');
233
+ continue;
234
+ }
235
+
236
+ // Check git status
237
+ try {
238
+ const branch = run('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: pkg.dir, quiet: true }).trim();
239
+ const hash = run('git', ['rev-parse', '--short', 'HEAD'], { cwd: pkg.dir, quiet: true }).trim();
240
+ logOk(`Git: ${branch} @ ${hash}`);
241
+ } catch {
242
+ logErr('Git status check failed');
243
+ allOk = false;
244
+ }
245
+
246
+ // Check entry point
247
+ if (pkg.verify(pkg.dir)) {
248
+ logOk(`Entry: ${pkg.verifyLabel} exists`);
249
+ } else {
250
+ logErr(`Entry: ${pkg.verifyLabel} missing`);
251
+ allOk = false;
252
+ }
253
+
254
+ // Check node_modules
255
+ if (fs.existsSync(path.join(pkg.dir, 'node_modules'))) {
256
+ logOk('Dependencies: node_modules present');
257
+ } else {
258
+ logErr('Dependencies: node_modules missing');
259
+ allOk = false;
260
+ }
261
+
262
+ // Check symlink
263
+ const linkPath = path.join(NODE_MODULES_DIR, key);
264
+ try {
265
+ const stat = fs.lstatSync(linkPath);
266
+ if (stat.isSymbolicLink()) {
267
+ const target = fs.readlinkSync(linkPath);
268
+ logOk(`Symlink: @spaces/${key} -> ${target}`);
269
+ } else {
270
+ logWarn(`@spaces/${key} exists but is not a symlink`);
271
+ }
272
+ } catch {
273
+ logErr(`Symlink: @spaces/${key} missing`);
274
+ allOk = false;
275
+ }
276
+
277
+ // Check native modules
278
+ const nativeOk = checkNativeModule('better-sqlite3', pkg.dir);
279
+ if (nativeOk) {
280
+ logOk('Native: better-sqlite3 loads OK');
281
+ } else {
282
+ logErr('Native: better-sqlite3 failed (ABI mismatch? Run: spaces upgrade)');
283
+ allOk = false;
284
+ }
285
+
286
+ // Check require() resolution
287
+ try {
288
+ run(process.execPath, [
289
+ '-e',
290
+ `require.resolve('${pkg.name}')`,
291
+ ], {
292
+ quiet: true,
293
+ env: { ...process.env, NODE_PATH: path.join(PACKAGES_DIR, 'node_modules') },
294
+ });
295
+ logOk(`require('${pkg.name}') resolves OK`);
296
+ } catch {
297
+ logErr(`require('${pkg.name}') fails`);
298
+ allOk = false;
299
+ }
300
+
301
+ log('');
302
+ }
303
+
304
+ if (allOk) {
305
+ logOk('All checks passed');
306
+ } else {
307
+ logErr('Some checks failed — run "spaces upgrade" to fix');
308
+ }
309
+ console.log('');
310
+ }
311
+
312
+ // ─── Upgrade command ──────────────────────────────────────────
313
+ function upgradePackage(pkgKey) {
314
+ if (pkgKey) {
315
+ // Upgrade specific package
316
+ const pkg = PACKAGES[pkgKey];
317
+ if (!pkg) {
318
+ logErr(`Unknown package: ${pkgKey}`);
319
+ process.exit(1);
320
+ }
321
+ if (!fs.existsSync(pkg.dir)) {
322
+ log(`${pkg.name} not installed — running install instead`);
323
+ installPackage(pkgKey);
324
+ return;
325
+ }
326
+ console.log(`\n Upgrading ${pkg.name}...\n`);
327
+ doUpgrade(pkgKey, pkg);
328
+ } else {
329
+ // Upgrade all installed packages
330
+ console.log('\n Upgrading all installed packages...\n');
331
+ for (const [key, pkg] of Object.entries(PACKAGES)) {
332
+ if (fs.existsSync(pkg.dir)) {
333
+ log(`─── ${pkg.name} ───`);
334
+ doUpgrade(key, pkg);
335
+ log('');
336
+ }
337
+ }
338
+ }
339
+ console.log('');
340
+ }
341
+
342
+ function doUpgrade(pkgKey, pkg) {
343
+ // Pull latest
344
+ gitPull(pkg.dir);
345
+
346
+ run('npm', ['install'], { cwd: pkg.dir });
347
+ log('Building TypeScript...');
348
+ run('npm', ['run', 'build'], { cwd: pkg.dir });
349
+ run('npm', ['prune', '--omit=dev'], { cwd: pkg.dir });
350
+
351
+ // Re-create symlink
352
+ createSymlink(pkgKey);
353
+
354
+ if (pkg.verify(pkg.dir)) {
355
+ logOk(`${pkg.name} upgraded successfully`);
356
+ } else {
357
+ logErr(`${pkg.name} upgrade failed — ${pkg.verifyLabel} not found`);
358
+ }
359
+ }
360
+
361
+ // ─── Uninstall command ────────────────────────────────────────
362
+ function uninstallOne(pkgKey) {
363
+ const pkg = PACKAGES[pkgKey];
364
+
365
+ // Remove symlink
366
+ const linkPath = path.join(NODE_MODULES_DIR, pkgKey);
367
+ try {
368
+ const stat = fs.lstatSync(linkPath);
369
+ if (stat.isSymbolicLink() || stat.isFile()) {
370
+ fs.unlinkSync(linkPath);
371
+ } else if (stat.isDirectory()) {
372
+ fs.rmSync(linkPath, { recursive: true });
373
+ }
374
+ logOk(`Removed symlink @spaces/${pkgKey}`);
375
+ } catch {
376
+ logWarn(`Symlink @spaces/${pkgKey} not found`);
377
+ }
378
+
379
+ // Remove package directory
380
+ if (fs.existsSync(pkg.dir)) {
381
+ fs.rmSync(pkg.dir, { recursive: true });
382
+ logOk(`Removed ${pkg.dir}`);
383
+ } else {
384
+ logWarn(`${pkg.dir} not found`);
385
+ }
386
+ }
387
+
388
+ function uninstallPackage(pkgKey) {
389
+ if (pkgKey) {
390
+ const pkg = PACKAGES[pkgKey];
391
+ if (!pkg) {
392
+ logErr(`Unknown package: ${pkgKey}`);
393
+ log(`Available: ${Object.keys(PACKAGES).join(', ')}`);
394
+ process.exit(1);
395
+ }
396
+ console.log(`\n Uninstalling ${pkg.name}...\n`);
397
+ uninstallOne(pkgKey);
398
+ // Reset tier to community if removing a tier package
399
+ const configPath = path.join(os.homedir(), '.spaces', 'server.json');
400
+ try {
401
+ if (fs.existsSync(configPath)) {
402
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
403
+ if (config.tier && config.tier !== 'community') {
404
+ config.tier = 'community';
405
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
406
+ logOk('Reset tier to community');
407
+ }
408
+ }
409
+ } catch {}
410
+ logOk(`${pkg.name} uninstalled`);
411
+ } else {
412
+ console.log('\n Uninstalling everything...\n');
413
+
414
+ // Remove tier packages
415
+ for (const [key, pkg] of Object.entries(PACKAGES)) {
416
+ if (fs.existsSync(pkg.dir) || fs.existsSync(path.join(NODE_MODULES_DIR, key))) {
417
+ log(`─── ${pkg.name} ───`);
418
+ uninstallOne(key);
419
+ }
420
+ }
421
+ // Clean up packages dir
422
+ try { fs.rmdirSync(NODE_MODULES_DIR); } catch {}
423
+ try { fs.rmdirSync(path.join(PACKAGES_DIR, 'node_modules')); } catch {}
424
+ try { fs.rmdirSync(PACKAGES_DIR); } catch {}
425
+
426
+ // Remove the global spaces CLI
427
+ log('─── @jlongo78/agent-spaces ───');
428
+ try {
429
+ run('npm', ['uninstall', '-g', '@jlongo78/agent-spaces'], { quiet: true });
430
+ logOk('Removed global spaces CLI');
431
+ } catch {
432
+ logWarn('Global spaces CLI not found or already removed');
433
+ }
434
+
435
+ // Reset tier to community in server.json
436
+ const configPath = path.join(os.homedir(), '.spaces', 'server.json');
437
+ try {
438
+ if (fs.existsSync(configPath)) {
439
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
440
+ if (config.tier && config.tier !== 'community') {
441
+ config.tier = 'community';
442
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
443
+ logOk('Reset tier to community');
444
+ }
445
+ }
446
+ } catch {}
447
+
448
+ logOk('Spaces fully uninstalled');
449
+ log('User data remains at ~/.spaces/ — remove manually if desired');
450
+ }
451
+ console.log('');
452
+ }
453
+
454
+ // ─── CLI ──────────────────────────────────────────────────────
455
+ const command = process.argv[2];
456
+ const target = process.argv[3];
457
+
458
+ switch (command) {
459
+ case 'install':
460
+ if (!target) {
461
+ logErr('Usage: spaces install <teams|pro>');
462
+ process.exit(1);
463
+ }
464
+ installPackage(target);
465
+ break;
466
+
467
+ case 'uninstall':
468
+ uninstallPackage(target || null);
469
+ break;
470
+
471
+ case 'verify':
472
+ verifyAll();
473
+ break;
474
+
475
+ case 'upgrade':
476
+ upgradePackage(target || null);
477
+ break;
478
+
479
+ default:
480
+ logErr(`Unknown command: ${command}`);
481
+ log('Usage: spaces <install|uninstall|verify|upgrade> [package]');
482
+ process.exit(1);
483
+ }