@inkeep/agents-manage-ui 0.21.0 → 0.22.0
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/.next/standalone/agents-manage-ui/.next/BUILD_ID +1 -1
- package/.next/standalone/agents-manage-ui/.next/app-build-manifest.json +107 -107
- package/.next/standalone/agents-manage-ui/.next/app-path-routes-manifest.json +6 -6
- package/.next/standalone/agents-manage-ui/.next/build-manifest.json +2 -2
- package/.next/standalone/agents-manage-ui/.next/prerender-manifest.json +3 -3
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/[agentId]/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/[agentId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/new/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/new/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/agents/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/api-keys/page.js +3 -3
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/api-keys/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/new/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/new/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/artifacts/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/[dataComponentId]/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/[dataComponentId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/[dataComponentId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/new/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/new/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/components/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/new/providers/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/credentials/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/new/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/mcp-servers/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/settings/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/ai-calls/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/ai-calls/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/ai-calls/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/conversations/[conversationId]/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/conversations/[conversationId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/page.js.nft.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/[projectId]/traces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/page.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/[tenantId]/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/_not-found.rsc +8 -8
- package/.next/standalone/agents-manage-ui/.next/server/app/api/signoz/conversations/[conversationId]/route.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/api/signoz/conversations/[conversationId]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/api/signoz/route_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app/page.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/app-paths-manifest.json +6 -6
- package/.next/standalone/agents-manage-ui/.next/server/chunks/2067.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/2083.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/2619.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/server/chunks/3547.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/{3024.js → 6212.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/{9919.js → 6583.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/{6112.js → 6584.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/6641.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/7035.js +4080 -0
- package/.next/standalone/agents-manage-ui/.next/server/chunks/7070.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/server/chunks/7457.js +2 -2
- package/.next/standalone/agents-manage-ui/.next/server/chunks/7504.js +6 -6
- package/.next/standalone/agents-manage-ui/.next/server/chunks/7711.js +4 -4
- package/.next/standalone/agents-manage-ui/.next/server/pages/404.html +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/pages/500.html +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/agents-manage-ui/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/44161-d95ce45824f6407d.js +25 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/{49858-80fbae619dcf597d.js → 49858-b9850a9d521ad392.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/71558-4673700b1497ce51.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/7190-147e573b0734249b.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/78225-06ef3ef4b847caee.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/95401-9ecce06ebdc779cc.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/agents/[agentId]/{page-23539ffb13a32236.js → page-2da0296fc049ca8b.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/agents/new/{page-887de345376cc750.js → page-b9246737a0a74c93.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/agents/{page-dccc4d0967ab039c.js → page-a0b9c3696ede708c.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/api-keys/page-66628630f0bd6d1b.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/[artifactComponentId]/{page-c3fb73f525dcca7b.js → page-2585425d67e22045.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/new/{page-c3fb73f525dcca7b.js → page-2585425d67e22045.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/artifacts/{page-5fe1256299d0574c.js → page-bf0ce03f97abccd9.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/[dataComponentId]/page-d3c2244b23341c14.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/new/page-d3c2244b23341c14.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/page-27eab3c6374c8196.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page-149f848844372a74.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page-caa95bf288754503.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page-b45e813b7b118850.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/page-062648e2e723c926.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/page-ce2a0be52a10a1f2.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/new/page-fa4c2d27d2730d98.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/page-8d096fc3eb8f1614.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/settings/{page-b45c94e5316eba0f.js → page-35171497402d3bb6.js} +1 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/traces/conversations/[conversationId]/page-1025ee478d7359e4.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/traces/page-067deb74bf6cb6d7.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/page-b21bd904105406f4.js +1 -0
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/layout-8d82f727f4d26b42.js +1 -0
- package/.next/standalone/agents-manage-ui/package.json +1 -1
- package/.next/standalone/packages/agents-core/package.json +1 -1
- package/README.md +3 -1
- package/package.json +4 -4
- package/src/app/[tenantId]/projects/[projectId]/credentials/new/page.tsx +13 -4
- package/src/app/layout.tsx +10 -8
- package/src/components/agent/configuration/model-options.tsx +10 -10
- package/src/components/agent/playground/chat-widget.tsx +4 -3
- package/src/components/agent/sidepane/metadata/metadata-editor.tsx +2 -2
- package/src/components/credentials/views/credential-form-validation.ts +3 -0
- package/src/components/credentials/views/credential-form.tsx +127 -22
- package/src/components/credentials/views/edit-credential-form.tsx +1 -5
- package/src/components/credentials/views/new-credential-form.tsx +65 -39
- package/src/components/traces/conversation-detail.tsx +3 -3
- package/src/components/traces/signoz-link.tsx +8 -4
- package/src/hooks/use-nango-connect.ts +5 -5
- package/src/hooks/use-oauth-login.ts +2 -2
- package/src/lib/README.md +1 -1
- package/src/lib/api/api-config.ts +1 -29
- package/src/lib/api/credentialStores.ts +70 -0
- package/src/lib/runtime-config/types.ts +6 -6
- package/src/lib/utils/mcp-urls.ts +4 -4
- package/.next/standalone/agents-manage-ui/.next/server/chunks/2068.js +0 -4080
- package/.next/standalone/agents-manage-ui/.next/server/chunks/5216.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/server/chunks/5689.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/30694-7b171c2aff25e28c.js +0 -25
- package/.next/standalone/agents-manage-ui/.next/static/chunks/48154-d59e3a94dcc204cb.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/71558-ec1db8ba03c725b8.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/7190-9f79959ef15514fc.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/78225-50111df5e77a5e16.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/api-keys/page-c894cf34e38f0106.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/[dataComponentId]/page-d0b61eea4092270f.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/new/page-d0b61eea4092270f.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/components/page-c952156059d097eb.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/[credentialId]/page-dbf8afc2734277c7.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/bearer/page-28106d6f99c9d4d1.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/new/providers/[providerId]/page-78e196c5e73762ca.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/credentials/page-a70bd87a0b04b1d5.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/page-0fb0f3d27e7a41cd.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/new/page-afbda9d62a083c82.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/mcp-servers/page-6d2e468869ec9f2a.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/traces/conversations/[conversationId]/page-e860de4595d782bf.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/[projectId]/traces/page-d3405bd00174af50.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/[tenantId]/projects/page-6927e6f75b1af49e.js +0 -1
- package/.next/standalone/agents-manage-ui/.next/static/chunks/app/layout-ae6feca142ce23d2.js +0 -1
- /package/.next/standalone/agents-manage-ui/.next/static/{YAZ-9NKnwGndT1sywiuFZ → swgQFTsM_YCcIeseVXgph}/_buildManifest.js +0 -0
- /package/.next/standalone/agents-manage-ui/.next/static/{YAZ-9NKnwGndT1sywiuFZ → swgQFTsM_YCcIeseVXgph}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
|
+
import { CredentialStoreType } from '@inkeep/agents-core/client-exports';
|
|
4
5
|
import { useEffect, useMemo, useState } from 'react';
|
|
5
6
|
import { useForm } from 'react-hook-form';
|
|
6
7
|
import { toast } from 'sonner';
|
|
@@ -11,6 +12,10 @@ import { Button } from '@/components/ui/button';
|
|
|
11
12
|
import { Checkbox } from '@/components/ui/checkbox';
|
|
12
13
|
import { Form } from '@/components/ui/form';
|
|
13
14
|
import { InfoCard } from '@/components/ui/info-card';
|
|
15
|
+
import {
|
|
16
|
+
type CredentialStoreStatus,
|
|
17
|
+
listCredentialStores,
|
|
18
|
+
} from '@/lib/api/credentialStores';
|
|
14
19
|
import { fetchMCPTools } from '@/lib/api/tools';
|
|
15
20
|
import type { MCPTool } from '@/lib/types/tools';
|
|
16
21
|
import { type CredentialFormData, credentialFormSchema } from './credential-form-validation';
|
|
@@ -28,13 +33,17 @@ const defaultValues: CredentialFormData = {
|
|
|
28
33
|
name: '',
|
|
29
34
|
apiKeyToSet: '',
|
|
30
35
|
metadata: {},
|
|
36
|
+
credentialStoreId: '',
|
|
37
|
+
credentialStoreType: 'nango',
|
|
31
38
|
selectedTool: undefined,
|
|
32
39
|
};
|
|
33
40
|
|
|
34
41
|
export function CredentialForm({ onCreateCredential, tenantId, projectId }: CredentialFormProps) {
|
|
35
|
-
const [
|
|
42
|
+
const [availableMCPServers, setAvailableMCPServers] = useState<MCPTool[]>([]);
|
|
36
43
|
const [toolsLoading, setToolsLoading] = useState(true);
|
|
37
44
|
const [shouldLinkToServer, setShouldLinkToServer] = useState(false);
|
|
45
|
+
const [credentialStores, setCredentialStores] = useState<CredentialStoreStatus[]>([]);
|
|
46
|
+
const [storesLoading, setStoresLoading] = useState(true);
|
|
38
47
|
|
|
39
48
|
const form = useForm({
|
|
40
49
|
resolver: zodResolver(credentialFormSchema),
|
|
@@ -48,7 +57,7 @@ export function CredentialForm({ onCreateCredential, tenantId, projectId }: Cred
|
|
|
48
57
|
try {
|
|
49
58
|
const allTools = await fetchMCPTools(tenantId, projectId);
|
|
50
59
|
const toolsWithoutCredentials = allTools.filter((tool) => !tool.credentialReferenceId);
|
|
51
|
-
|
|
60
|
+
setAvailableMCPServers(toolsWithoutCredentials);
|
|
52
61
|
} catch (err) {
|
|
53
62
|
console.error('Failed to load MCP tools:', err);
|
|
54
63
|
} finally {
|
|
@@ -59,6 +68,38 @@ export function CredentialForm({ onCreateCredential, tenantId, projectId }: Cred
|
|
|
59
68
|
loadAvailableTools();
|
|
60
69
|
}, [tenantId, projectId]);
|
|
61
70
|
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
const loadCredentialStores = async () => {
|
|
73
|
+
try {
|
|
74
|
+
const stores = await listCredentialStores(tenantId, projectId);
|
|
75
|
+
setCredentialStores(stores);
|
|
76
|
+
|
|
77
|
+
// Auto-select preferred store: prioritize Nango, then other available non-memory stores
|
|
78
|
+
const availableStores = stores.filter(
|
|
79
|
+
(store) => store.available && store.type !== 'memory'
|
|
80
|
+
);
|
|
81
|
+
if (availableStores.length > 0) {
|
|
82
|
+
// First try to find Nango store
|
|
83
|
+
const nangoStore = availableStores.find((store) => store.type === 'nango');
|
|
84
|
+
const preferredStore = nangoStore || availableStores[0];
|
|
85
|
+
|
|
86
|
+
// Only set values if form doesn't already have a credentialStoreId value
|
|
87
|
+
const currentStoreId = form.getValues('credentialStoreId');
|
|
88
|
+
if (!currentStoreId) {
|
|
89
|
+
form.setValue('credentialStoreId', preferredStore.id, { shouldValidate: true });
|
|
90
|
+
form.setValue('credentialStoreType', preferredStore.type as 'keychain' | 'nango', { shouldValidate: true });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
} catch (err) {
|
|
94
|
+
console.error('Failed to load credential stores:', err);
|
|
95
|
+
} finally {
|
|
96
|
+
setStoresLoading(false);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
loadCredentialStores();
|
|
101
|
+
}, [tenantId, projectId, form.getValues, form.setValue]);
|
|
102
|
+
|
|
62
103
|
// Handle checkbox state changes
|
|
63
104
|
useEffect(() => {
|
|
64
105
|
if (!shouldLinkToServer) {
|
|
@@ -67,6 +108,20 @@ export function CredentialForm({ onCreateCredential, tenantId, projectId }: Cred
|
|
|
67
108
|
}
|
|
68
109
|
}, [shouldLinkToServer, form]);
|
|
69
110
|
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
const subscription = form.watch((value: any, { name }: any) => {
|
|
113
|
+
if (name === 'credentialStoreId' && value.credentialStoreId) {
|
|
114
|
+
const selectedStore = credentialStores.find(
|
|
115
|
+
(store) => store.id === value.credentialStoreId
|
|
116
|
+
);
|
|
117
|
+
if (selectedStore && selectedStore.type !== 'memory') {
|
|
118
|
+
form.setValue('credentialStoreType', selectedStore.type);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return () => subscription.unsubscribe();
|
|
123
|
+
}, [form, credentialStores]);
|
|
124
|
+
|
|
70
125
|
const handleLinkToServerChange = (checked: boolean | 'indeterminate') => {
|
|
71
126
|
setShouldLinkToServer(checked === true);
|
|
72
127
|
};
|
|
@@ -99,14 +154,47 @@ export function CredentialForm({ onCreateCredential, tenantId, projectId }: Cred
|
|
|
99
154
|
},
|
|
100
155
|
]
|
|
101
156
|
: []),
|
|
102
|
-
...
|
|
157
|
+
...availableMCPServers.map((tool) => ({
|
|
103
158
|
value: tool.id,
|
|
104
159
|
label: `${tool.name} - ${tool.config.type === 'mcp' ? tool.config.mcp.server.url : ''}`,
|
|
105
160
|
})),
|
|
106
161
|
],
|
|
107
|
-
[
|
|
162
|
+
[availableMCPServers, toolsLoading]
|
|
108
163
|
);
|
|
109
164
|
|
|
165
|
+
const credentialStoreOptions = useMemo(() => {
|
|
166
|
+
if (storesLoading) {
|
|
167
|
+
return [
|
|
168
|
+
{
|
|
169
|
+
value: 'loading',
|
|
170
|
+
label: 'Loading credential stores...',
|
|
171
|
+
disabled: true,
|
|
172
|
+
},
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const availableStores = credentialStores.filter(
|
|
177
|
+
(store) => store.available && store.type !== 'memory'
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
if (availableStores.length === 0) {
|
|
181
|
+
return [
|
|
182
|
+
{
|
|
183
|
+
value: 'none',
|
|
184
|
+
label: 'No credential stores available',
|
|
185
|
+
disabled: true,
|
|
186
|
+
},
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const options = availableStores.map((store) => ({
|
|
191
|
+
value: store.id,
|
|
192
|
+
label: `${store.type === 'keychain' ? 'Keychain Store' : 'Nango Store'} (${store.id})`,
|
|
193
|
+
}));
|
|
194
|
+
|
|
195
|
+
return options;
|
|
196
|
+
}, [credentialStores, storesLoading]);
|
|
197
|
+
|
|
110
198
|
return (
|
|
111
199
|
<Form {...form}>
|
|
112
200
|
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
|
@@ -142,30 +230,47 @@ export function CredentialForm({ onCreateCredential, tenantId, projectId }: Cred
|
|
|
142
230
|
</InfoCard>
|
|
143
231
|
</div>
|
|
144
232
|
|
|
145
|
-
{
|
|
233
|
+
{!storesLoading && form.watch('credentialStoreType') === CredentialStoreType.nango && (
|
|
234
|
+
<div className="space-y-3">
|
|
235
|
+
<GenericKeyValueInput
|
|
236
|
+
control={form.control}
|
|
237
|
+
name="metadata"
|
|
238
|
+
label="Metadata (optional)"
|
|
239
|
+
keyPlaceholder="Header name (e.g., X-API-Key)"
|
|
240
|
+
valuePlaceholder="Header value"
|
|
241
|
+
/>
|
|
242
|
+
<InfoCard title="Additional headers">
|
|
243
|
+
<p className="mb-2">
|
|
244
|
+
Add extra headers to be included with authentication requests.
|
|
245
|
+
</p>
|
|
246
|
+
<p>
|
|
247
|
+
Examples:{' '}
|
|
248
|
+
<code className="bg-background px-1.5 py-0.5 rounded border mx-1">
|
|
249
|
+
User-Agent
|
|
250
|
+
</code>
|
|
251
|
+
<code className="bg-background px-1.5 py-0.5 rounded border mx-1">X-API-Key</code>
|
|
252
|
+
<code className="bg-background px-1.5 py-0.5 rounded border mx-1">
|
|
253
|
+
Content-Type
|
|
254
|
+
</code>
|
|
255
|
+
</p>
|
|
256
|
+
</InfoCard>
|
|
257
|
+
</div>
|
|
258
|
+
)}
|
|
259
|
+
|
|
260
|
+
{/* Credential Store Selection Section */}
|
|
146
261
|
<div className="space-y-3">
|
|
147
|
-
<
|
|
262
|
+
<GenericSelect
|
|
263
|
+
isRequired
|
|
148
264
|
control={form.control}
|
|
149
|
-
name="
|
|
150
|
-
label="
|
|
151
|
-
|
|
152
|
-
|
|
265
|
+
name="credentialStoreId"
|
|
266
|
+
label="Credential store"
|
|
267
|
+
options={credentialStoreOptions}
|
|
268
|
+
key={`credential-store-${credentialStores.length}-${storesLoading}`} // Force re-render when stores change
|
|
153
269
|
/>
|
|
154
|
-
<InfoCard title="Additional headers">
|
|
155
|
-
<p className="mb-2">Add extra headers to be included with authentication requests.</p>
|
|
156
|
-
<p>
|
|
157
|
-
Examples:{' '}
|
|
158
|
-
<code className="bg-background px-1.5 py-0.5 rounded border mx-1">User-Agent</code>
|
|
159
|
-
<code className="bg-background px-1.5 py-0.5 rounded border mx-1">X-API-Key</code>
|
|
160
|
-
<code className="bg-background px-1.5 py-0.5 rounded border mx-1">
|
|
161
|
-
Content-Type
|
|
162
|
-
</code>
|
|
163
|
-
</p>
|
|
164
|
-
</InfoCard>
|
|
165
270
|
</div>
|
|
166
271
|
|
|
167
272
|
{/* Tool Selection Section */}
|
|
168
|
-
{
|
|
273
|
+
{availableMCPServers.length > 0 && (
|
|
169
274
|
<div className="space-y-4">
|
|
170
275
|
<div className="flex items-center space-x-3 relative">
|
|
171
276
|
<Checkbox
|
|
@@ -161,11 +161,7 @@ export function EditCredentialForm({
|
|
|
161
161
|
)}
|
|
162
162
|
|
|
163
163
|
{/* MCP Servers Using This Credential */}
|
|
164
|
-
<CredentialToolsList
|
|
165
|
-
tools={credential.tools}
|
|
166
|
-
tenantId={tenantId}
|
|
167
|
-
projectId={projectId}
|
|
168
|
-
/>
|
|
164
|
+
<CredentialToolsList tools={credential.tools} tenantId={tenantId} projectId={projectId} />
|
|
169
165
|
</div>
|
|
170
166
|
|
|
171
167
|
<div className="flex gap-3 pt-4">
|
|
@@ -1,58 +1,84 @@
|
|
|
1
|
-
'use client'
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import { generateIdFromName } from '@inkeep/agents-core/client-exports'
|
|
4
|
-
import { CredentialStoreType } from '@inkeep/agents-core/types'
|
|
5
|
-
import { useParams, useRouter } from 'next/navigation'
|
|
6
|
-
import { toast } from 'sonner'
|
|
7
|
-
import type { CredentialFormData } from '@/components/credentials/views/credential-form-validation'
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { generateIdFromName } from '@inkeep/agents-core/client-exports';
|
|
4
|
+
import { CredentialStoreType } from '@inkeep/agents-core/types';
|
|
5
|
+
import { useParams, useRouter } from 'next/navigation';
|
|
6
|
+
import { toast } from 'sonner';
|
|
7
|
+
import type { CredentialFormData } from '@/components/credentials/views/credential-form-validation';
|
|
8
|
+
import { createCredentialInStore } from '@/lib/api/credentialStores';
|
|
9
|
+
import { updateMCPTool } from '@/lib/api/tools';
|
|
10
|
+
import { createNangoApiKeyConnection } from '@/lib/mcp-tools/nango';
|
|
11
|
+
import { findOrCreateCredential } from '@/lib/utils/credentials-utils';
|
|
12
|
+
import { CredentialForm } from './credential-form';
|
|
12
13
|
|
|
13
14
|
export function NewCredentialForm() {
|
|
14
|
-
const router = useRouter()
|
|
15
|
+
const router = useRouter();
|
|
15
16
|
const { tenantId, projectId } = useParams<{
|
|
16
|
-
tenantId: string
|
|
17
|
-
projectId: string
|
|
18
|
-
}>()
|
|
17
|
+
tenantId: string;
|
|
18
|
+
projectId: string;
|
|
19
|
+
}>();
|
|
19
20
|
|
|
20
21
|
const handleCreateCredential = async (data: CredentialFormData) => {
|
|
21
22
|
try {
|
|
22
|
-
const idFromName = generateIdFromName(data.name.trim())
|
|
23
|
+
const idFromName = generateIdFromName(data.name.trim());
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
name: idFromName,
|
|
26
|
-
apiKeyToSet: data.apiKeyToSet,
|
|
27
|
-
metadata: data.metadata as Record<string, string>,
|
|
28
|
-
})
|
|
25
|
+
let newCredential: Credential | undefined;
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
if (data.credentialStoreType === CredentialStoreType.nango) {
|
|
28
|
+
const { integration } = await createNangoApiKeyConnection({
|
|
29
|
+
name: idFromName,
|
|
30
|
+
apiKeyToSet: data.apiKeyToSet,
|
|
31
|
+
metadata: data.metadata as Record<string, string>,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
newCredential = await findOrCreateCredential(tenantId, projectId, {
|
|
35
|
+
id: idFromName,
|
|
36
|
+
type: data.credentialStoreType,
|
|
37
|
+
credentialStoreId: data.credentialStoreId,
|
|
38
|
+
retrievalParams: {
|
|
39
|
+
connectionId: idFromName,
|
|
40
|
+
providerConfigKey: integration.unique_key,
|
|
41
|
+
provider: integration.provider,
|
|
42
|
+
authMode: 'API_KEY',
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
} else if (data.credentialStoreType === CredentialStoreType.keychain) {
|
|
46
|
+
const keychainStoreValueToSet = JSON.stringify({
|
|
47
|
+
access_token: data.apiKeyToSet,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
await createCredentialInStore(
|
|
51
|
+
tenantId,
|
|
52
|
+
projectId,
|
|
53
|
+
data.credentialStoreId,
|
|
54
|
+
idFromName,
|
|
55
|
+
keychainStoreValueToSet
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
newCredential = await findOrCreateCredential(tenantId, projectId, {
|
|
59
|
+
id: idFromName,
|
|
60
|
+
type: data.credentialStoreType,
|
|
61
|
+
credentialStoreId: data.credentialStoreId,
|
|
62
|
+
retrievalParams: {
|
|
63
|
+
key: idFromName,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
41
67
|
|
|
42
68
|
if (data.selectedTool && newCredential) {
|
|
43
69
|
const updatedTool = {
|
|
44
70
|
credentialReferenceId: newCredential.id,
|
|
45
|
-
}
|
|
46
|
-
await updateMCPTool(tenantId, projectId, data.selectedTool, updatedTool)
|
|
71
|
+
};
|
|
72
|
+
await updateMCPTool(tenantId, projectId, data.selectedTool, updatedTool);
|
|
47
73
|
}
|
|
48
74
|
|
|
49
|
-
toast.success('Credential created successfully')
|
|
50
|
-
router.push(`/${tenantId}/projects/${projectId}/credentials`)
|
|
75
|
+
toast.success('Credential created successfully');
|
|
76
|
+
router.push(`/${tenantId}/projects/${projectId}/credentials`);
|
|
51
77
|
} catch (error) {
|
|
52
|
-
console.error('Failed to create credential:', error)
|
|
53
|
-
toast.error('Failed to create credential. Please try again.')
|
|
78
|
+
console.error('Failed to create credential:', error);
|
|
79
|
+
toast.error('Failed to create credential. Please try again.');
|
|
54
80
|
}
|
|
55
|
-
}
|
|
81
|
+
};
|
|
56
82
|
|
|
57
83
|
return (
|
|
58
84
|
<CredentialForm
|
|
@@ -60,5 +86,5 @@ export function NewCredentialForm() {
|
|
|
60
86
|
tenantId={tenantId}
|
|
61
87
|
projectId={projectId}
|
|
62
88
|
/>
|
|
63
|
-
)
|
|
89
|
+
);
|
|
64
90
|
}
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from 'lucide-react';
|
|
10
10
|
import { useParams } from 'next/navigation';
|
|
11
11
|
import { useEffect, useState } from 'react';
|
|
12
|
+
import { toast } from 'sonner';
|
|
12
13
|
import { formatDateTime, formatDuration } from '@/app/utils/format-date';
|
|
13
14
|
import type {
|
|
14
15
|
ActivityItem,
|
|
@@ -25,7 +26,6 @@ import { copyTraceToClipboard } from '@/lib/utils/trace-formatter';
|
|
|
25
26
|
import { SignozLink } from './signoz-link';
|
|
26
27
|
import { InfoRow } from './timeline/blocks';
|
|
27
28
|
import { TimelineWrapper } from './timeline/timeline-wrapper';
|
|
28
|
-
import { toast } from 'sonner';
|
|
29
29
|
|
|
30
30
|
interface ConversationDetailProps {
|
|
31
31
|
conversationId: string;
|
|
@@ -38,7 +38,7 @@ export function ConversationDetail({ conversationId, onBack }: ConversationDetai
|
|
|
38
38
|
const [error, setError] = useState<string | null>(null);
|
|
39
39
|
const [isCopying, setIsCopying] = useState(false);
|
|
40
40
|
const { tenantId, projectId } = useParams();
|
|
41
|
-
const {
|
|
41
|
+
const { PUBLIC_SIGNOZ_URL } = useRuntimeConfig();
|
|
42
42
|
|
|
43
43
|
const handleCopyTrace = async () => {
|
|
44
44
|
if (!conversation) return;
|
|
@@ -303,7 +303,7 @@ export function ConversationDetail({ conversationId, onBack }: ConversationDetai
|
|
|
303
303
|
className="mt-3 w-full flex items-center justify-center gap-1"
|
|
304
304
|
onClick={() => {
|
|
305
305
|
window.open(
|
|
306
|
-
getSignozTracesExplorerUrl(conversationId as string,
|
|
306
|
+
getSignozTracesExplorerUrl(conversationId as string, PUBLIC_SIGNOZ_URL),
|
|
307
307
|
'_blank'
|
|
308
308
|
);
|
|
309
309
|
}}
|
|
@@ -135,16 +135,20 @@ interface SignozSpanLinkProps {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
export function SignozLink({ conversationId }: SignozLinkProps) {
|
|
138
|
-
const {
|
|
138
|
+
const { PUBLIC_SIGNOZ_URL } = useRuntimeConfig();
|
|
139
139
|
return (
|
|
140
|
-
<ExternalLink href={makeTracesUrl(
|
|
140
|
+
<ExternalLink href={makeTracesUrl(PUBLIC_SIGNOZ_URL, conversationId)}>
|
|
141
|
+
View Conversation in SigNoz
|
|
142
|
+
</ExternalLink>
|
|
141
143
|
);
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
export function SignozSpanLink({ traceId, spanId }: SignozSpanLinkProps) {
|
|
145
|
-
const {
|
|
147
|
+
const { PUBLIC_SIGNOZ_URL } = useRuntimeConfig();
|
|
146
148
|
return (
|
|
147
|
-
<ExternalLink href={makeSpanUrl(
|
|
149
|
+
<ExternalLink href={makeSpanUrl(PUBLIC_SIGNOZ_URL, traceId, spanId)}>
|
|
150
|
+
View span in SigNoz
|
|
151
|
+
</ExternalLink>
|
|
148
152
|
);
|
|
149
153
|
}
|
|
150
154
|
|
|
@@ -18,17 +18,17 @@ type NangoConnectInstance = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export function useNangoConnect() {
|
|
21
|
-
const {
|
|
21
|
+
const { PUBLIC_NANGO_SERVER_URL, PUBLIC_NANGO_CONNECT_BASE_URL } = useRuntimeConfig();
|
|
22
22
|
|
|
23
23
|
const openNangoConnect = useCallback(
|
|
24
24
|
({ sessionToken, onEvent, connectOptions }: OpenNangoConnectOptions): NangoConnectInstance => {
|
|
25
25
|
const nango = new Nango({
|
|
26
|
-
host:
|
|
26
|
+
host: PUBLIC_NANGO_SERVER_URL || undefined,
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const connect = nango.openConnectUI({
|
|
30
|
-
baseURL: connectOptions?.baseURL ||
|
|
31
|
-
apiURL: connectOptions?.apiURL ||
|
|
30
|
+
baseURL: connectOptions?.baseURL || PUBLIC_NANGO_CONNECT_BASE_URL || undefined,
|
|
31
|
+
apiURL: connectOptions?.apiURL || PUBLIC_NANGO_SERVER_URL || undefined,
|
|
32
32
|
onEvent,
|
|
33
33
|
detectClosedAuthWindow: true,
|
|
34
34
|
});
|
|
@@ -37,7 +37,7 @@ export function useNangoConnect() {
|
|
|
37
37
|
|
|
38
38
|
return connect as NangoConnectInstance;
|
|
39
39
|
},
|
|
40
|
-
[
|
|
40
|
+
[PUBLIC_NANGO_SERVER_URL, PUBLIC_NANGO_CONNECT_BASE_URL]
|
|
41
41
|
);
|
|
42
42
|
|
|
43
43
|
return openNangoConnect;
|
|
@@ -12,7 +12,7 @@ interface UseOAuthLoginProps {
|
|
|
12
12
|
|
|
13
13
|
export function useOAuthLogin({ tenantId, projectId, onFinish, onError }: UseOAuthLoginProps) {
|
|
14
14
|
const router = useRouter();
|
|
15
|
-
const {
|
|
15
|
+
const { PUBLIC_INKEEP_AGENTS_MANAGE_API_URL } = useRuntimeConfig();
|
|
16
16
|
|
|
17
17
|
// Track active OAuth attempts to prevent conflicts
|
|
18
18
|
const activeAttempts = new Map<string, () => void>();
|
|
@@ -27,7 +27,7 @@ export function useOAuthLogin({ tenantId, projectId, onFinish, onError }: UseOAu
|
|
|
27
27
|
try {
|
|
28
28
|
// Get the OAuth URL and open in popup window
|
|
29
29
|
const oauthUrl = getOAuthLoginUrl({
|
|
30
|
-
|
|
30
|
+
PUBLIC_INKEEP_AGENTS_MANAGE_API_URL,
|
|
31
31
|
tenantId,
|
|
32
32
|
projectId,
|
|
33
33
|
id: toolId,
|
package/src/lib/README.md
CHANGED
|
@@ -7,7 +7,7 @@ This library provides server actions and types for interacting with the AgentFul
|
|
|
7
7
|
Set the following environment variable in your `.env.local` file:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
PUBLIC_INKEEP_AGENTS_RUN_API_URL="http://localhost:3003"
|
|
11
11
|
INKEEP_AGENTS_MANAGE_API_URL="http://localhost:3002"
|
|
12
12
|
```
|
|
13
13
|
|
|
@@ -4,17 +4,12 @@
|
|
|
4
4
|
* Centralized configuration for API endpoints and settings
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
DEFAULT_INKEEP_AGENTS_MANAGE_API_URL,
|
|
9
|
-
DEFAULT_INKEEP_AGENTS_RUN_API_URL,
|
|
10
|
-
} from '../runtime-config/defaults';
|
|
7
|
+
import { DEFAULT_INKEEP_AGENTS_MANAGE_API_URL } from '../runtime-config/defaults';
|
|
11
8
|
import { ApiError } from '../types/errors';
|
|
12
9
|
|
|
13
10
|
// Lazy initialization with runtime warnings
|
|
14
11
|
let INKEEP_AGENTS_MANAGE_API_URL: string | null = null;
|
|
15
|
-
let INKEEP_AGENTS_RUN_API_URL: string | null = null;
|
|
16
12
|
let hasWarnedManageApi = false;
|
|
17
|
-
let hasWarnedRunApi = false;
|
|
18
13
|
|
|
19
14
|
function getManageApiUrl(): string {
|
|
20
15
|
if (INKEEP_AGENTS_MANAGE_API_URL === null) {
|
|
@@ -31,21 +26,6 @@ function getManageApiUrl(): string {
|
|
|
31
26
|
return INKEEP_AGENTS_MANAGE_API_URL;
|
|
32
27
|
}
|
|
33
28
|
|
|
34
|
-
function getRunApiUrl(): string {
|
|
35
|
-
if (INKEEP_AGENTS_RUN_API_URL === null) {
|
|
36
|
-
INKEEP_AGENTS_RUN_API_URL =
|
|
37
|
-
process.env.INKEEP_AGENTS_RUN_API_URL || DEFAULT_INKEEP_AGENTS_RUN_API_URL;
|
|
38
|
-
|
|
39
|
-
if (!process.env.INKEEP_AGENTS_RUN_API_URL && !hasWarnedRunApi) {
|
|
40
|
-
console.warn(
|
|
41
|
-
`INKEEP_AGENTS_RUN_API_URL is not set, falling back to: ${DEFAULT_INKEEP_AGENTS_RUN_API_URL}`
|
|
42
|
-
);
|
|
43
|
-
hasWarnedRunApi = true;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return INKEEP_AGENTS_RUN_API_URL;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
29
|
async function makeApiRequestInternal<T>(
|
|
50
30
|
baseUrl: string,
|
|
51
31
|
endpoint: string,
|
|
@@ -115,11 +95,3 @@ export async function makeManagementApiRequest<T>(
|
|
|
115
95
|
): Promise<T> {
|
|
116
96
|
return makeApiRequestInternal<T>(getManageApiUrl(), endpoint, options);
|
|
117
97
|
}
|
|
118
|
-
|
|
119
|
-
// Inkeep Agents Run API requests (chat completions, agents run)
|
|
120
|
-
export async function makeAgentsRunApiRequest<T>(
|
|
121
|
-
endpoint: string,
|
|
122
|
-
options: RequestInit = {}
|
|
123
|
-
): Promise<T> {
|
|
124
|
-
return makeApiRequestInternal<T>(getRunApiUrl(), endpoint, options);
|
|
125
|
-
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
import type { CredentialStoreType } from '@inkeep/agents-core/client-exports';
|
|
4
|
+
import { makeManagementApiRequest } from './api-config';
|
|
5
|
+
import { validateProjectId, validateTenantId } from './resource-validation';
|
|
6
|
+
|
|
7
|
+
export interface CredentialStoreStatus {
|
|
8
|
+
id: string;
|
|
9
|
+
type: (typeof CredentialStoreType)[keyof typeof CredentialStoreType];
|
|
10
|
+
available: boolean;
|
|
11
|
+
reason: string | null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface CredentialStoresListResponse {
|
|
15
|
+
data: CredentialStoreStatus[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface CreateCredentialInStoreRequest {
|
|
19
|
+
key: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface CreateCredentialInStoreResponse {
|
|
24
|
+
data: {
|
|
25
|
+
key: string;
|
|
26
|
+
storeId: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* List credential stores - shows which credential stores are available and functional
|
|
33
|
+
*/
|
|
34
|
+
export async function listCredentialStores(
|
|
35
|
+
tenantId: string,
|
|
36
|
+
projectId: string
|
|
37
|
+
): Promise<CredentialStoreStatus[]> {
|
|
38
|
+
validateTenantId(tenantId);
|
|
39
|
+
validateProjectId(projectId);
|
|
40
|
+
|
|
41
|
+
const response = await makeManagementApiRequest<CredentialStoresListResponse>(
|
|
42
|
+
`tenants/${tenantId}/projects/${projectId}/credential-stores`
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return response.data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Create a credential in a specific credential store
|
|
50
|
+
*/
|
|
51
|
+
export async function createCredentialInStore(
|
|
52
|
+
tenantId: string,
|
|
53
|
+
projectId: string,
|
|
54
|
+
storeId: string,
|
|
55
|
+
key: string,
|
|
56
|
+
value: string
|
|
57
|
+
): Promise<CreateCredentialInStoreResponse['data']> {
|
|
58
|
+
validateTenantId(tenantId);
|
|
59
|
+
validateProjectId(projectId);
|
|
60
|
+
|
|
61
|
+
const response = await makeManagementApiRequest<CreateCredentialInStoreResponse>(
|
|
62
|
+
`tenants/${tenantId}/projects/${projectId}/credential-stores/${storeId}/credentials`,
|
|
63
|
+
{
|
|
64
|
+
method: 'POST',
|
|
65
|
+
body: JSON.stringify({ key, value }),
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return response.data;
|
|
70
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface RuntimeConfig {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
PUBLIC_INKEEP_AGENTS_MANAGE_API_URL: string;
|
|
3
|
+
PUBLIC_INKEEP_AGENTS_RUN_API_URL: string;
|
|
4
|
+
PUBLIC_INKEEP_AGENTS_RUN_API_BYPASS_SECRET?: string;
|
|
5
|
+
PUBLIC_SIGNOZ_URL: string;
|
|
6
|
+
PUBLIC_NANGO_SERVER_URL?: string;
|
|
7
|
+
PUBLIC_NANGO_CONNECT_BASE_URL?: string;
|
|
8
8
|
}
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
* This returns the URL that should be used for redirect on the client side
|
|
9
9
|
*/
|
|
10
10
|
export function getOAuthLoginUrl({
|
|
11
|
-
|
|
11
|
+
PUBLIC_INKEEP_AGENTS_MANAGE_API_URL,
|
|
12
12
|
tenantId,
|
|
13
13
|
projectId,
|
|
14
14
|
id,
|
|
15
15
|
}: {
|
|
16
|
-
|
|
16
|
+
PUBLIC_INKEEP_AGENTS_MANAGE_API_URL: string;
|
|
17
17
|
tenantId: string;
|
|
18
18
|
projectId: string;
|
|
19
19
|
id: string;
|
|
@@ -52,10 +52,10 @@ export function getOAuthLoginUrl({
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
const url = `${
|
|
55
|
+
const url = `${PUBLIC_INKEEP_AGENTS_MANAGE_API_URL}/oauth/login?tenantId=${encodeURIComponent(tenantId)}&projectId=${encodeURIComponent(projectId)}&toolId=${encodeURIComponent(id)}`;
|
|
56
56
|
|
|
57
57
|
// Verify the final URL starts with our expected base
|
|
58
|
-
if (!url.startsWith(
|
|
58
|
+
if (!url.startsWith(PUBLIC_INKEEP_AGENTS_MANAGE_API_URL)) {
|
|
59
59
|
throw new Error('Invalid OAuth URL generated');
|
|
60
60
|
}
|
|
61
61
|
|