hackmate-cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/README.md +420 -0
  2. package/dist/api.d.ts +3 -0
  3. package/dist/api.d.ts.map +1 -0
  4. package/dist/api.js +14 -0
  5. package/dist/api.js.map +1 -0
  6. package/dist/cli.d.ts +3 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +172 -0
  9. package/dist/cli.js.map +1 -0
  10. package/dist/commands/ComingSoon.d.ts +7 -0
  11. package/dist/commands/ComingSoon.d.ts.map +1 -0
  12. package/dist/commands/ComingSoon.js +4 -0
  13. package/dist/commands/ComingSoon.js.map +1 -0
  14. package/dist/commands/Config.d.ts +8 -0
  15. package/dist/commands/Config.d.ts.map +1 -0
  16. package/dist/commands/Config.js +42 -0
  17. package/dist/commands/Config.js.map +1 -0
  18. package/dist/commands/DataExport.d.ts +2 -0
  19. package/dist/commands/DataExport.d.ts.map +1 -0
  20. package/dist/commands/DataExport.js +49 -0
  21. package/dist/commands/DataExport.js.map +1 -0
  22. package/dist/commands/Discover.d.ts +2 -0
  23. package/dist/commands/Discover.d.ts.map +1 -0
  24. package/dist/commands/Discover.js +93 -0
  25. package/dist/commands/Discover.js.map +1 -0
  26. package/dist/commands/MatchList.d.ts +2 -0
  27. package/dist/commands/MatchList.d.ts.map +1 -0
  28. package/dist/commands/MatchList.js +118 -0
  29. package/dist/commands/MatchList.js.map +1 -0
  30. package/dist/commands/Presence.d.ts +7 -0
  31. package/dist/commands/Presence.d.ts.map +1 -0
  32. package/dist/commands/Presence.js +52 -0
  33. package/dist/commands/Presence.js.map +1 -0
  34. package/dist/commands/Privacy.d.ts +2 -0
  35. package/dist/commands/Privacy.d.ts.map +1 -0
  36. package/dist/commands/Privacy.js +38 -0
  37. package/dist/commands/Privacy.js.map +1 -0
  38. package/dist/commands/Settings.d.ts +2 -0
  39. package/dist/commands/Settings.d.ts.map +1 -0
  40. package/dist/commands/Settings.js +38 -0
  41. package/dist/commands/Settings.js.map +1 -0
  42. package/dist/commands/Stats.d.ts +2 -0
  43. package/dist/commands/Stats.d.ts.map +1 -0
  44. package/dist/commands/Stats.js +38 -0
  45. package/dist/commands/Stats.js.map +1 -0
  46. package/dist/commands/admin/admin.logic.d.ts +12 -0
  47. package/dist/commands/admin/admin.logic.d.ts.map +1 -0
  48. package/dist/commands/admin/admin.logic.js +41 -0
  49. package/dist/commands/admin/admin.logic.js.map +1 -0
  50. package/dist/commands/admin/admin.screen.d.ts +10 -0
  51. package/dist/commands/admin/admin.screen.d.ts.map +1 -0
  52. package/dist/commands/admin/admin.screen.js +19 -0
  53. package/dist/commands/admin/admin.screen.js.map +1 -0
  54. package/dist/commands/admin/index.d.ts +8 -0
  55. package/dist/commands/admin/index.d.ts.map +1 -0
  56. package/dist/commands/admin/index.js +8 -0
  57. package/dist/commands/admin/index.js.map +1 -0
  58. package/dist/commands/auth/Logout.d.ts +2 -0
  59. package/dist/commands/auth/Logout.d.ts.map +1 -0
  60. package/dist/commands/auth/Logout.js +15 -0
  61. package/dist/commands/auth/Logout.js.map +1 -0
  62. package/dist/commands/auth/Verify.d.ts +2 -0
  63. package/dist/commands/auth/Verify.d.ts.map +1 -0
  64. package/dist/commands/auth/Verify.js +16 -0
  65. package/dist/commands/auth/Verify.js.map +1 -0
  66. package/dist/commands/auth/auth.logic.d.ts +31 -0
  67. package/dist/commands/auth/auth.logic.d.ts.map +1 -0
  68. package/dist/commands/auth/auth.logic.js +147 -0
  69. package/dist/commands/auth/auth.logic.js.map +1 -0
  70. package/dist/commands/auth/index.d.ts +3 -0
  71. package/dist/commands/auth/index.d.ts.map +1 -0
  72. package/dist/commands/auth/index.js +17 -0
  73. package/dist/commands/auth/index.js.map +1 -0
  74. package/dist/commands/auth/login.screen.d.ts +15 -0
  75. package/dist/commands/auth/login.screen.d.ts.map +1 -0
  76. package/dist/commands/auth/login.screen.js +10 -0
  77. package/dist/commands/auth/login.screen.js.map +1 -0
  78. package/dist/commands/auth/signup.screen.d.ts +23 -0
  79. package/dist/commands/auth/signup.screen.d.ts.map +1 -0
  80. package/dist/commands/auth/signup.screen.js +13 -0
  81. package/dist/commands/auth/signup.screen.js.map +1 -0
  82. package/dist/commands/auth/verify.logic.d.ts +11 -0
  83. package/dist/commands/auth/verify.logic.d.ts.map +1 -0
  84. package/dist/commands/auth/verify.logic.js +56 -0
  85. package/dist/commands/auth/verify.logic.js.map +1 -0
  86. package/dist/commands/chat/ChatList.d.ts +2 -0
  87. package/dist/commands/chat/ChatList.d.ts.map +1 -0
  88. package/dist/commands/chat/ChatList.js +63 -0
  89. package/dist/commands/chat/ChatList.js.map +1 -0
  90. package/dist/commands/chat/chat.logic.d.ts +15 -0
  91. package/dist/commands/chat/chat.logic.d.ts.map +1 -0
  92. package/dist/commands/chat/chat.logic.js +139 -0
  93. package/dist/commands/chat/chat.logic.js.map +1 -0
  94. package/dist/commands/chat/chat.screen.d.ts +12 -0
  95. package/dist/commands/chat/chat.screen.d.ts.map +1 -0
  96. package/dist/commands/chat/chat.screen.js +12 -0
  97. package/dist/commands/chat/chat.screen.js.map +1 -0
  98. package/dist/commands/chat/index.d.ts +8 -0
  99. package/dist/commands/chat/index.d.ts.map +1 -0
  100. package/dist/commands/chat/index.js +9 -0
  101. package/dist/commands/chat/index.js.map +1 -0
  102. package/dist/commands/group/group.logic.d.ts +26 -0
  103. package/dist/commands/group/group.logic.d.ts.map +1 -0
  104. package/dist/commands/group/group.logic.js +73 -0
  105. package/dist/commands/group/group.logic.js.map +1 -0
  106. package/dist/commands/group/group.screen.d.ts +19 -0
  107. package/dist/commands/group/group.screen.d.ts.map +1 -0
  108. package/dist/commands/group/group.screen.js +22 -0
  109. package/dist/commands/group/group.screen.js.map +1 -0
  110. package/dist/commands/group/index.d.ts +9 -0
  111. package/dist/commands/group/index.d.ts.map +1 -0
  112. package/dist/commands/group/index.js +8 -0
  113. package/dist/commands/group/index.js.map +1 -0
  114. package/dist/commands/network/index.d.ts +8 -0
  115. package/dist/commands/network/index.d.ts.map +1 -0
  116. package/dist/commands/network/index.js +8 -0
  117. package/dist/commands/network/index.js.map +1 -0
  118. package/dist/commands/network/network.logic.d.ts +12 -0
  119. package/dist/commands/network/network.logic.d.ts.map +1 -0
  120. package/dist/commands/network/network.logic.js +69 -0
  121. package/dist/commands/network/network.logic.js.map +1 -0
  122. package/dist/commands/network/network.screen.d.ts +10 -0
  123. package/dist/commands/network/network.screen.d.ts.map +1 -0
  124. package/dist/commands/network/network.screen.js +17 -0
  125. package/dist/commands/network/network.screen.js.map +1 -0
  126. package/dist/commands/notification/index.d.ts +7 -0
  127. package/dist/commands/notification/index.d.ts.map +1 -0
  128. package/dist/commands/notification/index.js +8 -0
  129. package/dist/commands/notification/index.js.map +1 -0
  130. package/dist/commands/notification/notification.logic.d.ts +11 -0
  131. package/dist/commands/notification/notification.logic.d.ts.map +1 -0
  132. package/dist/commands/notification/notification.logic.js +33 -0
  133. package/dist/commands/notification/notification.logic.js.map +1 -0
  134. package/dist/commands/notification/notification.screen.d.ts +10 -0
  135. package/dist/commands/notification/notification.screen.d.ts.map +1 -0
  136. package/dist/commands/notification/notification.screen.js +13 -0
  137. package/dist/commands/notification/notification.screen.js.map +1 -0
  138. package/dist/commands/profile/index.d.ts +6 -0
  139. package/dist/commands/profile/index.d.ts.map +1 -0
  140. package/dist/commands/profile/index.js +14 -0
  141. package/dist/commands/profile/index.js.map +1 -0
  142. package/dist/commands/profile/profile-edit.screen.d.ts +12 -0
  143. package/dist/commands/profile/profile-edit.screen.d.ts.map +1 -0
  144. package/dist/commands/profile/profile-edit.screen.js +66 -0
  145. package/dist/commands/profile/profile-edit.screen.js.map +1 -0
  146. package/dist/commands/profile/profile-view.screen.d.ts +10 -0
  147. package/dist/commands/profile/profile-view.screen.d.ts.map +1 -0
  148. package/dist/commands/profile/profile-view.screen.js +12 -0
  149. package/dist/commands/profile/profile-view.screen.js.map +1 -0
  150. package/dist/commands/profile/profile.logic.d.ts +42 -0
  151. package/dist/commands/profile/profile.logic.d.ts.map +1 -0
  152. package/dist/commands/profile/profile.logic.js +74 -0
  153. package/dist/commands/profile/profile.logic.js.map +1 -0
  154. package/dist/commands/project/index.d.ts +9 -0
  155. package/dist/commands/project/index.d.ts.map +1 -0
  156. package/dist/commands/project/index.js +8 -0
  157. package/dist/commands/project/index.js.map +1 -0
  158. package/dist/commands/project/project.logic.d.ts +29 -0
  159. package/dist/commands/project/project.logic.d.ts.map +1 -0
  160. package/dist/commands/project/project.logic.js +92 -0
  161. package/dist/commands/project/project.logic.js.map +1 -0
  162. package/dist/commands/project/project.screen.d.ts +22 -0
  163. package/dist/commands/project/project.screen.d.ts.map +1 -0
  164. package/dist/commands/project/project.screen.js +27 -0
  165. package/dist/commands/project/project.screen.js.map +1 -0
  166. package/dist/commands/stubs/index.d.ts +9 -0
  167. package/dist/commands/stubs/index.d.ts.map +1 -0
  168. package/dist/commands/stubs/index.js +24 -0
  169. package/dist/commands/stubs/index.js.map +1 -0
  170. package/dist/config.d.ts +14 -0
  171. package/dist/config.d.ts.map +1 -0
  172. package/dist/config.js +29 -0
  173. package/dist/config.js.map +1 -0
  174. package/dist/context/AuthContext.d.ts +18 -0
  175. package/dist/context/AuthContext.d.ts.map +1 -0
  176. package/dist/context/AuthContext.js +49 -0
  177. package/dist/context/AuthContext.js.map +1 -0
  178. package/dist/context/SocketContext.d.ts +12 -0
  179. package/dist/context/SocketContext.d.ts.map +1 -0
  180. package/dist/context/SocketContext.js +44 -0
  181. package/dist/context/SocketContext.js.map +1 -0
  182. package/dist/context/index.d.ts +7 -0
  183. package/dist/context/index.d.ts.map +1 -0
  184. package/dist/context/index.js +9 -0
  185. package/dist/context/index.js.map +1 -0
  186. package/dist/features/admin/components/admin.screen.d.ts +10 -0
  187. package/dist/features/admin/components/admin.screen.d.ts.map +1 -0
  188. package/dist/features/admin/components/admin.screen.js +19 -0
  189. package/dist/features/admin/components/admin.screen.js.map +1 -0
  190. package/dist/features/admin/components/index.d.ts +8 -0
  191. package/dist/features/admin/components/index.d.ts.map +1 -0
  192. package/dist/features/admin/components/index.js +8 -0
  193. package/dist/features/admin/components/index.js.map +1 -0
  194. package/dist/features/admin/hooks/useAdmin.d.ts +12 -0
  195. package/dist/features/admin/hooks/useAdmin.d.ts.map +1 -0
  196. package/dist/features/admin/hooks/useAdmin.js +46 -0
  197. package/dist/features/admin/hooks/useAdmin.js.map +1 -0
  198. package/dist/features/admin/index.d.ts +3 -0
  199. package/dist/features/admin/index.d.ts.map +1 -0
  200. package/dist/features/admin/index.js +3 -0
  201. package/dist/features/admin/index.js.map +1 -0
  202. package/dist/features/chat/components/ChatList.d.ts +2 -0
  203. package/dist/features/chat/components/ChatList.d.ts.map +1 -0
  204. package/dist/features/chat/components/ChatList.js +63 -0
  205. package/dist/features/chat/components/ChatList.js.map +1 -0
  206. package/dist/features/chat/components/chat.screen.d.ts +12 -0
  207. package/dist/features/chat/components/chat.screen.d.ts.map +1 -0
  208. package/dist/features/chat/components/chat.screen.js +12 -0
  209. package/dist/features/chat/components/chat.screen.js.map +1 -0
  210. package/dist/features/chat/components/index.d.ts +9 -0
  211. package/dist/features/chat/components/index.d.ts.map +1 -0
  212. package/dist/features/chat/components/index.js +9 -0
  213. package/dist/features/chat/components/index.js.map +1 -0
  214. package/dist/features/chat/hooks/useChat.d.ts +15 -0
  215. package/dist/features/chat/hooks/useChat.d.ts.map +1 -0
  216. package/dist/features/chat/hooks/useChat.js +150 -0
  217. package/dist/features/chat/hooks/useChat.js.map +1 -0
  218. package/dist/features/chat/index.d.ts +4 -0
  219. package/dist/features/chat/index.d.ts.map +1 -0
  220. package/dist/features/chat/index.js +4 -0
  221. package/dist/features/chat/index.js.map +1 -0
  222. package/dist/features/group/components/group.screen.d.ts +19 -0
  223. package/dist/features/group/components/group.screen.d.ts.map +1 -0
  224. package/dist/features/group/components/group.screen.js +22 -0
  225. package/dist/features/group/components/group.screen.js.map +1 -0
  226. package/dist/features/group/components/index.d.ts +9 -0
  227. package/dist/features/group/components/index.d.ts.map +1 -0
  228. package/dist/features/group/components/index.js +8 -0
  229. package/dist/features/group/components/index.js.map +1 -0
  230. package/dist/features/group/hooks/useGroup.d.ts +26 -0
  231. package/dist/features/group/hooks/useGroup.d.ts.map +1 -0
  232. package/dist/features/group/hooks/useGroup.js +78 -0
  233. package/dist/features/group/hooks/useGroup.js.map +1 -0
  234. package/dist/features/group/index.d.ts +3 -0
  235. package/dist/features/group/index.d.ts.map +1 -0
  236. package/dist/features/group/index.js +3 -0
  237. package/dist/features/group/index.js.map +1 -0
  238. package/dist/features/network/components/UnfriendByUsername.d.ts +7 -0
  239. package/dist/features/network/components/UnfriendByUsername.d.ts.map +1 -0
  240. package/dist/features/network/components/UnfriendByUsername.js +40 -0
  241. package/dist/features/network/components/UnfriendByUsername.js.map +1 -0
  242. package/dist/features/network/components/index.d.ts +8 -0
  243. package/dist/features/network/components/index.d.ts.map +1 -0
  244. package/dist/features/network/components/index.js +9 -0
  245. package/dist/features/network/components/index.js.map +1 -0
  246. package/dist/features/network/components/network.screen.d.ts +10 -0
  247. package/dist/features/network/components/network.screen.d.ts.map +1 -0
  248. package/dist/features/network/components/network.screen.js +17 -0
  249. package/dist/features/network/components/network.screen.js.map +1 -0
  250. package/dist/features/network/hooks/useNetwork.d.ts +12 -0
  251. package/dist/features/network/hooks/useNetwork.d.ts.map +1 -0
  252. package/dist/features/network/hooks/useNetwork.js +74 -0
  253. package/dist/features/network/hooks/useNetwork.js.map +1 -0
  254. package/dist/features/network/hooks/useUnfriend.d.ts +7 -0
  255. package/dist/features/network/hooks/useUnfriend.d.ts.map +1 -0
  256. package/dist/features/network/hooks/useUnfriend.js +24 -0
  257. package/dist/features/network/hooks/useUnfriend.js.map +1 -0
  258. package/dist/features/network/index.d.ts +4 -0
  259. package/dist/features/network/index.d.ts.map +1 -0
  260. package/dist/features/network/index.js +4 -0
  261. package/dist/features/network/index.js.map +1 -0
  262. package/dist/features/notification/components/index.d.ts +7 -0
  263. package/dist/features/notification/components/index.d.ts.map +1 -0
  264. package/dist/features/notification/components/index.js +8 -0
  265. package/dist/features/notification/components/index.js.map +1 -0
  266. package/dist/features/notification/components/notification.screen.d.ts +10 -0
  267. package/dist/features/notification/components/notification.screen.d.ts.map +1 -0
  268. package/dist/features/notification/components/notification.screen.js +13 -0
  269. package/dist/features/notification/components/notification.screen.js.map +1 -0
  270. package/dist/features/notification/hooks/useNotification.d.ts +11 -0
  271. package/dist/features/notification/hooks/useNotification.d.ts.map +1 -0
  272. package/dist/features/notification/hooks/useNotification.js +38 -0
  273. package/dist/features/notification/hooks/useNotification.js.map +1 -0
  274. package/dist/features/notification/index.d.ts +3 -0
  275. package/dist/features/notification/index.d.ts.map +1 -0
  276. package/dist/features/notification/index.js +3 -0
  277. package/dist/features/notification/index.js.map +1 -0
  278. package/dist/features/profile/components/index.d.ts +6 -0
  279. package/dist/features/profile/components/index.d.ts.map +1 -0
  280. package/dist/features/profile/components/index.js +13 -0
  281. package/dist/features/profile/components/index.js.map +1 -0
  282. package/dist/features/profile/components/profile-edit.screen.d.ts +14 -0
  283. package/dist/features/profile/components/profile-edit.screen.d.ts.map +1 -0
  284. package/dist/features/profile/components/profile-edit.screen.js +182 -0
  285. package/dist/features/profile/components/profile-edit.screen.js.map +1 -0
  286. package/dist/features/profile/components/profile-view.screen.d.ts +10 -0
  287. package/dist/features/profile/components/profile-view.screen.d.ts.map +1 -0
  288. package/dist/features/profile/components/profile-view.screen.js +13 -0
  289. package/dist/features/profile/components/profile-view.screen.js.map +1 -0
  290. package/dist/features/profile/hooks/useProfile.d.ts +17 -0
  291. package/dist/features/profile/hooks/useProfile.d.ts.map +1 -0
  292. package/dist/features/profile/hooks/useProfile.js +148 -0
  293. package/dist/features/profile/hooks/useProfile.js.map +1 -0
  294. package/dist/features/profile/index.d.ts +3 -0
  295. package/dist/features/profile/index.d.ts.map +1 -0
  296. package/dist/features/profile/index.js +3 -0
  297. package/dist/features/profile/index.js.map +1 -0
  298. package/dist/features/project/components/index.d.ts +9 -0
  299. package/dist/features/project/components/index.d.ts.map +1 -0
  300. package/dist/features/project/components/index.js +8 -0
  301. package/dist/features/project/components/index.js.map +1 -0
  302. package/dist/features/project/components/project.screen.d.ts +22 -0
  303. package/dist/features/project/components/project.screen.d.ts.map +1 -0
  304. package/dist/features/project/components/project.screen.js +27 -0
  305. package/dist/features/project/components/project.screen.js.map +1 -0
  306. package/dist/features/project/hooks/useProject.d.ts +29 -0
  307. package/dist/features/project/hooks/useProject.d.ts.map +1 -0
  308. package/dist/features/project/hooks/useProject.js +97 -0
  309. package/dist/features/project/hooks/useProject.js.map +1 -0
  310. package/dist/features/project/index.d.ts +3 -0
  311. package/dist/features/project/index.d.ts.map +1 -0
  312. package/dist/features/project/index.js +3 -0
  313. package/dist/features/project/index.js.map +1 -0
  314. package/package.json +58 -0
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface ConfigProps {
3
+ action?: 'get' | 'set';
4
+ value?: string;
5
+ }
6
+ export declare const Config: React.FC<ConfigProps>;
7
+ export {};
8
+ //# sourceMappingURL=Config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/commands/Config.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,UAAU,WAAW;IACjB,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsExC,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
3
+ import { Box, Text, useInput, useApp } from 'ink';
4
+ import TextInput from 'ink-text-input';
5
+ import { getApiUrl, setApiUrl } from '../config.js';
6
+ export const Config = ({ action = 'get', value }) => {
7
+ const { exit } = useApp();
8
+ const [url, setUrl] = useState('');
9
+ const [mode, setMode] = useState(action === 'get' ? 'display' : 'input');
10
+ useInput((input, key) => {
11
+ if (key.escape) {
12
+ exit();
13
+ }
14
+ });
15
+ useEffect(() => {
16
+ if (action === 'get') {
17
+ const currentUrl = getApiUrl();
18
+ setUrl(currentUrl);
19
+ }
20
+ else if (action === 'set' && value) {
21
+ // Set directly from CLI argument
22
+ setApiUrl(value);
23
+ setUrl(value);
24
+ setMode('saved');
25
+ setTimeout(() => process.exit(0), 1500);
26
+ }
27
+ }, [action, value]);
28
+ const handleSubmit = (inputUrl) => {
29
+ setApiUrl(inputUrl);
30
+ setUrl(inputUrl);
31
+ setMode('saved');
32
+ setTimeout(() => process.exit(0), 1500);
33
+ };
34
+ if (mode === 'display') {
35
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "HackMate Configuration" }), _jsx(Text, {}), _jsxs(Text, { children: ["API URL: ", _jsx(Text, { color: "green", children: url })] }), _jsx(Text, {}), _jsx(Text, { dimColor: true, children: "Use `hackmate config set <url>` to change" }), _jsx(Text, { dimColor: true, children: "Press ESC to exit" })] }));
36
+ }
37
+ if (mode === 'saved') {
38
+ return (_jsx(Box, { flexDirection: "column", padding: 1, children: _jsxs(Text, { color: "green", children: ["\u2713 API URL updated to: ", url] }) }));
39
+ }
40
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "Set API URL" }), _jsx(Text, {}), _jsxs(Box, { children: [_jsx(Text, { children: "API URL: " }), _jsx(TextInput, { value: url, onChange: setUrl, onSubmit: handleSubmit, placeholder: "http://your-server.com:3001" })] }), _jsx(Text, {}), _jsx(Text, { dimColor: true, children: "Press ESC to exit" }), _jsx(Text, { dimColor: true, children: "Press Enter to save" })] }));
41
+ };
42
+ //# sourceMappingURL=Config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/commands/Config.t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V,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAC,6BAA6B,GAC3C,IACA,EACN,KAAC,IAAI,KAAQ,EACb,KAAC,IAAI,IAAC,QAAQ,wCAAyB,EACvC,KAAC,IAAI,IAAC,QAAQ,0CAA2B,IACvC,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const DataExport: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=DataExport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataExport.d.ts","sourceRoot":"","sources":["../../src/commands/DataExport.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU,+CAkEtB,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useState } from 'react';
3
+ import { Box, Text, useInput, useApp } from 'ink';
4
+ import api from '../api.js';
5
+ import fs from 'fs';
6
+ import path from 'path';
7
+ export const DataExport = () => {
8
+ const { exit } = useApp();
9
+ const [loading, setLoading] = useState(false);
10
+ const [error, setError] = useState(null);
11
+ const [success, setSuccess] = useState(false);
12
+ const [filePath, setFilePath] = useState('');
13
+ useInput((input, key) => {
14
+ if (key.escape) {
15
+ exit();
16
+ }
17
+ });
18
+ React.useEffect(() => {
19
+ const exportData = async () => {
20
+ setLoading(true);
21
+ try {
22
+ const { data } = await api.get('/data/export');
23
+ // Save to file
24
+ const exportPath = path.join(process.cwd(), `hackmate_export_${Date.now()}.json`);
25
+ fs.writeFileSync(exportPath, JSON.stringify(data, null, 2));
26
+ setFilePath(exportPath);
27
+ setSuccess(true);
28
+ }
29
+ catch (err) {
30
+ setError(err.response?.data?.message || 'Failed to export data');
31
+ }
32
+ finally {
33
+ setLoading(false);
34
+ }
35
+ };
36
+ exportData();
37
+ }, []);
38
+ if (loading) {
39
+ return (_jsxs(Box, { borderStyle: "round", borderColor: "yellow", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, children: "\uD83D\uDCE6 Data Export" }), _jsx(Text, { children: "Exporting your data..." }), _jsx(Text, { color: "gray", children: "This may take a moment" })] }));
40
+ }
41
+ if (error) {
42
+ return (_jsx(Box, { borderStyle: "round", borderColor: "red", padding: 1, children: _jsxs(Text, { color: "red", children: ["Error: ", error] }) }));
43
+ }
44
+ if (success) {
45
+ return (_jsxs(Box, { borderStyle: "round", borderColor: "green", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, color: "green", children: "\u2705 Data Export Complete" }), _jsx(Text, { children: "Your data has been exported to:" }), _jsx(Text, { bold: true, color: "cyan", children: filePath }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "This file contains your profile, messages, connections, projects, and more." }) })] }));
46
+ }
47
+ return _jsx(Text, { children: "Exporting..." });
48
+ };
49
+ //# sourceMappingURL=DataExport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataExport.js","sourceRoot":"","sources":["../../src/commands/DataExport.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,C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AAC,QAAQ,aAC5E,KAAC,IAAI,IAAC,IAAI,+CAAsB,EAChC,KAAC,IAAI,yCAA8B,EACnC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,uCAA8B,IAC9C,CACT,CAAC;IACN,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,CACH,KAAC,GAAG,IAAC,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,OAAO,EAAE,CAAC,YACjD,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,wBAAS,KAAK,IAAQ,GACrC,CACT,CAAC;IACN,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACV,OAAO,CACH,MAAC,GAAG,IAAC,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAC,OAAO,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,aAC3E,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,OAAO,4CAA8B,EACtD,KAAC,IAAI,kDAAuC,EAC5C,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,YAAE,QAAQ,GAAQ,EACzC,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACb,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,4FAAmF,GACnG,IACJ,CACT,CAAC;IACN,CAAC;IAED,OAAO,KAAC,IAAI,+BAAoB,CAAC;AACrC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const Discover: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=Discover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Discover.d.ts","sourceRoot":"","sources":["../../src/commands/Discover.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,QAAQ,+CAqHpB,CAAC"}
@@ -0,0 +1,93 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { Text, Box, useApp, Newline, useInput } from 'ink';
4
+ import api from '../api.js';
5
+ import { useAuth } from '../context/index.js';
6
+ import { Chat } from '../features/chat/index.js';
7
+ export const Discover = () => {
8
+ const [selectedIndex, setSelectedIndex] = useState(0);
9
+ const { isAuthenticated, isLoading: authLoading } = useAuth();
10
+ const [view, setView] = useState('list');
11
+ const [selectedUser, setSelectedUser] = useState(null);
12
+ // Restore missing state
13
+ const [matches, setMatches] = useState([]);
14
+ const [loading, setLoading] = useState(true);
15
+ const [error, setError] = useState(null);
16
+ const { exit } = useApp();
17
+ useInput((input, key) => {
18
+ if (view === 'list') {
19
+ if (key.upArrow) {
20
+ setSelectedIndex(Math.max(0, selectedIndex - 1));
21
+ }
22
+ if (key.downArrow) {
23
+ setSelectedIndex(Math.min(matches.length - 1, selectedIndex + 1));
24
+ }
25
+ if (key.return) {
26
+ const match = matches[selectedIndex];
27
+ if (match && match.userId?.username) {
28
+ setSelectedUser(match.userId.username);
29
+ setView('chat');
30
+ }
31
+ }
32
+ if (key.escape) {
33
+ exit();
34
+ }
35
+ }
36
+ });
37
+ useEffect(() => {
38
+ if (authLoading)
39
+ return;
40
+ if (!isAuthenticated) {
41
+ setError('Please login first using "hackmate auth login"');
42
+ setLoading(false);
43
+ setTimeout(() => exit(), 100);
44
+ return;
45
+ }
46
+ const fetchMatches = async () => {
47
+ try {
48
+ const { data } = await api.get('/match/discover');
49
+ setMatches(data);
50
+ }
51
+ catch (err) {
52
+ let msg = err.response?.data?.message || 'Failed to fetch matches';
53
+ if (msg.includes('No Authorization')) {
54
+ msg = 'Please login first using "hackmate auth login"';
55
+ }
56
+ setError(msg);
57
+ setTimeout(() => exit(), 100);
58
+ }
59
+ finally {
60
+ setLoading(false);
61
+ }
62
+ };
63
+ fetchMatches();
64
+ }, [isAuthenticated, authLoading]);
65
+ if (loading && view === 'list')
66
+ return _jsx(Text, { children: "Finding your tribe..." });
67
+ if (error && view === 'list')
68
+ return _jsxs(Text, { color: "red", children: ["Error: ", error] });
69
+ if (matches.length === 0 && view === 'list')
70
+ return _jsx(Text, { children: "No matches found yet. Try back later!" });
71
+ if (view === 'chat' && selectedUser) {
72
+ return (
73
+ // Dynamic import to avoid circular dependency issues if any,
74
+ // though standard import works if structured correctly.
75
+ // Using the imported Chat component.
76
+ _jsx(Chat, { targetUsername: selectedUser,
77
+ // When user exits chat via Esc, go back to list
78
+ // The Chat component handles Esc internally and calls this callback if provided?
79
+ // Wait, Chat logic calls `exit`. We need to override it or handle it.
80
+ // Looking at useChatLogic: `const exit = onExit || appExit;`
81
+ // So we pass onExit:
82
+ // @ts-ignore - Check props compatibility
83
+ onExit: () => {
84
+ setView('list');
85
+ setSelectedUser(null);
86
+ } }));
87
+ }
88
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, color: "magenta", children: " \uD83D\uDE80 Top Matches for You " }), _jsx(Text, { color: "gray", italic: true, children: " (Use Arrow Keys to Navigate, Enter to Chat, Esc to Exit) " }), _jsx(Newline, {}), matches.map((match, i) => {
89
+ const isSelected = i === selectedIndex;
90
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: isSelected ? "double" : "single", borderColor: isSelected ? "green" : "cyan", marginBottom: 1, paddingX: 1, children: [_jsxs(Box, { justifyContent: "space-between", children: [_jsxs(Text, { bold: true, color: isSelected ? "green" : "cyan", children: [isSelected ? '> ' : '', "@", match.userId?.username || 'Unknown'] }), _jsxs(Text, { color: "green", children: [match.score, " pts"] })] }), _jsx(Text, { italic: true, children: match.bio }), _jsxs(Text, { children: ["Stack: ", match.stack.join(', ')] }), _jsx(Newline, {}), _jsxs(Text, { color: "gray", children: ["Why? ", match.matchReasons.join(' • ')] })] }, i));
91
+ })] }));
92
+ };
93
+ //# sourceMappingURL=Discover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Discover.js","sourceRoot":"","sources":["../../src/commands/Discover.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,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B,MAAM,UAAU,GAAG,CAAC,KAAK,aAAa,CAAC;gBACvC,OAAO,CACH,MAAC,GAAG,IAEA,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAC7C,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAC1C,YAAY,EAAE,CAAC,EACf,QAAQ,EAAE,CAAC,aAEX,MAAC,GAAG,IAAC,cAAc,EAAC,eAAe,aAC/B,MAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,aAC1C,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAG,KAAK,CAAC,MAAM,EAAE,QAAQ,IAAI,SAAS,IAC1D,EACP,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,aAAE,KAAK,CAAC,KAAK,YAAY,IAC1C,EACN,KAAC,IAAI,IAAC,MAAM,kBAAE,KAAK,CAAC,GAAG,GAAQ,EAC/B,MAAC,IAAI,0BAAS,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAQ,EAC5C,KAAC,OAAO,KAAG,EACX,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,sBAAO,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAQ,KAhB1D,CAAC,CAiBJ,CACT,CAAC;YACN,CAAC,CAAC,IACA,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const MatchList: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=MatchList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MatchList.d.ts","sourceRoot":"","sources":["../../src/commands/MatchList.tsx"],"names":[],"mappings":"AAwBA,eAAO,MAAM,SAAS,+CAiLrB,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
3
+ import { Box, Text, useInput, useApp } from 'ink';
4
+ import SelectInput from 'ink-select-input';
5
+ import api from '../api.js';
6
+ import { useAuth } from '../context/index.js';
7
+ import { Chat } from '../features/chat/index.js';
8
+ import { ProfileView } from '../features/profile/index.js';
9
+ export const MatchList = () => {
10
+ const { exit } = useApp();
11
+ const { isAuthenticated, isLoading: authLoading } = useAuth();
12
+ const [matches, setMatches] = useState([]);
13
+ const [loading, setLoading] = useState(true);
14
+ const [error, setError] = useState(null);
15
+ const [selectedIndex, setSelectedIndex] = useState(0);
16
+ const [viewMode, setViewMode] = useState('list');
17
+ const [actionMessage, setActionMessage] = useState(null);
18
+ useInput((input, key) => {
19
+ if (viewMode === 'list') {
20
+ if (key.escape) {
21
+ exit();
22
+ return;
23
+ }
24
+ if (key.upArrow) {
25
+ setSelectedIndex(Math.max(0, selectedIndex - 1));
26
+ }
27
+ if (key.downArrow) {
28
+ setSelectedIndex(Math.min(matches.length - 1, selectedIndex + 1));
29
+ }
30
+ if (key.return) {
31
+ setViewMode('actions');
32
+ }
33
+ }
34
+ else if (viewMode === 'profile') {
35
+ if (key.escape) {
36
+ setViewMode('list');
37
+ }
38
+ }
39
+ });
40
+ useEffect(() => {
41
+ if (authLoading)
42
+ return;
43
+ if (!isAuthenticated) {
44
+ setError('Please login first using "hackmate auth login"');
45
+ setLoading(false);
46
+ setTimeout(() => exit(), 100);
47
+ return;
48
+ }
49
+ const fetchMatches = async () => {
50
+ try {
51
+ const { data } = await api.get('/match/top?limit=10');
52
+ setMatches(data);
53
+ }
54
+ catch (err) {
55
+ let msg = err.response?.data?.message || 'Failed to fetch matches';
56
+ if (msg.includes('No Authorization')) {
57
+ msg = 'Please login first using "hackmate auth login"';
58
+ }
59
+ setError(msg);
60
+ setTimeout(() => exit(), 100);
61
+ }
62
+ finally {
63
+ setLoading(false);
64
+ }
65
+ };
66
+ fetchMatches();
67
+ }, [isAuthenticated, authLoading]);
68
+ const handleActionSelect = async (item) => {
69
+ if (item.value === 'back') {
70
+ setViewMode('list');
71
+ }
72
+ else if (item.value === 'view') {
73
+ setViewMode('profile');
74
+ }
75
+ else if (item.value === 'dm') {
76
+ setViewMode('chat');
77
+ // Chat component handles input, so we don't need to do anything else here
78
+ }
79
+ else if (item.value === 'follow') {
80
+ try {
81
+ const targetId = matches[selectedIndex].userId._id;
82
+ await api.post('/network/request', { targetUserId: targetId });
83
+ setActionMessage(`✅ Friend request sent to @${matches[selectedIndex].userId.username}!`);
84
+ }
85
+ catch (e) {
86
+ setActionMessage(`❌ Error: ${e.response?.data?.message || e.message}`);
87
+ }
88
+ // Clear message after 3s
89
+ setTimeout(() => setActionMessage(null), 3000);
90
+ setViewMode('list');
91
+ }
92
+ };
93
+ if (loading)
94
+ return _jsx(Text, { children: "Finding your best matches..." });
95
+ if (error)
96
+ return _jsxs(Text, { color: "red", children: ["Error: ", error] });
97
+ // Empty state
98
+ if (matches.length === 0) {
99
+ return (_jsxs(Box, { borderStyle: "round", borderColor: "magenta", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, color: "magenta", children: "\u2764\uFE0F Match Queue" }), _jsx(Text, { children: "No new matches found." }), _jsx(Text, { color: "gray", children: "Try updating your profile or filters!" }), _jsx(Text, { color: "gray", children: "Press ESC to exit." })] }));
100
+ }
101
+ const selectedMatch = matches[selectedIndex];
102
+ // CHAT VIEW
103
+ if (viewMode === 'chat') {
104
+ return _jsx(Chat, { targetUsername: selectedMatch.userId.username, onExit: () => setViewMode('list') });
105
+ }
106
+ // PROFILE VIEW
107
+ if (viewMode === 'profile') {
108
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", padding: 1, children: [_jsx(ProfileView, { username: selectedMatch.userId.username }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to return to matches" }) })] }));
109
+ }
110
+ // LIST / ACTIONS VIEW
111
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", padding: 1, children: [_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", children: [_jsx(Text, { bold: true, underline: true, color: "magenta", children: "\uD83D\uDC95 Your Top Matches" }), actionMessage && _jsx(Text, { bold: true, color: actionMessage.includes('Error') ? 'red' : 'green', children: actionMessage })] }), viewMode === 'actions' ? (_jsxs(Box, { flexDirection: "column", marginY: 1, borderStyle: "round", borderColor: "yellow", padding: 1, children: [_jsxs(Text, { bold: true, color: "yellow", children: ["Selected: @", selectedMatch.userId.username] }), _jsx(Text, { color: "gray", children: "Choose an action:" }), _jsx(SelectInput, { items: [
112
+ { label: '📄 View Full Profile', value: 'view' },
113
+ { label: '💬 Send Message (DM)', value: 'dm' },
114
+ { label: '👋 Follow / Connect', value: 'follow' },
115
+ { label: '⬅️ Back to List', value: 'back' }
116
+ ], onSelect: handleActionSelect })] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { color: "gray", children: "Use \u2191\u2193 arrows to navigate, ENTER to interact, ESC to exit" }), _jsx(Box, { marginTop: 1, flexDirection: "column", children: matches.map((match, index) => (_jsxs(Box, { borderStyle: index === selectedIndex ? 'bold' : undefined, borderColor: index === selectedIndex ? 'cyan' : undefined, flexDirection: "column", paddingX: 1, marginY: 0, children: [_jsxs(Text, { children: [_jsxs(Text, { bold: true, color: "green", children: ["@", match.userId.username] }), _jsxs(Text, { color: "yellow", children: [" (", match.compatibilityPercentage, "% match)"] })] }), _jsx(Text, { children: match.fullName || 'No name' }), match.bio && _jsxs(Text, { italic: true, color: "gray", children: [match.bio.substring(0, 80), "..."] }), (match.city || match.country) && (_jsxs(Text, { color: "blue", children: ["\uD83D\uDCCD ", [match.city, match.country].filter(Boolean).join(', ')] })), _jsxs(Text, { color: "cyan", children: ["\uD83D\uDCBB ", match.stack?.slice(0, 3).join(', ') || 'N/A'] }), match.matchReasons && match.matchReasons.length > 0 && (_jsxs(Text, { color: "magenta", children: ["\uD83D\uDCA1 ", match.matchReasons[0]] }))] }, match.userId._id))) })] })), viewMode === 'list' && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Select a user to Follow or DM" }) }))] }));
117
+ };
118
+ //# sourceMappingURL=MatchList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MatchList.js","sourceRoot":"","sources":["../../src/commands/MatchList.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAkB3D,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,EAAE,CAAC;IAC9D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAU,EAAE,CAAC,CAAC;IACpD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAA0C,MAAM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AC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAC9B,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,8BAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAQ,CACxF,EACD,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,8BAAK,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,IAAQ,EAC1E,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,CACpD,MAAC,IAAI,IAAC,KAAK,EAAC,SAAS,8BAAK,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAQ,CAC1D,KAnBI,KAAK,CAAC,MAAM,CAAC,GAAG,CAoBnB,CACT,CAAC,GACA,IACP,CACN,EAEA,QAAQ,KAAK,MAAM,IAAI,CACpB,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACb,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,8CAAqC,GACrD,CACT,IACC,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface PresenceProps {
3
+ status: 'online' | 'away' | 'busy' | 'offline';
4
+ }
5
+ export declare const Presence: React.FC<PresenceProps>;
6
+ export {};
7
+ //# sourceMappingURL=Presence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presence.d.ts","sourceRoot":"","sources":["../../src/commands/Presence.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,UAAU,aAAa;IACnB,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAClD;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAmD5C,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useState } from 'react';
3
+ import { Box, Text, useApp } from 'ink';
4
+ import api from '../api.js';
5
+ import { useAuth } from '../context/index.js';
6
+ export const Presence = ({ status }) => {
7
+ const { exit } = useApp();
8
+ const { isAuthenticated, isLoading: authLoading } = useAuth();
9
+ const [loading, setLoading] = useState(true);
10
+ const [error, setError] = useState(null);
11
+ const [success, setSuccess] = useState(false);
12
+ React.useEffect(() => {
13
+ if (authLoading)
14
+ return;
15
+ if (!isAuthenticated) {
16
+ setError('Please login first using "hackmate auth login"');
17
+ setLoading(false);
18
+ setTimeout(() => exit(), 100);
19
+ return;
20
+ }
21
+ const updatePresence = async () => {
22
+ setLoading(true);
23
+ try {
24
+ await api.put('/presence/status', { status });
25
+ setSuccess(true);
26
+ setTimeout(() => exit(), 1500); // Exit after showing success
27
+ }
28
+ catch (err) {
29
+ let msg = err.response?.data?.message || 'Failed to update presence';
30
+ if (msg.includes('No Authorization')) {
31
+ msg = 'Please login first using "hackmate auth login"';
32
+ }
33
+ setError(msg);
34
+ setTimeout(() => exit(), 100);
35
+ }
36
+ finally {
37
+ setLoading(false);
38
+ }
39
+ };
40
+ updatePresence();
41
+ }, [status, isAuthenticated, authLoading]);
42
+ if (loading || authLoading)
43
+ return _jsx(Text, { children: "Updating presence..." });
44
+ if (error)
45
+ return _jsxs(Text, { color: "red", children: ["Error: ", error] });
46
+ if (success) {
47
+ const color = status === 'online' ? 'green' : status === 'away' ? 'yellow' : status === 'busy' ? 'red' : 'gray';
48
+ return (_jsx(Box, { borderStyle: "round", borderColor: color, padding: 1, children: _jsxs(Text, { children: ["Presence updated to: ", _jsx(Text, { bold: true, color: color, children: status.toUpperCase() })] }) }));
49
+ }
50
+ return _jsx(Text, { children: "Processing..." });
51
+ };
52
+ //# sourceMappingURL=Presence.js.map
@@ -0,0 +1 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AAG,MAAM,CAAC,WAAW,EAAE,GAAQ,IACxE,GACL,CACT,CAAC;IACN,CAAC;IAED,OAAO,KAAC,IAAI,gCAAqB,CAAC;AACtC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const Privacy: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=Privacy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Privacy.d.ts","sourceRoot":"","sources":["../../src/commands/Privacy.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,OAAO,+CA6CnB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
3
+ import { Box, Text, useInput, useApp } from 'ink';
4
+ import api from '../api.js';
5
+ export const Privacy = () => {
6
+ const { exit } = useApp();
7
+ const [settings, setSettings] = useState(null);
8
+ const [loading, setLoading] = useState(true);
9
+ const [error, setError] = useState(null);
10
+ useInput((input, key) => {
11
+ if (key.escape) {
12
+ exit();
13
+ }
14
+ });
15
+ useEffect(() => {
16
+ const fetchSettings = async () => {
17
+ try {
18
+ const { data } = await api.get('/settings');
19
+ setSettings(data.privacy);
20
+ }
21
+ catch (err) {
22
+ setError(err.response?.data?.message || 'Failed to fetch settings');
23
+ }
24
+ finally {
25
+ setLoading(false);
26
+ }
27
+ };
28
+ fetchSettings();
29
+ }, []);
30
+ if (loading)
31
+ return _jsx(Text, { children: "Loading privacy settings..." });
32
+ if (error)
33
+ return _jsxs(Text, { color: "red", children: ["Error: ", error] });
34
+ if (!settings)
35
+ return _jsx(Text, { children: "No settings found" });
36
+ return (_jsxs(Box, { borderStyle: "round", borderColor: "yellow", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, underline: true, color: "yellow", children: "\uD83D\uDD12 Privacy Settings" }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { children: ["Profile Visibility: ", _jsx(Text, { bold: true, color: "cyan", children: settings.profileVisibility })] }), _jsxs(Text, { children: ["Message Settings: ", _jsx(Text, { bold: true, color: "cyan", children: settings.messageSettings })] }), _jsxs(Text, { children: ["Show Online Status: ", _jsx(Text, { bold: true, color: "cyan", children: settings.showOnlineStatus ? 'Yes' : 'No' })] }), _jsxs(Text, { children: ["Allow Tagging: ", _jsx(Text, { bold: true, color: "cyan", children: settings.allowTagging ? 'Yes' : 'No' })] })] }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: "gray", children: "Use 'hackmate settings' to modify these settings" }), _jsx(Text, { color: "gray", children: "Press ESC to exit" })] })] }));
37
+ };
38
+ //# sourceMappingURL=Privacy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Privacy.js","sourceRoot":"","sources":["../../src/commands/Privacy.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAElD,OAAO,GAAG,MAAM,WAAW,CAAC;AAS5B,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAyB,IAAI,CAAC,CAAC;IACvE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExD,QAAQ,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACpB,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACb,IAAI,EAAE,CAAC;QACX,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,aA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I,QAAC,KAAK,EAAC,MAAM,YAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAQ,IAAO,EAC1G,MAAC,IAAI,kCAAgB,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,YAAE,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAQ,IAAO,IAC/F,EACN,MAAC,GAAG,IAAC,SAAS,EAAE,CAAC,aACb,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,iEAAwD,EACzE,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kCAAyB,IAC1C,IACJ,CACT,CAAC;AACV,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const Settings: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=Settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../src/commands/Settings.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,QAAQ,+CA8CpB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
3
+ import { Box, Text, useInput, useApp } from 'ink';
4
+ import api from '../api.js';
5
+ export const Settings = () => {
6
+ const { exit } = useApp();
7
+ const [preferences, setPreferences] = useState(null);
8
+ const [loading, setLoading] = useState(true);
9
+ const [error, setError] = useState(null);
10
+ useInput((input, key) => {
11
+ if (key.escape) {
12
+ exit();
13
+ }
14
+ });
15
+ useEffect(() => {
16
+ const fetchSettings = async () => {
17
+ try {
18
+ const { data } = await api.get('/settings');
19
+ setPreferences(data.preferences);
20
+ }
21
+ catch (err) {
22
+ setError(err.response?.data?.message || 'Failed to fetch preferences');
23
+ }
24
+ finally {
25
+ setLoading(false);
26
+ }
27
+ };
28
+ fetchSettings();
29
+ }, []);
30
+ if (loading)
31
+ return _jsx(Text, { children: "Loading preferences..." });
32
+ if (error)
33
+ return _jsxs(Text, { color: "red", children: ["Error: ", error] });
34
+ if (!preferences)
35
+ return _jsx(Text, { children: "No preferences found" });
36
+ return (_jsxs(Box, { borderStyle: "round", borderColor: "blue", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, underline: true, color: "blue", children: "\u2699\uFE0F Preferences" }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to exit" }) }), _jsx(Text, { bold: true, children: "Notifications:" }), _jsxs(Text, { children: [" Email: ", _jsx(Text, { color: preferences.notifications.email ? 'green' : 'red', children: preferences.notifications.email ? 'Enabled' : 'Disabled' })] }), _jsxs(Text, { children: [" Push: ", _jsx(Text, { color: preferences.notifications.push ? 'green' : 'red', children: preferences.notifications.push ? 'Enabled' : 'Disabled' })] }), _jsxs(Text, { children: [" In-App: ", _jsx(Text, { color: preferences.notifications.inApp ? 'green' : 'red', children: preferences.notifications.inApp ? 'Enabled' : 'Disabled' })] }), _jsxs(Text, { children: ["Language: ", _jsx(Text, { bold: true, color: "cyan", children: preferences.language })] }), _jsxs(Text, { children: ["Timezone: ", _jsx(Text, { bold: true, color: "cyan", children: preferences.timezone })] })] })] }));
37
+ };
38
+ //# sourceMappingURL=Settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../src/commands/Settings.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,GAAG,MAAM,WAAW,CAAC;AAY5B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IACzB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,C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AC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const Stats: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=Stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stats.d.ts","sourceRoot":"","sources":["../../src/commands/Stats.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,KAAK,+CA+CjB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
3
+ import { Box, Text, useInput, useApp } from 'ink';
4
+ import api from '../api.js';
5
+ export const Stats = () => {
6
+ const { exit } = useApp();
7
+ const [stats, setStats] = useState(null);
8
+ const [loading, setLoading] = useState(true);
9
+ const [error, setError] = useState(null);
10
+ useInput((input, key) => {
11
+ if (key.escape) {
12
+ exit();
13
+ }
14
+ });
15
+ useEffect(() => {
16
+ const fetchStats = async () => {
17
+ try {
18
+ const { data } = await api.get('/profile/stats');
19
+ setStats(data);
20
+ }
21
+ catch (err) {
22
+ setError(err.response?.data?.message || 'Failed to fetch stats');
23
+ }
24
+ finally {
25
+ setLoading(false);
26
+ }
27
+ };
28
+ fetchStats();
29
+ }, []);
30
+ if (loading)
31
+ return _jsx(Text, { children: "Loading stats..." });
32
+ if (error)
33
+ return _jsxs(Text, { color: "red", children: ["Error: ", error] });
34
+ if (!stats)
35
+ return _jsx(Text, { color: "yellow", children: "No stats available" });
36
+ return (_jsxs(Box, { borderStyle: "round", borderColor: "blue", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, underline: true, color: "cyan", children: "\uD83D\uDCCA Your Stats" }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { children: ["\uD83D\uDD25 Streak: ", _jsxs(Text, { bold: true, color: "yellow", children: [stats.streak, " days"] })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to exit" }) }), _jsxs(Text, { children: ["\uD83D\uDCAC Messages Sent: ", _jsx(Text, { bold: true, color: "green", children: stats.messagesCount })] }), _jsxs(Text, { children: ["\uD83D\uDC41\uFE0F Profile Views: ", _jsx(Text, { bold: true, color: "blue", children: stats.profileViews })] }), _jsxs(Text, { children: ["\uD83E\uDD1D Connections: ", _jsx(Text, { bold: true, color: "magenta", children: stats.connectionsCount })] }), _jsxs(Text, { children: ["\uD83D\uDE80 Projects: ", _jsx(Text, { bold: true, color: "cyan", children: stats.projectsCount })] }), _jsxs(Text, { children: ["\uD83D\uDC65 Groups: ", _jsx(Text, { bold: true, color: "yellow", children: stats.groupsCount })] }), _jsxs(Text, { children: ["\u2B50 Reputation: ", _jsxs(Text, { bold: true, color: "green", children: [stats.reputation, "+"] })] })] })] }));
37
+ };
38
+ //# sourceMappingURL=Stats.js.map