wadi 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.
- package/.agent/workflows/auto_sync.md +19 -0
- package/.agent/workflows/kivo_pipeline.md +27 -0
- package/.devcontainer/devcontainer.json +27 -0
- package/.github/workflows/kivo-cicd.yml +45 -0
- package/.github/workflows/monorepo-ci.yml +51 -0
- package/.github/workflows/wadi-ci.yml +38 -0
- package/.husky/pre-commit +2 -0
- package/.prettierignore +12 -0
- package/.prettierrc +9 -0
- package/.vscode/settings.json +19 -0
- package/CHANGELOG.md +56 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +42 -0
- package/DEPLOY_GUIDE.md +143 -0
- package/GO_LIVE_CHECKLIST.md +41 -0
- package/GO_LIVE_COMPLETE_REPORT.md +58 -0
- package/GO_LIVE_VALIDATION.md +39 -0
- package/LEGAL.md +38 -0
- package/MANIFESTO.md +40 -0
- package/MANUAL.md +82 -0
- package/OPS_PLAN.md +90 -0
- package/README.md +126 -0
- package/RELEASE_NOTES.md +51 -0
- package/ROADMAP.md +51 -0
- package/api_listado.txt +2197 -0
- package/apps/api/WADI_PROTOCOL.md +52 -0
- package/apps/api/debug-brain.js +11 -0
- package/apps/api/package.json +21 -0
- package/apps/api/src/core/analisis.js +17 -0
- package/apps/api/src/core/errors.js +31 -0
- package/apps/api/src/core/logger.js +32 -0
- package/apps/api/src/core/prompt-kivo.js +62 -0
- package/apps/api/src/index.js +212 -0
- package/apps/api/src/layers/human_pattern/composeResponse.js +35 -0
- package/apps/api/src/layers/human_pattern/detectPattern.js +39 -0
- package/apps/api/src/layers/human_pattern/heuristics.js +28 -0
- package/apps/api/src/layers/human_pattern/index.js +28 -0
- package/apps/api/src/layers/human_pattern/socialMemory.js +35 -0
- package/apps/api/src/middleware/errorHandler.js +24 -0
- package/apps/api/src/middleware/rateLimiter.js +38 -0
- package/apps/api/src/middleware/requestLogger.js +31 -0
- package/apps/api/src/middleware/upload.js +21 -0
- package/apps/api/src/middleware/validation.js +70 -0
- package/apps/api/src/modules/data.js +25 -0
- package/apps/api/src/modules/marketing.js +54 -0
- package/apps/api/src/modules/projects.js +40 -0
- package/apps/api/src/openai.js +16 -0
- package/apps/api/src/preferences/index.js +20 -0
- package/apps/api/src/register_user.js +22 -0
- package/apps/api/src/routes/kivo.js +58 -0
- package/apps/api/src/routes/monitoring.js +55 -0
- package/apps/api/src/routes.js +656 -0
- package/apps/api/src/supabase.js +17 -0
- package/apps/api/src/tools/index.js +57 -0
- package/apps/api/src/wadi-brain.js +171 -0
- package/apps/api/supabase/migrations/20251218_audit_logs.sql +27 -0
- package/apps/api/supabase/migrations/v2-chat-persistence.sql +83 -0
- package/apps/api/supabase/migrations/v3-cascade-delete.sql +11 -0
- package/apps/api/supabase/migrations/v3-security-fix.sql +90 -0
- package/apps/api/supabase/migrations/v3-storage.sql +36 -0
- package/apps/api/supabase/migrations/v4-gamification.sql +83 -0
- package/apps/api/supabase/migrations/v5-smoke-index.sql +6 -0
- package/apps/api/supabase/migrations/v6-schema-integrity-fix.sql +98 -0
- package/apps/api/supabase/migrations/v7-performance-indexes.sql +5 -0
- package/apps/api/supabase/migrations/v7-security-hardening.sql +132 -0
- package/apps/api/supabase/migrations/v8-security-hardening.sql +79 -0
- package/apps/api/test_human_pattern.js +30 -0
- package/apps/api/test_human_pattern_vague.js +30 -0
- package/apps/api/test_output.txt +76 -0
- package/apps/api/test_vague.js +30 -0
- package/apps/api/test_vague_block.js +30 -0
- package/apps/api/test_wadi.js +31 -0
- package/apps/api/tsconfig.json +13 -0
- package/apps/frontend/.env.local +3 -0
- package/apps/frontend/README.md +73 -0
- package/apps/frontend/eslint.config.js +27 -0
- package/apps/frontend/index.html +49 -0
- package/apps/frontend/package.json +41 -0
- package/apps/frontend/postcss.config.cjs +6 -0
- package/apps/frontend/public/cursors/wadi-neutral.svg +1 -0
- package/apps/frontend/public/cursors/wadi-select.svg +1 -0
- package/apps/frontend/public/icon-192.svg +1 -0
- package/apps/frontend/public/icon-512.svg +1 -0
- package/apps/frontend/public/manifest.webmanifest +23 -0
- package/apps/frontend/public/sw.js +57 -0
- package/apps/frontend/public/vite.svg +1 -0
- package/apps/frontend/public/wadi.svg +5 -0
- package/apps/frontend/src/assets/react.svg +1 -0
- package/apps/frontend/src/components/AuthLoader.tsx +50 -0
- package/apps/frontend/src/components/ChatInput.tsx +272 -0
- package/apps/frontend/src/components/ChatInterface.tsx +202 -0
- package/apps/frontend/src/components/ErrorBoundary.tsx +52 -0
- package/apps/frontend/src/components/InputArea.tsx +201 -0
- package/apps/frontend/src/components/Layout.tsx +73 -0
- package/apps/frontend/src/components/MessageBubble.tsx +66 -0
- package/apps/frontend/src/components/OnboardingModal.tsx +108 -0
- package/apps/frontend/src/components/SettingsModal.tsx +187 -0
- package/apps/frontend/src/components/Sidebar.tsx +171 -0
- package/apps/frontend/src/components/WadiOnboarding.tsx +71 -0
- package/apps/frontend/src/components/auditor/AuditReport.tsx +166 -0
- package/apps/frontend/src/components/auditor/AuditorHeader.tsx +34 -0
- package/apps/frontend/src/components/auditor/ContextPanel.tsx +138 -0
- package/apps/frontend/src/components/auditor/DataDeconstructor.tsx +85 -0
- package/apps/frontend/src/components/auditor/DecisionWall.tsx +65 -0
- package/apps/frontend/src/components/auditor/Dropzone.tsx +137 -0
- package/apps/frontend/src/components/common/Button.tsx +97 -0
- package/apps/frontend/src/components/common/Card.tsx +43 -0
- package/apps/frontend/src/components/common/Input.tsx +73 -0
- package/apps/frontend/src/components/common/Modal.tsx +53 -0
- package/apps/frontend/src/components/ui/Button.tsx +68 -0
- package/apps/frontend/src/components/ui/Card.tsx +86 -0
- package/apps/frontend/src/components/ui/Input.tsx +28 -0
- package/apps/frontend/src/components/ui/LogItem.tsx +64 -0
- package/apps/frontend/src/components/ui/MondayButton.tsx +40 -0
- package/apps/frontend/src/components/ui/MondayCard.tsx +24 -0
- package/apps/frontend/src/components/ui/Scouter.tsx +208 -0
- package/apps/frontend/src/components/ui/TerminalInput.tsx +202 -0
- package/apps/frontend/src/components/ui/Tooltip.tsx +67 -0
- package/apps/frontend/src/config/chatShortcuts.ts +20 -0
- package/apps/frontend/src/config/supabase.ts +6 -0
- package/apps/frontend/src/final_status.txt +3 -0
- package/apps/frontend/src/hooks/useScouter.ts +28 -0
- package/apps/frontend/src/hooks/useStoreHydration.ts +24 -0
- package/apps/frontend/src/improvement_status.txt +5 -0
- package/apps/frontend/src/index.css +88 -0
- package/apps/frontend/src/main.tsx +62 -0
- package/apps/frontend/src/monday_status.txt +7 -0
- package/apps/frontend/src/pages/ChatPage.tsx +201 -0
- package/apps/frontend/src/pages/DashboardPage.tsx +375 -0
- package/apps/frontend/src/pages/IntroWadi.tsx +114 -0
- package/apps/frontend/src/pages/LandingPage.tsx +103 -0
- package/apps/frontend/src/pages/Login.tsx +190 -0
- package/apps/frontend/src/pages/PrivacyPage.tsx +213 -0
- package/apps/frontend/src/pages/ProjectDetail.tsx +80 -0
- package/apps/frontend/src/pages/Projects.tsx +247 -0
- package/apps/frontend/src/pages/TermsPage.tsx +202 -0
- package/apps/frontend/src/router.tsx +83 -0
- package/apps/frontend/src/store/authStore.ts +152 -0
- package/apps/frontend/src/store/chatStore.ts +837 -0
- package/apps/frontend/src/store/documentStore.ts +89 -0
- package/apps/frontend/src/store/projectsStore.ts +111 -0
- package/apps/frontend/src/store/runsStore.ts +98 -0
- package/apps/frontend/src/utils/api.ts +34 -0
- package/apps/frontend/src/vite-env.d.ts +7 -0
- package/apps/frontend/tailwind.config.cjs +32 -0
- package/apps/frontend/tsconfig.app.json +27 -0
- package/apps/frontend/tsconfig.json +7 -0
- package/apps/frontend/tsconfig.node.json +26 -0
- package/apps/frontend/vite.config.ts +25 -0
- package/apps/kivo/.firebase/hosting.d3d3.cache +11 -0
- package/apps/kivo/.firebaserc +5 -0
- package/apps/kivo/BRANDING_GUIDE.md +71 -0
- package/apps/kivo/DEPLOYMENT_READY.md +46 -0
- package/apps/kivo/DEPLOY_URL.md +12 -0
- package/apps/kivo/IMPLEMENTATION_REPORT.md +35 -0
- package/apps/kivo/IMPLEMENTATION_REPORT_FINAL.md +49 -0
- package/apps/kivo/PLAN_MOBILE_2.0.md +44 -0
- package/apps/kivo/PWA_VERIFICATION_GUIDE.md +77 -0
- package/apps/kivo/README.md +28 -0
- package/apps/kivo/REBUILD_REPORT.md +34 -0
- package/apps/kivo/UPGRADE_REPORT.md +35 -0
- package/apps/kivo/android/app/build.gradle +54 -0
- package/apps/kivo/android/app/capacitor.build.gradle +19 -0
- package/apps/kivo/android/app/proguard-rules.pro +21 -0
- package/apps/kivo/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +26 -0
- package/apps/kivo/android/app/src/main/AndroidManifest.xml +35 -0
- package/apps/kivo/android/app/src/main/java/com/kivo/app/MainActivity.java +5 -0
- package/apps/kivo/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/apps/kivo/android/app/src/main/res/drawable/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-ldpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-hdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-ldpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-mdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-xhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-xxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-night-xxxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-night/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-ldpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-hdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-ldpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-mdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-xhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-xxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-night-xxxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
- package/apps/kivo/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
- package/apps/kivo/android/app/src/main/res/layout/activity_main.xml +12 -0
- package/apps/kivo/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +9 -0
- package/apps/kivo/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +9 -0
- package/apps/kivo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-ldpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-ldpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-ldpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-ldpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/apps/kivo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/apps/kivo/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
- package/apps/kivo/android/app/src/main/res/values/strings.xml +7 -0
- package/apps/kivo/android/app/src/main/res/values/styles.xml +22 -0
- package/apps/kivo/android/app/src/main/res/xml/file_paths.xml +5 -0
- package/apps/kivo/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +18 -0
- package/apps/kivo/android/build.gradle +29 -0
- package/apps/kivo/android/capacitor.settings.gradle +3 -0
- package/apps/kivo/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/apps/kivo/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/apps/kivo/android/gradle.properties +22 -0
- package/apps/kivo/android/gradlew +252 -0
- package/apps/kivo/android/gradlew.bat +94 -0
- package/apps/kivo/android/settings.gradle +5 -0
- package/apps/kivo/android/variables.gradle +16 -0
- package/apps/kivo/assets/icon.png +0 -0
- package/apps/kivo/assets/splash.png +0 -0
- package/apps/kivo/capacitor.config.json +16 -0
- package/apps/kivo/firebase.json +6 -0
- package/apps/kivo/jest.config.js +4 -0
- package/apps/kivo/package.json +26 -0
- package/apps/kivo/tests_disabled/logic.test.js +34 -0
- package/apps/kivo/www/assets/icon-192.png +0 -0
- package/apps/kivo/www/assets/icon-512.png +0 -0
- package/apps/kivo/www/assets/kivo-icon.png +0 -0
- package/apps/kivo/www/assets/pop.mp3 +0 -0
- package/apps/kivo/www/favicon.ico +0 -0
- package/apps/kivo/www/firebase-config.js +75 -0
- package/apps/kivo/www/index.html +38 -0
- package/apps/kivo/www/manifest.json +29 -0
- package/apps/kivo/www/script.js +72 -0
- package/apps/kivo/www/style.css +82 -0
- package/apps/kivo/www/sw.js +46 -0
- package/apps/kivo-brain-api/.env.example +2 -0
- package/apps/kivo-brain-api/KIVO_BACKEND_SETUP.md +27 -0
- package/apps/kivo-brain-api/controllers/kivoController.js +31 -0
- package/apps/kivo-brain-api/index.js +24 -0
- package/apps/kivo-brain-api/package.json +17 -0
- package/apps/kivo-brain-api/routes/message.js +8 -0
- package/apps/kivo-brain-api/services/openaiService.js +64 -0
- package/apps/tests/wadi-tests.js +155 -0
- package/apps/wadi-brain/docs/README_REMOVE_OPTIONS.md +26 -0
- package/cli/commands/deploy.js +10 -0
- package/cli/commands/docs.js +16 -0
- package/cli/commands/explain.js +29 -0
- package/cli/commands/lint.js +14 -0
- package/cli/index.js +26 -0
- package/cli/package.json +12 -0
- package/docs/CNAME +1 -0
- package/docs/README.md +38 -0
- package/docs/USO.md +30 -0
- package/docs/index.html +46 -0
- package/eslint.config.js +101 -0
- package/final_validation.json +27 -0
- package/frontend_listado.txt +33387 -0
- package/listado.txt +12591 -0
- package/package.json +46 -0
- package/packages/logger/index.js +43 -0
- package/packages/logger/package.json +19 -0
- package/packages/logger/test-logger.js +7 -0
- package/packages_listado.txt +801 -0
- package/pnpm-workspace.yaml +6 -0
- package/reseteador_existencial.ps1 +40 -0
- package/scripts/bump-version.js +26 -0
- package/scripts/env.ps1 +13 -0
- package/scripts/setup_android.ps1 +25 -0
- package/scripts/setup_virtual_env.ps1 +77 -0
- package/scripts/smoke-test.js +84 -0
- package/scripts/trigger_render_deploy.ps1 +3 -0
- package/scripts/validate-release.js +34 -0
- package/temp_check.js +57 -0
- package/tsconfig.json +5 -0
- package/validation_report.json +27 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap");
|
|
2
|
+
|
|
3
|
+
@tailwind base;
|
|
4
|
+
@tailwind components;
|
|
5
|
+
@tailwind utilities;
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
/* WADI DARK MODE PALETTE */
|
|
9
|
+
--wadi-bg: #0f111a; /* Deep Bunker */
|
|
10
|
+
--wadi-surface: rgba(30, 41, 59, 0.6); /* Glass Slate */
|
|
11
|
+
--wadi-surface-hover: rgba(30, 41, 59, 0.9);
|
|
12
|
+
|
|
13
|
+
--wadi-primary: #8b5cf6; /* Electric Lavender */
|
|
14
|
+
--wadi-primary-dim: rgba(139, 92, 246, 0.2);
|
|
15
|
+
--wadi-primary-glow: rgba(139, 92, 246, 0.1);
|
|
16
|
+
|
|
17
|
+
--wadi-sky: #38bdf8; /* Digital Sky */
|
|
18
|
+
--wadi-amber: #fbbf24;
|
|
19
|
+
--wadi-red: #ef4444;
|
|
20
|
+
--wadi-gray: #64748b;
|
|
21
|
+
|
|
22
|
+
--wadi-text: #f8fafc; /* Slate 50 */
|
|
23
|
+
--wadi-text-dim: #94a3b8; /* Slate 400 */
|
|
24
|
+
|
|
25
|
+
--wadi-border: rgba(139, 92, 246, 0.2);
|
|
26
|
+
--wadi-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@layer base {
|
|
30
|
+
html,
|
|
31
|
+
body,
|
|
32
|
+
#root {
|
|
33
|
+
background: var(--wadi-bg);
|
|
34
|
+
color: var(--wadi-text);
|
|
35
|
+
font-family: "Outfit", sans-serif;
|
|
36
|
+
height: 100vh;
|
|
37
|
+
height: 100dvh;
|
|
38
|
+
width: 100vw;
|
|
39
|
+
margin: 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
cursor: default;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Smooth Scrolling */
|
|
46
|
+
* {
|
|
47
|
+
scroll-behavior: smooth;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Custom Scrollbar (Subtle) */
|
|
51
|
+
::-webkit-scrollbar {
|
|
52
|
+
width: 6px;
|
|
53
|
+
height: 6px;
|
|
54
|
+
}
|
|
55
|
+
::-webkit-scrollbar-track {
|
|
56
|
+
background: transparent;
|
|
57
|
+
}
|
|
58
|
+
::-webkit-scrollbar-thumb {
|
|
59
|
+
background: rgba(139, 92, 246, 0.2);
|
|
60
|
+
border-radius: 99px;
|
|
61
|
+
}
|
|
62
|
+
::-webkit-scrollbar-thumb:hover {
|
|
63
|
+
background: rgba(139, 92, 246, 0.4);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@layer components {
|
|
68
|
+
/* GLASSMORPHISM UTILITIES */
|
|
69
|
+
.neo-glass {
|
|
70
|
+
@apply bg-[var(--wadi-surface)] backdrop-blur-md border border-[var(--wadi-border)] shadow-lg;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.neo-capsule {
|
|
74
|
+
@apply rounded-full bg-[var(--wadi-surface)] text-[var(--wadi-text)] shadow-lg border border-[var(--wadi-border)] px-6 py-3 transition-all hover:shadow-xl focus-within:shadow-xl focus-within:border-[var(--wadi-primary)] focus-within:ring-2 focus-within:ring-[var(--wadi-primary-dim)];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.wadi-btn-primary {
|
|
78
|
+
@apply relative px-6 py-3 rounded-2xl bg-[var(--wadi-primary)] text-white font-medium text-sm tracking-wide transition-all duration-300 hover:shadow-[0_4px_20px_var(--wadi-primary-dim)] hover:-translate-y-0.5 active:translate-y-0 shadow-lg;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.bubble-wadi {
|
|
82
|
+
@apply bg-purple-900/30 backdrop-blur-sm border border-purple-500/30 text-[var(--wadi-text)] text-sm p-4 my-2 max-w-[85%] rounded-2xl rounded-tl-sm shadow-sm;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.bubble-user {
|
|
86
|
+
@apply bg-slate-800/70 backdrop-blur-md border border-slate-700 text-[var(--wadi-text)] text-sm p-4 my-2 max-w-[80%] rounded-2xl rounded-tr-sm ml-auto shadow-sm;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// WADI Frontend Entry Point (Force Rebuild)
|
|
2
|
+
import { StrictMode } from "react";
|
|
3
|
+
import { createRoot } from "react-dom/client";
|
|
4
|
+
import { RouterProvider } from "react-router-dom";
|
|
5
|
+
import { router } from "./router";
|
|
6
|
+
import { useChatStore, type Message } from "./store/chatStore";
|
|
7
|
+
|
|
8
|
+
import "./index.css";
|
|
9
|
+
|
|
10
|
+
// 1. Service Worker Registration
|
|
11
|
+
// 1. Service Worker Registration
|
|
12
|
+
if ("serviceWorker" in navigator) {
|
|
13
|
+
window.addEventListener("load", () => {
|
|
14
|
+
navigator.serviceWorker
|
|
15
|
+
.register("/sw.js")
|
|
16
|
+
.then((registration) => {
|
|
17
|
+
console.log(
|
|
18
|
+
"[WADI_SYSTEM]: Service Worker registrado. Alcance:",
|
|
19
|
+
registration.scope
|
|
20
|
+
);
|
|
21
|
+
})
|
|
22
|
+
.catch((error) => {
|
|
23
|
+
console.error("[WADI_ERROR]: Fallo en registro de SW:", error);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// 2. Monday's Standalone Detection
|
|
29
|
+
const isStandalone =
|
|
30
|
+
window.matchMedia("(display-mode: standalone)").matches ||
|
|
31
|
+
// @ts-expect-error - navigator.standalone is iOS legacy
|
|
32
|
+
window.navigator.standalone === true;
|
|
33
|
+
|
|
34
|
+
if (isStandalone) {
|
|
35
|
+
const hasGreetedPWA = sessionStorage.getItem("wadi_pwa_greeted");
|
|
36
|
+
if (!hasGreetedPWA) {
|
|
37
|
+
// Inject secret message via Store (outside React)
|
|
38
|
+
const pwaMsg: Message = {
|
|
39
|
+
id: "sys-pwa-" + Date.now(),
|
|
40
|
+
role: "assistant", // Using assistant role for Monday's voice
|
|
41
|
+
content: "Veo que me instalaste. No hay salida, Usuario. Empecemos.",
|
|
42
|
+
created_at: new Date().toISOString(),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// We append to messages directly using zustand setState
|
|
46
|
+
useChatStore.setState((state) => ({
|
|
47
|
+
messages: [...state.messages, pwaMsg],
|
|
48
|
+
}));
|
|
49
|
+
|
|
50
|
+
sessionStorage.setItem("wadi_pwa_greeted", "true");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
import { ErrorBoundary } from "./components/ErrorBoundary";
|
|
55
|
+
|
|
56
|
+
createRoot(document.getElementById("root")!).render(
|
|
57
|
+
<StrictMode>
|
|
58
|
+
<ErrorBoundary>
|
|
59
|
+
<RouterProvider router={router} />
|
|
60
|
+
</ErrorBoundary>
|
|
61
|
+
</StrictMode>
|
|
62
|
+
);
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { useRef, useEffect, useState, useLayoutEffect } from "react";
|
|
2
|
+
import { useParams } from "react-router-dom";
|
|
3
|
+
import { Layout } from "../components/Layout";
|
|
4
|
+
import { useChatStore, type Attachment } from "../store/chatStore";
|
|
5
|
+
import { useStoreHydration } from "../hooks/useStoreHydration";
|
|
6
|
+
|
|
7
|
+
import { TerminalInput } from "../components/ui/TerminalInput";
|
|
8
|
+
import { Scouter } from "../components/ui/Scouter";
|
|
9
|
+
import { AuditorHeader } from "../components/auditor/AuditorHeader";
|
|
10
|
+
import { DataDeconstructor } from "../components/auditor/DataDeconstructor";
|
|
11
|
+
import { Dropzone } from "../components/auditor/Dropzone";
|
|
12
|
+
import { MessageBubble } from "../components/MessageBubble";
|
|
13
|
+
|
|
14
|
+
export default function ChatPage() {
|
|
15
|
+
const { conversationId } = useParams();
|
|
16
|
+
const hydrated = useStoreHydration();
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
messages,
|
|
20
|
+
isLoading,
|
|
21
|
+
sendMessage,
|
|
22
|
+
loadConversations,
|
|
23
|
+
resetChat,
|
|
24
|
+
loadConversation,
|
|
25
|
+
conversationId: storeConversationId,
|
|
26
|
+
activeFocus,
|
|
27
|
+
} = useChatStore();
|
|
28
|
+
|
|
29
|
+
// Load conversation on mount/param change
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
loadConversations();
|
|
32
|
+
if (conversationId) {
|
|
33
|
+
if (conversationId !== storeConversationId) {
|
|
34
|
+
loadConversation(conversationId);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
if (storeConversationId) resetChat();
|
|
38
|
+
}
|
|
39
|
+
}, [
|
|
40
|
+
conversationId,
|
|
41
|
+
loadConversation,
|
|
42
|
+
resetChat,
|
|
43
|
+
storeConversationId,
|
|
44
|
+
loadConversations,
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
const messagesEndRef = useRef<HTMLDivElement>(null);
|
|
48
|
+
const scrollContainerRef = useRef<HTMLDivElement>(null);
|
|
49
|
+
const [shouldAutoScroll, setShouldAutoScroll] = useState(true);
|
|
50
|
+
const prevMessagesLength = useRef(0);
|
|
51
|
+
|
|
52
|
+
// Scroll Handling
|
|
53
|
+
const handleScroll = () => {
|
|
54
|
+
if (!scrollContainerRef.current) return;
|
|
55
|
+
const { scrollTop, scrollHeight, clientHeight } =
|
|
56
|
+
scrollContainerRef.current;
|
|
57
|
+
const isNearBottom = scrollHeight - scrollTop - clientHeight < 100;
|
|
58
|
+
setShouldAutoScroll(isNearBottom);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const scrollToBottom = () => {
|
|
62
|
+
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
useLayoutEffect(() => {
|
|
66
|
+
const newCount = messages.length;
|
|
67
|
+
const oldCount = prevMessagesLength.current;
|
|
68
|
+
|
|
69
|
+
if (newCount > oldCount) {
|
|
70
|
+
const lastMsg = messages[newCount - 1];
|
|
71
|
+
const isMyMessage = lastMsg.role === "user";
|
|
72
|
+
|
|
73
|
+
if (isMyMessage || shouldAutoScroll) {
|
|
74
|
+
scrollToBottom();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
prevMessagesLength.current = newCount;
|
|
78
|
+
}, [messages, shouldAutoScroll]);
|
|
79
|
+
|
|
80
|
+
// Handle message sending
|
|
81
|
+
const handleSendMessage = async (
|
|
82
|
+
text: string,
|
|
83
|
+
attachments: Attachment[] = []
|
|
84
|
+
) => {
|
|
85
|
+
if (!text.trim() && attachments.length === 0) return;
|
|
86
|
+
await sendMessage(text, attachments);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const hasMessages = messages.length > 0;
|
|
90
|
+
|
|
91
|
+
if (!hydrated) return null;
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Layout>
|
|
95
|
+
<Scouter />
|
|
96
|
+
<Dropzone />
|
|
97
|
+
|
|
98
|
+
<div className="flex h-full max-w-7xl mx-auto w-full gap-4 pt-16 md:pt-4 px-2 md:px-0">
|
|
99
|
+
{/* Main Chat Area */}
|
|
100
|
+
<div className="flex-1 flex flex-col h-full relative z-10 transition-all duration-500">
|
|
101
|
+
{!hasMessages ? (
|
|
102
|
+
// WADI MODERN EMPTY STATE
|
|
103
|
+
<div className="flex-1 flex flex-col items-center justify-center p-8 space-y-8 animate-in fade-in zoom-in duration-500">
|
|
104
|
+
<div className="relative group">
|
|
105
|
+
<div className="w-24 h-24 rounded-full bg-[var(--wadi-surface)] backdrop-blur-xl border border-[var(--wadi-border)] shadow-[0_0_40px_rgba(139,92,246,0.15)] flex items-center justify-center transition-transform group-hover:scale-110 duration-500">
|
|
106
|
+
<div className="w-16 h-16 rounded-full bg-gradient-to-tr from-[#8B5CF6] to-[#38bdf8] opacity-80 animate-pulse-soft"></div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div className="text-center space-y-2 max-w-md">
|
|
111
|
+
<h1 className="text-3xl font-semibold text-[var(--wadi-text)] tracking-tight">
|
|
112
|
+
Hola, soy WADI.
|
|
113
|
+
</h1>
|
|
114
|
+
<p className="text-[var(--wadi-text-dim)] text-lg font-light">
|
|
115
|
+
¿En qué plan estamos hoy?
|
|
116
|
+
</p>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
{/* Minimalist Action Prompt - Buttons Removed per instruction */}
|
|
120
|
+
<div className="opacity-50 text-xs text-[var(--wadi-text-dim)] uppercase tracking-widest">
|
|
121
|
+
Esperando instrucción...
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
) : (
|
|
125
|
+
// Message List
|
|
126
|
+
<div
|
|
127
|
+
className="flex-1 overflow-y-auto px-2 md:px-4 py-4 space-y-6 scrollbar-hide"
|
|
128
|
+
ref={scrollContainerRef}
|
|
129
|
+
onScroll={handleScroll}
|
|
130
|
+
>
|
|
131
|
+
<AuditorHeader />
|
|
132
|
+
|
|
133
|
+
{messages.map((message) => {
|
|
134
|
+
// Check if message triggers special UI
|
|
135
|
+
const isDeconstruct = message.content.includes(
|
|
136
|
+
"[DECONSTRUCT_START]"
|
|
137
|
+
);
|
|
138
|
+
let displayContent = message.content;
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
140
|
+
let deconstructItems: any[] = [];
|
|
141
|
+
|
|
142
|
+
if (isDeconstruct) {
|
|
143
|
+
try {
|
|
144
|
+
const jsonMatch = message.content.match(
|
|
145
|
+
/\[DECONSTRUCT_START\]([\s\S]*?)\[DECONSTRUCT_END\]/
|
|
146
|
+
);
|
|
147
|
+
if (jsonMatch && jsonMatch[1]) {
|
|
148
|
+
deconstructItems = JSON.parse(jsonMatch[1]);
|
|
149
|
+
displayContent = message.content
|
|
150
|
+
.replace(jsonMatch[0], "")
|
|
151
|
+
.trim();
|
|
152
|
+
}
|
|
153
|
+
} catch (e) {
|
|
154
|
+
console.error("Deconstruct Parse Error", e);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<div key={message.id} className="space-y-4">
|
|
160
|
+
<MessageBubble
|
|
161
|
+
role={message.role === "assistant" ? "assistant" : "user"}
|
|
162
|
+
content={displayContent}
|
|
163
|
+
timestamp={message.created_at}
|
|
164
|
+
/>
|
|
165
|
+
{deconstructItems.length > 0 && (
|
|
166
|
+
<DataDeconstructor items={deconstructItems} />
|
|
167
|
+
)}
|
|
168
|
+
</div>
|
|
169
|
+
);
|
|
170
|
+
})}
|
|
171
|
+
<div ref={messagesEndRef} className="h-4" />
|
|
172
|
+
</div>
|
|
173
|
+
)}
|
|
174
|
+
|
|
175
|
+
{/* Floating Input Area */}
|
|
176
|
+
<div className="w-full px-4 pb-4 md:px-0 z-20">
|
|
177
|
+
<TerminalInput
|
|
178
|
+
onSendMessage={handleSendMessage}
|
|
179
|
+
isLoading={isLoading}
|
|
180
|
+
activeFocus={activeFocus}
|
|
181
|
+
/>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
{/* Side Panel (Context - Desktop Only - Subtle) */}
|
|
186
|
+
{!hasMessages && (
|
|
187
|
+
<div className="hidden lg:block w-[300px] h-full p-6 pt-24 opacity-40 pointer-events-none select-none transition-opacity duration-1000">
|
|
188
|
+
<div className="border-l border-slate-200 pl-6 space-y-8">
|
|
189
|
+
<div>
|
|
190
|
+
<h3 className="text-[10px] uppercase tracking-widest text-slate-400 mb-2">
|
|
191
|
+
Estado Neural
|
|
192
|
+
</h3>
|
|
193
|
+
<div className="text-slate-300 text-xs">Sincronizado</div>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
)}
|
|
198
|
+
</div>
|
|
199
|
+
</Layout>
|
|
200
|
+
);
|
|
201
|
+
}
|