apteva 0.2.7 → 0.2.9
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/dist/App.m4hg4bxq.js +218 -0
- package/dist/index.html +4 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/auth/index.ts +386 -0
- package/src/auth/middleware.ts +183 -0
- package/src/binary.ts +19 -1
- package/src/db.ts +688 -45
- package/src/integrations/composio.ts +437 -0
- package/src/integrations/index.ts +80 -0
- package/src/openapi.ts +1724 -0
- package/src/routes/api.ts +1476 -118
- package/src/routes/auth.ts +242 -0
- package/src/server.ts +121 -11
- package/src/web/App.tsx +64 -19
- package/src/web/components/agents/AgentCard.tsx +24 -22
- package/src/web/components/agents/AgentPanel.tsx +810 -45
- package/src/web/components/agents/AgentsView.tsx +81 -9
- package/src/web/components/agents/CreateAgentModal.tsx +28 -1
- package/src/web/components/api/ApiDocsPage.tsx +583 -0
- package/src/web/components/auth/CreateAccountStep.tsx +176 -0
- package/src/web/components/auth/LoginPage.tsx +91 -0
- package/src/web/components/auth/index.ts +2 -0
- package/src/web/components/common/Icons.tsx +56 -0
- package/src/web/components/common/Modal.tsx +184 -1
- package/src/web/components/dashboard/Dashboard.tsx +70 -22
- package/src/web/components/index.ts +3 -0
- package/src/web/components/layout/Header.tsx +135 -18
- package/src/web/components/layout/Sidebar.tsx +87 -43
- package/src/web/components/mcp/IntegrationsPanel.tsx +743 -0
- package/src/web/components/mcp/McpPage.tsx +451 -63
- package/src/web/components/onboarding/OnboardingWizard.tsx +64 -8
- package/src/web/components/settings/SettingsPage.tsx +340 -26
- package/src/web/components/tasks/TasksPage.tsx +22 -20
- package/src/web/components/telemetry/TelemetryPage.tsx +163 -61
- package/src/web/context/AuthContext.tsx +230 -0
- package/src/web/context/ProjectContext.tsx +182 -0
- package/src/web/context/index.ts +5 -0
- package/src/web/hooks/useAgents.ts +18 -6
- package/src/web/hooks/useOnboarding.ts +20 -4
- package/src/web/hooks/useProviders.ts +15 -5
- package/src/web/icon.png +0 -0
- package/src/web/index.html +1 -1
- package/src/web/styles.css +12 -0
- package/src/web/types.ts +10 -1
- package/dist/App.3kb50qa3.js +0 -213
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
2
|
import { AgentCard } from "./AgentCard";
|
|
3
3
|
import { AgentPanel } from "./AgentPanel";
|
|
4
4
|
import { LoadingSpinner } from "../common/LoadingSpinner";
|
|
5
|
+
import { useProjects } from "../../context";
|
|
5
6
|
import type { Agent, Provider } from "../../types";
|
|
6
7
|
|
|
7
8
|
interface AgentsViewProps {
|
|
@@ -14,6 +15,8 @@ interface AgentsViewProps {
|
|
|
14
15
|
onToggleAgent: (agent: Agent, e?: React.MouseEvent) => void;
|
|
15
16
|
onDeleteAgent: (id: string, e?: React.MouseEvent) => void;
|
|
16
17
|
onUpdateAgent: (id: string, updates: Partial<Agent>) => Promise<{ error?: string }>;
|
|
18
|
+
onNewAgent?: () => void;
|
|
19
|
+
canCreateAgent?: boolean;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
export function AgentsView({
|
|
@@ -26,25 +29,76 @@ export function AgentsView({
|
|
|
26
29
|
onToggleAgent,
|
|
27
30
|
onDeleteAgent,
|
|
28
31
|
onUpdateAgent,
|
|
32
|
+
onNewAgent,
|
|
33
|
+
canCreateAgent = true,
|
|
29
34
|
}: AgentsViewProps) {
|
|
35
|
+
const { currentProjectId, currentProject } = useProjects();
|
|
36
|
+
|
|
37
|
+
// Filter agents by current project
|
|
38
|
+
const filteredAgents = useMemo(() => {
|
|
39
|
+
if (currentProjectId === null) {
|
|
40
|
+
// "All Projects" - show all agents
|
|
41
|
+
return agents;
|
|
42
|
+
}
|
|
43
|
+
if (currentProjectId === "unassigned") {
|
|
44
|
+
// Show only agents without a project
|
|
45
|
+
return agents.filter(a => !a.projectId);
|
|
46
|
+
}
|
|
47
|
+
// Show only agents in the selected project
|
|
48
|
+
return agents.filter(a => a.projectId === currentProjectId);
|
|
49
|
+
}, [agents, currentProjectId]);
|
|
50
|
+
|
|
51
|
+
const headerTitle = currentProjectId === null
|
|
52
|
+
? "Agents"
|
|
53
|
+
: currentProjectId === "unassigned"
|
|
54
|
+
? "Unassigned Agents"
|
|
55
|
+
: currentProject?.name || "Agents";
|
|
56
|
+
|
|
30
57
|
return (
|
|
31
58
|
<div className="flex-1 flex overflow-hidden relative">
|
|
32
59
|
{/* Agents list */}
|
|
33
60
|
<div className="flex-1 overflow-auto p-6">
|
|
61
|
+
{/* Header with create button */}
|
|
62
|
+
<div className="flex items-center justify-between mb-6">
|
|
63
|
+
<div className="flex items-center gap-3">
|
|
64
|
+
{currentProject && (
|
|
65
|
+
<span
|
|
66
|
+
className="w-3 h-3 rounded-full"
|
|
67
|
+
style={{ backgroundColor: currentProject.color }}
|
|
68
|
+
/>
|
|
69
|
+
)}
|
|
70
|
+
<h1 className="text-xl font-semibold">{headerTitle}</h1>
|
|
71
|
+
{currentProjectId !== null && (
|
|
72
|
+
<span className="text-sm text-[#666]">
|
|
73
|
+
({filteredAgents.length} agent{filteredAgents.length !== 1 ? "s" : ""})
|
|
74
|
+
</span>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
{onNewAgent && (
|
|
78
|
+
<button
|
|
79
|
+
onClick={onNewAgent}
|
|
80
|
+
disabled={!canCreateAgent}
|
|
81
|
+
className="bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-2 rounded font-medium transition"
|
|
82
|
+
>
|
|
83
|
+
+ New Agent
|
|
84
|
+
</button>
|
|
85
|
+
)}
|
|
86
|
+
</div>
|
|
87
|
+
|
|
34
88
|
{loading ? (
|
|
35
89
|
<LoadingSpinner message="Loading agents..." />
|
|
36
|
-
) :
|
|
37
|
-
<EmptyState />
|
|
90
|
+
) : filteredAgents.length === 0 ? (
|
|
91
|
+
<EmptyState onNewAgent={onNewAgent} canCreateAgent={canCreateAgent} hasProjectFilter={currentProjectId !== null} />
|
|
38
92
|
) : (
|
|
39
93
|
<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
|
|
40
|
-
{
|
|
94
|
+
{filteredAgents.map((agent) => (
|
|
41
95
|
<AgentCard
|
|
42
96
|
key={agent.id}
|
|
43
97
|
agent={agent}
|
|
44
98
|
selected={selectedAgent?.id === agent.id}
|
|
45
99
|
onSelect={() => onSelectAgent(agent)}
|
|
46
100
|
onToggle={(e) => onToggleAgent(agent, e)}
|
|
47
|
-
|
|
101
|
+
showProject={currentProjectId === null}
|
|
48
102
|
/>
|
|
49
103
|
))}
|
|
50
104
|
</div>
|
|
@@ -61,7 +115,7 @@ export function AgentsView({
|
|
|
61
115
|
|
|
62
116
|
{/* Agent Panel - slides in from right */}
|
|
63
117
|
{selectedAgent && (
|
|
64
|
-
<div className="absolute right-0 top-0 bottom-0 w-[600px] z-20">
|
|
118
|
+
<div className="absolute right-0 top-0 bottom-0 w-full sm:w-[500px] lg:w-[600px] xl:w-[700px] z-20">
|
|
65
119
|
<AgentPanel
|
|
66
120
|
agent={selectedAgent}
|
|
67
121
|
providers={providers}
|
|
@@ -76,11 +130,29 @@ export function AgentsView({
|
|
|
76
130
|
);
|
|
77
131
|
}
|
|
78
132
|
|
|
79
|
-
function EmptyState() {
|
|
133
|
+
function EmptyState({ onNewAgent, canCreateAgent, hasProjectFilter }: { onNewAgent?: () => void; canCreateAgent?: boolean; hasProjectFilter?: boolean }) {
|
|
80
134
|
return (
|
|
81
135
|
<div className="text-center py-20 text-[#666]">
|
|
82
|
-
|
|
83
|
-
|
|
136
|
+
{hasProjectFilter ? (
|
|
137
|
+
<>
|
|
138
|
+
<p className="text-lg">No agents in this project</p>
|
|
139
|
+
<p className="text-sm mt-1">Create an agent or assign existing agents to this project</p>
|
|
140
|
+
</>
|
|
141
|
+
) : (
|
|
142
|
+
<>
|
|
143
|
+
<p className="text-lg">No agents yet</p>
|
|
144
|
+
<p className="text-sm mt-1">Create your first agent to get started</p>
|
|
145
|
+
</>
|
|
146
|
+
)}
|
|
147
|
+
{onNewAgent && (
|
|
148
|
+
<button
|
|
149
|
+
onClick={onNewAgent}
|
|
150
|
+
disabled={!canCreateAgent}
|
|
151
|
+
className="mt-4 bg-[#f97316] hover:bg-[#fb923c] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-2 rounded font-medium transition"
|
|
152
|
+
>
|
|
153
|
+
+ New Agent
|
|
154
|
+
</button>
|
|
155
|
+
)}
|
|
84
156
|
</div>
|
|
85
157
|
);
|
|
86
158
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Modal } from "../common/Modal";
|
|
3
3
|
import { Select } from "../common/Select";
|
|
4
|
-
import { MemoryIcon, TasksIcon, VisionIcon, OperatorIcon, McpIcon, RealtimeIcon } from "../common/Icons";
|
|
4
|
+
import { MemoryIcon, TasksIcon, FilesIcon, VisionIcon, OperatorIcon, McpIcon, RealtimeIcon, MultiAgentIcon } from "../common/Icons";
|
|
5
|
+
import { useProjects } from "../../context";
|
|
5
6
|
import type { Provider, NewAgentForm, AgentFeatures } from "../../types";
|
|
6
7
|
|
|
7
8
|
interface CreateAgentModalProps {
|
|
@@ -18,10 +19,12 @@ interface CreateAgentModalProps {
|
|
|
18
19
|
const FEATURE_CONFIG = [
|
|
19
20
|
{ key: "memory" as keyof AgentFeatures, label: "Memory", description: "Persistent recall", icon: MemoryIcon },
|
|
20
21
|
{ key: "tasks" as keyof AgentFeatures, label: "Tasks", description: "Schedule and execute tasks", icon: TasksIcon },
|
|
22
|
+
{ key: "files" as keyof AgentFeatures, label: "Files", description: "File storage and management", icon: FilesIcon },
|
|
21
23
|
{ key: "vision" as keyof AgentFeatures, label: "Vision", description: "Process images and PDFs", icon: VisionIcon },
|
|
22
24
|
{ key: "operator" as keyof AgentFeatures, label: "Operator", description: "Browser automation", icon: OperatorIcon },
|
|
23
25
|
{ key: "mcp" as keyof AgentFeatures, label: "MCP", description: "External tools/services", icon: McpIcon },
|
|
24
26
|
{ key: "realtime" as keyof AgentFeatures, label: "Realtime", description: "Voice conversations", icon: RealtimeIcon },
|
|
27
|
+
{ key: "agents" as keyof AgentFeatures, label: "Multi-Agent", description: "Communicate with peer agents", icon: MultiAgentIcon },
|
|
25
28
|
];
|
|
26
29
|
|
|
27
30
|
export function CreateAgentModal({
|
|
@@ -34,6 +37,7 @@ export function CreateAgentModal({
|
|
|
34
37
|
onClose,
|
|
35
38
|
onGoToSettings,
|
|
36
39
|
}: CreateAgentModalProps) {
|
|
40
|
+
const { projects, currentProjectId } = useProjects();
|
|
37
41
|
const selectedProvider = providers.find(p => p.id === form.provider);
|
|
38
42
|
|
|
39
43
|
const providerOptions = configuredProviders.map(p => ({
|
|
@@ -47,6 +51,18 @@ export function CreateAgentModal({
|
|
|
47
51
|
recommended: m.recommended,
|
|
48
52
|
})) || [];
|
|
49
53
|
|
|
54
|
+
const projectOptions = [
|
|
55
|
+
{ value: "", label: "No Project" },
|
|
56
|
+
...projects.map(p => ({ value: p.id, label: p.name })),
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
// Set default project from current selection (but not "unassigned" or "all")
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
if (form.projectId === undefined && currentProjectId && currentProjectId !== "unassigned") {
|
|
62
|
+
onFormChange({ ...form, projectId: currentProjectId });
|
|
63
|
+
}
|
|
64
|
+
}, [currentProjectId]);
|
|
65
|
+
|
|
50
66
|
const toggleFeature = (key: keyof AgentFeatures) => {
|
|
51
67
|
onFormChange({
|
|
52
68
|
...form,
|
|
@@ -76,6 +92,17 @@ export function CreateAgentModal({
|
|
|
76
92
|
/>
|
|
77
93
|
</FormField>
|
|
78
94
|
|
|
95
|
+
{projects.length > 0 && (
|
|
96
|
+
<FormField label="Project">
|
|
97
|
+
<Select
|
|
98
|
+
value={form.projectId || ""}
|
|
99
|
+
options={projectOptions}
|
|
100
|
+
onChange={(value) => onFormChange({ ...form, projectId: value || null })}
|
|
101
|
+
placeholder="Select project..."
|
|
102
|
+
/>
|
|
103
|
+
</FormField>
|
|
104
|
+
)}
|
|
105
|
+
|
|
79
106
|
<FormField label="Provider">
|
|
80
107
|
<Select
|
|
81
108
|
value={form.provider}
|