@elizaos/client 1.5.5-alpha.10
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/LICENSE +21 -0
- package/README.md +350 -0
- package/dist/assets/empty-module-CLMscLYw.js +1 -0
- package/dist/assets/main-BBZ_3lkn.css +5999 -0
- package/dist/assets/main-C5zNUkXH.js +7 -0
- package/dist/assets/main-Dz64ENQg.js +614 -0
- package/dist/assets/react-vendor-DM5m98rr.js +545 -0
- package/dist/assets/ui-vendor-BQCqNqg0.js +1 -0
- package/dist/elizaos-avatar.png +0 -0
- package/dist/elizaos-icon.png +0 -0
- package/dist/elizaos-logo-light.png +0 -0
- package/dist/elizaos.webp +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/images/agents/agent1.png +0 -0
- package/dist/images/agents/agent2.png +0 -0
- package/dist/images/agents/agent3.png +0 -0
- package/dist/images/agents/agent4.png +0 -0
- package/dist/images/agents/agent5.png +0 -0
- package/dist/index.html +14 -0
- package/index.html +24 -0
- package/package.json +159 -0
- package/postcss.config.js +3 -0
- package/public/elizaos-avatar.png +0 -0
- package/public/elizaos-icon.png +0 -0
- package/public/elizaos-logo-light.png +0 -0
- package/public/elizaos.webp +0 -0
- package/public/favicon.ico +0 -0
- package/public/images/agents/agent1.png +0 -0
- package/public/images/agents/agent2.png +0 -0
- package/public/images/agents/agent3.png +0 -0
- package/public/images/agents/agent4.png +0 -0
- package/public/images/agents/agent5.png +0 -0
- package/src/App.tsx +222 -0
- package/src/components/AgentDetailsPanel.tsx +147 -0
- package/src/components/ChatInputArea.tsx +196 -0
- package/src/components/ChatMessageListComponent.tsx +139 -0
- package/src/components/actionTool.tsx +186 -0
- package/src/components/add-agent-card.tsx +77 -0
- package/src/components/agent-action-viewer.tsx +816 -0
- package/src/components/agent-avatar-stack.tsx +121 -0
- package/src/components/agent-card.cy.tsx +259 -0
- package/src/components/agent-card.tsx +177 -0
- package/src/components/agent-creator.tsx +142 -0
- package/src/components/agent-log-viewer.tsx +645 -0
- package/src/components/agent-memory-edit-overlay.tsx +461 -0
- package/src/components/agent-memory-viewer.tsx +504 -0
- package/src/components/agent-settings.tsx +270 -0
- package/src/components/agent-sidebar.tsx +178 -0
- package/src/components/api-key-dialog.tsx +113 -0
- package/src/components/app-sidebar.tsx +685 -0
- package/src/components/array-input.tsx +116 -0
- package/src/components/audio-recorder.tsx +292 -0
- package/src/components/avatar-panel.tsx +141 -0
- package/src/components/character-form.tsx +1138 -0
- package/src/components/chat.tsx +1813 -0
- package/src/components/combobox.tsx +187 -0
- package/src/components/confirmation-dialog.tsx +59 -0
- package/src/components/connection-error-banner.tsx +101 -0
- package/src/components/connection-status.cy.tsx +73 -0
- package/src/components/connection-status.tsx +155 -0
- package/src/components/copy-button.tsx +35 -0
- package/src/components/delete-button.tsx +24 -0
- package/src/components/env-settings.tsx +261 -0
- package/src/components/group-card.tsx +160 -0
- package/src/components/group-panel.tsx +543 -0
- package/src/components/input-copy.tsx +21 -0
- package/src/components/logs-page.tsx +41 -0
- package/src/components/media-content.tsx +385 -0
- package/src/components/memory-graph.tsx +170 -0
- package/src/components/missing-secrets-dialog.tsx +72 -0
- package/src/components/onboarding-tour.tsx +247 -0
- package/src/components/page-title.tsx +8 -0
- package/src/components/plugins-panel.tsx +383 -0
- package/src/components/profile-card.tsx +66 -0
- package/src/components/profile-overlay.tsx +283 -0
- package/src/components/retry-button.tsx +28 -0
- package/src/components/secret-panel.tsx +1505 -0
- package/src/components/server-management.tsx +264 -0
- package/src/components/split-button.tsx +148 -0
- package/src/components/stop-agent-button.tsx +99 -0
- package/src/components/ui/alert-dialog.cy.tsx +333 -0
- package/src/components/ui/alert-dialog.tsx +115 -0
- package/src/components/ui/alert.tsx +49 -0
- package/src/components/ui/avatar.cy.tsx +180 -0
- package/src/components/ui/avatar.tsx +57 -0
- package/src/components/ui/badge.cy.tsx +146 -0
- package/src/components/ui/badge.tsx +43 -0
- package/src/components/ui/button.cy.tsx +177 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/card.cy.tsx +160 -0
- package/src/components/ui/card.tsx +73 -0
- package/src/components/ui/chat/animated-markdown.tsx +59 -0
- package/src/components/ui/chat/chat-bubble.tsx +178 -0
- package/src/components/ui/chat/chat-container.tsx +51 -0
- package/src/components/ui/chat/chat-input.cy.tsx +169 -0
- package/src/components/ui/chat/chat-input.tsx +47 -0
- package/src/components/ui/chat/chat-message-list.tsx +61 -0
- package/src/components/ui/chat/chat-tts-button.tsx +199 -0
- package/src/components/ui/chat/code-block.tsx +79 -0
- package/src/components/ui/chat/expandable-chat.tsx +131 -0
- package/src/components/ui/chat/hooks/useAutoScroll.ts +86 -0
- package/src/components/ui/chat/markdown.tsx +209 -0
- package/src/components/ui/chat/message-loading.tsx +48 -0
- package/src/components/ui/checkbox.cy.tsx +170 -0
- package/src/components/ui/checkbox.tsx +30 -0
- package/src/components/ui/collapsible.cy.tsx +283 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/command.cy.tsx +313 -0
- package/src/components/ui/command.tsx +143 -0
- package/src/components/ui/dialog.cy.tsx +279 -0
- package/src/components/ui/dialog.tsx +104 -0
- package/src/components/ui/dropdown-menu.cy.tsx +273 -0
- package/src/components/ui/dropdown-menu.tsx +281 -0
- package/src/components/ui/input.cy.tsx +82 -0
- package/src/components/ui/input.tsx +27 -0
- package/src/components/ui/label.cy.tsx +157 -0
- package/src/components/ui/label.tsx +19 -0
- package/src/components/ui/resizable.tsx +42 -0
- package/src/components/ui/scroll-area.cy.tsx +242 -0
- package/src/components/ui/scroll-area.tsx +46 -0
- package/src/components/ui/select.cy.tsx +277 -0
- package/src/components/ui/select.tsx +155 -0
- package/src/components/ui/separator.cy.tsx +145 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/sheet.cy.tsx +324 -0
- package/src/components/ui/sheet.tsx +119 -0
- package/src/components/ui/sidebar.tsx +734 -0
- package/src/components/ui/skeleton.cy.tsx +149 -0
- package/src/components/ui/skeleton.tsx +17 -0
- package/src/components/ui/split-button.cy.tsx +274 -0
- package/src/components/ui/split-button.tsx +112 -0
- package/src/components/ui/switch.tsx +28 -0
- package/src/components/ui/tabs.cy.tsx +271 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/textarea.cy.tsx +136 -0
- package/src/components/ui/textarea.tsx +26 -0
- package/src/components/ui/toast.cy.tsx +209 -0
- package/src/components/ui/toast.tsx +126 -0
- package/src/components/ui/toaster.tsx +29 -0
- package/src/components/ui/tooltip.cy.tsx +244 -0
- package/src/components/ui/tooltip.tsx +30 -0
- package/src/config/agent-templates.ts +349 -0
- package/src/config/voice-models.ts +181 -0
- package/src/constants.ts +23 -0
- package/src/context/AuthContext.tsx +44 -0
- package/src/context/ConnectionContext.tsx +194 -0
- package/src/entry.tsx +9 -0
- package/src/hooks/__tests__/use-agent-tab-state.test.ts +137 -0
- package/src/hooks/__tests__/use-agent-update.test.tsx +250 -0
- package/src/hooks/__tests__/use-character-convert.test.ts +102 -0
- package/src/hooks/__tests__/use-panel-width-state.test.ts +243 -0
- package/src/hooks/__tests__/use-sidebar-state.test.ts +117 -0
- package/src/hooks/use-agent-management.ts +130 -0
- package/src/hooks/use-agent-tab-state.ts +74 -0
- package/src/hooks/use-agent-update.ts +469 -0
- package/src/hooks/use-character-convert.ts +138 -0
- package/src/hooks/use-confirmation.ts +55 -0
- package/src/hooks/use-delete-agent.ts +123 -0
- package/src/hooks/use-dm-channels.ts +198 -0
- package/src/hooks/use-elevenlabs-voices.ts +83 -0
- package/src/hooks/use-file-upload.ts +224 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/hooks/use-onboarding.tsx +49 -0
- package/src/hooks/use-panel-width-state.ts +147 -0
- package/src/hooks/use-partial-update.ts +288 -0
- package/src/hooks/use-plugin-details.ts +462 -0
- package/src/hooks/use-plugins.ts +119 -0
- package/src/hooks/use-query-hooks.ts +1263 -0
- package/src/hooks/use-server-agents.ts +62 -0
- package/src/hooks/use-server-version.tsx +47 -0
- package/src/hooks/use-sidebar-state.ts +50 -0
- package/src/hooks/use-socket-chat.ts +264 -0
- package/src/hooks/use-toast.ts +260 -0
- package/src/hooks/use-version.tsx +64 -0
- package/src/index.css +146 -0
- package/src/lib/api-client-config.ts +53 -0
- package/src/lib/api-type-mappers.ts +196 -0
- package/src/lib/export-utils.ts +123 -0
- package/src/lib/logger.ts +19 -0
- package/src/lib/media-utils.ts +170 -0
- package/src/lib/pca.test.ts +17 -0
- package/src/lib/pca.ts +52 -0
- package/src/lib/socketio-manager.ts +664 -0
- package/src/lib/utils.ts +168 -0
- package/src/main.tsx +16 -0
- package/src/mocks/empty-module.ts +12 -0
- package/src/mocks/node-module.ts +57 -0
- package/src/polyfills.ts +37 -0
- package/src/routes/agent-detail.tsx +30 -0
- package/src/routes/agent-list.tsx +27 -0
- package/src/routes/agent-settings.tsx +48 -0
- package/src/routes/character-detail.tsx +52 -0
- package/src/routes/character-form.tsx +79 -0
- package/src/routes/character-list.tsx +38 -0
- package/src/routes/chat.tsx +128 -0
- package/src/routes/createAgent.tsx +13 -0
- package/src/routes/group-new.tsx +50 -0
- package/src/routes/group.tsx +29 -0
- package/src/routes/home.tsx +218 -0
- package/src/routes/not-found.tsx +71 -0
- package/src/test/setup.ts +154 -0
- package/src/types/crypto-browserify.d.ts +4 -0
- package/src/types/index.ts +13 -0
- package/src/types/rooms.ts +8 -0
- package/src/types.ts +84 -0
- package/src/vite-env.d.ts +40 -0
- package/tailwind.config.ts +90 -0
- package/tsconfig.json +10 -0
- package/vite.config.ts +102 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Update the IAttachment interface
|
|
2
|
+
|
|
3
|
+
import { Agent, UUID } from '@elizaos/core';
|
|
4
|
+
import type {
|
|
5
|
+
Agent as CoreAgent,
|
|
6
|
+
Character as CoreCharacter,
|
|
7
|
+
Room as CoreRoom,
|
|
8
|
+
AgentStatus as CoreAgentStatus,
|
|
9
|
+
ChannelType as CoreChannelType,
|
|
10
|
+
} from '@elizaos/core';
|
|
11
|
+
import type { ServerMetadata, ChannelMetadata, MessageMetadata } from '@elizaos/api-client';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Interface representing an attachment.
|
|
15
|
+
* @interface
|
|
16
|
+
* @property {string} url - The URL of the attachment.
|
|
17
|
+
* @property {string} [contentType] - The content type of the attachment, optional.
|
|
18
|
+
* @property {string} title - The title of the attachment.
|
|
19
|
+
*/
|
|
20
|
+
export interface IAttachment {
|
|
21
|
+
url: string;
|
|
22
|
+
contentType?: string; // Make contentType optional
|
|
23
|
+
title: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Agent type for client-side display, extending core Agent with a string status for UI flexibility if needed,
|
|
27
|
+
// but ideally aligns with CoreAgentStatus enum.
|
|
28
|
+
export interface AgentWithStatus extends Partial<CoreAgent> {
|
|
29
|
+
id: UUID;
|
|
30
|
+
name: string;
|
|
31
|
+
characterName?: string; // From core Agent, which extends Character
|
|
32
|
+
bio?: string | string[];
|
|
33
|
+
status: CoreAgentStatus; // Use the enum from @elizaos/core
|
|
34
|
+
settings?: CoreCharacter['settings']; // From core Character
|
|
35
|
+
// any other client-specific properties
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Interface for agent panels (public routes)
|
|
39
|
+
export interface AgentPanel {
|
|
40
|
+
name: string;
|
|
41
|
+
path: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Represents a server/guild in the central messaging system for the client
|
|
45
|
+
export interface MessageServer {
|
|
46
|
+
id: UUID; // Global serverId
|
|
47
|
+
name: string;
|
|
48
|
+
sourceType: string;
|
|
49
|
+
sourceId?: string;
|
|
50
|
+
metadata?: ServerMetadata;
|
|
51
|
+
createdAt: string; // ISO Date string from server, or Date object
|
|
52
|
+
updatedAt: string; // ISO Date string from server, or Date object
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Represents a channel within a MessageServer for the client
|
|
56
|
+
export interface MessageChannel {
|
|
57
|
+
id: UUID; // Global channelId
|
|
58
|
+
messageServerId: UUID;
|
|
59
|
+
name: string;
|
|
60
|
+
type: CoreChannelType; // Using the enum from @elizaos/core
|
|
61
|
+
sourceType?: string;
|
|
62
|
+
sourceId?: string;
|
|
63
|
+
topic?: string;
|
|
64
|
+
metadata?: ChannelMetadata;
|
|
65
|
+
createdAt: string; // ISO Date string from server, or Date object
|
|
66
|
+
updatedAt: string; // ISO Date string from server, or Date object
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Represents a message from the central system for client display
|
|
70
|
+
// This should align with what apiClient.getChannelMessages returns for each message
|
|
71
|
+
export interface ServerMessage {
|
|
72
|
+
id: UUID;
|
|
73
|
+
channelId: UUID;
|
|
74
|
+
serverId?: UUID; // Optional: May be added during client-side processing or be in metadata
|
|
75
|
+
authorId: UUID;
|
|
76
|
+
authorDisplayName?: string; // Optional: May be in metadata or fetched separately
|
|
77
|
+
content: string;
|
|
78
|
+
createdAt: number; // Expecting timestamp MS for UI sorting/display
|
|
79
|
+
rawMessage?: unknown;
|
|
80
|
+
inReplyToRootMessageId?: UUID;
|
|
81
|
+
sourceType?: string;
|
|
82
|
+
sourceId?: string;
|
|
83
|
+
metadata?: MessageMetadata;
|
|
84
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
declare module '*.svg' {
|
|
4
|
+
import React = require('react');
|
|
5
|
+
export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
6
|
+
const src: string;
|
|
7
|
+
export default src;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare module '*.jpg' {
|
|
11
|
+
const content: string;
|
|
12
|
+
export default content;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare module '*.png' {
|
|
16
|
+
const content: string;
|
|
17
|
+
export default content;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare module '*.json' {
|
|
21
|
+
const content: string;
|
|
22
|
+
export default content;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface ImportMetaEnv {
|
|
26
|
+
readonly VITE_SERVER_PORT: string;
|
|
27
|
+
// Add other env variables as needed
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface ImportMeta {
|
|
31
|
+
readonly env: ImportMetaEnv;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Ensure global types
|
|
35
|
+
declare global {
|
|
36
|
+
interface Window {
|
|
37
|
+
global: typeof globalThis;
|
|
38
|
+
Buffer: typeof Buffer;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Config } from 'tailwindcss';
|
|
2
|
+
import tailwindAnimate from 'tailwindcss-animate';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
darkMode: ['class'],
|
|
6
|
+
content: ['src/**/*.{ts,tsx}', 'components/**/*.{ts,tsx}'],
|
|
7
|
+
theme: {
|
|
8
|
+
extend: {
|
|
9
|
+
fontFamily: {
|
|
10
|
+
sans: [
|
|
11
|
+
'Inter',
|
|
12
|
+
'ui-sans-serif',
|
|
13
|
+
'system-ui',
|
|
14
|
+
'sans-serif',
|
|
15
|
+
'Apple Color Emoji',
|
|
16
|
+
'Segoe UI Emoji',
|
|
17
|
+
'Segoe UI Symbol',
|
|
18
|
+
'Noto Color Emoji',
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
keyframes: {
|
|
22
|
+
'bounce-sm': {
|
|
23
|
+
'0%, 100%': { transform: 'translateY(0)' },
|
|
24
|
+
'50%': { transform: 'translateY(-4px)' },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
animation: {
|
|
28
|
+
'bounce-sm': 'bounce-sm 0.6s ease-in-out 2',
|
|
29
|
+
},
|
|
30
|
+
borderRadius: {
|
|
31
|
+
lg: 'var(--radius)',
|
|
32
|
+
md: 'calc(var(--radius) - 2px)',
|
|
33
|
+
sm: 'calc(var(--radius) - 4px)',
|
|
34
|
+
},
|
|
35
|
+
colors: {
|
|
36
|
+
background: 'hsl(var(--background))',
|
|
37
|
+
foreground: 'hsl(var(--foreground))',
|
|
38
|
+
card: {
|
|
39
|
+
DEFAULT: 'hsl(var(--card))',
|
|
40
|
+
foreground: 'hsl(var(--card-foreground))',
|
|
41
|
+
},
|
|
42
|
+
popover: {
|
|
43
|
+
DEFAULT: 'hsl(var(--popover))',
|
|
44
|
+
foreground: 'hsl(var(--popover-foreground))',
|
|
45
|
+
},
|
|
46
|
+
primary: {
|
|
47
|
+
DEFAULT: 'hsl(var(--primary))',
|
|
48
|
+
foreground: 'hsl(var(--primary-foreground))',
|
|
49
|
+
},
|
|
50
|
+
secondary: {
|
|
51
|
+
DEFAULT: 'hsl(var(--secondary))',
|
|
52
|
+
foreground: 'hsl(var(--secondary-foreground))',
|
|
53
|
+
},
|
|
54
|
+
muted: {
|
|
55
|
+
DEFAULT: 'hsl(var(--muted))',
|
|
56
|
+
foreground: 'hsl(var(--muted-foreground))',
|
|
57
|
+
},
|
|
58
|
+
accent: {
|
|
59
|
+
DEFAULT: 'hsl(var(--accent))',
|
|
60
|
+
foreground: 'hsl(var(--accent-foreground))',
|
|
61
|
+
},
|
|
62
|
+
destructive: {
|
|
63
|
+
DEFAULT: 'hsl(var(--destructive))',
|
|
64
|
+
foreground: 'hsl(var(--destructive-foreground))',
|
|
65
|
+
},
|
|
66
|
+
border: 'hsl(var(--border))',
|
|
67
|
+
input: 'hsl(var(--input))',
|
|
68
|
+
ring: 'hsl(var(--ring))',
|
|
69
|
+
chart: {
|
|
70
|
+
'1': 'hsl(var(--chart-1))',
|
|
71
|
+
'2': 'hsl(var(--chart-2))',
|
|
72
|
+
'3': 'hsl(var(--chart-3))',
|
|
73
|
+
'4': 'hsl(var(--chart-4))',
|
|
74
|
+
'5': 'hsl(var(--chart-5))',
|
|
75
|
+
},
|
|
76
|
+
sidebar: {
|
|
77
|
+
DEFAULT: 'hsl(var(--sidebar-background))',
|
|
78
|
+
foreground: 'hsl(var(--sidebar-foreground))',
|
|
79
|
+
primary: 'hsl(var(--sidebar-primary))',
|
|
80
|
+
'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
|
|
81
|
+
accent: 'hsl(var(--sidebar-accent))',
|
|
82
|
+
'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
|
|
83
|
+
border: 'hsl(var(--sidebar-border))',
|
|
84
|
+
ring: 'hsl(var(--sidebar-ring))',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
plugins: [tailwindAnimate],
|
|
90
|
+
} satisfies Config;
|
package/tsconfig.json
ADDED
package/vite.config.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { defineConfig, type PluginOption } from 'vite';
|
|
2
|
+
import react from '@vitejs/plugin-react-swc';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
6
|
+
|
|
7
|
+
// https://vite.dev/config/
|
|
8
|
+
export default defineConfig(({ mode, command }) => {
|
|
9
|
+
const isDev = mode === 'development';
|
|
10
|
+
const isBuild = command === 'build';
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
plugins: [tailwindcss() as unknown as PluginOption, react() as unknown as PluginOption],
|
|
14
|
+
server: {
|
|
15
|
+
port: 5173,
|
|
16
|
+
strictPort: true,
|
|
17
|
+
host: true,
|
|
18
|
+
// Reduce watcher pressure to avoid EMFILE on large workspaces
|
|
19
|
+
watch: {
|
|
20
|
+
ignored: [
|
|
21
|
+
'**/node_modules/**',
|
|
22
|
+
'**/.git/**',
|
|
23
|
+
'**/.turbo/**',
|
|
24
|
+
'**/dist/**',
|
|
25
|
+
'**/coverage/**',
|
|
26
|
+
'cypress/screenshots/**',
|
|
27
|
+
'cypress/videos/**',
|
|
28
|
+
],
|
|
29
|
+
usePolling: true,
|
|
30
|
+
interval: 150,
|
|
31
|
+
},
|
|
32
|
+
proxy: {
|
|
33
|
+
'/api': 'http://localhost:3000',
|
|
34
|
+
'/socket.io': {
|
|
35
|
+
target: 'http://localhost:3000',
|
|
36
|
+
ws: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
resolve: {
|
|
41
|
+
alias: {
|
|
42
|
+
'@': path.resolve(__dirname, './src'),
|
|
43
|
+
// In dev mode, use source. In build/production, let Node resolution handle it
|
|
44
|
+
...(isDev
|
|
45
|
+
? {
|
|
46
|
+
'@elizaos/core': path.resolve(__dirname, '../core/src/index.ts'),
|
|
47
|
+
}
|
|
48
|
+
: {}),
|
|
49
|
+
// Prevent node Sentry code from entering the browser bundle
|
|
50
|
+
'@sentry/node': path.resolve(__dirname, './src/mocks/empty-module.ts'),
|
|
51
|
+
'@sentry/node-core': path.resolve(__dirname, './src/mocks/empty-module.ts'),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
optimizeDeps: {
|
|
55
|
+
esbuildOptions: {
|
|
56
|
+
define: {
|
|
57
|
+
global: 'globalThis',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
entries: ['./src/entry.tsx'],
|
|
61
|
+
include: ['buffer', 'process', '@elizaos/core', '@elizaos/api-client'],
|
|
62
|
+
},
|
|
63
|
+
build: {
|
|
64
|
+
target: 'esnext',
|
|
65
|
+
sourcemap: false,
|
|
66
|
+
reportCompressedSize: false,
|
|
67
|
+
minify: 'esbuild',
|
|
68
|
+
chunkSizeWarningLimit: 2200, // Increase chunk size warning limit to accommodate large chunks
|
|
69
|
+
cssMinify: false, // Disable CSS minification to avoid :is() syntax errors in webkit scrollbar styles
|
|
70
|
+
rollupOptions: {
|
|
71
|
+
input: {
|
|
72
|
+
main: path.resolve(__dirname, 'index.html'),
|
|
73
|
+
},
|
|
74
|
+
output: {
|
|
75
|
+
manualChunks: (id) => {
|
|
76
|
+
if (id.includes('node_modules')) {
|
|
77
|
+
if (id.includes('react') || id.includes('react-dom') || id.includes('react-router')) {
|
|
78
|
+
return 'react-vendor';
|
|
79
|
+
}
|
|
80
|
+
if (id.includes('@radix-ui')) {
|
|
81
|
+
return 'ui-vendor';
|
|
82
|
+
}
|
|
83
|
+
if (id.includes('@elizaos')) {
|
|
84
|
+
return 'elizaos-vendor';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
commonjsOptions: {
|
|
91
|
+
transformMixedEsModules: true,
|
|
92
|
+
ignoreTryCatch: false,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
define: {
|
|
96
|
+
// Define globals for browser compatibility
|
|
97
|
+
'process.env': JSON.stringify({}),
|
|
98
|
+
'process.browser': true,
|
|
99
|
+
global: 'globalThis',
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
});
|