Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
2a9e122
upd
dimaMachina Jan 17, 2026
5558659
remove useMemo imports
dimaMachina Jan 17, 2026
d4f460b
refactor useMemo
dimaMachina Jan 17, 2026
737e679
refactor useMemo
dimaMachina Jan 17, 2026
4d8e531
refactor useMemo
dimaMachina Jan 17, 2026
4dd6d20
refactor useMemo
dimaMachina Jan 17, 2026
50b4855
refactor useMemo
dimaMachina Jan 17, 2026
42ea4d6
refactor useMemo
dimaMachina Jan 17, 2026
da4b987
refactor useCallback imports
dimaMachina Jan 17, 2026
2e95783
refactor useCallback
dimaMachina Jan 17, 2026
6b11f26
refactor useCallback
dimaMachina Jan 17, 2026
87062bf
refactor useCallback
dimaMachina Jan 17, 2026
0d3526e
fix compiler errors
dimaMachina Jan 17, 2026
ea67a3f
fix compiler errors
dimaMachina Jan 17, 2026
89dbd2c
fix compiler errors
dimaMachina Jan 17, 2026
aed0bcf
fix compiler errors
dimaMachina Jan 17, 2026
495abdd
fix compiler errors
dimaMachina Jan 17, 2026
65d17b2
fix compiler errors
dimaMachina Jan 17, 2026
4b6a429
fix compiler errors
dimaMachina Jan 17, 2026
9efb2d5
fix compiler errors [skip ci]
dimaMachina Jan 17, 2026
cc81def
upd
dimaMachina Jan 18, 2026
f6028d1
Merge branch 'main' into prd-4966
dimaMachina Jan 18, 2026
a82b706
fix errors
dimaMachina Jan 18, 2026
6c89839
fix errors
dimaMachina Jan 18, 2026
85c0ddf
fix errors
dimaMachina Jan 18, 2026
173fcec
fix errors
dimaMachina Jan 18, 2026
0bf112d
fix errors
dimaMachina Jan 18, 2026
aaeeae3
fix errors
dimaMachina Jan 18, 2026
ef479ec
fix errors
dimaMachina Jan 18, 2026
6bbdc51
fix errors
dimaMachina Jan 18, 2026
ceebbc2
fix errors
dimaMachina Jan 18, 2026
5911c53
fix errors [skip ci]
dimaMachina Jan 18, 2026
a9ee0e7
fix errors [skip ci]
dimaMachina Jan 18, 2026
5b1a902
fix errors [skip ci]
dimaMachina Jan 18, 2026
f7b625b
fix errors [skip ci]
dimaMachina Jan 18, 2026
c241fb5
fix errors [skip ci]
dimaMachina Jan 18, 2026
865f504
fix errors [skip ci]
dimaMachina Jan 18, 2026
d2d5b68
fix errors [skip ci]
dimaMachina Jan 18, 2026
04443ce
fix errors [skip ci]
dimaMachina Jan 18, 2026
7422b16
fix errors [skip ci]
dimaMachina Jan 18, 2026
d2fb8d1
fix errors [skip ci]
dimaMachina Jan 18, 2026
e6956dd
fix errors [skip ci]
dimaMachina Jan 18, 2026
0c67983
fix errors [skip ci]
dimaMachina Jan 18, 2026
bffb7b6
fix errors [skip ci]
dimaMachina Jan 18, 2026
61ffbab
fix errors [skip ci]
dimaMachina Jan 18, 2026
a7b4f4c
fix errors [skip ci]
dimaMachina Jan 18, 2026
2780d71
fix errors [skip ci]
dimaMachina Jan 18, 2026
c03697b
fix errors [skip ci]
dimaMachina Jan 18, 2026
d07c4a4
fix errors [skip ci]
dimaMachina Jan 18, 2026
9f3afb2
fix errors [skip ci]
dimaMachina Jan 18, 2026
4bfb6f7
fix errors [skip ci]
dimaMachina Jan 18, 2026
d4d5abc
fix errors [skip ci]
dimaMachina Jan 18, 2026
0cb067e
fix errors [skip ci]
dimaMachina Jan 18, 2026
b314a04
fix errors [skip ci]
dimaMachina Jan 18, 2026
2c8fb1d
fix errors [skip ci]
dimaMachina Jan 18, 2026
3b5bf76
fix errors [skip ci]
dimaMachina Jan 18, 2026
6dd12bf
Merge branch 'react-compiler-for-docs' into prd-4966
dimaMachina Jan 18, 2026
f76de8b
fix errors [skip ci]
dimaMachina Jan 19, 2026
39cb4fd
fix errors [skip ci]
dimaMachina Jan 19, 2026
05035bd
fix errors [skip ci]
dimaMachina Jan 19, 2026
24b2952
fix errors [skip ci]
dimaMachina Jan 19, 2026
1296fc9
fix errors [skip ci]
dimaMachina Jan 19, 2026
1b9a4b9
fix errors [skip ci]
dimaMachina Jan 19, 2026
f6a6c9e
fix errors [skip ci]
dimaMachina Jan 19, 2026
40a4ac8
fix errors [skip ci]
dimaMachina Jan 19, 2026
ada3e21
fix errors [skip ci]
dimaMachina Jan 19, 2026
f8d1ffc
fix errors [skip ci]
dimaMachina Jan 19, 2026
82814a3
fix errors [skip ci]
dimaMachina Jan 19, 2026
282b5ba
fix errors [skip ci]
dimaMachina Jan 19, 2026
ae15644
fix errors [skip ci]
dimaMachina Jan 19, 2026
15fc4ff
fix errors [skip ci]
dimaMachina Jan 19, 2026
44c0584
fix errors [skip ci]
dimaMachina Jan 19, 2026
3f4bdf7
fix errors [skip ci]
dimaMachina Jan 19, 2026
937ded2
fix errors [skip ci]
dimaMachina Jan 19, 2026
eec26b5
fix errors [skip ci]
dimaMachina Jan 19, 2026
bc4168b
fix errors [skip ci]
dimaMachina Jan 19, 2026
3c813f4
fix errors [skip ci]
dimaMachina Jan 19, 2026
ecd9ca8
fix errors [skip ci]
dimaMachina Jan 19, 2026
8885fe8
fix errors [skip ci]
dimaMachina Jan 19, 2026
db26eef
fix errors [skip ci]
dimaMachina Jan 19, 2026
72469eb
fix errors [skip ci]
dimaMachina Jan 19, 2026
16a3598
format [skip ci]
dimaMachina Jan 19, 2026
5f8f923
fix errors [skip ci]
dimaMachina Jan 19, 2026
a707f52
fix errors [skip ci]
dimaMachina Jan 19, 2026
16f2119
fix errors [skip ci]
dimaMachina Jan 19, 2026
e052bce
fix errors [skip ci]
dimaMachina Jan 19, 2026
c082946
useWatch [skip ci]
dimaMachina Jan 19, 2026
d95285f
useWatch [skip ci]
dimaMachina Jan 19, 2026
8adea62
useWatch [skip ci]
dimaMachina Jan 19, 2026
464fbdd
useWatch [skip ci]
dimaMachina Jan 19, 2026
9ee4a75
useWatch [skip ci]
dimaMachina Jan 19, 2026
3194b9e
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
4a795fa
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
8593474
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
510741a
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
c62cab4
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
93bf8f1
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
e919c65
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
c97d0c6
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
f3a77ed
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
ccf991f
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
117cb55
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
cb0af5d
fix compiler errors [skip ci]
dimaMachina Jan 19, 2026
c611ce4
fix lint errors [skip ci]
dimaMachina Jan 19, 2026
b8012ab
fix lint errors [skip ci]
dimaMachina Jan 19, 2026
f0b6bb1
fix lint errors [skip ci]
dimaMachina Jan 19, 2026
dacd1d0
fix lint errors [skip ci]
dimaMachina Jan 19, 2026
32b70d9
fix lint errors [skip ci]
dimaMachina Jan 19, 2026
2393563
fix lint errors [skip ci]
dimaMachina Jan 19, 2026
3099573
fix lint errors [skip ci]
dimaMachina Jan 19, 2026
6b89312
fix lint errors [skip ci]
dimaMachina Jan 19, 2026
f65f92e
fix lint errors [skip ci]
dimaMachina Jan 19, 2026
388fa25
fix lint errors [skip ci]
dimaMachina Jan 19, 2026
07b4ea2
fix lint errors
dimaMachina Jan 19, 2026
0780958
lint
dimaMachina Jan 19, 2026
4acaa93
lint
dimaMachina Jan 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/perky-ends-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inkeep/agents-manage-ui": minor
---

setup react compiler for all dashboard components and pages
1 change: 0 additions & 1 deletion agents-manage-ui/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const nextConfig: NextConfig = {
},
output: 'standalone',
reactCompiler: {
compilationMode: 'annotation',
// Fail the build on any compiler diagnostic
panicThreshold: 'all_errors',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Layout: FC<LayoutProps<'/[tenantId]/projects/[projectId]/agents/[agentId]'
return () => {
setSidebarOpen({ isSidebarSessionOpen: true });
};
}, [setSidebarOpen]);
}, []);

// Generate suggestions from context config
useEffect(() => {
Expand All @@ -40,7 +40,7 @@ const Layout: FC<LayoutProps<'/[tenantId]/projects/[projectId]/agents/[agentId]'
contextVariables,
});
setVariableSuggestions(variables);
}, [contextConfig, setVariableSuggestions]);
}, [contextConfig]);

return (
<ReactFlowProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ export const Agent: FC<AgentProps> = ({

// Workaround for a React Compiler limitation.
// Todo: Support value blocks (conditional, logical, optional chaining, etc) within a try/catch statement
async function doRequest(): Promise<void> {
async function doRequest() {
const [fullProjectResult, toolsResult] = await Promise.all([
getFullProjectAction(tenantId, projectId),
options?.fetchTools ? fetchToolsAction(tenantId, projectId) : Promise.resolve(null),
Expand Down Expand Up @@ -913,7 +913,6 @@ export const Agent: FC<AgentProps> = ({
return false;
};

// biome-ignore lint/correctness/useExhaustiveDependencies: only on mount
useEffect(() => {
const onCompletion = () => {
// @ts-expect-error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { CredentialStoreType, DEFAULT_NANGO_STORE_ID } from '@inkeep/agents-core/client-exports';
import type { ApiProvider } from '@nangohq/types';
import { useRouter } from 'next/navigation';
import { use, useCallback, useEffect, useState } from 'react';
import { use, useEffect, useState } from 'react';
import { toast } from 'sonner';
import { requiresCredentialForm } from '@/components/credentials/views/auth-form-config';
import { GenericAuthForm } from '@/components/credentials/views/generic-auth-form';
Expand Down Expand Up @@ -32,103 +32,110 @@ function ProviderSetupPage({

const provider = providers?.find((p: ApiProvider) => encodeURIComponent(p.name) === providerId);

const handleNangoConnect = useCallback(
async (event: any) => {
if (!provider || event.type !== 'connect') return;
const handleNangoConnect = async (event: any) => {
if (!provider || event.type !== 'connect') return;

if (!event.payload?.connectionId || !event.payload?.providerConfigKey) {
console.error('Missing required connection data:', event.payload);
toast.error('Invalid connection data received');
return;
}
if (!event.payload?.connectionId || !event.payload?.providerConfigKey) {
console.error('Missing required connection data:', event.payload);
toast.error('Invalid connection data received');
return;
}
// Workaround for a React Compiler limitation.
// Todo: Support value blocks (conditional, logical, optional chaining, etc) within a try/catch statement
function doRequest(provider: ApiProvider) {
return findOrCreateCredential(tenantId, projectId, {
id: generateId(),
name: provider.name,
type: CredentialStoreType.nango,
createdBy: user?.email ?? undefined,
credentialStoreId: DEFAULT_NANGO_STORE_ID,
retrievalParams: {
connectionId: event.payload.connectionId,
providerConfigKey: event.payload.providerConfigKey,
provider: provider.name,
authMode: provider.auth_mode,
},
});
}

try {
await findOrCreateCredential(tenantId, projectId, {
id: generateId(),
name: provider.name,
type: CredentialStoreType.nango,
createdBy: user?.email ?? undefined,
credentialStoreId: DEFAULT_NANGO_STORE_ID,
retrievalParams: {
connectionId: event.payload.connectionId,
providerConfigKey: event.payload.providerConfigKey,
provider: provider.name,
authMode: provider.auth_mode,
},
});

toast.success('Credential created successfully');
router.push(`/${tenantId}/projects/${projectId}/credentials`);
} catch (credentialError) {
console.error('Failed to create credential record:', credentialError);
if (credentialError instanceof Error && credentialError.message?.includes('database')) {
toast.error('Failed to save credential. Please check your connection and try again.');
} else {
toast.error('Failed to save credential. Please try again.');
}
try {
await doRequest(provider);
toast.success('Credential created successfully');
router.push(`/${tenantId}/projects/${projectId}/credentials`);
} catch (credentialError) {
console.error('Failed to create credential record:', credentialError);
if (credentialError instanceof Error && credentialError.message?.includes('database')) {
toast.error('Failed to save credential. Please check your connection and try again.');
} else {
toast.error('Failed to save credential. Please try again.');
}
},
[provider, tenantId, projectId, router, user?.email]
);
}
};

const handleCreateCredential = useCallback(
async (credentials?: Record<string, any>) => {
if (!provider) return;

const { data: organizationData } = await authClient.organization.getFullOrganization();

setLoading(true);
setHasAttempted(true);
try {
const connectToken = await createProviderConnectSession({
providerName: provider.name,
uniqueKey: provider.name,
displayName: provider.name,
credentials:
credentials && provider.auth_mode
? ({
...credentials,
type: provider.auth_mode,
} as any)
: undefined,
endUserId: user?.id,
endUserEmail: user?.email,
endUserDisplayName: user?.name,
organizationId: organizationData?.id,
organizationDisplayName: organizationData?.name,
});

openNangoConnect({
sessionToken: connectToken,
onEvent: handleNangoConnect,
});
} catch (error) {
console.error('Failed to create credential:', error);

if (error instanceof NangoError) {
if (error.operation === 'createConnectSession') {
toast.error('Failed to start authentication flow. Please try again.');
} else {
toast.error('Service temporarily unavailable. Please try again later.');
}
} else if (error instanceof Error && error.message?.includes('NANGO_SECRET_KEY')) {
toast.error('Configuration error. Please contact support.');
const handleCreateCredential = async (credentials?: Record<string, any>) => {
if (!provider) return;

const { data: organizationData } = await authClient.organization.getFullOrganization();

setLoading(true);
setHasAttempted(true);
// Workaround for a React Compiler limitation.
// Todo: Support value blocks (conditional, logical, optional chaining, etc) within a try/catch statement
async function doRequest(provider: ApiProvider) {
const connectToken = await createProviderConnectSession({
providerName: provider.name,
uniqueKey: provider.name,
displayName: provider.name,
credentials:
credentials && provider.auth_mode
? ({
...credentials,
type: provider.auth_mode,
} as any)
: undefined,
endUserId: user?.id,
endUserEmail: user?.email,
endUserDisplayName: user?.name,
organizationId: organizationData?.id,
organizationDisplayName: organizationData?.name,
});
openNangoConnect({
sessionToken: connectToken,
onEvent: handleNangoConnect,
});
}
try {
await doRequest(provider);
} catch (error) {
console.error('Failed to create credential:', error);

if (error instanceof NangoError) {
if (error.operation === 'createConnectSession') {
toast.error('Failed to start authentication flow. Please try again.');
} else {
toast.error('Failed to create credential. Please try again.');
toast.error('Service temporarily unavailable. Please try again later.');
}
} finally {
setLoading(false);
} else if (error instanceof Error && error.message?.includes('NANGO_SECRET_KEY')) {
toast.error('Configuration error. Please contact support.');
} else {
toast.error('Failed to create credential. Please try again.');
}
},
[provider, openNangoConnect, handleNangoConnect, user?.id, user?.email, user?.name, authClient]
);
}
setLoading(false);
};

// Auto-connect when no credential form is required
useEffect(() => {
if (provider && !requiresCredentialForm(provider.auth_mode) && !loading && !hasAttempted) {
handleCreateCredential();
}
}, [provider, loading, hasAttempted, handleCreateCredential]);
}, [
provider,
loading,
hasAttempted,
// biome-ignore lint/correctness/useExhaustiveDependencies: false positive, variable is stable and optimized by the React Compiler
handleCreateCredential,
]);

const handleBack = () => {
router.push(`/${tenantId}/projects/${projectId}/credentials/new/providers`);
Expand Down
30 changes: 21 additions & 9 deletions agents-manage-ui/src/app/[tenantId]/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { useParams } from 'next/navigation';
import { useCallback, useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { ErrorContent } from '@/components/errors/full-page-error';
import { MembersTable } from '@/components/settings/members-table';
import { CopyableSingleLineCode } from '@/components/ui/copyable-single-line-code';
Expand All @@ -16,6 +16,12 @@ type FullOrganization = NonNullable<

type Member = FullOrganization['members'][number];

// Workaround for a React Compiler limitation.
// Todo: Support value blocks (conditional, logical, optional chaining, etc) within a try/catch statement
function getErrorMessage(error: unknown) {
return error instanceof Error ? error.message : 'Failed to fetch organization';
}

export default function SettingsPage() {
const authClient = useAuthClient();
const { tenantId } = useParams<{ tenantId: string }>();
Expand All @@ -24,10 +30,11 @@ export default function SettingsPage() {
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);

const fetchOrganization = useCallback(async () => {
const fetchOrganization = async () => {
if (!tenantId) return;

try {
// Workaround for a React Compiler limitation.
// Todo: Support value blocks (conditional, logical, optional chaining, etc) within a try/catch statement
async function doRequest() {
const [orgResult, memberResult] = await Promise.all([
authClient.organization.getFullOrganization({
query: {
Expand All @@ -50,16 +57,21 @@ export default function SettingsPage() {
if (memberResult.data) {
setCurrentMember(memberResult.data as Member);
}
}
try {
await doRequest();
} catch (err) {
setError(err instanceof Error ? err.message : 'Failed to fetch organization');
} finally {
setLoading(false);
setError(getErrorMessage(err));
}
}, [tenantId, authClient]);
setLoading(false);
};

useEffect(() => {
fetchOrganization();
}, [fetchOrganization]);
}, [
// biome-ignore lint/correctness/useExhaustiveDependencies: false positive, variable is stable and optimized by the React Compiler
fetchOrganization,
]);

if (loading) {
return <SettingsLoadingSkeleton />;
Expand Down
19 changes: 14 additions & 5 deletions agents-manage-ui/src/app/accept-invitation/[invitationId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ export default function AcceptInvitationPage() {
setIsLoading(false);
return;
}

try {
// Workaround for a React Compiler limitation.
// Todo: Support value blocks (conditional, logical, optional chaining, etc) within a try/catch statement
async function doRequest() {
const result = await authClient.organization.getInvitation({
query: { id: invitationId },
});
Expand All @@ -49,11 +50,13 @@ export default function AcceptInvitationPage() {
if ('data' in result && result.data) {
setInvitation(result.data);
}
}
try {
await doRequest();
} catch {
setError('Failed to load invitation');
} finally {
setIsLoading(false);
}
setIsLoading(false);
}

fetchInvitation();
Expand All @@ -69,7 +72,9 @@ export default function AcceptInvitationPage() {
setIsAccepting(true);
setError(null);

try {
// Workaround for a React Compiler limitation.
// Todo: Support value blocks (conditional, logical, optional chaining, etc) within a try/catch statement
async function doRequest() {
const result = await authClient.organization.acceptInvitation({
invitationId,
});
Expand Down Expand Up @@ -101,6 +106,10 @@ export default function AcceptInvitationPage() {
router.push('/');
}
}, 2000);
}

try {
await doRequest();
} catch (err) {
setError(err instanceof Error ? err.message : 'Failed to accept invitation');
setIsAccepting(false);
Expand Down
Loading
Loading