-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathindex.ts
More file actions
94 lines (83 loc) · 2.07 KB
/
Copy pathindex.ts
File metadata and controls
94 lines (83 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**
* Base API URL for server communication
*/
export const API_BASE_URL = window.AGENT_BASE_URL ?? 'http://localhost:3000';
/**
* Default API endpoints
*/
export const API_ENDPOINTS = {
SESSIONS: '/api/v1/sessions',
CREATE_SESSION: '/api/v1/sessions/create',
SESSION_DETAILS: '/api/v1/sessions/details',
SESSION_EVENTS: '/api/v1/sessions/events',
SESSION_STATUS: '/api/v1/sessions/status',
UPDATE_SESSION: '/api/v1/sessions/update',
DELETE_SESSION: '/api/v1/sessions/delete',
QUERY: '/api/v1/sessions/query',
QUERY_STREAM: '/api/v1/sessions/query/stream',
ABORT: '/api/v1/sessions/abort',
GENERATE_SUMMARY: '/api/v1/sessions/generate-summary',
HEALTH: '/api/v1/health',
// Share endpoints
SHARE_CONFIG: '/api/v1/share/config',
SESSIONS_SHARE: '/api/v1/sessions/share',
// System endpoints
VERSION: '/api/v1/version',
AGENT_OPTIONS: '/api/v1/agent/options',
// Workspace endpoints
WORKSPACE_SEARCH: '/api/v1/sessions/workspace/search',
WORKSPACE_VALIDATE: '/api/v1/sessions/workspace/validate',
};
/**
* WebSocket events
*/
export const SOCKET_EVENTS = {
CONNECT: 'connect',
DISCONNECT: 'disconnect',
ERROR: 'error',
RECONNECT_ATTEMPT: 'reconnect_attempt',
RECONNECT_FAILED: 'reconnect_failed',
JOIN_SESSION: 'join-session',
AGENT_EVENT: 'agent-event',
AGENT_STATUS: 'agent-status',
PING: 'ping',
SEND_QUERY: 'send-query',
ABORT_QUERY: 'abort-query',
};
/**
* Local storage keys
*/
export const STORAGE_KEYS = {
ACTIVE_SESSION: 'agent-tars-active-session',
THEME: 'agent-tars-theme',
};
/**
* Message roles
*/
export const MESSAGE_ROLES = {
USER: 'user',
ASSISTANT: 'assistant',
SYSTEM: 'system',
TOOL: 'tool',
} as const;
/**
* Connection settings
*/
export const CONNECTION_SETTINGS = {
HEARTBEAT_INTERVAL: 15000,
MAX_MISSED_HEARTBEATS: 2,
MAX_RECONNECT_ATTEMPTS: 5,
RECONNECTION_DELAY: 1000,
RECONNECTION_DELAY_MAX: 5000,
};
/**
* Agent configuration
*/
export {
getAgentTitle,
getWebUIConfig,
isContextualSelectorEnabled,
getLogoUrl,
getWorkspaceNavItems,
getGUIAgentConfig,
} from './shared';