crewos 0.1.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 (64) hide show
  1. package/app/.env.example +1 -0
  2. package/app/index.html +50 -0
  3. package/app/package.json +25 -0
  4. package/app/public/favicon.svg +1 -0
  5. package/app/public/images/cursor-ide-guiiding.png +0 -0
  6. package/app/public/images/gpt.jpg +0 -0
  7. package/app/src/app.jsx +22 -0
  8. package/app/src/components/ConfirmModal.jsx +50 -0
  9. package/app/src/components/Icons.jsx +377 -0
  10. package/app/src/components/RedirectRoute.jsx +14 -0
  11. package/app/src/components/SplashScreen.jsx +15 -0
  12. package/app/src/hooks/useAuth.js +28 -0
  13. package/app/src/index.css +268 -0
  14. package/app/src/main.jsx +5 -0
  15. package/app/src/navigations/AuthRoutes.jsx +15 -0
  16. package/app/src/navigations/MainRoutes.jsx +15 -0
  17. package/app/src/navigations/OnboardingRoutes.jsx +15 -0
  18. package/app/src/navigations/index.jsx +37 -0
  19. package/app/src/pages/Home/index.jsx +2095 -0
  20. package/app/src/pages/Login/index.jsx +118 -0
  21. package/app/src/pages/Onboarding/index.jsx +550 -0
  22. package/app/src/services/api.js +46 -0
  23. package/app/src/services/auth.service.js +3 -0
  24. package/app/src/services/config.service.js +13 -0
  25. package/app/src/services/member.service.js +7 -0
  26. package/app/src/services/onboarding.service.js +17 -0
  27. package/app/src/services/role.service.js +6 -0
  28. package/app/src/services/task.service.js +22 -0
  29. package/app/src/stores/auth.store.js +7 -0
  30. package/app/src/utils/environments.js +5 -0
  31. package/app/vite.config.js +10 -0
  32. package/app/yarn.lock +1337 -0
  33. package/backend/package-lock.json +918 -0
  34. package/backend/package.json +18 -0
  35. package/backend/src/configs/db.config.js +40 -0
  36. package/backend/src/controllers/auth.controller.js +19 -0
  37. package/backend/src/controllers/config.controller.js +23 -0
  38. package/backend/src/controllers/member.controller.js +30 -0
  39. package/backend/src/controllers/models.controller.js +25 -0
  40. package/backend/src/controllers/onboarding.controller.js +49 -0
  41. package/backend/src/controllers/role.controller.js +17 -0
  42. package/backend/src/controllers/task.controller.js +63 -0
  43. package/backend/src/index.js +36 -0
  44. package/backend/src/middlewares/onboarding.guard.js +14 -0
  45. package/backend/src/routes/auth.route.js +8 -0
  46. package/backend/src/routes/config.route.js +11 -0
  47. package/backend/src/routes/index.js +22 -0
  48. package/backend/src/routes/member.route.js +11 -0
  49. package/backend/src/routes/models.route.js +8 -0
  50. package/backend/src/routes/onboarding.route.js +13 -0
  51. package/backend/src/routes/role.route.js +9 -0
  52. package/backend/src/routes/task.route.js +20 -0
  53. package/backend/src/services/auth.service.js +14 -0
  54. package/backend/src/services/config.service.js +176 -0
  55. package/backend/src/services/data/roles.json +474 -0
  56. package/backend/src/services/member.service.js +77 -0
  57. package/backend/src/services/onboarding.service.js +328 -0
  58. package/backend/src/services/role.service.js +23 -0
  59. package/backend/src/services/task.service.js +665 -0
  60. package/backend/src/utils/catcher.js +9 -0
  61. package/backend/src/utils/sanitize.js +13 -0
  62. package/backend/yarn.lock +513 -0
  63. package/bin/crewos.js +307 -0
  64. package/package.json +11 -0
@@ -0,0 +1,3 @@
1
+ import api from './api';
2
+
3
+ export const getMe = () => api.get('/api/v1/auth/me');
@@ -0,0 +1,13 @@
1
+ import api from './api';
2
+
3
+ export const getConfig = () => api.get('/api/v1/config');
4
+
5
+ export const updateConfig = (data) => api.put('/api/v1/config', data);
6
+
7
+ export const fetchModels = (baseURL, apiKey) =>
8
+ api.post('/api/v1/models', { baseURL, apiKey });
9
+
10
+ export const startReanalysis = () => api.post('/api/v1/config/analyze');
11
+
12
+ export const getReanalysisProgress = () =>
13
+ api.get('/api/v1/config/analyze/progress');
@@ -0,0 +1,7 @@
1
+ import api from './api';
2
+
3
+ export const getMembers = () => api.get('/api/v1/members');
4
+
5
+ export const updateMember = (id, data) => api.put(`/api/v1/members/${id}`, data);
6
+
7
+ export const removeMember = (id) => api.delete(`/api/v1/members/${id}`);
@@ -0,0 +1,17 @@
1
+ import api from './api';
2
+
3
+ export const getOnboardingStatus = () => api.get('/api/v1/onboarding/status');
4
+
5
+ export const validateCredentials = (baseURL, apiKey) =>
6
+ api.post('/api/v1/onboarding/validate', { baseURL, apiKey });
7
+
8
+ export const saveCredentials = (baseURL, apiKey) =>
9
+ api.post('/api/v1/onboarding/credentials', { baseURL, apiKey });
10
+
11
+ export const startAnalysis = () => api.post('/api/v1/onboarding/analyze');
12
+
13
+ export const getAnalysisProgress = () =>
14
+ api.get('/api/v1/onboarding/analyze/progress');
15
+
16
+ export const completeOnboarding = () =>
17
+ api.post('/api/v1/onboarding/complete');
@@ -0,0 +1,6 @@
1
+ import api from './api';
2
+
3
+ export const getRoles = () => api.get('/api/v1/roles');
4
+
5
+ export const pullRole = (roleId) =>
6
+ api.post(`/api/v1/roles/${roleId}/pull`);
@@ -0,0 +1,22 @@
1
+ import api from './api';
2
+
3
+ export const getTasks = (params) => api.get('/api/v1/tasks', { params });
4
+
5
+ export const createTask = (data) => api.post('/api/v1/tasks', data);
6
+
7
+ export const updateTask = (id, data) => api.put(`/api/v1/tasks/${id}`, data);
8
+
9
+ export const removeTask = (id) => api.delete(`/api/v1/tasks/${id}`);
10
+
11
+ export const startTask = (id) => api.post(`/api/v1/tasks/${id}/start`);
12
+
13
+ export const stopTask = () => api.post('/api/v1/tasks/stop');
14
+
15
+ export const getProgress = () => api.get('/api/v1/tasks/progress');
16
+
17
+ export const startAutoDo = (taskIds) =>
18
+ api.post('/api/v1/tasks/auto/start', { taskIds });
19
+
20
+ export const stopAutoDo = () => api.post('/api/v1/tasks/auto/stop');
21
+
22
+ export const getAutoStatus = () => api.get('/api/v1/tasks/auto/status');
@@ -0,0 +1,7 @@
1
+ import { signal } from '@preact/signals';
2
+
3
+ export const auth = signal({
4
+ user: null,
5
+ initialized: false,
6
+ onboardingCompleted: false,
7
+ });
@@ -0,0 +1,5 @@
1
+ const environments = {
2
+ BACKEND_URL: import.meta.env.VITE_BACKEND_URL,
3
+ };
4
+
5
+ export default environments;
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'vite';
2
+ import preact from '@preact/preset-vite';
3
+ import tailwindcss from '@tailwindcss/vite';
4
+
5
+ export default defineConfig({
6
+ plugins: [preact(), tailwindcss()],
7
+ build: {
8
+ outDir: process.env.OUTPUT_DIR,
9
+ },
10
+ });