The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.

Viewing files at commit 160755529234Commit detailsView latest

apps/dashboard/vite.config.ts 71 lines · 2.4 KB · typescript
1
import path from 'node:path';
2
import tailwindcss from '@tailwindcss/vite';
3
import { defineConfig, loadEnv } from 'vite';
4
import react from '@vitejs/plugin-react';
5
6
export default defineConfig(({ mode }) => {
7
  const env = loadEnv(mode, process.cwd(), '');
8
  return {
9
    root: 'apps/dashboard',
10
    plugins: [react(), tailwindcss()],
11
    resolve: {
12
      alias: {
13
        '@': path.resolve(process.cwd(), 'apps/dashboard/src'),
14
      },
15
    },
16
    define: {
17
      __AUTH0_DOMAIN__: JSON.stringify(
18
        process.env.NEXT_PUBLIC_AUTH0_DOMAIN ??
19
          process.env.AUTH0_DOMAIN ??
20
          env.NEXT_PUBLIC_AUTH0_DOMAIN ??
21
          env.AUTH0_DOMAIN ??
22
          'icfg-0ua6bab8d4omtfolx72mrhzo.us.auth0.com',
23
      ),
24
      __AUTH0_CLIENT_ID__: JSON.stringify(
25
        process.env.NEXT_PUBLIC_AUTH0_CLIENT_ID ??
26
          process.env.AUTH0_CLIENT_ID ??
27
          env.NEXT_PUBLIC_AUTH0_CLIENT_ID ??
28
          env.AUTH0_CLIENT_ID ??
29
          'vGxzZd4LiO7TqH4U61QblwH96YcimpcA',
30
      ),
31
      __AUTH0_AUDIENCE__: JSON.stringify(
32
        process.env.NEXT_PUBLIC_AUTH0_AUDIENCE ??
33
          process.env.AUTH0_AUDIENCE ??
34
          process.env.OPENCLASP_MCP_URL ??
35
          env.NEXT_PUBLIC_AUTH0_AUDIENCE ??
36
          env.AUTH0_AUDIENCE ??
37
          env.OPENCLASP_MCP_URL ??
38
          'https://openclasp.vercel.app/mcp',
39
      ),
40
      __OPENCLASP_PUBLIC_URL__: JSON.stringify(
41
        process.env.OPENCLASP_PUBLIC_URL ??
42
          env.OPENCLASP_PUBLIC_URL ??
43
          'https://openclasp.vercel.app',
44
      ),
45
      __PUBLIC_LOGIN_ENABLED__: JSON.stringify(
46
        (process.env.OPENCLASP_PUBLIC_LOGIN_ENABLED ??
47
          env.OPENCLASP_PUBLIC_LOGIN_ENABLED ??
48
          'false') === 'true',
49
      ),
50
    },
51
    server: {
52
      port: 5173,
53
      proxy: {
54
        '/v0.1': { target: 'http://127.0.0.1:3100', changeOrigin: true },
55
        '/agents': {
56
          target: 'http://127.0.0.1:3100',
57
          changeOrigin: true,
58
          bypass(request) {
59
            const path = request.url ?? '';
60
            if (request.headers.accept?.includes('text/html')) return '/index.html';
61
            if (path === '/agents' || path === '/agents/') return '/index.html';
62
            return undefined;
63
          },
64
        },
65
        '/health': { target: 'http://127.0.0.1:3100', changeOrigin: true },
66
        '/openapi.json': { target: 'http://127.0.0.1:3100', changeOrigin: true },
67
      },
68
    },
69
    build: { outDir: 'dist', emptyOutDir: true },
70
  };
71
});