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,132 @@
|
|
|
1
|
+
-- Protocolo de Blindaje Ejecutado. Dejá de dejar las ventanas abiertas si no querés que el caos entre sin permiso.
|
|
2
|
+
-- Migration: v7-security-hardening.sql
|
|
3
|
+
-- Purpose: Enable RLS on all tables and strictly enforce owner-only or system-read-only access.
|
|
4
|
+
|
|
5
|
+
BEGIN;
|
|
6
|
+
|
|
7
|
+
-- 1. Enable RLS on ALL tables
|
|
8
|
+
ALTER TABLE IF EXISTS public.folders ENABLE ROW LEVEL SECURITY;
|
|
9
|
+
ALTER TABLE IF EXISTS public.tags ENABLE ROW LEVEL SECURITY;
|
|
10
|
+
ALTER TABLE IF EXISTS public.ai_presets ENABLE ROW LEVEL SECURITY;
|
|
11
|
+
ALTER TABLE IF EXISTS public.audit_logs ENABLE ROW LEVEL SECURITY;
|
|
12
|
+
ALTER TABLE IF EXISTS public.conversations ENABLE ROW LEVEL SECURITY;
|
|
13
|
+
ALTER TABLE IF EXISTS public.messages ENABLE ROW LEVEL SECURITY;
|
|
14
|
+
ALTER TABLE IF EXISTS public.profiles ENABLE ROW LEVEL SECURITY;
|
|
15
|
+
ALTER TABLE IF EXISTS public.projects ENABLE ROW LEVEL SECURITY;
|
|
16
|
+
ALTER TABLE IF EXISTS public.project_tags ENABLE ROW LEVEL SECURITY;
|
|
17
|
+
|
|
18
|
+
-- 2. Clean up existing policies to avoid conflicts or permissive holes
|
|
19
|
+
-- (We use DO blocks to avoid errors if policies don't exist)
|
|
20
|
+
DO $$
|
|
21
|
+
DECLARE
|
|
22
|
+
tbl text;
|
|
23
|
+
BEGIN
|
|
24
|
+
FOR tbl IN (SELECT tablename FROM pg_tables WHERE schemaname = 'public') LOOP
|
|
25
|
+
-- This loop is a bit aggressive, technically we should target specific policies.
|
|
26
|
+
-- But since we want to "clean security", dropping all and recreating is cleaner IF we cover everything.
|
|
27
|
+
-- Usage of explicit names below acts as replacements if we use CREATE OR REPLACE logic or DROP IF EXISTS.
|
|
28
|
+
END LOOP;
|
|
29
|
+
END $$;
|
|
30
|
+
|
|
31
|
+
-- ---------------------------------------------------------
|
|
32
|
+
-- USER DATA TABLES (Owner Access Only)
|
|
33
|
+
-- ---------------------------------------------------------
|
|
34
|
+
|
|
35
|
+
-- FOLDERS
|
|
36
|
+
DROP POLICY IF EXISTS "Users can manage their own folders" ON public.folders;
|
|
37
|
+
CREATE POLICY "Users can manage their own folders" ON public.folders
|
|
38
|
+
FOR ALL
|
|
39
|
+
TO authenticated
|
|
40
|
+
USING (auth.uid() = user_id)
|
|
41
|
+
WITH CHECK (auth.uid() = user_id);
|
|
42
|
+
|
|
43
|
+
-- CONVERSATIONS
|
|
44
|
+
DROP POLICY IF EXISTS "Users can manage their own conversations" ON public.conversations;
|
|
45
|
+
CREATE POLICY "Users can manage their own conversations" ON public.conversations
|
|
46
|
+
FOR ALL
|
|
47
|
+
TO authenticated
|
|
48
|
+
USING (auth.uid() = user_id)
|
|
49
|
+
WITH CHECK (auth.uid() = user_id);
|
|
50
|
+
|
|
51
|
+
-- MESSAGES
|
|
52
|
+
DROP POLICY IF EXISTS "Users can manage their own messages" ON public.messages;
|
|
53
|
+
CREATE POLICY "Users can manage their own messages" ON public.messages
|
|
54
|
+
FOR ALL
|
|
55
|
+
TO authenticated
|
|
56
|
+
USING (auth.uid() = user_id)
|
|
57
|
+
WITH CHECK (auth.uid() = user_id);
|
|
58
|
+
|
|
59
|
+
-- PROFILES
|
|
60
|
+
DROP POLICY IF EXISTS "Users can manage their own profile" ON public.profiles;
|
|
61
|
+
CREATE POLICY "Users can manage their own profile" ON public.profiles
|
|
62
|
+
FOR ALL
|
|
63
|
+
TO authenticated
|
|
64
|
+
USING (auth.uid() = id)
|
|
65
|
+
WITH CHECK (auth.uid() = id);
|
|
66
|
+
|
|
67
|
+
-- PROJECTS
|
|
68
|
+
DROP POLICY IF EXISTS "Users can manage their own projects" ON public.projects;
|
|
69
|
+
CREATE POLICY "Users can manage their own projects" ON public.projects
|
|
70
|
+
FOR ALL
|
|
71
|
+
TO authenticated
|
|
72
|
+
USING (auth.uid() = user_id)
|
|
73
|
+
WITH CHECK (auth.uid() = user_id);
|
|
74
|
+
|
|
75
|
+
-- ---------------------------------------------------------
|
|
76
|
+
-- RELATIONAL / MIXED TABLES
|
|
77
|
+
-- ---------------------------------------------------------
|
|
78
|
+
|
|
79
|
+
-- PROJECT_TAGS
|
|
80
|
+
-- Assuming it links projects and tags. Access controlled by Project ownership.
|
|
81
|
+
DROP POLICY IF EXISTS "Users can manage tags for their projects" ON public.project_tags;
|
|
82
|
+
CREATE POLICY "Users can manage tags for their projects" ON public.project_tags
|
|
83
|
+
FOR ALL
|
|
84
|
+
TO authenticated
|
|
85
|
+
USING (
|
|
86
|
+
EXISTS (
|
|
87
|
+
SELECT 1 FROM public.projects
|
|
88
|
+
WHERE id = project_tags.project_id
|
|
89
|
+
AND user_id = auth.uid()
|
|
90
|
+
)
|
|
91
|
+
)
|
|
92
|
+
WITH CHECK (
|
|
93
|
+
EXISTS (
|
|
94
|
+
SELECT 1 FROM public.projects
|
|
95
|
+
WHERE id = project_tags.project_id
|
|
96
|
+
AND user_id = auth.uid()
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
-- ---------------------------------------------------------
|
|
101
|
+
-- SYSTEM / READ-ONLY TABLES
|
|
102
|
+
-- ---------------------------------------------------------
|
|
103
|
+
|
|
104
|
+
-- AI_PRESETS (Global Config - Read Only for Users)
|
|
105
|
+
DROP POLICY IF EXISTS "Authenticated users can read presets" ON public.ai_presets;
|
|
106
|
+
CREATE POLICY "Authenticated users can read presets" ON public.ai_presets
|
|
107
|
+
FOR SELECT
|
|
108
|
+
TO authenticated
|
|
109
|
+
USING (true);
|
|
110
|
+
|
|
111
|
+
-- TAGS (Global Tags - Read Only for Users)
|
|
112
|
+
DROP POLICY IF EXISTS "Authenticated users can read global tags" ON public.tags;
|
|
113
|
+
CREATE POLICY "Authenticated users can read global tags" ON public.tags
|
|
114
|
+
FOR SELECT
|
|
115
|
+
TO authenticated
|
|
116
|
+
USING (true);
|
|
117
|
+
|
|
118
|
+
-- AUDIT_LOGS (System Logs - Read Only for Users, Insert for Service Role)
|
|
119
|
+
-- Re-apply to ensure no loopholes
|
|
120
|
+
DROP POLICY IF EXISTS "Enable insert for service role only" ON public.audit_logs;
|
|
121
|
+
CREATE POLICY "Enable insert for service role only" ON public.audit_logs
|
|
122
|
+
FOR INSERT
|
|
123
|
+
TO service_role
|
|
124
|
+
WITH CHECK (true);
|
|
125
|
+
|
|
126
|
+
DROP POLICY IF EXISTS "Enable select for authenticated users" ON public.audit_logs;
|
|
127
|
+
CREATE POLICY "Enable select for authenticated users" ON public.audit_logs
|
|
128
|
+
FOR SELECT
|
|
129
|
+
TO authenticated
|
|
130
|
+
USING (true);
|
|
131
|
+
|
|
132
|
+
COMMIT;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
-- [SECURITY_HARDENING]: El búnker no tiene puertas para extraños. Solo los autorizados dejan huella.
|
|
2
|
+
|
|
3
|
+
-- -----------------------------------------------------------------------------
|
|
4
|
+
-- 1. Tablas Privadas: Blindaje Total (Solo Authenticated)
|
|
5
|
+
-- -----------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
-- Habilitar RLS en todas las tablas sensibles
|
|
8
|
+
ALTER TABLE IF EXISTS conversations ENABLE ROW LEVEL SECURITY;
|
|
9
|
+
ALTER TABLE IF EXISTS messages ENABLE ROW LEVEL SECURITY;
|
|
10
|
+
ALTER TABLE IF EXISTS profiles ENABLE ROW LEVEL SECURITY;
|
|
11
|
+
ALTER TABLE IF EXISTS folders ENABLE ROW LEVEL SECURITY;
|
|
12
|
+
ALTER TABLE IF EXISTS projects ENABLE ROW LEVEL SECURITY;
|
|
13
|
+
ALTER TABLE IF EXISTS runs ENABLE ROW LEVEL SECURITY;
|
|
14
|
+
ALTER TABLE IF EXISTS user_usage ENABLE ROW LEVEL SECURITY;
|
|
15
|
+
ALTER TABLE IF EXISTS workspace_members ENABLE ROW LEVEL SECURITY;
|
|
16
|
+
|
|
17
|
+
-- Revocar TODOS los privilegios del rol 'anon' y 'public' para asegurar que no puedan ni leer
|
|
18
|
+
-- (RLS es una segunda capa, pero esto cierra la puerta a nivel privilegios)
|
|
19
|
+
REVOKE ALL ON conversations FROM anon, public;
|
|
20
|
+
REVOKE ALL ON messages FROM anon, public;
|
|
21
|
+
REVOKE ALL ON profiles FROM anon, public;
|
|
22
|
+
REVOKE ALL ON folders FROM anon, public;
|
|
23
|
+
REVOKE ALL ON projects FROM anon, public;
|
|
24
|
+
REVOKE ALL ON runs FROM anon, public;
|
|
25
|
+
REVOKE ALL ON user_usage FROM anon, public;
|
|
26
|
+
REVOKE ALL ON workspace_members FROM anon, public;
|
|
27
|
+
|
|
28
|
+
-- Garantizar acceso completo solo a usuarios autenticados
|
|
29
|
+
GRANT ALL ON conversations TO authenticated;
|
|
30
|
+
GRANT ALL ON messages TO authenticated;
|
|
31
|
+
GRANT ALL ON profiles TO authenticated;
|
|
32
|
+
GRANT ALL ON folders TO authenticated;
|
|
33
|
+
GRANT ALL ON projects TO authenticated;
|
|
34
|
+
GRANT ALL ON runs TO authenticated;
|
|
35
|
+
GRANT ALL ON user_usage TO authenticated;
|
|
36
|
+
GRANT ALL ON workspace_members TO authenticated;
|
|
37
|
+
GRANT ALL ON workspace_members TO service_role;
|
|
38
|
+
|
|
39
|
+
-- Eliminar políticas antiguas (Limpieza de "Puertas Traseras")
|
|
40
|
+
-- Nota: Como no sabemos los nombres exactos, creamos políticas "Sledgehammer" que aseguran el acceso correcto.
|
|
41
|
+
-- PostgreSQL aplica políticas con OR. Si queda una política anon vieja, podría permitir acceso.
|
|
42
|
+
-- Lo ideal es borrar manualmente políticas nombradas "Enable read access for all users" etc.
|
|
43
|
+
-- Pero con los REVOKE de arriba, las políticas RLS para anon se vuelven irrelevantes (no tienen permiso de tabla).
|
|
44
|
+
|
|
45
|
+
-- Política Estándar para Authenticated (Ejemplo para conversations)
|
|
46
|
+
DROP POLICY IF EXISTS "Users can own conversations" ON conversations;
|
|
47
|
+
CREATE POLICY "Users can own conversations" ON conversations
|
|
48
|
+
FOR ALL
|
|
49
|
+
TO authenticated
|
|
50
|
+
USING (auth.uid() = user_id)
|
|
51
|
+
WITH CHECK (auth.uid() = user_id);
|
|
52
|
+
|
|
53
|
+
-- (Repetir patrón strict para otras tablas si se desea RLS granular,
|
|
54
|
+
-- pero el REVOKE anon es la clave del pedido del usuario).
|
|
55
|
+
|
|
56
|
+
-- -----------------------------------------------------------------------------
|
|
57
|
+
-- 2. Tablas de Sistema: Lectura Pública Controlada (System Read-Only)
|
|
58
|
+
-- -----------------------------------------------------------------------------
|
|
59
|
+
|
|
60
|
+
ALTER TABLE IF EXISTS ai_presets ENABLE ROW LEVEL SECURITY;
|
|
61
|
+
ALTER TABLE IF EXISTS tags ENABLE ROW LEVEL SECURITY;
|
|
62
|
+
ALTER TABLE IF EXISTS public_project_tags ENABLE ROW LEVEL SECURITY;
|
|
63
|
+
|
|
64
|
+
-- Permitir SELECT a public/anon/authenticated
|
|
65
|
+
GRANT SELECT ON ai_presets TO anon, public, authenticated;
|
|
66
|
+
GRANT SELECT ON tags TO anon, public, authenticated;
|
|
67
|
+
GRANT SELECT ON public_project_tags TO anon, public, authenticated;
|
|
68
|
+
|
|
69
|
+
-- PROHIBIR escritura a todos menos service_role (Backend)
|
|
70
|
+
REVOKE INSERT, UPDATE, DELETE ON ai_presets FROM anon, public, authenticated;
|
|
71
|
+
REVOKE INSERT, UPDATE, DELETE ON tags FROM anon, public, authenticated;
|
|
72
|
+
REVOKE INSERT, UPDATE, DELETE ON public_project_tags FROM anon, public, authenticated;
|
|
73
|
+
|
|
74
|
+
-- Políticas RLS de Lectura Pública
|
|
75
|
+
DROP POLICY IF EXISTS "Public Read Presets" ON ai_presets;
|
|
76
|
+
CREATE POLICY "Public Read Presets" ON ai_presets FOR SELECT USING (true);
|
|
77
|
+
|
|
78
|
+
DROP POLICY IF EXISTS "Public Read Tags" ON tags;
|
|
79
|
+
CREATE POLICY "Public Read Tags" ON tags FOR SELECT USING (true);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
async function testHumanPattern() {
|
|
2
|
+
try {
|
|
3
|
+
const res = await fetch("http://127.0.0.1:10000/api/chat", {
|
|
4
|
+
method: "POST",
|
|
5
|
+
headers: { "Content-Type": "application/json" },
|
|
6
|
+
body: JSON.stringify({
|
|
7
|
+
message: "Quiero hacer algo innovador con IA para mejorar la educación",
|
|
8
|
+
conversationId: "test-session-human",
|
|
9
|
+
mode: "normal",
|
|
10
|
+
topic: "general",
|
|
11
|
+
isMobile: false,
|
|
12
|
+
memory: {},
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
if (!res.ok) {
|
|
17
|
+
console.log("Status:", res.status);
|
|
18
|
+
const txt = await res.text();
|
|
19
|
+
console.log("Error Body:", txt);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const data = await res.json();
|
|
24
|
+
console.log("WADI RESPONSE:\n" + data.reply);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error("Fetch Error:", error);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
testHumanPattern();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
async function testHumanPatternVague() {
|
|
2
|
+
try {
|
|
3
|
+
const res = await fetch("http://127.0.0.1:10000/api/chat", {
|
|
4
|
+
method: "POST",
|
|
5
|
+
headers: { "Content-Type": "application/json" },
|
|
6
|
+
body: JSON.stringify({
|
|
7
|
+
message: "Quiero una idea innovadora", // < 80 chars, triggers VAGUE_AMBITION
|
|
8
|
+
conversationId: "test-session-human-vague",
|
|
9
|
+
mode: "normal",
|
|
10
|
+
topic: "general",
|
|
11
|
+
isMobile: false,
|
|
12
|
+
memory: {},
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
if (!res.ok) {
|
|
17
|
+
console.log("Status:", res.status);
|
|
18
|
+
const txt = await res.text();
|
|
19
|
+
console.log("Error Body:", txt);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const data = await res.json();
|
|
24
|
+
console.log("WADI RESPONSE:\n" + data.reply);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error("Fetch Error:", error);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
testHumanPatternVague();
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Starting WADI Brain Tests...
|
|
2
|
+
|
|
3
|
+
INPUT: "Estoy agotado de estar siempre para los demás y nunca para mí." (Topic: general)
|
|
4
|
+
RESPONSE (670ms):
|
|
5
|
+
Parece que estás cargado de responsabilidades al cuidar a los demás. ¿De quién se encargas exactamente? De familiares, amigos o tal vez colegas de trabajo? ¿Podrías decirme un poco más sobre esta sensación de estar agotado?
|
|
6
|
+
--------------------------------------------------
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
INPUT: "Analizá esto un poco más profundo: siento que no tengo lugar en ningún lado." (Topic: general)
|
|
10
|
+
RESPONSE (2730ms):
|
|
11
|
+
Entiendo que ese sentimiento de no tener lugar en ningún lado es un tema difícil de abordar. Decís que te siente como si no tuvieras una función, una voz o un espacio en la vida. ¿Podrías decirme un poco más sobre cuándo empezaste a sentir esto? Si es un sentimiento reciente o si ha ido creciendo con el tiempo.
|
|
12
|
+
|
|
13
|
+
También me gustaría saber, ¿hay algún momento en particular en el que te sientes así? ¿Es cuando estás con otras personas, o más bien cuando estás solo? ¿Hay alguna situación o lugar específico que te haga sentir que no tienes lugar?
|
|
14
|
+
|
|
15
|
+
Quiero entender mejor lo que estás viviendo para poder ayudarte a explorar más a fondo.
|
|
16
|
+
--------------------------------------------------
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
INPUT: "Siento culpa cuando digo que no, ¿qué ves ahí?" (Topic: general)
|
|
20
|
+
RESPONSE (9735ms):
|
|
21
|
+
Entiendo que estás buscando profundizar en cómo te sientes al decir "no". Parece que la culpa es un sentimiento que te surge al rechazar algo o al no cumplir con las expectativas de alguien, ¿correcto?
|
|
22
|
+
|
|
23
|
+
Decís que sientes culpa cuando digo que no, ¿te ocurre con personas específicas o con situaciones en general? ¿Te duele más cuando te preguntan por qué no puedes hacer algo, o cuando te sientes obligado a decir "no" a algo que realmente quieres?
|
|
24
|
+
--------------------------------------------------
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
INPUT: "Tengo este error en React: Cannot read property 'map' of undefined" (Topic: tech)
|
|
28
|
+
RESPONSE (9869ms):
|
|
29
|
+
¿Qué es lo que estás intentando hacer justo cuando te aparece este error? ¿Es algún array o lista que estás tratando de iterar?
|
|
30
|
+
|
|
31
|
+
En general, este error `Cannot read property 'map' of undefined` sucede cuando estás tratando de utilizar el método `map()` sobre una_variable que no es un array (o no está definida). Te recomiendo verificar qué valor tiene la variable justo antes de llamar a `map()` y asegurarte de que sea un array válido.
|
|
32
|
+
|
|
33
|
+
Podemos seguir una secuencia de preguntas para resolver esto paso a paso. Por ejemplo:
|
|
34
|
+
|
|
35
|
+
1. ¿Qué tienes en la variable que estás tratando de mapear?
|
|
36
|
+
2. ¿Podrías mostrarme el código relevante alrededor de la línea donde se produce el error?
|
|
37
|
+
3. ¿Has estado trabajando con algún dato fetched desde una API o almacenado en el estado del componente?
|
|
38
|
+
|
|
39
|
+
Con eso, podemos intentar ayudarte a localizar y resolver el problema.
|
|
40
|
+
--------------------------------------------------
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
INPUT: "Ayudame a ordenar mi semana de trabajo en pasos claros." (Topic: general)
|
|
44
|
+
RESPONSE (9795ms):
|
|
45
|
+
Una semana de trabajo organizada puede ser muy útil para mantener el ritmo y la productividad. Vamos a repasar juntos tus tareas y objetivos para crear un plan claro y realista.
|
|
46
|
+
|
|
47
|
+
Pero antes, ¿podrías decirme más sobre tus tareas y responsabilidades? ¿Cuáles son tus objetivos principales a corto plazo? ¿Tienes algún proyecto importante que debes completar?
|
|
48
|
+
|
|
49
|
+
Si no sabes desde dónde empezar, podemos comenzar con categorías generales. Por ejemplo, podemos dividir tus tareas en:
|
|
50
|
+
|
|
51
|
+
1. Proyectos importantes
|
|
52
|
+
2. Tareas regulares (como reportes, reuniones, etc.)
|
|
53
|
+
3. Tareas administrativas (como finanzas, gestión de proyectos, etc.)
|
|
54
|
+
4. Tareas creativas o innovadoras
|
|
55
|
+
|
|
56
|
+
¿Te parece bien empezar con alguna de estas categorías?
|
|
57
|
+
--------------------------------------------------
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
INPUT: "Quiero ideas de marketing para vender servicios de fotografía." (Topic: biz)
|
|
61
|
+
RESPONSE (9994ms):
|
|
62
|
+
Interesante. Quieres ideas de marketing para vender servicios de fotografía. ¿Quieres enfocarte en un tipo de servicio en particular, como sesiones de boda o sesión de retrato infantil? O quizás tienes un público objetivo en mente, como jóvenes o empresarios.
|
|
63
|
+
|
|
64
|
+
Antes de seguir adelante, ¿podrías darte una idea de qué es lo que te gustaría lograr con tus servicios de marketing de fotografía? Quiero decir, ¿qué es lo que deseas atraer al público y qué mensaje quieres transmitir?
|
|
65
|
+
|
|
66
|
+
¿Quieres algo de esto?
|
|
67
|
+
|
|
68
|
+
1. **Llegar a un público más amplio** y aumentar tus ventas.
|
|
69
|
+
2. **Crear una imagen de marca** profesional y establecer tu presencia en la industria.
|
|
70
|
+
3. **Vender tus servicios** específicos al público objetivo.
|
|
71
|
+
4. **Establecer una comunidad** de leales clientes y fidelizarlos.
|
|
72
|
+
|
|
73
|
+
¿Alguna de estas opciones te llama la atención, o tienes otra dirección en mente?
|
|
74
|
+
--------------------------------------------------
|
|
75
|
+
|
|
76
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
async function testVague() {
|
|
2
|
+
try {
|
|
3
|
+
const res = await fetch("http://127.0.0.1:10000/api/chat", {
|
|
4
|
+
method: "POST",
|
|
5
|
+
headers: { "Content-Type": "application/json" },
|
|
6
|
+
body: JSON.stringify({
|
|
7
|
+
message: "Quiero hacer algo innovador",
|
|
8
|
+
conversationId: "test-session-vague",
|
|
9
|
+
mode: "normal",
|
|
10
|
+
topic: "general",
|
|
11
|
+
isMobile: false,
|
|
12
|
+
memory: {},
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
if (!res.ok) {
|
|
17
|
+
console.log("Status:", res.status);
|
|
18
|
+
const txt = await res.text();
|
|
19
|
+
console.log("Error Body:", txt);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const data = await res.json();
|
|
24
|
+
console.log("WADI RESPONSE:\n" + data.reply);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error("Fetch Error:", error);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
testVague();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
async function testVagueBlocked() {
|
|
2
|
+
try {
|
|
3
|
+
const res = await fetch("http://127.0.0.1:10000/api/chat", {
|
|
4
|
+
method: "POST",
|
|
5
|
+
headers: { "Content-Type": "application/json" },
|
|
6
|
+
body: JSON.stringify({
|
|
7
|
+
message: "Quiero una idea", // Short and containing "quiero" + "idea"
|
|
8
|
+
conversationId: "test-session-blocked",
|
|
9
|
+
mode: "normal",
|
|
10
|
+
topic: "general",
|
|
11
|
+
isMobile: false,
|
|
12
|
+
memory: {},
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
if (!res.ok) {
|
|
17
|
+
console.log("Status:", res.status);
|
|
18
|
+
const txt = await res.text();
|
|
19
|
+
console.log("Error Body:", txt);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const data = await res.json();
|
|
24
|
+
console.log("WADI RESPONSE:\n" + data.reply);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error("Fetch Error:", error);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
testVagueBlocked();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// ESM syntax or just global fetch
|
|
2
|
+
async function testWadi() {
|
|
3
|
+
try {
|
|
4
|
+
const res = await fetch("http://127.0.0.1:10000/api/chat", {
|
|
5
|
+
method: "POST",
|
|
6
|
+
headers: { "Content-Type": "application/json" },
|
|
7
|
+
body: JSON.stringify({
|
|
8
|
+
message: "Quiero hacer algo innovador con IA para mejorar la educación",
|
|
9
|
+
conversationId: "test-session-anti",
|
|
10
|
+
mode: "normal",
|
|
11
|
+
topic: "general",
|
|
12
|
+
isMobile: false,
|
|
13
|
+
memory: {},
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
if (!res.ok) {
|
|
18
|
+
console.log("Status:", res.status);
|
|
19
|
+
const txt = await res.text();
|
|
20
|
+
console.log("Error Body:", txt);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const data = await res.json();
|
|
25
|
+
console.log("WADI RESPONSE:\n" + data.reply);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error("Fetch Error:", error);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
testWadi();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
VITE_API_URL=http://localhost:3000
|
|
2
|
+
VITE_SUPABASE_URL=https://smkbiguvgiscojwxgbae.supabase.co
|
|
3
|
+
VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InNta2JpZ3V2Z2lzY29qd3hnYmFlIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjM0MTE4MjMsImV4cCI6MjA3ODk4NzgyM30.n0Axs-saQDaAhGJidiRkI_w9EEOJDavJnmPXZ0UUvyM
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
+
|
|
14
|
+
## Expanding the ESLint configuration
|
|
15
|
+
|
|
16
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
export default defineConfig([
|
|
20
|
+
globalIgnores(["dist"]),
|
|
21
|
+
{
|
|
22
|
+
files: ["**/*.{ts,tsx}"],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
|
+
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
|
+
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
]);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// eslint.config.js
|
|
50
|
+
import reactX from "eslint-plugin-react-x";
|
|
51
|
+
import reactDom from "eslint-plugin-react-dom";
|
|
52
|
+
|
|
53
|
+
export default defineConfig([
|
|
54
|
+
globalIgnores(["dist"]),
|
|
55
|
+
{
|
|
56
|
+
files: ["**/*.{ts,tsx}"],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs["recommended-typescript"],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
]);
|
|
73
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
4
|
+
import reactRefresh from "eslint-plugin-react-refresh";
|
|
5
|
+
import tseslint from "typescript-eslint";
|
|
6
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
globalIgnores(["dist"]),
|
|
10
|
+
{
|
|
11
|
+
files: ["**/*.{ts,tsx}"],
|
|
12
|
+
extends: [
|
|
13
|
+
js.configs.recommended,
|
|
14
|
+
tseslint.configs.recommended,
|
|
15
|
+
reactHooks.configs.flat.recommended,
|
|
16
|
+
reactRefresh.configs.vite,
|
|
17
|
+
],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
ecmaVersion: 2020,
|
|
20
|
+
globals: globals.browser,
|
|
21
|
+
parserOptions: {
|
|
22
|
+
projectService: true,
|
|
23
|
+
tsconfigRootDir: import.meta.dirname,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
]);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/wadi.svg" />
|
|
6
|
+
<link rel="manifest" href="/manifest.webmanifest" />
|
|
7
|
+
<meta name="theme-color" content="#8B5CF6" />
|
|
8
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
9
|
+
<meta
|
|
10
|
+
name="apple-mobile-web-app-status-bar-style"
|
|
11
|
+
content="black-translucent"
|
|
12
|
+
/>
|
|
13
|
+
<meta name="apple-mobile-web-app-title" content="WADI" />
|
|
14
|
+
<link rel="apple-touch-icon" href="/icon-192.svg" />
|
|
15
|
+
<meta
|
|
16
|
+
name="viewport"
|
|
17
|
+
content="width=device-width, initial-scale=1, maximum-scale=1, interactive-widget=resizes-content"
|
|
18
|
+
/>
|
|
19
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
20
|
+
<title>WADI · Agentic Workspace</title>
|
|
21
|
+
</head>
|
|
22
|
+
<body>
|
|
23
|
+
<div id="root">
|
|
24
|
+
<div
|
|
25
|
+
style="
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
height: 100vh;
|
|
31
|
+
background-color: #050816;
|
|
32
|
+
color: #8b5cf6;
|
|
33
|
+
font-family: monospace;
|
|
34
|
+
text-align: center;
|
|
35
|
+
"
|
|
36
|
+
>
|
|
37
|
+
<div
|
|
38
|
+
style="font-size: 2rem; letter-spacing: 0.2rem; margin-bottom: 1rem"
|
|
39
|
+
>
|
|
40
|
+
WADI
|
|
41
|
+
</div>
|
|
42
|
+
<div style="font-size: 0.8rem; opacity: 0.7">
|
|
43
|
+
[DESPERTANDO_CENTINELA... (puede tardar 30s)]
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
48
|
+
</body>
|
|
49
|
+
</html>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "frontend",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"preview": "vite preview"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@hcaptcha/react-hcaptcha": "^1.17.1",
|
|
14
|
+
"@supabase/supabase-js": "^2.86.0",
|
|
15
|
+
"@types/node": "^24.10.1",
|
|
16
|
+
"@types/react": "^19.2.5",
|
|
17
|
+
"@types/react-dom": "^19.2.3",
|
|
18
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
19
|
+
"class-variance-authority": "^0.7.1",
|
|
20
|
+
"clsx": "^2.1.1",
|
|
21
|
+
"lucide-react": "^0.562.0",
|
|
22
|
+
"react": "^19.2.0",
|
|
23
|
+
"react-dom": "^19.2.0",
|
|
24
|
+
"react-router-dom": "^7.10.0",
|
|
25
|
+
"tailwind-merge": "^3.4.0",
|
|
26
|
+
"typescript": "~5.9.3",
|
|
27
|
+
"vite": "^7.2.4",
|
|
28
|
+
"zustand": "^5.0.9"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@eslint/js": "^9.39.1",
|
|
32
|
+
"autoprefixer": "^10.4.23",
|
|
33
|
+
"eslint": "^9.39.1",
|
|
34
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
35
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
36
|
+
"globals": "^16.5.0",
|
|
37
|
+
"postcss": "^8.5.6",
|
|
38
|
+
"tailwindcss": "^3.4.17",
|
|
39
|
+
"typescript-eslint": "^8.46.4"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.65376 12.3673H5.46026L5.31717 12.4976L0.500002 16.8866V2.19842L14.7138 12.3673H5.65376Z" fill="#101010" stroke="#91F6D7" stroke-width="1.5"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.5 11h-2V7h2v4zm1 0h2v-4h-2v4zm-1 2h2v2h-2v-2zm-3-2V7h-2v4h2zm0 2h-2v2h2v-2zm12-9H4.5v2h9V4zm0 13H5v2h8.5v-2zm2-2h-1v2h1v-2zm0-9h-1V4h1v2zm-1 11h-1v2h1v-2zm0-9h-1v2h1V7z" fill="#91F6D7" stroke="#101010" stroke-width="0.5"/></svg>
|