Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions agents-manage-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"react-runner": "^1.0.5",
"recharts": "2.15.4",
"remark-supersub": "^1.0.0",
"server-only": "^0.0.1",
"shiki": "^3.13.0",
"sonner": "^2.0.6",
"streamdown": "^1.4.0",
Expand Down
1 change: 1 addition & 0 deletions agents-manage-ui/src/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function LoginForm() {
id="password"
type="password"
placeholder="••••••••"
autoComplete="on"
value={formData.password}
onChange={(e) => setFormData({ ...formData, password: e.target.value })}
required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import type { FullProjectDefinition } from '@inkeep/agents-core';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import * as projectFullClient from '../../api/project-full';

Check failure on line 7 in agents-manage-ui/src/lib/actions/__tests__/project-full.test.ts

View workflow job for this annotation

GitHub Actions / ci

src/lib/actions/__tests__/project-full.test.ts

Error: [vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file. Read more: https://vitest.dev/api/vi.html#vi-mock ❯ src/lib/actions/__tests__/project-full.test.ts:7:1 Caused by: Caused by: Error: This module cannot be imported from a Client Component module. It should only be used from a Server Component. ❯ Object.<anonymous> ../node_modules/.pnpm/server-only@0.0.1/node_modules/server-only/index.js:1:7
import { ApiError } from '../../types/errors';
import { getFullProjectAction } from '../project-full';

vi.mock('../../api/project-full', async (importOriginal) => {
Expand Down Expand Up @@ -62,7 +63,7 @@
});

it('should handle API errors gracefully', async () => {
const apiError = new projectFullClient.ApiError(
const apiError = new ApiError(
{
code: 'not_found',
message: 'Project not found',
Expand Down
2 changes: 1 addition & 1 deletion agents-manage-ui/src/lib/actions/agent-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import type { AgentApiInsert } from '@inkeep/agents-core/client-exports';
import { revalidatePath } from 'next/cache';
import {
ApiError,
createAgent as apiCreateAgent,
createFullAgent as apiCreateFullAgent,
deleteFullAgent as apiDeleteFullAgent,
Expand All @@ -24,6 +23,7 @@ import {
type FullAgentDefinition,
FullAgentDefinitionSchema,
} from '../types/agent-full';
import { ApiError } from '../types/errors';
import type { TeamAgent } from '../types/team-agents';

/**
Expand Down
3 changes: 2 additions & 1 deletion agents-manage-ui/src/lib/actions/project-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
*/

import type { FullProjectDefinition } from '@inkeep/agents-core';
import { ApiError, getFullProject as apiGetFullProject } from '../api/project-full';
import { getFullProject as apiGetFullProject } from '../api/project-full';
import { ApiError } from '../types/errors';

/**
* Result type for server actions - follows a consistent pattern
Expand Down
6 changes: 2 additions & 4 deletions agents-manage-ui/src/lib/api/agent-full-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* inkeep-chat backend AgentFull REST API endpoints.
*/

'use server';

import type { AgentApiInsert } from '@inkeep/agents-core/client-exports';
import type {
Agent,
Expand All @@ -14,7 +16,6 @@ import type {
GetAgentResponse,
UpdateAgentResponse,
} from '../types/agent-full';
import { ApiError } from '../types/errors';
import type { ListResponse } from '../types/response';
import type { TeamAgent } from '../types/team-agents';
import { makeManagementApiRequest } from './api-config';
Expand Down Expand Up @@ -141,6 +142,3 @@ export async function deleteFullAgent(
method: 'DELETE',
});
}

// Export the error class for use in server actions
export { ApiError };
2 changes: 2 additions & 0 deletions agents-manage-ui/src/lib/api/api-config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'server-only';

/**
* API Configuration
*
Expand Down
4 changes: 2 additions & 2 deletions agents-manage-ui/src/lib/api/project-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* management backend for full project operations.
*/

'use server';

import type { FullProjectDefinition } from '@inkeep/agents-core';
import type { SingleResponse } from '../types/response';
import { makeManagementApiRequest } from './api-config';
Expand All @@ -25,5 +27,3 @@ export async function getFullProject(
`tenants/${tenantId}/project-full/${projectId}`
);
}

export { ApiError } from '../types/errors';
2 changes: 1 addition & 1 deletion agents-manage-ui/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export {

// API Client exports (for advanced use cases)
export {
ApiError,
createFullAgent,
deleteFullAgent,
getFullAgent,
Expand Down Expand Up @@ -45,3 +44,4 @@ export {
ToolApiSchema,
type UpdateAgentResponse,
} from './types/agent-full';
export { ApiError } from './types/errors';
Loading
Loading