Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

datapools v2 ui changes

Ahmed Essam87b6c6caf83c
diff --git a/packages/app/src/backend/config.ts b/packages/app/src/backend/config.ts
index cbd0642f..221520c5 100644
--- a/packages/app/src/backend/config.ts
+++ b/packages/app/src/backend/config.ts
@@ -84,6 +84,7 @@ const config = {
POSTHOG_API_KEY: process.env.POSTHOG_API_KEY,
PUB_API_SERVER: process.env.PUB_API_SERVER,
IS_AWS_ENVIRONMENT: process.env.IS_AWS_ENVIRONMENT || false,
+ DISABLE_DATA_POOL_V1: process.env.DISABLE_DATA_POOL_V1 || false,
},
api: {
SMYTH_USER_API_URL: `${MW_BASE_URL}/v1`,
diff --git a/packages/app/src/backend/routes/api/router.ts b/packages/app/src/backend/routes/api/router.ts
index cdcea1a0..467d8b27 100644
--- a/packages/app/src/backend/routes/api/router.ts
+++ b/packages/app/src/backend/routes/api/router.ts
@@ -165,6 +165,9 @@ router.get('/status', includeTeamDetails, async (req, res) => {
doc_url: config.env.DOC_SERVER,
prod_agent_domain: config.env.PROD_AGENT_DOMAIN,
embodiment_url: config.env.EMBODIMENT_SERVER_BASE_URL,
+ flags: {
+ disable_data_pool_v1: !!config.env.DISABLE_DATA_POOL_V1,
+ },
},
});
} catch (error) {
@@ -176,6 +179,9 @@ router.get('/status', includeTeamDetails, async (req, res) => {
server: 'Offline',
smythos_edition: config.env.SMYTHOS_EDITION,
env: config.env.NODE_ENV,
+ flags: {
+ disable_data_pool_v1: !!config.env.DISABLE_DATA_POOL_V1,
+ },
},
});
}
diff --git a/packages/app/src/react/features/credentials/components/create-credentials.modal.tsx b/packages/app/src/react/features/credentials/components/create-credentials.modal.tsx
index 89e0b3e2..835cb9b8 100644
--- a/packages/app/src/react/features/credentials/components/create-credentials.modal.tsx
+++ b/packages/app/src/react/features/credentials/components/create-credentials.modal.tsx
@@ -65,6 +65,8 @@ export interface CredentialConnection {
group: string;
credentials: Record<string, string>;
isActive?: boolean;
+ isReadOnly?: boolean;
+ isManaged?: boolean;
}
/**
diff --git a/packages/app/src/react/features/credentials/hooks/use-credentials.ts b/packages/app/src/react/features/credentials/hooks/use-credentials.ts
index e93c0ba2..6a48bcc3 100644
--- a/packages/app/src/react/features/credentials/hooks/use-credentials.ts
+++ b/packages/app/src/react/features/credentials/hooks/use-credentials.ts
@@ -10,6 +10,21 @@ import { useEffect, useMemo, useState } from 'react';
import { credentialsClient } from '../clients/credentials.client';
import type { CredentialConnection } from '../components/create-credentials.modal';
+const INTERNAL_CREDENTIALS = {
+ vector_db_creds: [
+ {
+ id: '__smythos_vectordb_cred__',
+ name: 'SmythOS Pinecone',
+ provider: 'Pinecone',
+ credentials: {},
+ createdAt: '2024-11-26T17:59:56.212Z',
+ updatedAt: '2024-11-26T17:59:56.213Z',
+ isReadOnly: true,
+ isManaged: true,
+ },
+ ],
+};
+
/**
* Custom hook to fetch and manage credential connections
*
@@ -41,7 +56,8 @@ export function useCredentials(group: string) {
try {
const data = await credentialsClient.fetchCredentials(group);
- setCredentials(data);
+ const internalCreds = INTERNAL_CREDENTIALS[group];
+ setCredentials([...internalCreds, ...data]);
} catch (err: any) {
console.error('Error fetching credentials:', err);
setError(err.message || 'Failed to fetch credentials');
diff --git a/packages/app/src/react/features/data-pool/client/datapool.client.ts b/packages/app/src/react/features/data-pool/client/datapool.client.ts
index b6dfcf0a..239745b7 100644
--- a/packages/app/src/react/features/data-pool/client/datapool.client.ts
+++ b/packages/app/src/react/features/data-pool/client/datapool.client.ts
@@ -81,6 +81,10 @@ export const dataPoolClient = {
}
const result = await response.json();
+ // sort by createdAt
+ result.namespaces.sort((a: Namespace, b: Namespace) => {
+ return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
+ });
return result;
} catch (error) {
if (error instanceof Error) {
diff --git a/packages/app/src/react/features/data-pool/components/CreateNamespaceModal.tsx b/packages/app/src/react/features/data-pool/components/CreateNamespaceModal.tsx
index eb8f3174..347d02df 100644
--- a/packages/app/src/react/features/data-pool/components/CreateNamespaceModal.tsx
+++ b/packages/app/src/react/features/data-pool/components/CreateNamespaceModal.tsx
@@ -239,6 +239,9 @@ export const CreateNamespaceModal: FC<CreateNamespaceModalProps> = ({
/>
)}
<span>{selectedCred?.name}</span>
+ {selectedCred?.isManaged && (
+ <span className="text-xs text-gray-500">Managed</span>
+ )}
</div>
);
})()}
@@ -277,6 +280,9 @@ export const CreateNamespaceModal: FC<CreateNamespaceModalProps> = ({
/>
)}
<span>{cred.name}</span>
+ {cred.isManaged && (
+ <span className="text-xs text-gray-500">Managed</span>
+ )}
</div>
</SelectItem>
);
diff --git a/packages/app/src/react/features/data-pool/components/DatasourcesTable.tsx b/packages/app/src/react/features/data-pool/components/DatasourcesTable.tsx
index e8bf4354..10a689ee 100644
--- a/packages/app/src/react/features/data-pool/components/DatasourcesTable.tsx
+++ b/packages/app/src/react/features/data-pool/components/DatasourcesTable.tsx
@@ -75,7 +75,11 @@ export const DatasourcesTable: FC<DatasourcesTableProps> = ({ datasources, onDel
{/* Size */}
- <td className="px-6 py-4 text-gray-700">{formatSize(datasource.datasourceSizeMb)}</td>
+ <td className="px-6 py-4 text-gray-700">{
+ datasource.datasourceSizeMb ?
+ formatSize(datasource.datasourceSizeMb) :
+ '-'
+ }</td>
{/* Created */}
<td className="px-6 py-4 text-gray-700">{formatDate(datasource.createdAt)}</td>
diff --git a/packages/app/src/react/features/data-pool/components/NamespaceTable.tsx b/packages/app/src/react/features/data-pool/components/NamespaceTable.tsx
index 1d95953b..572560fc 100644
--- a/packages/app/src/react/features/data-pool/components/NamespaceTable.tsx
+++ b/packages/app/src/react/features/data-pool/components/NamespaceTable.tsx
@@ -14,6 +14,20 @@ import { useDataPoolContext } from '../contexts/data-pool.context';
import type { NamespaceWithProvider } from '../types';
import { UploadDatasourceDialog } from './UploadDatasourceDialog';
+// const INTERNAL_CREDS: Record<string, CredentialConnection> = {
+// __smythos_vectordb_cred__: {
+// group: 'vector_db_creds',
+// credentials: {
+// apiKey: '',
+// apiSecret: '',
+// },
+// provider: 'Pinecone',
+// name: 'SmythOS Pinecone',
+// id: '__smythos_vectordb_cred__',
+// isReadOnly: true,
+// },
+// };
+
interface NamespaceTableProps {
namespaces: NamespaceWithProvider[];
onDelete: (namespace: NamespaceWithProvider) => void;
@@ -50,7 +64,8 @@ export const NamespaceTable: FC<NamespaceTableProps> = ({ namespaces, onDelete }
</thead>
<tbody>
{namespaces.map((namespace) => {
- const credential = getCredentialById(namespace.credentialId);
+ const credential =
+ getCredentialById(namespace.credentialId);
const providerLogo = credential ? getProviderLogo(credential.provider) : undefined;
// Format model name for display (truncate if too long)
@@ -109,7 +124,10 @@ export const NamespaceTable: FC<NamespaceTableProps> = ({ namespaces, onDelete }
className="w-5 h-5 object-contain"
/>
)}
- <span>{credential?.name || 'Deleted'}</span>
+ <span>{credential?.name || 'Unknown'}</span>
+ {credential?.isManaged && (
+ <span className="text-xs text-gray-500">Managed</span>
+ )}
</div>
</td>
diff --git a/packages/app/src/react/features/data-pool/components/ViewDatasourceDialog.tsx b/packages/app/src/react/features/data-pool/components/ViewDatasourceDialog.tsx
index 1c1a8efb..08e1700e 100644
--- a/packages/app/src/react/features/data-pool/components/ViewDatasourceDialog.tsx
+++ b/packages/app/src/react/features/data-pool/components/ViewDatasourceDialog.tsx
@@ -5,10 +5,10 @@
*/
import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
} from '@src/react/shared/components/ui/dialog';
import { Tooltip } from 'flowbite-react';
import { Calendar, Database, FileText, Hash } from 'lucide-react';
@@ -128,7 +128,7 @@ export const ViewDatasourceDialog: FC<ViewDatasourceDialogProps> = ({
<span className="text-sm font-medium text-green-900">Size</span>
</div>
<p className="text-lg font-semibold text-green-900">
- {formatSize(datasource.datasourceSizeMb)}
+ {datasource.datasourceSizeMb ? formatSize(datasource.datasourceSizeMb) : '-'}
</p>
</div>
@@ -172,7 +172,8 @@ export const ViewDatasourceDialog: FC<ViewDatasourceDialogProps> = ({
)}
{/* Metadata Section */}
- <div className="space-y-2">
+ {metadata && (
+ <div className="space-y-2">
<h3 className="text-lg font-semibold text-gray-900">Metadata</h3>
<div className="relative bg-[#282c34] border border-gray-700 rounded-lg overflow-hidden">
<div className="absolute top-3 right-3 z-10">
@@ -208,6 +209,7 @@ export const ViewDatasourceDialog: FC<ViewDatasourceDialogProps> = ({
</Suspense>
</div>
</div>
+ )}
{/* Source Text Section */}
{datasource.text && (
diff --git a/packages/app/src/react/features/vault/components/vector-databases.tsx b/packages/app/src/react/features/vault/components/vector-databases.tsx
index d90f2485..99ab0b3f 100644
--- a/packages/app/src/react/features/vault/components/vector-databases.tsx
+++ b/packages/app/src/react/features/vault/components/vector-databases.tsx
@@ -183,7 +183,25 @@ export function VectorDatabases() {
<tr key={connection.id} className="border-t">
{/* Connection Name */}
<td className="pr-4 py-3 truncate" title={connection.name}>
- <span className="font-medium">{connection.name}</span>
+ <div className="flex items-center gap-2">
+ <span className="font-medium">{connection.name}</span>
+ {connection.isManaged && (
+ <span
+ className="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold bg-gradient-to-r from-blue-100 to-purple-100 text-blue-700 border border-blue-200 ml-2 shadow-sm"
+ title="This is an internal connection automatically managed by SmythOS"
+ >
+ <svg
+ className="w-3 h-3 mr-1 text-blue-400"
+ fill="currentColor"
+ viewBox="0 0 20 20"
+ aria-hidden="true"
+ >
+ <path d="M10 2a8 8 0 100 16 8 8 0 000-16zm.93 12.412a.75.75 0 11-1.86 0l-1.406-5.624A.75.75 0 017.38 7h5.24a.75.75 0 01.716.788l-1.406 5.624zm-.93-7.162a1 1 0 110-2 1 1 0 010 2z" />
+ </svg>
+ Managed
+ </span>
+ )}
+ </div>
</td>
{/* Provider */}
@@ -201,7 +219,10 @@ export function VectorDatabases() {
</td>
{/* Actions */}
- <td className="pl-4 py-3">
+
+
+ {!connection.isReadOnly && (
+ <td className="pl-4 py-3">
<div className="flex items-center justify-end gap-1">
{/* Edit Button */}
<Tooltip content="Edit">
@@ -226,6 +247,7 @@ export function VectorDatabases() {
</Tooltip>
</div>
</td>
+ )}
</tr>
))}
</tbody>
diff --git a/packages/app/src/shared/state_stores/builder/slices/server_status.slice.ts b/packages/app/src/shared/state_stores/builder/slices/server_status.slice.ts
index ba43d1dc..5fdef2d0 100644
--- a/packages/app/src/shared/state_stores/builder/slices/server_status.slice.ts
+++ b/packages/app/src/shared/state_stores/builder/slices/server_status.slice.ts
@@ -17,6 +17,9 @@ export interface ServerStatus {
user: any;
userData: any;
edition: string;
+ flags: {
+ disable_data_pool_v1: boolean;
+ };
}
export interface ServerStatusSlice extends Slice {
@@ -59,6 +62,7 @@ export const serverStatusSlice: StateCreator<BuilderStore, [], [], ServerStatusS
user: data.user,
userData: data.user,
edition: data.smythos_edition,
+ flags: data.flags || {},
},
});
} catch (err) {