Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat(openapi): expose goal, task, memory, notification and signal REST resources (#20221)

Arvin Xu9b64111cc921
diff --git a/apps/server/src/routers/lambda/notification.ts b/apps/server/src/routers/lambda/notification.ts
index 6752beb3d82..02ec26be024 100644
--- a/apps/server/src/routers/lambda/notification.ts
+++ b/apps/server/src/routers/lambda/notification.ts
@@ -3,9 +3,12 @@ import { z } from 'zod';
import { withScopedPermission } from '@/business/server/trpc-middlewares/rbacPermission';
import { wsCompatProcedure } from '@/business/server/trpc-middlewares/workspaceAuth';
import { NotificationModel } from '@/database/models/notification';
-import { ResourceTransferRequestModel } from '@/database/models/resourceTransferRequest';
import { router } from '@/libs/trpc/lambda';
import { serverDatabase } from '@/libs/trpc/lambda/middleware';
+import {
+ resolveNavigationCounts,
+ resolveUnreadCount,
+} from '@/server/services/notification/inboxCounts';
const notificationProcedure = wsCompatProcedure.use(serverDatabase).use(async (opts) => {
const { ctx } = opts;
@@ -25,25 +28,6 @@ const notificationWriteProcedure = notificationProcedure.use(
withScopedPermission('message:create'),
);
-/**
- * Live transfer requests rendered as inbox cards for this user β€” incoming
- * (recipient answers) AND outgoing (initiator may withdraw), matching what
- * `Content` renders from `listMine`. Empty in personal mode. Call this BEFORE
- * snapshotting any notification counts: `listPendingForUser` lazily expires
- * overdue transfers (settling their linked rows as read), so counting first
- * would preserve a ghost unread row for a request this very call just expired.
- */
-const listLiveTransferCards = async (ctx: {
- serverDB: ConstructorParameters<typeof ResourceTransferRequestModel>[0];
- userId: string;
- workspaceId?: string | null;
-}) => {
- if (!ctx.workspaceId) return [];
-
- const transferModel = new ResourceTransferRequestModel(ctx.serverDB, ctx.workspaceId);
- return transferModel.listPendingForUser(ctx.userId);
-};
-
export const notificationRouter = router({
archive: notificationWriteProcedure
.input(z.object({ id: z.string() }))
@@ -56,42 +40,7 @@ export const notificationRouter = router({
}),
navigationCounts: notificationProcedure.query(async ({ ctx }) => {
- // The pending category is action-driven, not read-driven: while a
- // transfer request awaits the user, its count must keep prompting even
- // after the linked inbox row was read. Swap the linked rows out of the
- // row-based counts and count the live request cards themselves β€”
- // outgoing (withdrawable) cards render in the unread view too, so they
- // count the same as incoming ones.
- const cards = await listLiveTransferCards(ctx);
- const counts = await ctx.notificationModel.getNavigationCounts();
- if (cards.length === 0) return counts;
-
- const linked = await ctx.notificationModel.countLinkedToTransfers(
- cards.map((request) => request.id),
- );
- // Each live request renders exactly one UNREAD card, replacing
- // its linked row (when one exists) in every tally β€” a request whose
- // linked row is missing or archived still shows a card, so it must still
- // count, while a linked row that was read is suppressed by the card and
- // must leave the read tally it would otherwise inflate.
- const linkedRead = linked.total - linked.unread;
- const unreadDelta = cards.length - linked.unread;
- const totalDelta = cards.length - linked.total;
- const pending = counts.find((item) => item.category === 'pending');
- if (pending) {
- pending.unreadCount = Math.max(0, pending.unreadCount + unreadDelta);
- pending.readCount = Math.max(0, pending.readCount - linkedRead);
- pending.totalCount = Math.max(0, pending.totalCount + totalDelta);
- } else if (unreadDelta > 0 || totalDelta > 0) {
- counts.push({
- category: 'pending',
- readCount: 0,
- totalCount: Math.max(0, totalDelta),
- unreadCount: Math.max(0, unreadDelta),
- });
- }
-
- return counts;
+ return resolveNavigationCounts(ctx);
}),
list: notificationProcedure
@@ -119,17 +68,7 @@ export const notificationRouter = router({
}),
unreadCount: notificationProcedure.query(async ({ ctx }) => {
- // The header bell must keep prompting while a transfer awaits the user β€”
- // even if the linked row was read/archived or its delivery failed β€” so
- // apply the same live-transfer reconciliation as `navigationCounts`.
- const cards = await listLiveTransferCards(ctx);
- const unread = await ctx.notificationModel.getUnreadCount();
- if (cards.length === 0) return unread;
-
- const linked = await ctx.notificationModel.countLinkedToTransfers(
- cards.map((request) => request.id),
- );
- return Math.max(0, unread + cards.length - linked.unread);
+ return resolveUnreadCount(ctx);
}),
});
diff --git a/apps/server/src/routers/lambda/task.ts b/apps/server/src/routers/lambda/task.ts
index 247f7b13a5f..355f1c848bd 100644
--- a/apps/server/src/routers/lambda/task.ts
+++ b/apps/server/src/routers/lambda/task.ts
@@ -1,15 +1,9 @@
import { TASK_STATUSES } from '@lobechat/builtin-tool-task';
import { AgentRuntimeErrorType } from '@lobechat/model-runtime';
import type { TaskListItem, TaskParticipant, TaskVerifyConfig } from '@lobechat/types';
-import {
- isValidTimezone,
- validateCronPattern,
- validateScheduleUpdate,
-} from '@lobechat/utils/cronEval';
import { TRPCError } from '@trpc/server';
import { z } from 'zod';
-import { notifyTaskAssigned } from '@/business/server/task/notifyTaskAssigned';
import type { TaskCommentActivityRecipient } from '@/business/server/task/notifyTaskCommentActivity';
import { notifyTaskCommentActivity } from '@/business/server/task/notifyTaskCommentActivity';
import { withScopedPermission } from '@/business/server/trpc-middlewares/rbacPermission';
@@ -28,7 +22,17 @@ import { markSilentTRPCErrorLog } from '@/libs/trpc/utils/errorLogger';
import { EditLockService } from '@/server/services/editLock';
import { publishResourceEvent } from '@/server/services/resourceEvents';
import { TaskService } from '@/server/services/task';
+import { notifyAssignedBestEffort } from '@/server/services/task/assignmentNotification';
import { TaskIntentService } from '@/server/services/task/intent';
+import {
+ assertAssigneeAgentBelongsToUser,
+ resolveTaskPatchInvariants,
+} from '@/server/services/task/patchValidation';
+import {
+ assertResultingScheduleValid,
+ schedulePatternSchema,
+ scheduleTimezoneSchema,
+} from '@/server/services/task/scheduleValidation';
import { TaskLifecycleService } from '@/server/services/taskLifecycle';
import { TaskRunnerService } from '@/server/services/taskRunner';
import { AcceptanceService } from '@/server/services/verify/acceptanceService';
@@ -80,23 +84,6 @@ const taskVerifyConfigPatchSchema = z.object({
verifyRubricId: z.string().nullish(),
});
-// Reject cron the schedule dispatcher cannot evaluate at write time, instead of
-// storing it and letting it silently never fire. An empty string still clears.
-const schedulePatternSchema = z.string().superRefine((pattern, ctx) => {
- if (!pattern) return;
- const result = validateCronPattern(pattern, null);
- if (!result.valid) {
- ctx.addIssue({
- code: 'custom',
- message: `Invalid schedulePattern "${pattern}": ${result.error}`,
- });
- }
-});
-
-const scheduleTimezoneSchema = z.string().refine((tz) => !tz || isValidTimezone(tz), {
- message: 'scheduleTimezone must be an IANA timezone such as "Asia/Shanghai"',
-});
-
// Priority: 0=None, 1=Urgent, 2=High, 3=Normal, 4=Low
const createSchema = z.object({
assigneeAgentId: z.string().optional(),
@@ -214,29 +201,6 @@ const groupListSchema = z
});
// Helper: resolve id/identifier and throw if not found
-/**
- * The field schemas check `schedulePattern` and `scheduleTimezone` one at a
- * time; this checks the pair the task ends up with, filling any field the
- * input leaves out from the stored row, so e.g. a pattern-only update cannot
- * keep a legacy invalid timezone and still report success.
- */
-function assertResultingScheduleValid(
- stored: { schedulePattern?: string | null; scheduleTimezone?: string | null } | null,
- input: {
- automationMode?: string | null;
- schedulePattern?: string | null;
- scheduleTimezone?: string | null;
- },
-) {
- const result = validateScheduleUpdate(
- stored ? { pattern: stored.schedulePattern, timezone: stored.scheduleTimezone } : null,
- input,
- );
- if (result && !result.valid) {
- throw new TRPCError({ code: 'BAD_REQUEST', message: `Invalid schedule: ${result.error}` });
- }
-}
-
async function resolveOrThrow(model: TaskModel, id: string) {
const task = await model.resolve(id);
if (!task) throw new TRPCError({ code: 'NOT_FOUND', message: 'Task not found' });
@@ -329,63 +293,6 @@ function notifyCommentActivityBestEffort(
});
}
-/**
- * Assignment ping (Linear-style), delivered after the response as best-effort
- * work. Silent for self-assignment; the assignee lock already guarantees the
- * member is active and can open the task (`assertAssigneeUserVisibilityCompat`
- * rejects private tasks assigned to anyone but their creator). Callers decide
- * whether the assignee actually changed.
- */
-function notifyAssignedBestEffort(
- ctx: { userId: string; workspaceId?: string | null },
- task: {
- assigneeUserId: string | null;
- id: string;
- identifier: string;
- name: string | null;
- },
-) {
- const { assigneeUserId } = task;
- if (!assigneeUserId || assigneeUserId === ctx.userId) return;
-
- const params = {
- actorUserId: ctx.userId,
- assigneeUserId,
- taskId: task.id,
- taskIdentifier: task.identifier,
- taskName: task.name,
- workspaceId: ctx.workspaceId ?? undefined,
- };
- after(async () => {
- try {
- await notifyTaskAssigned(params);
- } catch (error) {
- console.error('[task] Failed to send assignment notification', error);
- }
- });
-}
-
-async function assertAssigneeAgentBelongsToUser(
- db: LobeChatDatabase,
- callerCtx: { userId: string; workspaceId?: string },
- assigneeAgentId?: string | null,
-) {
- if (!assigneeAgentId) return;
-
- try {
- await assertAgentUsableBy(db, assigneeAgentId, callerCtx);
- } catch (error) {
- if (error instanceof TRPCError && error.code === 'NOT_FOUND') {
- // Preserve the task-context message so the UI surfaces "Assignee agent
- // not found" instead of the generic "Agent not found". Cross-user access
- // to a private agent still resolves to NOT_FOUND, never FORBIDDEN, so we
- // don't leak existence of someone else's private agent.
- throw new TRPCError({ code: 'NOT_FOUND', message: 'Assignee agent not found' });
- }
- throw error;
- }
-}
-
/**
* Who an activity row is attributed to.
*
@@ -417,40 +324,6 @@ async function resolveActivityActor(
return { agentId: claimedAgentId ?? null, userId: ctx.userId };
}
-async function resolveSafeParentTaskId(
- model: TaskModel,
- taskId: string,
- parentTaskId: string | null,
-): Promise<string | null> {
- if (parentTaskId === null) return null;
-
- const parent = await resolveOrThrow(model, parentTaskId);
- if (parent.id === taskId) {
- throw new TRPCError({
- code: 'BAD_REQUEST',
- message: 'Task cannot be parented to itself',
- });
- }
-
- const descendants = await model.findAllDescendants(taskId);
- if (descendants.some((task) => task.id === parent.id)) {
- throw new TRPCError({
- code: 'BAD_REQUEST',
- message: 'Task cannot be parented to its own descendant',
- });
- }
-
- const task = await resolveOrThrow(model, taskId);
- if (task.projectId !== parent.projectId) {
- throw new TRPCError({
- code: 'BAD_REQUEST',
- message: 'Parent task must belong to the same project',
- });
- }
-
- return parent.id;
-}
-
export const taskRouter = router({
/**
* Read a composer draft and report what it means β€” a name, the outcome as
@@ -1506,70 +1379,20 @@ export const taskRouter = router({
try {
const model = ctx.taskModel;
const actor = await resolveActivityActor(ctx, actorAgentId);
- await assertAssigneeAgentBelongsToUser(
- ctx.serverDB,
- { userId: ctx.userId, workspaceId: ctx.workspaceId ?? undefined },
- data.assigneeAgentId,
- );
- const resolved = await resolveOrThrow(model, id);
- assertResultingScheduleValid(resolved, data);
-
- // Collaborative edit lock: reject writes to a workspace task another member
- // is actively editing. Inert until a client acquires the lock.
- if (ctx.workspaceId) {
- const blockedBy = await ctx.editLockService.getBlockingHolder('task', resolved.id);
- if (blockedBy) {
- throw new TRPCError({
- cause: { data: { code: 'DocumentLocked' } },
- code: 'CONFLICT',
- message: 'Task is being edited by another user',
- });
- }
- }
-
- // Reject changing the assignee to a private agent on a public task β€”
- // a public task must never be assigned to a private agent.
- // `undefined` means "no change"; `null` clears the assignee and is
- // always safe.
- if (data.assigneeAgentId) {
- const agentVisibility = await ctx.agentModel.getAgentVisibility(data.assigneeAgentId);
- ctx.taskService.assertAgentVisibilityCompat(resolved.visibility, agentVisibility);
- }
-
- // A private task can only be assigned to its creator β€” the assignee
- // would otherwise never see the task. `null` clears and is always safe.
- ctx.taskService.assertAssigneeUserVisibilityCompat(
- resolved.visibility,
- data.assigneeUserId,
- resolved.createdByUserId,
+ // Hierarchy, visibility and assignment invariants β€” shared with the
+ // REST patch boundary so the two cannot drift.
+ const { data: normalizedUpdateData, resolved } = await resolveTaskPatchInvariants(
+ {
+ agentModel: ctx.agentModel,
+ editLockService: ctx.editLockService,
+ serverDB: ctx.serverDB,
+ taskModel: model,
+ taskService: ctx.taskService,
+ userId: ctx.userId,
+ workspaceId: ctx.workspaceId ?? undefined,
+ },
+ { data, id, parentTaskId },
);
-
- const resolvedParentTaskId =
- parentTaskId === undefined
- ? undefined
- : await resolveSafeParentTaskId(model, resolved.id, parentTaskId);
-
- // Reparenting a public task under a private one breaks the parent
- // visibility invariant β€” a subtask cannot be more public than its
- // parent (otherwise workspace members would still see the child while
- // its new parent is hidden). `undefined` means "no change"; `null`
- // clears the parent and is always safe.
- if (resolvedParentTaskId) {
- const newParent = await model.findById(resolvedParentTaskId);
- ctx.taskService.assertParentVisibilityCompat(resolved.visibility, newParent?.visibility);
- }
-
- const updateData =
- parentTaskId === undefined ? data : { ...data, parentTaskId: resolvedParentTaskId };
- // `instruction` is the markdown source of truth while `editorData` is its
- // rich-text mirror. Text-only callers (for example the editTask builtin)
- // cannot produce Lexical JSON, so discard the stale mirror and let the
- // editor rebuild from markdown. Callers that provide both fields keep
- // their explicit editor state.
- const normalizedUpdateData =
- updateData.instruction !== undefined && updateData.editorData === undefined
- ? { ...updateData, editorData: null }
- : updateData;
// Agent attribution comes from `resolveActivityActor` above. The
// assignment activity is written inside this update's own transaction
// (see `TaskModel.updateWithLog`), so a concurrent reassignment cannot
diff --git a/apps/server/src/services/goal/scheduler/impls/local.ts b/apps/server/src/services/goal/scheduler/impls/local.ts
index 76684a918fe..1ce1f5b23a6 100644
--- a/apps/server/src/services/goal/scheduler/impls/local.ts
+++ b/apps/server/src/services/goal/scheduler/impls/local.ts
@@ -1,6 +1,5 @@
import debug from 'debug';
-import { advanceGoal } from '../../advanceGoal';
import type { GoalSchedulerImpl, ScheduleGoalAdvanceParams } from './type';
const log = debug('goal-scheduler:local');
@@ -21,6 +20,10 @@ export class LocalGoalScheduler implements GoalSchedulerImpl {
const timer = setTimeout(async () => {
this.pending.delete(scheduleId);
try {
+ // Loaded here rather than at module scope: the advance runner imports
+ // `GoalService`, which reaches this scheduler through the goal graph, so
+ // a static import would close a module cycle (`lint:circular`).
+ const { advanceGoal } = await import('../../advanceGoal');
await advanceGoal({ goalId, trigger, userId, workspaceId });
} catch (error) {
// Never surface: an advance is best-effort, and the sweep retries.
diff --git a/apps/server/src/services/notification/inboxCounts.ts b/apps/server/src/services/notification/inboxCounts.ts
new file mode 100644
index 00000000000..d583748eee1
--- /dev/null
+++ b/apps/server/src/services/notification/inboxCounts.ts
@@ -0,0 +1,95 @@
+import type { NotificationModel } from '@/database/models/notification';
+import { ResourceTransferRequestModel } from '@/database/models/resourceTransferRequest';
+import type { LobeChatDatabase } from '@/database/type';
+
+export type NotificationNavigationCount = Awaited<
+ ReturnType<NotificationModel['getNavigationCounts']>
+>[number];
+
+type TransferCard = Awaited<ReturnType<ResourceTransferRequestModel['listPendingForUser']>>[number];
+
+export interface InboxCountContext {
+ notificationModel: NotificationModel;
+ serverDB: LobeChatDatabase;
+ userId: string;
+ workspaceId?: string | null;
+}
+
+/**
+ * Live transfer requests rendered as inbox cards for this user β€” incoming
+ * (recipient answers) AND outgoing (initiator may withdraw), matching what
+ * `Content` renders from `listMine`. Empty in personal mode. Call this BEFORE
+ * snapshotting any notification counts: `listPendingForUser` lazily expires
+ * overdue transfers (settling their linked rows as read), so counting first
+ * would preserve a ghost unread row for a request this very call just expired.
+ */
+export const listLiveTransferCards = async (ctx: InboxCountContext): Promise<TransferCard[]> => {
+ if (!ctx.workspaceId) return [];
+
+ const transferModel = new ResourceTransferRequestModel(ctx.serverDB, ctx.workspaceId);
+ return transferModel.listPendingForUser(ctx.userId);
+};
+
+/**
+ * Unread count for the header bell, reconciled against live transfer requests.
+ *
+ * A pending transfer keeps prompting even if its linked inbox row was
+ * read/archived or its delivery failed, so the raw row count undercounts the
+ * inbox and the two numbers would disagree. Shared by every transport (the
+ * tRPC router the in-app bell calls and the REST route behind the SDK) so the
+ * reconciliation cannot drift between them.
+ */
+export const resolveUnreadCount = async (ctx: InboxCountContext): Promise<number> => {
+ const cards = await listLiveTransferCards(ctx);
+ const unread = await ctx.notificationModel.getUnreadCount();
+ if (cards.length === 0) return unread;
+
+ const linked = await ctx.notificationModel.countLinkedToTransfers(
+ cards.map((request) => request.id),
+ );
+ return Math.max(0, unread + cards.length - linked.unread);
+};
+
+/**
+ * Per-category navigation counts, reconciled against live transfer requests.
+ *
+ * The pending category is action-driven, not read-driven: while a transfer
+ * request awaits the user, its count must keep prompting even after the linked
+ * inbox row was read. Swap the linked rows out of the row-based counts and
+ * count the live request cards themselves β€” outgoing (withdrawable) cards
+ * render in the unread view too, so they count the same as incoming ones.
+ */
+export const resolveNavigationCounts = async (
+ ctx: InboxCountContext,
+): Promise<NotificationNavigationCount[]> => {
+ const cards = await listLiveTransferCards(ctx);
+ const counts = await ctx.notificationModel.getNavigationCounts();
+ if (cards.length === 0) return counts;
+
+ const linked = await ctx.notificationModel.countLinkedToTransfers(
+ cards.map((request) => request.id),
+ );
+ // Each live request renders exactly one UNREAD card, replacing
+ // its linked row (when one exists) in every tally β€” a request whose
+ // linked row is missing or archived still shows a card, so it must still
+ // count, while a linked row that was read is suppressed by the card and
+ // must leave the read tally it would otherwise inflate.
+ const linkedRead = linked.total - linked.unread;
+ const unreadDelta = cards.length - linked.unread;
+ const totalDelta = cards.length - linked.total;
+ const pending = counts.find((item) => item.category === 'pending');
+ if (pending) {
+ pending.unreadCount = Math.max(0, pending.unreadCount + unreadDelta);
+ pending.readCount = Math.max(0, pending.readCount - linkedRead);
+ pending.totalCount = Math.max(0, pending.totalCount + totalDelta);
+ } else if (unreadDelta > 0 || totalDelta > 0) {
+ counts.push({
+ category: 'pending',
+ readCount: 0,
+ totalCount: Math.max(0, totalDelta),
+ unreadCount: Math.max(0, unreadDelta),
+ });
+ }
+
+ return counts;
+};
diff --git a/apps/server/src/services/task/assignmentNotification.ts b/apps/server/src/services/task/assignmentNotification.ts
new file mode 100644
index 00000000000..efa8fa235af
--- /dev/null
+++ b/apps/server/src/services/task/assignmentNotification.ts
@@ -0,0 +1,44 @@
+import { notifyTaskAssigned } from '@/business/server/task/notifyTaskAssigned';
+import { after } from '@/server/utils/scheduleAfterResponse';
+
+/**
+ * Assignment ping (Linear-style), delivered after the response as best-effort
+ * work. Silent for self-assignment; the assignee lock already guarantees the
+ * member is active and can open the task (`assertAssigneeUserVisibilityCompat`
+ * rejects private tasks assigned to anyone but their creator). Callers decide
+ * whether the assignee actually changed.
+ *
+ * Shared by every write boundary that can assign a task β€” the tRPC mutation the
+ * in-app editor calls and the REST create/patch the OpenAPI SDK is generated
+ * from β€” so a task assigned through either one lands in the assignee's inbox
+ * and the two cannot drift.
+ */
+export const notifyAssignedBestEffort = (
+ ctx: { userId: string; workspaceId?: string | null },
+ task: {
+ assigneeUserId: string | null;
+ id: string;
+ identifier: string;
+ name: string | null;
+ },
+): void => {
+ const { assigneeUserId } = task;
+ if (!assigneeUserId || assigneeUserId === ctx.userId) return;
+
+ const params = {
+ actorUserId: ctx.userId,
+ assigneeUserId,
+ taskId: task.id,
+ taskIdentifier: task.identifier,
+ taskName: task.name,
+ workspaceId: ctx.workspaceId ?? undefined,
+ };
+
+ after(async () => {
+ try {
+ await notifyTaskAssigned(params);
+ } catch (error) {
+ console.error('[task] Failed to send assignment notification', error);
+ }
+ });
+};
diff --git a/apps/server/src/services/task/patchValidation.test.ts b/apps/server/src/services/task/patchValidation.test.ts
new file mode 100644
index 00000000000..5aa5f393909
--- /dev/null
+++ b/apps/server/src/services/task/patchValidation.test.ts
@@ -0,0 +1,226 @@
+// @vitest-environment node
+import { TRPCError } from '@trpc/server';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+import { resolveTaskPatchInvariants } from './patchValidation';
+
+const { assertAgentUsableByMock } = vi.hoisted(() => ({ assertAgentUsableByMock: vi.fn() }));
+
+vi.mock('@/database/utils/agent-access', () => ({
+ assertAgentUsableBy: assertAgentUsableByMock,
+}));
+
+const CALLER = 'me';
+const WORKSPACE = 'ws-1';
+
+/** The row `TaskModel.resolve` hands back for `id`. */
+const storedTask = (id: string, overrides: Record<string, unknown> = {}) => ({
+ createdByUserId: CALLER,
+ id,
+ projectId: 'project-1',
+ schedulePattern: null,
+ scheduleTimezone: null,
+ visibility: 'public' as const,
+ ...overrides,
+});
+
+/**
+ * The fake task model resolves by id, like the real one β€” a fixture that
+ * returned the same row for every id would make the self-parent guard fire in
+ * every hierarchy case and hide the check under test.
+ */
+const buildContext = (rows: Record<string, Record<string, unknown>> = {}) => {
+ const taskModel = {
+ findAllDescendants: vi.fn().mockResolvedValue([]),
+ findById: vi.fn().mockResolvedValue({ id: 'parent-1', projectId: 'project-1' }),
+ resolve: vi.fn(async (id: string) => storedTask(id, rows[id])),
+ };
+ const taskService = {
+ assertAgentVisibilityCompat: vi.fn(),
+ assertAssigneeUserVisibilityCompat: vi.fn(),
+ assertParentVisibilityCompat: vi.fn(),
+ };
+ const agentModel = { getAgentVisibility: vi.fn().mockResolvedValue('public') };
+ const editLockService = { getBlockingHolder: vi.fn().mockResolvedValue(null) };
+
+ return {
+ agentModel,
+ context: {
+ agentModel,
+ editLockService,
+ serverDB: {} as never,
+ taskModel: taskModel as never,
+ taskService: taskService as never,
+ userId: CALLER,
+ workspaceId: WORKSPACE,
+ },
+ editLockService,
+ taskModel,
+ taskService,
+ };
+};
+
+describe('resolveTaskPatchInvariants hierarchy', () => {
+ beforeEach(() => {
+ vi.resetAllMocks();
+ });
+
+ it('refuses parenting a task to itself', async () => {
+ const { context } = buildContext();
+ const patch = { parentTaskId: 'task-1' };
+
+ await expect(
+ resolveTaskPatchInvariants(context, { data: patch, id: 'task-1', parentTaskId: 'task-1' }),
+ ).rejects.toThrow('Task cannot be parented to itself');
+ });
+
+ it('refuses parenting a task to one of its own descendants', async () => {
+ const { context, taskModel } = buildContext();
+ const patch = { parentTaskId: 'child-1' };
+ taskModel.findAllDescendants.mockResolvedValue([{ id: 'child-1' }]);
+
+ await expect(
+ resolveTaskPatchInvariants(context, { data: patch, id: 'task-1', parentTaskId: 'child-1' }),
+ ).rejects.toThrow('Task cannot be parented to its own descendant');
+ });
+
+ it('refuses a parent from another project', async () => {
+ const { context } = buildContext({ 'parent-1': { projectId: 'project-2' } });
+ const patch = { parentTaskId: 'parent-1' };
+
+ await expect(
+ resolveTaskPatchInvariants(context, { data: patch, id: 'task-1', parentTaskId: 'parent-1' }),
+ ).rejects.toThrow('Parent task must belong to the same project');
+ });
+
+ it('refuses a public child under a private parent', async () => {
+ const { context, taskService } = buildContext({ 'task-1': { visibility: 'public' } });
+ const patch = { parentTaskId: 'parent-1' };
+ taskService.assertParentVisibilityCompat.mockImplementation(() => {
+ throw new TRPCError({ code: 'BAD_REQUEST', message: 'Subtask cannot be more public than' });
+ });
+
+ await expect(
+ resolveTaskPatchInvariants(context, { data: patch, id: 'task-1', parentTaskId: 'parent-1' }),
+ ).rejects.toThrow('Subtask cannot be more public than');
+ expect(taskService.assertParentVisibilityCompat).toHaveBeenCalledWith('public', undefined);
+ });
+
+ it('accepts clearing the parent', async () => {
+ const { context, taskModel } = buildContext();
+ const patch = { parentTaskId: null };
+
+ const result = await resolveTaskPatchInvariants(context, {
+ data: patch,
+ id: 'task-1',
+ parentTaskId: null,
+ });
+
+ expect(result.data.parentTaskId).toBeNull();
+ expect(taskModel.findAllDescendants).not.toHaveBeenCalled();
+ });
+});
+
+describe('resolveTaskPatchInvariants assignment', () => {
+ beforeEach(() => {
+ vi.resetAllMocks();
+ });
+
+ it('refuses an assignee agent the caller cannot use', async () => {
+ const { context } = buildContext();
+ const patch = { assigneeAgentId: 'agent-1' };
+ assertAgentUsableByMock.mockRejectedValue(
+ new TRPCError({ code: 'NOT_FOUND', message: 'Agent not found' }),
+ );
+
+ await expect(
+ resolveTaskPatchInvariants(context, { data: patch, id: 'task-1' }),
+ ).rejects.toThrow('Assignee agent not found');
+ });
+
+ it('refuses a private assignee agent on a public task', async () => {
+ const { context, taskService } = buildContext({ 'task-1': { visibility: 'public' } });
+ const patch = { assigneeAgentId: 'agent-1' };
+ taskService.assertAgentVisibilityCompat.mockImplementation(() => {
+ throw new TRPCError({ code: 'BAD_REQUEST', message: 'Public task needs a public agent' });
+ });
+
+ await expect(
+ resolveTaskPatchInvariants(context, { data: patch, id: 'task-1' }),
+ ).rejects.toThrow('Public task needs a public agent');
+ });
+
+ it('checks the assignee before resolving the task', async () => {
+ const { context, taskModel } = buildContext();
+ const patch = { assigneeAgentId: 'agent-1' };
+ assertAgentUsableByMock.mockRejectedValue(
+ new TRPCError({ code: 'NOT_FOUND', message: 'Agent not found' }),
+ );
+
+ await expect(
+ resolveTaskPatchInvariants(context, { data: patch, id: 'missing-task' }),
+ ).rejects.toThrow('Assignee agent not found');
+ expect(taskModel.resolve).not.toHaveBeenCalled();
+ });
+
+ it('refuses a patch that would leave an unusable stored schedule', async () => {
+ const { context } = buildContext({ 'task-1': { scheduleTimezone: 'Legacy/Zone' } });
+ const patch = { automationMode: 'schedule' };
+
+ await expect(
+ resolveTaskPatchInvariants(context, { data: patch, id: 'task-1' }),
+ ).rejects.toThrow('Invalid schedule');
+ });
+});
+
+describe('resolveTaskPatchInvariants edit lock', () => {
+ beforeEach(() => {
+ vi.resetAllMocks();
+ });
+
+ it('refuses a write while another member holds the edit lock', async () => {
+ const { context, editLockService } = buildContext();
+ const patch = { name: 'renamed' };
+ editLockService.getBlockingHolder.mockResolvedValue('other-member');
+
+ await expect(
+ resolveTaskPatchInvariants(context, { data: patch, id: 'task-1' }),
+ ).rejects.toThrow('Task is being edited by another user');
+ });
+
+ it('does not consult the edit lock outside a workspace', async () => {
+ const { context, editLockService } = buildContext();
+ const patch = { name: 'renamed' };
+ const personal = { ...context, workspaceId: undefined };
+
+ await resolveTaskPatchInvariants(personal, { data: patch, id: 'task-1' });
+
+ expect(editLockService.getBlockingHolder).not.toHaveBeenCalled();
+ });
+});
+
+describe('resolveTaskPatchInvariants normalization', () => {
+ beforeEach(() => {
+ vi.resetAllMocks();
+ });
+
+ it('drops the stale rich-text mirror when only markdown is sent', async () => {
+ const { context } = buildContext();
+ const markdownOnly: { editorData?: unknown; instruction: string } = { instruction: '# done' };
+
+ const onlyMarkdown = await resolveTaskPatchInvariants(context, {
+ data: markdownOnly,
+ id: 'task-1',
+ });
+ expect(onlyMarkdown.data.editorData).toBeNull();
+ });
+
+ it('keeps an explicit editor state when both fields are sent', async () => {
+ const { context } = buildContext();
+ const both = { editorData: { root: {} }, instruction: '# done' };
+
+ const result = await resolveTaskPatchInvariants(context, { data: both, id: 'task-1' });
+
+ expect(result.data.editorData).toEqual({ root: {} });
+ });
+});
diff --git a/apps/server/src/services/task/patchValidation.ts b/apps/server/src/services/task/patchValidation.ts
new file mode 100644
index 00000000000..dfab16ab7ef
--- /dev/null
+++ b/apps/server/src/services/task/patchValidation.ts
@@ -0,0 +1,197 @@
+import { TRPCError } from '@trpc/server';
+
+import type { AgentModel } from '@/database/models/agent';
+import type { TaskModel } from '@/database/models/task';
+import type { LobeChatDatabase } from '@/database/type';
+import { assertAgentUsableBy } from '@/database/utils/agent-access';
+import type { EditLockService } from '@/server/services/editLock';
+import type { TaskService } from '@/server/services/task';
+
+import { assertResultingScheduleValid } from './scheduleValidation';
+
+/**
+ * The invariants a task patch must satisfy, shared by every write boundary: the
+ * tRPC mutation the in-app editor calls and the REST patch the OpenAPI SDK is
+ * generated from. Both must refuse a patch the hierarchy, visibility or
+ * assignment rules forbid β€” writing the row directly would otherwise persist
+ * e.g. a task parented to itself (the foreign key accepts it) or a public child
+ * under a private parent.
+ */
+
+type ResolvedTask = NonNullable<Awaited<ReturnType<TaskModel['resolve']>>>;
+
+/**
+ * The fields this helper reads off a patch. It is a *minimum*, not a whitelist:
+ * a patch carries whatever other task columns the caller sent β€” they are passed
+ * through untouched β€” hence the open index signature.
+ */
+export interface TaskPatchFields {
+ [key: string]: unknown;
+ assigneeAgentId?: string | null;
+ assigneeUserId?: string | null;
+ automationMode?: string | null;
+ editorData?: unknown;
+ instruction?: string | null;
+ schedulePattern?: string | null;
+ scheduleTimezone?: string | null;
+}
+
+export interface TaskPatchInvariantContext {
+ agentModel: Pick<AgentModel, 'getAgentVisibility'>;
+ editLockService: Pick<EditLockService, 'getBlockingHolder'>;
+ serverDB: LobeChatDatabase;
+ taskModel: TaskModel;
+ taskService: Pick<
+ TaskService,
+ | 'assertAgentVisibilityCompat'
+ | 'assertAssigneeUserVisibilityCompat'
+ | 'assertParentVisibilityCompat'
+ >;
+ userId: string;
+ workspaceId?: string;
+}
+
+async function resolveOrThrow(model: TaskModel, id: string): Promise<ResolvedTask> {
+ const task = await model.resolve(id);
+ if (!task) throw new TRPCError({ code: 'NOT_FOUND', message: 'Task not found' });
+ return task;
+}
+
+export async function assertAssigneeAgentBelongsToUser(
+ db: LobeChatDatabase,
+ callerCtx: { userId: string; workspaceId?: string },
+ assigneeAgentId?: string | null,
+) {
+ if (!assigneeAgentId) return;
+
+ try {
+ await assertAgentUsableBy(db, assigneeAgentId, callerCtx);
+ } catch (error) {
+ if (error instanceof TRPCError && error.code === 'NOT_FOUND') {
+ // Preserve the task-context message so the UI surfaces "Assignee agent
+ // not found" instead of the generic "Agent not found". Cross-user access
+ // to a private agent still resolves to NOT_FOUND, never FORBIDDEN, so we
+ // don't leak existence of someone else's private agent.
+ throw new TRPCError({ code: 'NOT_FOUND', message: 'Assignee agent not found' });
+ }
+ throw error;
+ }
+}
+
+async function resolveSafeParentTaskId(
+ model: TaskModel,
+ taskId: string,
+ parentTaskId: string | null,
+): Promise<string | null> {
+ if (parentTaskId === null) return null;
+
+ const parent = await resolveOrThrow(model, parentTaskId);
+ if (parent.id === taskId) {
+ throw new TRPCError({
+ code: 'BAD_REQUEST',
+ message: 'Task cannot be parented to itself',
+ });
+ }
+
+ const descendants = await model.findAllDescendants(taskId);
+ if (descendants.some((task) => task.id === parent.id)) {
+ throw new TRPCError({
+ code: 'BAD_REQUEST',
+ message: 'Task cannot be parented to its own descendant',
+ });
+ }
+
+ const task = await resolveOrThrow(model, taskId);
+ if (task.projectId !== parent.projectId) {
+ throw new TRPCError({
+ code: 'BAD_REQUEST',
+ message: 'Parent task must belong to the same project',
+ });
+ }
+
+ return parent.id;
+}
+
+/**
+ * Resolve the task being patched and reject the patch if it breaks an existing
+ * invariant, returning the data the row write should use (with `parentTaskId`
+ * resolved and the stale rich-text mirror dropped).
+ *
+ * The order of the checks is load-bearing β€” the assignee agent is validated
+ * before the task is resolved so a bad agent reports itself rather than a
+ * missing task β€” and is kept identical for both boundaries.
+ */
+export async function resolveTaskPatchInvariants<Data extends TaskPatchFields>(
+ ctx: TaskPatchInvariantContext,
+ params: { data: Data; id: string; parentTaskId?: string | null },
+): Promise<{ data: Data & { parentTaskId?: string | null }; resolved: ResolvedTask }> {
+ const { data, id, parentTaskId } = params;
+
+ await assertAssigneeAgentBelongsToUser(
+ ctx.serverDB,
+ { userId: ctx.userId, workspaceId: ctx.workspaceId },
+ data.assigneeAgentId,
+ );
+
+ const resolved = await resolveOrThrow(ctx.taskModel, id);
+ assertResultingScheduleValid(resolved, data);
+
+ // Collaborative edit lock: reject writes to a workspace task another member
+ // is actively editing. Inert until a client acquires the lock.
+ if (ctx.workspaceId) {
+ const blockedBy = await ctx.editLockService.getBlockingHolder('task', resolved.id);
+ if (blockedBy) {
+ throw new TRPCError({
+ cause: { data: { code: 'DocumentLocked' } },
+ code: 'CONFLICT',
+ message: 'Task is being edited by another user',
+ });
+ }
+ }
+
+ // Reject changing the assignee to a private agent on a public task β€” a public
+ // task must never be assigned to a private agent. `undefined` means "no
+ // change"; `null` clears the assignee and is always safe.
+ if (data.assigneeAgentId) {
+ const agentVisibility = await ctx.agentModel.getAgentVisibility(data.assigneeAgentId);
+ ctx.taskService.assertAgentVisibilityCompat(resolved.visibility, agentVisibility);
+ }
+
+ // A private task can only be assigned to its creator β€” the assignee would
+ // otherwise never see the task. `null` clears and is always safe.
+ ctx.taskService.assertAssigneeUserVisibilityCompat(
+ resolved.visibility,
+ data.assigneeUserId,
+ resolved.createdByUserId,
+ );
+
+ const resolvedParentTaskId =
+ parentTaskId === undefined
+ ? undefined
+ : await resolveSafeParentTaskId(ctx.taskModel, resolved.id, parentTaskId);
+
+ // Reparenting a public task under a private one breaks the parent visibility
+ // invariant β€” a subtask cannot be more public than its parent (otherwise
+ // workspace members would still see the child while its new parent is
+ // hidden). `undefined` means "no change"; `null` clears the parent and is
+ // always safe.
+ if (resolvedParentTaskId) {
+ const newParent = await ctx.taskModel.findById(resolvedParentTaskId);
+ ctx.taskService.assertParentVisibilityCompat(resolved.visibility, newParent?.visibility);
+ }
+
+ const updateData =
+ parentTaskId === undefined ? data : { ...data, parentTaskId: resolvedParentTaskId };
+
+ // `instruction` is the markdown source of truth while `editorData` is its
+ // rich-text mirror. Text-only callers (for example the editTask builtin)
+ // cannot produce Lexical JSON, so discard the stale mirror and let the editor
+ // rebuild from markdown. Callers that provide both fields keep their explicit
+ // editor state.
+ const normalizedData =
+ updateData.instruction !== undefined && updateData.editorData === undefined
+ ? { ...updateData, editorData: null }
+ : updateData;
+
+ return { data: normalizedData, resolved };
+}
diff --git a/apps/server/src/services/task/scheduleValidation.ts b/apps/server/src/services/task/scheduleValidation.ts
new file mode 100644
index 00000000000..e815f44fded
--- /dev/null
+++ b/apps/server/src/services/task/scheduleValidation.ts
@@ -0,0 +1,57 @@
+import {
+ isValidTimezone,
+ validateCronPattern,
+ validateScheduleUpdate,
+} from '@lobechat/utils/cronEval';
+import { TRPCError } from '@trpc/server';
+import { z } from 'zod';
+
+/**
+ * Write-time schedule validation, shared by every boundary that can create or
+ * patch a task: the tRPC router the in-app surfaces call and the REST routes
+ * the OpenAPI SDK is generated from. Both must refuse a schedule the
+ * dispatcher cannot evaluate, or the task is stored and then silently never
+ * fires.
+ */
+
+/**
+ * Reject cron the schedule dispatcher cannot evaluate at write time, instead of
+ * storing it and letting it silently never fire. An empty string still clears.
+ */
+export const schedulePatternSchema = z.string().superRefine((pattern, ctx) => {
+ if (!pattern) return;
+ const result = validateCronPattern(pattern, null);
+ if (!result.valid) {
+ ctx.addIssue({
+ code: 'custom',
+ message: `Invalid schedulePattern "${pattern}": ${result.error}`,
+ });
+ }
+});
+
+export const scheduleTimezoneSchema = z.string().refine((tz) => !tz || isValidTimezone(tz), {
+ message: 'scheduleTimezone must be an IANA timezone such as "Asia/Shanghai"',
+});
+
+/**
+ * The field schemas check `schedulePattern` and `scheduleTimezone` one at a
+ * time; this checks the pair the task ends up with, filling any field the
+ * input leaves out from the stored row, so e.g. a pattern-only update cannot
+ * keep a legacy invalid timezone and still report success.
+ */
+export function assertResultingScheduleValid(
+ stored: { schedulePattern?: string | null; scheduleTimezone?: string | null } | null,
+ input: {
+ automationMode?: string | null;
+ schedulePattern?: string | null;
+ scheduleTimezone?: string | null;
+ },
+) {
+ const result = validateScheduleUpdate(
+ stored ? { pattern: stored.schedulePattern, timezone: stored.scheduleTimezone } : null,
+ input,
+ );
+ if (result && !result.valid) {
+ throw new TRPCError({ code: 'BAD_REQUEST', message: `Invalid schedule: ${result.error}` });
+ }
+}
diff --git a/apps/server/src/services/verify/acceptanceService.ts b/apps/server/src/services/verify/acceptanceService.ts
index cb526424e44..3fceda9c534 100644
--- a/apps/server/src/services/verify/acceptanceService.ts
+++ b/apps/server/src/services/verify/acceptanceService.ts
@@ -35,7 +35,6 @@ import type {
VerifyRunItem,
} from '@/database/schemas/verify';
import type { LobeChatDatabase } from '@/database/type';
-import { TaskService } from '@/server/services/task';
import { ExpertiseRejectionWorkflow } from '@/server/workflows/expertiseRejection';
import { type AcceptanceMergeSummary, mergeAcceptanceRounds } from './acceptanceMerge';
@@ -1137,7 +1136,10 @@ export class AcceptanceService {
if (!task || ['canceled', 'completed', 'failed'].includes(task.status)) return;
// TaskService cascades checkpoint / sibling rollup / downstream unlock β€”
- // the same completion path settle.ts drives on a passed verify.
+ // the same completion path settle.ts drives on a passed verify. Loaded
+ // lazily because `TaskService` reaches this module through its acceptance
+ // resolution, so a static import would close a module cycle.
+ const { TaskService } = await import('../task');
await new TaskService(this.db, this.userId, this.workspaceId).updateStatus({
id: task.id,
status: 'completed',
diff --git a/packages/openapi/openapi.yml b/packages/openapi/openapi.yml
index 45f1e146f5e..da944167fcd 100644
--- a/packages/openapi/openapi.yml
+++ b/packages/openapi/openapi.yml
@@ -1141,8 +1141,6 @@ paths:
required:
- name
responses:
- "200":
- description: Response
"201":
content:
application/json:
@@ -2735,8 +2733,6 @@ paths:
- name
additionalProperties: false
responses:
- "200":
- description: Response
"201":
content:
application/json:
@@ -11623,20 +11619,36 @@ paths:
description: Internal server error
tags:
- files
- /api/v1/knowledge-bases:
+ /api/v1/goals:
get:
- operationId: getApiV1KnowledgeBases
+ operationId: getApiV1Goals
parameters:
- in: query
- name: keyword
+ name: agentId
schema:
type: string
- in: query
- name: page
+ name: limit
+ schema:
+ type: integer
+ minimum: 1
+ maximum: 100
+ - in: query
+ name: offset
+ schema:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ - in: query
+ name: projectId
schema:
type: string
- in: query
- name: pageSize
+ name: statuses
+ schema:
+ type: string
+ - in: query
+ name: topicId
schema:
type: string
responses:
@@ -11648,17 +11660,10 @@ paths:
properties:
data:
additionalProperties: true
- properties:
- knowledgeBases:
- items:
- $ref: "#/components/schemas/KnowledgeBase"
- type: array
- total:
- minimum: 0
- type: integer
- required:
- - knowledgeBases
- type: object
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -11728,9 +11733,9 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - knowledge-bases
+ - goals
post:
- operationId: postApiV1KnowledgeBases
+ operationId: postApiV1Goals
requestBody:
required: true
content:
@@ -11738,27 +11743,73 @@ paths:
schema:
type: object
properties:
- avatar:
+ agentId:
type: string
- format: uri
- description:
+ config:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ criteria:
+ type: array
+ items:
+ type: object
+ properties:
+ description:
+ type: string
+ instruction:
+ type: string
+ title:
+ type: string
+ minLength: 1
+ required:
+ - title
+ deadline:
type: string
- maxLength: 1000
- name:
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
+ maxTotalCost:
+ type: number
+ exclusiveMinimum: 0
+ problemDescription:
+ type: string
+ projectId:
+ type: string
+ requirement:
+ type: string
+ tasks:
+ type: array
+ items:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: object
+ properties:
+ description:
+ type: string
+ title:
+ type: string
+ minLength: 1
+ required:
+ - title
+ title:
type: string
minLength: 1
- maxLength: 255
required:
- - name
+ - title
responses:
- "200":
+ "201":
content:
application/json:
schema:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/KnowledgeBase"
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -11828,10 +11879,10 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - knowledge-bases
- /api/v1/knowledge-bases/{id}:
+ - goals
+ /api/v1/goals/{id}:
get:
- operationId: getApiV1KnowledgeBasesById
+ operationId: getApiV1GoalsById
parameters:
- in: path
name: id
@@ -11847,7 +11898,11 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/KnowledgeBase"
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -11917,9 +11972,9 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - knowledge-bases
+ - goals
patch:
- operationId: patchApiV1KnowledgeBasesById
+ operationId: patchApiV1GoalsById
parameters:
- in: path
name: id
@@ -11934,16 +11989,53 @@ paths:
schema:
type: object
properties:
- avatar:
- type: string
- format: uri
- description:
- type: string
- maxLength: 1000
- name:
+ budget:
+ type: object
+ properties:
+ deadline:
+ anyOf:
+ - type: string
+ format: date-time
+ pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
+ - type: "null"
+ maxAttemptsPerTask:
+ type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ maxConcurrentTasks:
+ anyOf:
+ - type: integer
+ minimum: 1
+ maximum: 10
+ - type: "null"
+ maxExperiments:
+ type: integer
+ minimum: 1
+ maximum: 200
+ maxManagerTurns:
+ type: integer
+ minimum: 1
+ maximum: 100
+ maxRounds:
+ anyOf:
+ - type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ - type: "null"
+ maxStepsPerRun:
+ anyOf:
+ - type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ - type: "null"
+ maxTotalCost:
+ anyOf:
+ - type: number
+ exclusiveMinimum: 0
+ - type: "null"
+ requirement:
type: string
minLength: 1
- maxLength: 255
responses:
"200":
content:
@@ -11952,7 +12044,11 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/KnowledgeBase"
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -12022,9 +12118,9 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - knowledge-bases
+ - goals
delete:
- operationId: deleteApiV1KnowledgeBasesById
+ operationId: deleteApiV1GoalsById
parameters:
- in: path
name: id
@@ -12042,6 +12138,7 @@ paths:
data:
additionalProperties: true
type:
+ - array
- object
- "null"
message:
@@ -12113,35 +12210,12 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - knowledge-bases
- /api/v1/knowledge-bases/{id}/files:
+ - goals
+ /api/v1/goals/{id}/supervision:
get:
- operationId: getApiV1KnowledgeBasesByIdFiles
- parameters:
- - in: path
- name: id
- schema:
- type: string
- minLength: 1
- required: true
- - in: query
- name: keyword
- schema:
- type: string
- - in: query
- name: page
- schema:
- type: string
- - in: query
- name: pageSize
- schema:
- type: string
- - in: query
- name: fileType
- schema:
- type:
- - string
- - "null"
+ operationId: getGoalSupervision
+ tags:
+ - goals
responses:
"200":
content:
@@ -12151,7 +12225,10 @@ paths:
properties:
data:
additionalProperties: true
- type: object
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -12220,11 +12297,6 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
- tags:
- - knowledge-bases
- /api/v1/knowledge-bases/{id}/files/batch:
- post:
- operationId: postApiV1KnowledgeBasesByIdFilesBatch
parameters:
- in: path
name: id
@@ -12232,21 +12304,11 @@ paths:
type: string
minLength: 1
required: true
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- fileIds:
- minItems: 1
- type: array
- items:
- type: string
- minLength: 1
- required:
- - fileIds
+ /api/v1/goals/{id}/advance:
+ post:
+ operationId: advanceGoal
+ tags:
+ - goals
responses:
"200":
content:
@@ -12256,7 +12318,10 @@ paths:
properties:
data:
additionalProperties: true
- type: object
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -12325,10 +12390,6 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
- tags:
- - knowledge-bases
- delete:
- operationId: deleteApiV1KnowledgeBasesByIdFilesBatch
parameters:
- in: path
name: id
@@ -12336,21 +12397,11 @@ paths:
type: string
minLength: 1
required: true
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- fileIds:
- minItems: 1
- type: array
- items:
- type: string
- minLength: 1
- required:
- - fileIds
+ /api/v1/goals/{id}/pause:
+ post:
+ operationId: pauseGoal
+ tags:
+ - goals
responses:
"200":
content:
@@ -12361,6 +12412,7 @@ paths:
data:
additionalProperties: true
type:
+ - array
- object
- "null"
message:
@@ -12431,11 +12483,6 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
- tags:
- - knowledge-bases
- /api/v1/knowledge-bases/{id}/files/move:
- post:
- operationId: postApiV1KnowledgeBasesByIdFilesMove
parameters:
- in: path
name: id
@@ -12443,25 +12490,11 @@ paths:
type: string
minLength: 1
required: true
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- fileIds:
- minItems: 1
- type: array
- items:
- type: string
- minLength: 1
- targetKnowledgeBaseId:
- type: string
- minLength: 1
- required:
- - fileIds
- - targetKnowledgeBaseId
+ /api/v1/goals/{id}/resume:
+ post:
+ operationId: resumeGoal
+ tags:
+ - goals
responses:
"200":
content:
@@ -12471,7 +12504,10 @@ paths:
properties:
data:
additionalProperties: true
- type: object
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -12540,14 +12576,18 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ required: true
+ /api/v1/goals/{id}/restart:
+ post:
+ operationId: restartGoal
tags:
- - knowledge-bases
- /api/v1/mcp-servers:
- get:
- operationId: getApiV1McpServers
- summary: List remote MCP servers
- tags:
- - mcp-servers
+ - goals
responses:
"200":
content:
@@ -12556,9 +12596,11 @@ paths:
additionalProperties: false
properties:
data:
- items:
- $ref: "#/components/schemas/McpServer"
- type: array
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -12573,12 +12615,25 @@ paths:
type: object
description: Successful response
"400":
+ description: Validation Error
content:
application/json:
schema:
- $ref: "#/components/schemas/ApiError"
- description: Invalid request
- "401":
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
content:
application/json:
schema:
@@ -12614,20 +12669,59 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
- post:
- operationId: postApiV1McpServers
- summary: Add a remote MCP server
- tags:
- - mcp-servers
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ agentId:
+ type: string
+ minLength: 1
+ /api/v1/knowledge-bases:
+ get:
+ operationId: getApiV1KnowledgeBases
+ parameters:
+ - in: query
+ name: keyword
+ schema:
+ type: string
+ - in: query
+ name: page
+ schema:
+ type: string
+ - in: query
+ name: pageSize
+ schema:
+ type: string
responses:
- "201":
+ "200":
content:
application/json:
schema:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/McpServer"
+ additionalProperties: true
+ properties:
+ knowledgeBases:
+ items:
+ $ref: "#/components/schemas/KnowledgeBase"
+ type: array
+ total:
+ minimum: 0
+ type: integer
+ required:
+ - knowledgeBases
+ type: object
message:
type: string
success:
@@ -12696,6 +12790,10 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
+ tags:
+ - knowledge-bases
+ post:
+ operationId: postApiV1KnowledgeBases
requestBody:
required: true
content:
@@ -12703,87 +12801,18 @@ paths:
schema:
type: object
properties:
- credentials:
- oneOf:
- - type: object
- properties:
- token:
- type: string
- minLength: 1
- maxLength: 10000
- type:
- type: string
- const: bearer
- required:
- - token
- - type
- additionalProperties: false
- - type: object
- properties:
- apiKey:
- type: string
- minLength: 1
- maxLength: 10000
- type:
- type: string
- const: apikey
- required:
- - apiKey
- - type
- additionalProperties: false
- - type: object
- properties:
- headers:
- type: object
- propertyNames:
- type: string
- minLength: 1
- maxLength: 256
- additionalProperties:
- type: string
- maxLength: 10000
- type:
- type: string
- const: header
- required:
- - headers
- - type
- additionalProperties: false
- description:
+ avatar:
type: string
- maxLength: 2000
- identifier:
+ format: uri
+ description:
type: string
- minLength: 1
- maxLength: 255
- pattern: ^[a-z\d](?:[\w-]*[a-z\d])?$
- isEnabled:
- default: true
- type: boolean
+ maxLength: 1000
name:
type: string
minLength: 1
maxLength: 255
- serverUrl:
- type: string
- maxLength: 2048
- format: uri
required:
- - identifier
- name
- - serverUrl
- additionalProperties: false
- /api/v1/mcp-servers/{id}:
- get:
- operationId: getApiV1McpServersById
- parameters:
- - in: path
- name: id
- schema:
- type: string
- format: uuid
- pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
- required: true
responses:
"200":
content:
@@ -12792,7 +12821,7 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/McpServer"
+ $ref: "#/components/schemas/KnowledgeBase"
message:
type: string
success:
@@ -12862,88 +12891,17 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - mcp-servers
- patch:
- operationId: patchApiV1McpServersById
+ - knowledge-bases
+ /api/v1/knowledge-bases/{id}:
+ get:
+ operationId: getApiV1KnowledgeBasesById
parameters:
- in: path
name: id
schema:
type: string
- format: uuid
- pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
+ minLength: 1
required: true
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- credentials:
- anyOf:
- - oneOf:
- - type: object
- properties:
- token:
- type: string
- minLength: 1
- maxLength: 10000
- type:
- type: string
- const: bearer
- required:
- - token
- - type
- additionalProperties: false
- - type: object
- properties:
- apiKey:
- type: string
- minLength: 1
- maxLength: 10000
- type:
- type: string
- const: apikey
- required:
- - apiKey
- - type
- additionalProperties: false
- - type: object
- properties:
- headers:
- type: object
- propertyNames:
- type: string
- minLength: 1
- maxLength: 256
- additionalProperties:
- type: string
- maxLength: 10000
- type:
- type: string
- const: header
- required:
- - headers
- - type
- additionalProperties: false
- - type: "null"
- description:
- anyOf:
- - type: string
- maxLength: 2000
- - type: "null"
- isEnabled:
- type: boolean
- name:
- type: string
- minLength: 1
- maxLength: 255
- serverUrl:
- type: string
- maxLength: 2048
- format: uri
- additionalProperties: false
responses:
"200":
content:
@@ -12952,7 +12910,7 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/McpServer"
+ $ref: "#/components/schemas/KnowledgeBase"
message:
type: string
success:
@@ -13022,30 +12980,43 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - mcp-servers
- delete:
- operationId: deleteApiV1McpServersById
+ - knowledge-bases
+ patch:
+ operationId: patchApiV1KnowledgeBasesById
parameters:
- in: path
name: id
schema:
type: string
- format: uuid
- pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
+ minLength: 1
required: true
- responses:
- "200":
- content:
- application/json:
- schema:
- additionalProperties: false
- properties:
- data:
- additionalProperties: true
- type:
- - object
- - "null"
- message:
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ avatar:
+ type: string
+ format: uri
+ description:
+ type: string
+ maxLength: 1000
+ name:
+ type: string
+ minLength: 1
+ maxLength: 255
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/KnowledgeBase"
+ message:
type: string
success:
const: true
@@ -13114,13 +13085,16 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - mcp-servers
- /api/v1/mcp-servers/{id}/sync:
- post:
- operationId: postApiV1McpServersByIdSync
- summary: Discover and sync MCP tools
- tags:
- - mcp-servers
+ - knowledge-bases
+ delete:
+ operationId: deleteApiV1KnowledgeBasesById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ required: true
responses:
"200":
content:
@@ -13129,22 +13103,10 @@ paths:
additionalProperties: false
properties:
data:
- additionalProperties: false
- properties:
- id:
- format: uuid
- type: string
- status:
- const: connected
- type: string
- toolCount:
- minimum: 0
- type: integer
- required:
- - id
- - status
- - toolCount
- type: object
+ additionalProperties: true
+ type:
+ - object
+ - "null"
message:
type: string
success:
@@ -13213,46 +13175,36 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
+ tags:
+ - knowledge-bases
+ /api/v1/knowledge-bases/{id}/files:
+ get:
+ operationId: getApiV1KnowledgeBasesByIdFiles
parameters:
- in: path
name: id
schema:
type: string
- format: uuid
- pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
+ minLength: 1
required: true
- /api/v1/message-translations/{messageId}:
- post:
- operationId: postApiV1MessageTranslationsByMessageId
- parameters:
- - in: path
- name: messageId
+ - in: query
+ name: keyword
schema:
type: string
- minLength: 1
- required: true
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- from:
- type: string
- model:
- type:
- - string
- - "null"
- provider:
- type:
- - string
- - "null"
- to:
- type: string
- minLength: 1
- required:
- - to
+ - in: query
+ name: page
+ schema:
+ type: string
+ - in: query
+ name: pageSize
+ schema:
+ type: string
+ - in: query
+ name: fileType
+ schema:
+ type:
+ - string
+ - "null"
responses:
"200":
content:
@@ -13332,16 +13284,32 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - message-translations
- get:
- operationId: getApiV1MessageTranslationsByMessageId
+ - knowledge-bases
+ /api/v1/knowledge-bases/{id}/files/batch:
+ post:
+ operationId: postApiV1KnowledgeBasesByIdFilesBatch
parameters:
- in: path
- name: messageId
+ name: id
schema:
type: string
minLength: 1
required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ fileIds:
+ minItems: 1
+ type: array
+ items:
+ type: string
+ minLength: 1
+ required:
+ - fileIds
responses:
"200":
content:
@@ -13421,12 +13389,12 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - message-translations
- patch:
- operationId: patchApiV1MessageTranslationsByMessageId
+ - knowledge-bases
+ delete:
+ operationId: deleteApiV1KnowledgeBasesByIdFilesBatch
parameters:
- in: path
- name: messageId
+ name: id
schema:
type: string
minLength: 1
@@ -13438,23 +13406,14 @@ paths:
schema:
type: object
properties:
- from:
- type: string
- model:
- type:
- - string
- - "null"
- provider:
- type:
- - string
- - "null"
- to:
- type: string
- minLength: 1
- content:
- type: string
+ fileIds:
+ minItems: 1
+ type: array
+ items:
+ type: string
+ minLength: 1
required:
- - to
+ - fileIds
responses:
"200":
content:
@@ -13464,7 +13423,9 @@ paths:
properties:
data:
additionalProperties: true
- type: object
+ type:
+ - object
+ - "null"
message:
type: string
success:
@@ -13534,16 +13495,36 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - message-translations
- delete:
- operationId: deleteApiV1MessageTranslationsByMessageId
+ - knowledge-bases
+ /api/v1/knowledge-bases/{id}/files/move:
+ post:
+ operationId: postApiV1KnowledgeBasesByIdFilesMove
parameters:
- in: path
- name: messageId
+ name: id
schema:
type: string
minLength: 1
required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ fileIds:
+ minItems: 1
+ type: array
+ items:
+ type: string
+ minLength: 1
+ targetKnowledgeBaseId:
+ type: string
+ minLength: 1
+ required:
+ - fileIds
+ - targetKnowledgeBaseId
responses:
"200":
content:
@@ -13623,33 +13604,13 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - message-translations
- /api/v1/messages/count:
+ - knowledge-bases
+ /api/v1/mcp-servers:
get:
- operationId: getApiV1MessagesCount
- parameters:
- - in: query
- name: topicId
- schema:
- type: string
- minLength: 1
- - in: query
- name: threadId
- schema:
- type: string
- minLength: 1
- - in: query
- name: topicIds
- schema:
- type:
- - string
- - "null"
- - in: query
- name: userId
- schema:
- type:
- - string
- - "null"
+ operationId: getApiV1McpServers
+ summary: List remote MCP servers
+ tags:
+ - mcp-servers
responses:
"200":
content:
@@ -13658,14 +13619,9 @@ paths:
additionalProperties: false
properties:
data:
- additionalProperties: false
- properties:
- count:
- minimum: 0
- type: integer
- required:
- - count
- type: object
+ items:
+ $ref: "#/components/schemas/McpServer"
+ type: array
message:
type: string
success:
@@ -13680,24 +13636,11 @@ paths:
type: object
description: Successful response
"400":
- description: Validation Error
content:
application/json:
schema:
- type: object
- properties:
- success:
- type: boolean
- enum:
- - false
- error:
- type: array
- items: {}
- data: {}
- required:
- - success
- - error
- - data
+ $ref: "#/components/schemas/ApiError"
+ description: Invalid request
"401":
content:
application/json:
@@ -13734,88 +13677,20 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
+ post:
+ operationId: postApiV1McpServers
+ summary: Add a remote MCP server
tags:
- - messages
- /api/v1/messages:
- get:
- operationId: getApiV1Messages
- parameters:
- - in: query
- name: threadId
- schema:
- type: string
- minLength: 1
- - in: query
- name: topicId
- schema:
- type:
- - string
- - "null"
- - in: query
- name: userId
- schema:
- type:
- - string
- - "null"
- - in: query
- name: role
- schema:
- anyOf:
- - type: string
- enum:
- - user
- - system
- - assistant
- - tool
- - type: "null"
- - in: query
- name: keyword
- schema:
- type: string
- - in: query
- name: page
- schema:
- type: integer
- minimum: 1
- maximum: 1000000
- - in: query
- name: pageSize
- schema:
- type: integer
- minimum: 1
- maximum: 100
- - in: query
- name: limit
- schema:
- type: integer
- minimum: 1
- maximum: 100
- - in: query
- name: offset
- schema:
- type: integer
- minimum: 0
- maximum: 1000000
+ - mcp-servers
responses:
- "200":
+ "201":
content:
application/json:
schema:
additionalProperties: false
properties:
data:
- additionalProperties: true
- properties:
- messages:
- items:
- $ref: "#/components/schemas/Message"
- type: array
- total:
- minimum: 0
- type: integer
- required:
- - messages
- type: object
+ $ref: "#/components/schemas/McpServer"
message:
type: string
success:
@@ -13884,10 +13759,6 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
- tags:
- - messages
- post:
- operationId: postApiV1Messages
requestBody:
required: true
content:
@@ -13895,86 +13766,87 @@ paths:
schema:
type: object
properties:
- content:
+ credentials:
+ oneOf:
+ - type: object
+ properties:
+ token:
+ type: string
+ minLength: 1
+ maxLength: 10000
+ type:
+ type: string
+ const: bearer
+ required:
+ - token
+ - type
+ additionalProperties: false
+ - type: object
+ properties:
+ apiKey:
+ type: string
+ minLength: 1
+ maxLength: 10000
+ type:
+ type: string
+ const: apikey
+ required:
+ - apiKey
+ - type
+ additionalProperties: false
+ - type: object
+ properties:
+ headers:
+ type: object
+ propertyNames:
+ type: string
+ minLength: 1
+ maxLength: 256
+ additionalProperties:
+ type: string
+ maxLength: 10000
+ type:
+ type: string
+ const: header
+ required:
+ - headers
+ - type
+ additionalProperties: false
+ description:
+ type: string
+ maxLength: 2000
+ identifier:
type: string
minLength: 1
- role:
+ maxLength: 255
+ pattern: ^[a-z\d](?:[\w-]*[a-z\d])?$
+ isEnabled:
+ default: true
+ type: boolean
+ name:
type: string
- enum:
- - user
- - system
- - assistant
- - tool
- model:
- type:
- - string
- - "null"
- provider:
- type:
- - string
- - "null"
- topicId:
- type:
- - string
- - "null"
- threadId:
- type:
- - string
- - "null"
- parentId:
- type:
- - string
- - "null"
- quotaId:
- type:
- - string
- - "null"
- agentId:
- type:
- - string
- - "null"
- clientId:
- type:
- - string
- - "null"
- metadata:
- anyOf:
- - {}
- - type: "null"
- reasoning:
- anyOf:
- - {}
- - type: "null"
- search:
- anyOf:
- - {}
- - type: "null"
- tools:
- anyOf:
- - {}
- - type: "null"
- traceId:
- type:
- - string
- - "null"
- observationId:
- type:
- - string
- - "null"
- files:
- anyOf:
- - type: array
- items:
- type: string
- - type: "null"
- favorite:
- default: false
- type:
- - boolean
- - "null"
+ minLength: 1
+ maxLength: 255
+ serverUrl:
+ type: string
+ maxLength: 2048
+ format: uri
required:
- - content
- - role
+ - identifier
+ - name
+ - serverUrl
+ additionalProperties: false
+ /api/v1/mcp-servers/{id}:
+ get:
+ operationId: getApiV1McpServersById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ format: uuid
+ pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
+ required: true
responses:
"200":
content:
@@ -13983,7 +13855,7 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Message"
+ $ref: "#/components/schemas/McpServer"
message:
type: string
success:
@@ -14053,24 +13925,88 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - messages
- delete:
- operationId: deleteApiV1Messages
- requestBody:
- required: true
- content:
- application/json:
- schema:
+ - mcp-servers
+ patch:
+ operationId: patchApiV1McpServersById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ format: uuid
+ pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
+ required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
type: object
properties:
- messageIds:
- minItems: 1
- type: array
- items:
- type: string
- minLength: 1
- required:
- - messageIds
+ credentials:
+ anyOf:
+ - oneOf:
+ - type: object
+ properties:
+ token:
+ type: string
+ minLength: 1
+ maxLength: 10000
+ type:
+ type: string
+ const: bearer
+ required:
+ - token
+ - type
+ additionalProperties: false
+ - type: object
+ properties:
+ apiKey:
+ type: string
+ minLength: 1
+ maxLength: 10000
+ type:
+ type: string
+ const: apikey
+ required:
+ - apiKey
+ - type
+ additionalProperties: false
+ - type: object
+ properties:
+ headers:
+ type: object
+ propertyNames:
+ type: string
+ minLength: 1
+ maxLength: 256
+ additionalProperties:
+ type: string
+ maxLength: 10000
+ type:
+ type: string
+ const: header
+ required:
+ - headers
+ - type
+ additionalProperties: false
+ - type: "null"
+ description:
+ anyOf:
+ - type: string
+ maxLength: 2000
+ - type: "null"
+ isEnabled:
+ type: boolean
+ name:
+ type: string
+ minLength: 1
+ maxLength: 255
+ serverUrl:
+ type: string
+ maxLength: 2048
+ format: uri
+ additionalProperties: false
responses:
"200":
content:
@@ -14079,10 +14015,7 @@ paths:
additionalProperties: false
properties:
data:
- additionalProperties: true
- type:
- - object
- - "null"
+ $ref: "#/components/schemas/McpServer"
message:
type: string
success:
@@ -14152,16 +14085,16 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - messages
- /api/v1/messages/{id}:
- get:
- operationId: getApiV1MessagesById
+ - mcp-servers
+ delete:
+ operationId: deleteApiV1McpServersById
parameters:
- in: path
name: id
schema:
type: string
- minLength: 1
+ format: uuid
+ pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
required: true
responses:
"200":
@@ -14171,7 +14104,10 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Message"
+ additionalProperties: true
+ type:
+ - object
+ - "null"
message:
type: string
success:
@@ -14241,16 +14177,13 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - messages
- delete:
- operationId: deleteApiV1MessagesById
- parameters:
- - in: path
- name: id
- schema:
- type: string
- minLength: 1
- required: true
+ - mcp-servers
+ /api/v1/mcp-servers/{id}/sync:
+ post:
+ operationId: postApiV1McpServersByIdSync
+ summary: Discover and sync MCP tools
+ tags:
+ - mcp-servers
responses:
"200":
content:
@@ -14259,10 +14192,22 @@ paths:
additionalProperties: false
properties:
data:
- additionalProperties: true
- type:
- - object
- - "null"
+ additionalProperties: false
+ properties:
+ id:
+ format: uuid
+ type: string
+ status:
+ const: connected
+ type: string
+ toolCount:
+ minimum: 0
+ type: integer
+ required:
+ - id
+ - status
+ - toolCount
+ type: object
message:
type: string
success:
@@ -14331,94 +14276,20 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ format: uuid
+ pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
+ required: true
+ /api/v1/memories/persona:
+ get:
+ operationId: getMemoryPersona
+ summary: Get the current persona document
tags:
- - messages
- /api/v1/messages/replies:
- post:
- operationId: postApiV1MessagesReplies
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- content:
- type: string
- minLength: 1
- role:
- type: string
- const: user
- model:
- type:
- - string
- - "null"
- provider:
- type:
- - string
- - "null"
- topicId:
- type:
- - string
- - "null"
- threadId:
- type:
- - string
- - "null"
- parentId:
- type:
- - string
- - "null"
- quotaId:
- type:
- - string
- - "null"
- agentId:
- type:
- - string
- - "null"
- clientId:
- type:
- - string
- - "null"
- metadata:
- anyOf:
- - {}
- - type: "null"
- reasoning:
- anyOf:
- - {}
- - type: "null"
- search:
- anyOf:
- - {}
- - type: "null"
- tools:
- anyOf:
- - {}
- - type: "null"
- traceId:
- type:
- - string
- - "null"
- observationId:
- type:
- - string
- - "null"
- files:
- anyOf:
- - type: array
- items:
- type: string
- - type: "null"
- favorite:
- default: false
- type:
- - boolean
- - "null"
- required:
- - content
- - role
+ - memories
responses:
"200":
content:
@@ -14427,9 +14298,11 @@ paths:
additionalProperties: false
properties:
data:
- anyOf:
- - $ref: "#/components/schemas/Message"
- - type: "null"
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -14444,24 +14317,11 @@ paths:
type: object
description: Successful response
"400":
- description: Validation Error
content:
application/json:
schema:
- type: object
- properties:
- success:
- type: boolean
- enum:
- - false
- error:
- type: array
- items: {}
- data: {}
- required:
- - success
- - error
- - data
+ $ref: "#/components/schemas/ApiError"
+ description: Invalid request
"401":
content:
application/json:
@@ -14498,54 +14358,12 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
- tags:
- - messages
- /api/v1/models:
+ /api/v1/memories/persona/versions:
get:
- operationId: getApiV1Models
- parameters:
- - in: query
- name: keyword
- schema:
- type: string
- - in: query
- name: page
- schema:
- type: string
- - in: query
- name: pageSize
- schema:
- type: string
- - in: query
- name: enabled
- schema:
- type:
- - string
- - "null"
- - in: query
- name: provider
- schema:
- anyOf:
- - type: string
- minLength: 1
- maxLength: 64
- - type: "null"
- - in: query
- name: type
- schema:
- anyOf:
- - type: string
- enum:
- - chat
- - embedding
- - tts
- - asr
- - image
- - text2video
- - text2music
- - realtime
- - stt
- - type: "null"
+ operationId: listMemoryPersonaVersions
+ summary: List persona document versions
+ tags:
+ - memories
responses:
"200":
content:
@@ -14555,17 +14373,10 @@ paths:
properties:
data:
additionalProperties: true
- properties:
- models:
- items:
- $ref: "#/components/schemas/Model"
- type: array
- total:
- minimum: 0
- type: integer
- required:
- - models
- type: object
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -14580,24 +14391,11 @@ paths:
type: object
description: Successful response
"400":
- description: Validation Error
content:
application/json:
schema:
- type: object
- properties:
- success:
- type: boolean
- enum:
- - false
- error:
- type: array
- items: {}
- data: {}
- required:
- - success
- - error
- - data
+ $ref: "#/components/schemas/ApiError"
+ description: Invalid request
"401":
content:
application/json:
@@ -14634,110 +14432,12 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
+ /api/v1/memories:
+ delete:
+ operationId: deleteAllMemories
+ summary: Delete all memory entries
tags:
- - models
- post:
- operationId: postApiV1Models
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- abilities:
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties: {}
- - type: "null"
- config:
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties: {}
- - type: "null"
- contextWindowTokens:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- description:
- type:
- - string
- - "null"
- displayName:
- type: string
- minLength: 1
- enabled:
- type:
- - boolean
- - "null"
- organization:
- type:
- - string
- - "null"
- parameters:
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties: {}
- - type: "null"
- pricing:
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties: {}
- - type: "null"
- releasedAt:
- type:
- - string
- - "null"
- sort:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- source:
- anyOf:
- - type: string
- enum:
- - remote
- - custom
- - builtin
- - type: "null"
- type:
- anyOf:
- - type: string
- enum:
- - chat
- - embedding
- - tts
- - asr
- - image
- - text2video
- - text2music
- - realtime
- - stt
- - type: "null"
- id:
- type: string
- minLength: 1
- maxLength: 150
- providerId:
- type: string
- minLength: 1
- maxLength: 64
- required:
- - displayName
- - id
- - providerId
+ - memories
responses:
"200":
content:
@@ -14746,7 +14446,11 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Model"
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -14761,24 +14465,11 @@ paths:
type: object
description: Successful response
"400":
- description: Validation Error
content:
application/json:
schema:
- type: object
- properties:
- success:
- type: boolean
- enum:
- - false
- error:
- type: array
- items: {}
- data: {}
- required:
- - success
- - error
- - data
+ $ref: "#/components/schemas/ApiError"
+ description: Invalid request
"401":
content:
application/json:
@@ -14815,26 +14506,11 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
+ /api/v1/memories/{category}/{id}:
+ delete:
+ operationId: deleteMemoryEntry
tags:
- - models
- /api/v1/models/{providerId}/{modelId}:
- get:
- operationId: getApiV1ModelsByProviderIdByModelId
- parameters:
- - in: path
- name: modelId
- schema:
- type: string
- minLength: 1
- maxLength: 150
- required: true
- - in: path
- name: providerId
- schema:
- type: string
- minLength: 1
- maxLength: 64
- required: true
+ - memories
responses:
"200":
content:
@@ -14844,7 +14520,10 @@ paths:
properties:
data:
additionalProperties: true
- type: object
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -14913,113 +14592,29 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
- tags:
- - models
- patch:
- operationId: patchApiV1ModelsByProviderIdByModelId
parameters:
- in: path
- name: modelId
+ name: category
schema:
type: string
- minLength: 1
- maxLength: 150
+ enum:
+ - identities
+ - preferences
+ - contexts
+ - activities
+ - experiences
required: true
- in: path
- name: providerId
+ name: id
schema:
type: string
minLength: 1
- maxLength: 64
required: true
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- abilities:
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties: {}
- - type: "null"
- config:
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties: {}
- - type: "null"
- contextWindowTokens:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- description:
- type:
- - string
- - "null"
- displayName:
- type: string
- minLength: 1
- enabled:
- type:
- - boolean
- - "null"
- organization:
- type:
- - string
- - "null"
- parameters:
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties: {}
- - type: "null"
- pricing:
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties: {}
- - type: "null"
- releasedAt:
- type:
- - string
- - "null"
- sort:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- source:
- anyOf:
- - type: string
- enum:
- - remote
- - custom
- - builtin
- - type: "null"
- type:
- anyOf:
- - type: string
- enum:
- - chat
- - embedding
- - tts
- - asr
- - image
- - text2video
- - text2music
- - realtime
- - stt
- - type: "null"
+ /api/v1/memories/{category}:
+ get:
+ operationId: listMemoryCategory
+ tags:
+ - memories
responses:
"200":
content:
@@ -15029,7 +14624,10 @@ paths:
properties:
data:
additionalProperties: true
- type: object
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -15098,37 +14696,50 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
- tags:
- - models
- /api/v1/permissions:
- get:
- operationId: getApiV1Permissions
parameters:
- - in: query
- name: active
- schema:
- type:
- - string
- - "null"
- - in: query
+ - in: path
name: category
- schema:
- anyOf:
- - type: string
- minLength: 1
- - type: "null"
- - in: query
- name: keyword
- schema:
- type: string
- - in: query
- name: page
schema:
type: string
- - in: query
- name: pageSize
+ enum:
+ - identities
+ - preferences
+ - contexts
+ - activities
+ - experiences
+ required: true
+ /api/v1/message-translations/{messageId}:
+ post:
+ operationId: postApiV1MessageTranslationsByMessageId
+ parameters:
+ - in: path
+ name: messageId
schema:
type: string
+ minLength: 1
+ required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ from:
+ type: string
+ model:
+ type:
+ - string
+ - "null"
+ provider:
+ type:
+ - string
+ - "null"
+ to:
+ type: string
+ minLength: 1
+ required:
+ - to
responses:
"200":
content:
@@ -15138,16 +14749,6 @@ paths:
properties:
data:
additionalProperties: true
- properties:
- permissions:
- items:
- $ref: "#/components/schemas/Permission"
- type: array
- total:
- minimum: 0
- type: integer
- required:
- - permissions
type: object
message:
type: string
@@ -15218,38 +14819,16 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - permissions
- post:
- operationId: postApiV1Permissions
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- category:
- type: string
- minLength: 1
- code:
- type: string
- minLength: 1
- description:
- type:
- - string
- - "null"
- isActive:
- default: true
- type:
- - boolean
- - "null"
- name:
- type: string
- minLength: 1
- required:
- - category
- - code
- - name
+ - message-translations
+ get:
+ operationId: getApiV1MessageTranslationsByMessageId
+ parameters:
+ - in: path
+ name: messageId
+ schema:
+ type: string
+ minLength: 1
+ required: true
responses:
"200":
content:
@@ -15258,7 +14837,8 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Permission"
+ additionalProperties: true
+ type: object
message:
type: string
success:
@@ -15328,18 +14908,40 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - permissions
- /api/v1/permissions/{id}:
- get:
- operationId: getApiV1PermissionsById
+ - message-translations
+ patch:
+ operationId: patchApiV1MessageTranslationsByMessageId
parameters:
- in: path
- name: id
+ name: messageId
schema:
type: string
- minLength: 16
- maxLength: 16
+ minLength: 1
required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ from:
+ type: string
+ model:
+ type:
+ - string
+ - "null"
+ provider:
+ type:
+ - string
+ - "null"
+ to:
+ type: string
+ minLength: 1
+ content:
+ type: string
+ required:
+ - to
responses:
"200":
content:
@@ -15348,7 +14950,8 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Permission"
+ additionalProperties: true
+ type: object
message:
type: string
success:
@@ -15418,42 +15021,16 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - permissions
- patch:
- operationId: patchApiV1PermissionsById
+ - message-translations
+ delete:
+ operationId: deleteApiV1MessageTranslationsByMessageId
parameters:
- in: path
- name: id
+ name: messageId
schema:
type: string
- minLength: 16
- maxLength: 16
+ minLength: 1
required: true
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- category:
- type: string
- minLength: 1
- code:
- type: string
- minLength: 1
- description:
- type:
- - string
- - "null"
- isActive:
- default: true
- type:
- - boolean
- - "null"
- name:
- type: string
- minLength: 1
responses:
"200":
content:
@@ -15462,7 +15039,8 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Permission"
+ additionalProperties: true
+ type: object
message:
type: string
success:
@@ -15532,17 +15110,33 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - permissions
- delete:
- operationId: deleteApiV1PermissionsById
+ - message-translations
+ /api/v1/messages/count:
+ get:
+ operationId: getApiV1MessagesCount
parameters:
- - in: path
- name: id
+ - in: query
+ name: topicId
schema:
type: string
- minLength: 16
- maxLength: 16
- required: true
+ minLength: 1
+ - in: query
+ name: threadId
+ schema:
+ type: string
+ minLength: 1
+ - in: query
+ name: topicIds
+ schema:
+ type:
+ - string
+ - "null"
+ - in: query
+ name: userId
+ schema:
+ type:
+ - string
+ - "null"
responses:
"200":
content:
@@ -15551,10 +15145,14 @@ paths:
additionalProperties: false
properties:
data:
- additionalProperties: true
- type:
- - object
- - "null"
+ additionalProperties: false
+ properties:
+ count:
+ minimum: 0
+ type: integer
+ required:
+ - count
+ type: object
message:
type: string
success:
@@ -15624,11 +15222,39 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - permissions
- /api/v1/providers:
+ - messages
+ /api/v1/messages:
get:
- operationId: getApiV1Providers
+ operationId: getApiV1Messages
parameters:
+ - in: query
+ name: threadId
+ schema:
+ type: string
+ minLength: 1
+ - in: query
+ name: topicId
+ schema:
+ type:
+ - string
+ - "null"
+ - in: query
+ name: userId
+ schema:
+ type:
+ - string
+ - "null"
+ - in: query
+ name: role
+ schema:
+ anyOf:
+ - type: string
+ enum:
+ - user
+ - system
+ - assistant
+ - tool
+ - type: "null"
- in: query
name: keyword
schema:
@@ -15636,15 +15262,27 @@ paths:
- in: query
name: page
schema:
- type: string
+ type: integer
+ minimum: 1
+ maximum: 1000000
- in: query
name: pageSize
schema:
- type: string
+ type: integer
+ minimum: 1
+ maximum: 100
- in: query
- name: enabled
+ name: limit
schema:
- type: boolean
+ type: integer
+ minimum: 1
+ maximum: 100
+ - in: query
+ name: offset
+ schema:
+ type: integer
+ minimum: 0
+ maximum: 1000000
responses:
"200":
content:
@@ -15655,15 +15293,15 @@ paths:
data:
additionalProperties: true
properties:
- providers:
+ messages:
items:
- $ref: "#/components/schemas/Provider"
+ $ref: "#/components/schemas/Message"
type: array
total:
minimum: 0
type: integer
required:
- - providers
+ - messages
type: object
message:
type: string
@@ -15734,9 +15372,9 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - providers
+ - messages
post:
- operationId: postApiV1Providers
+ operationId: postApiV1Messages
requestBody:
required: true
content:
@@ -15744,61 +15382,86 @@ paths:
schema:
type: object
properties:
- checkModel:
+ content:
+ type: string
+ minLength: 1
+ role:
+ type: string
+ enum:
+ - user
+ - system
+ - assistant
+ - tool
+ model:
type:
- string
- "null"
- config:
- type: object
- propertyNames:
- type: string
- additionalProperties: {}
- description:
+ provider:
type:
- string
- "null"
- enabled:
- type: boolean
- fetchOnClient:
+ topicId:
type:
- - boolean
+ - string
- "null"
- keyVaults:
- type: object
- propertyNames:
- type: string
- additionalProperties:
- type: string
- logo:
+ threadId:
type:
- string
- "null"
- name:
+ parentId:
+ type:
+ - string
+ - "null"
+ quotaId:
+ type:
+ - string
+ - "null"
+ agentId:
+ type:
+ - string
+ - "null"
+ clientId:
+ type:
+ - string
+ - "null"
+ metadata:
anyOf:
- - type: string
- minLength: 1
+ - {}
- type: "null"
- settings:
- type: object
- propertyNames:
- type: string
- additionalProperties: {}
- sort:
+ reasoning:
anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
+ - {}
- type: "null"
- source:
- type: string
- enum:
- - builtin
- - custom
- id:
- type: string
- minLength: 1
+ search:
+ anyOf:
+ - {}
+ - type: "null"
+ tools:
+ anyOf:
+ - {}
+ - type: "null"
+ traceId:
+ type:
+ - string
+ - "null"
+ observationId:
+ type:
+ - string
+ - "null"
+ files:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ - type: "null"
+ favorite:
+ default: false
+ type:
+ - boolean
+ - "null"
required:
- - id
+ - content
+ - role
responses:
"200":
content:
@@ -15807,7 +15470,7 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Provider"
+ $ref: "#/components/schemas/Message"
message:
type: string
success:
@@ -15877,27 +15540,36 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - providers
- /api/v1/providers/{id}:
- get:
- operationId: getApiV1ProvidersById
- parameters:
- - in: path
- name: id
- schema:
- type: string
- minLength: 1
- maxLength: 64
- required: true
- responses:
- "200":
- content:
- application/json:
- schema:
- additionalProperties: false
- properties:
- data:
- $ref: "#/components/schemas/Provider"
+ - messages
+ delete:
+ operationId: deleteApiV1Messages
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ messageIds:
+ minItems: 1
+ type: array
+ items:
+ type: string
+ minLength: 1
+ required:
+ - messageIds
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - object
+ - "null"
message:
type: string
success:
@@ -15967,76 +15639,17 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - providers
- patch:
- operationId: patchApiV1ProvidersById
+ - messages
+ /api/v1/messages/{id}:
+ get:
+ operationId: getApiV1MessagesById
parameters:
- in: path
name: id
schema:
type: string
minLength: 1
- maxLength: 64
required: true
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- checkModel:
- type:
- - string
- - "null"
- config:
- type: object
- propertyNames:
- type: string
- additionalProperties: {}
- description:
- type:
- - string
- - "null"
- enabled:
- type: boolean
- fetchOnClient:
- type:
- - boolean
- - "null"
- keyVaults:
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties:
- type: string
- - type: "null"
- logo:
- type:
- - string
- - "null"
- name:
- anyOf:
- - type: string
- minLength: 1
- - type: "null"
- settings:
- type: object
- propertyNames:
- type: string
- additionalProperties: {}
- sort:
- anyOf:
- - type: integer
- minimum: -9007199254740991
- maximum: 9007199254740991
- - type: "null"
- source:
- type: string
- enum:
- - builtin
- - custom
responses:
"200":
content:
@@ -16045,7 +15658,7 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Provider"
+ $ref: "#/components/schemas/Message"
message:
type: string
success:
@@ -16115,16 +15728,15 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - providers
+ - messages
delete:
- operationId: deleteApiV1ProvidersById
+ operationId: deleteApiV1MessagesById
parameters:
- in: path
name: id
schema:
type: string
minLength: 1
- maxLength: 64
required: true
responses:
"200":
@@ -16207,10 +15819,10 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - providers
- /api/v1/responses:
+ - messages
+ /api/v1/messages/replies:
post:
- operationId: postApiV1Responses
+ operationId: postApiV1MessagesReplies
requestBody:
required: true
content:
@@ -16218,295 +15830,105 @@ paths:
schema:
type: object
properties:
- input:
- anyOf:
- - type: string
- - type: array
- items:
- oneOf:
- - type: object
- properties:
- content:
- anyOf:
- - type: string
- - type: array
- items:
- oneOf:
- - type: object
- properties:
- text:
- type: string
- type:
- type: string
- const: input_text
- required:
- - text
- - type
- - type: object
- properties:
- annotations:
- type: array
- items: {}
- logprobs:
- type: array
- items: {}
- text:
- type: string
- type:
- type: string
- const: output_text
- required:
- - text
- - type
- - type: object
- properties:
- detail:
- type: string
- enum:
- - auto
- - low
- - high
- image_url:
- type: string
- type:
- type: string
- const: input_image
- required:
- - type
- - type: object
- properties:
- file_data:
- type: string
- file_id:
- type: string
- filename:
- type: string
- type:
- type: string
- const: input_file
- required:
- - type
- id:
- type: string
- role:
- type: string
- enum:
- - user
- - assistant
- - system
- - developer
- status:
- type: string
- enum:
- - completed
- - in_progress
- type:
- type: string
- const: message
- required:
- - content
- - role
- - type
- additionalProperties: {}
- - type: object
- properties:
- arguments:
- type: string
- call_id:
- type: string
- id:
- type: string
- name:
- type: string
- status:
- type: string
- enum:
- - completed
- - in_progress
- type:
- type: string
- const: function_call
- required:
- - arguments
- - name
- - type
- - type: object
- properties:
- call_id:
- type: string
- id:
- type: string
- output:
- type: string
- status:
- type: string
- enum:
- - completed
- - in_progress
- - incomplete
- type:
- type: string
- const: function_call_output
- required:
- - call_id
- - output
- - type
- instructions:
+ content:
+ type: string
+ minLength: 1
+ role:
+ type: string
+ const: user
+ model:
type:
- string
- "null"
- max_output_tokens:
- anyOf:
- - type: integer
- exclusiveMinimum: 0
- maximum: 9007199254740991
- - type: "null"
- metadata:
- anyOf:
- - type: object
- propertyNames:
- type: string
- additionalProperties:
- type: string
- - type: "null"
- model:
- type: string
- parallel_tool_calls:
+ provider:
type:
- - boolean
+ - string
- "null"
- previous_response_id:
+ topicId:
type:
- string
- "null"
- reasoning:
- anyOf:
- - type: object
- properties:
- effort:
- type: string
- enum:
- - low
- - medium
- - high
- - type: "null"
- stream:
+ threadId:
type:
- - boolean
+ - string
- "null"
- temperature:
+ parentId:
+ type:
+ - string
+ - "null"
+ quotaId:
+ type:
+ - string
+ - "null"
+ agentId:
+ type:
+ - string
+ - "null"
+ clientId:
+ type:
+ - string
+ - "null"
+ metadata:
anyOf:
- - type: number
- minimum: 0
- maximum: 2
+ - {}
- type: "null"
- tool_choice:
+ reasoning:
anyOf:
- - anyOf:
- - type: string
- enum:
- - auto
- - required
- - none
- - type: object
- properties:
- name:
- type: string
- type:
- type: string
- const: function
- required:
- - name
- - type
+ - {}
- type: "null"
- tools:
+ search:
anyOf:
- - type: array
- items:
- anyOf:
- - type: object
- properties:
- description:
- type: string
- name:
- type: string
- parameters:
- type: object
- propertyNames:
- type: string
- additionalProperties: {}
- strict:
- type: boolean
- type:
- type: string
- const: function
- required:
- - name
- - type
- - type: object
- properties:
- type:
- type: string
- pattern: ^lobe-.*
- required:
- - type
+ - {}
- type: "null"
- top_p:
+ tools:
anyOf:
- - type: number
- minimum: 0
- maximum: 1
+ - {}
- type: "null"
- truncation:
+ traceId:
+ type:
+ - string
+ - "null"
+ observationId:
+ type:
+ - string
+ - "null"
+ files:
anyOf:
- - type: object
- properties:
- type:
- default: disabled
- type: string
- enum:
- - auto
- - disabled
+ - type: array
+ items:
+ type: string
- type: "null"
- user:
+ favorite:
+ default: false
type:
- - string
+ - boolean
- "null"
required:
- - input
- - model
- additionalProperties: {}
+ - content
+ - role
responses:
"200":
content:
application/json:
schema:
- additionalProperties: true
+ additionalProperties: false
properties:
- id:
- type: string
- object:
- const: response
+ data:
+ anyOf:
+ - $ref: "#/components/schemas/Message"
+ - type: "null"
+ message:
type: string
- output:
- items:
- type: object
- type: array
- status:
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
type: string
- usage:
- type:
- - object
- - "null"
required:
- - id
- - object
- - output
- - status
+ - success
+ - timestamp
type: object
- text/event-stream:
- schema:
- type: string
description: Successful response
"400":
description: Validation Error
@@ -16564,23 +15986,11 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - responses
- /api/v1/roles:
+ - messages
+ /api/v1/models:
get:
- operationId: getApiV1Roles
+ operationId: getApiV1Models
parameters:
- - in: query
- name: active
- schema:
- type:
- - string
- - "null"
- - in: query
- name: system
- schema:
- type:
- - string
- - "null"
- in: query
name: keyword
schema:
@@ -16593,6 +16003,36 @@ paths:
name: pageSize
schema:
type: string
+ - in: query
+ name: enabled
+ schema:
+ type:
+ - string
+ - "null"
+ - in: query
+ name: provider
+ schema:
+ anyOf:
+ - type: string
+ minLength: 1
+ maxLength: 64
+ - type: "null"
+ - in: query
+ name: type
+ schema:
+ anyOf:
+ - type: string
+ enum:
+ - chat
+ - embedding
+ - tts
+ - asr
+ - image
+ - text2video
+ - text2music
+ - realtime
+ - stt
+ - type: "null"
responses:
"200":
content:
@@ -16603,15 +16043,15 @@ paths:
data:
additionalProperties: true
properties:
- roles:
+ models:
items:
- $ref: "#/components/schemas/Role"
+ $ref: "#/components/schemas/Model"
type: array
total:
minimum: 0
type: integer
required:
- - roles
+ - models
type: object
message:
type: string
@@ -16682,9 +16122,9 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - roles
+ - models
post:
- operationId: postApiV1Roles
+ operationId: postApiV1Models
requestBody:
required: true
content:
@@ -16692,29 +16132,3604 @@ paths:
schema:
type: object
properties:
+ abilities:
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ - type: "null"
+ config:
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ - type: "null"
+ contextWindowTokens:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
description:
type:
- string
- "null"
displayName:
type: string
- minLength: 1
- isActive:
- default: true
- type:
- - boolean
- - "null"
- isSystem:
- default: false
- type:
- - boolean
- - "null"
- name:
+ minLength: 1
+ enabled:
+ type:
+ - boolean
+ - "null"
+ organization:
+ type:
+ - string
+ - "null"
+ parameters:
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ - type: "null"
+ pricing:
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ - type: "null"
+ releasedAt:
+ type:
+ - string
+ - "null"
+ sort:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ source:
+ anyOf:
+ - type: string
+ enum:
+ - remote
+ - custom
+ - builtin
+ - type: "null"
+ type:
+ anyOf:
+ - type: string
+ enum:
+ - chat
+ - embedding
+ - tts
+ - asr
+ - image
+ - text2video
+ - text2music
+ - realtime
+ - stt
+ - type: "null"
+ id:
+ type: string
+ minLength: 1
+ maxLength: 150
+ providerId:
+ type: string
+ minLength: 1
+ maxLength: 64
+ required:
+ - displayName
+ - id
+ - providerId
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/Model"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - models
+ /api/v1/models/{providerId}/{modelId}:
+ get:
+ operationId: getApiV1ModelsByProviderIdByModelId
+ parameters:
+ - in: path
+ name: modelId
+ schema:
+ type: string
+ minLength: 1
+ maxLength: 150
+ required: true
+ - in: path
+ name: providerId
+ schema:
+ type: string
+ minLength: 1
+ maxLength: 64
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type: object
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - models
+ patch:
+ operationId: patchApiV1ModelsByProviderIdByModelId
+ parameters:
+ - in: path
+ name: modelId
+ schema:
+ type: string
+ minLength: 1
+ maxLength: 150
+ required: true
+ - in: path
+ name: providerId
+ schema:
+ type: string
+ minLength: 1
+ maxLength: 64
+ required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ abilities:
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ - type: "null"
+ config:
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ - type: "null"
+ contextWindowTokens:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ description:
+ type:
+ - string
+ - "null"
+ displayName:
+ type: string
+ minLength: 1
+ enabled:
+ type:
+ - boolean
+ - "null"
+ organization:
+ type:
+ - string
+ - "null"
+ parameters:
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ - type: "null"
+ pricing:
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ - type: "null"
+ releasedAt:
+ type:
+ - string
+ - "null"
+ sort:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ source:
+ anyOf:
+ - type: string
+ enum:
+ - remote
+ - custom
+ - builtin
+ - type: "null"
+ type:
+ anyOf:
+ - type: string
+ enum:
+ - chat
+ - embedding
+ - tts
+ - asr
+ - image
+ - text2video
+ - text2music
+ - realtime
+ - stt
+ - type: "null"
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type: object
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - models
+ /api/v1/notifications:
+ get:
+ operationId: getApiV1Notifications
+ parameters:
+ - in: query
+ name: category
+ schema:
+ type: string
+ - in: query
+ name: cursor
+ schema:
+ type: string
+ - in: query
+ name: isRead
+ schema:
+ anyOf:
+ - type: boolean
+ - type: string
+ enum:
+ - "true"
+ - "false"
+ - in: query
+ name: limit
+ schema:
+ type: integer
+ minimum: 1
+ maximum: 50
+ - in: query
+ name: unreadOnly
+ schema:
+ anyOf:
+ - type: boolean
+ - type: string
+ enum:
+ - "true"
+ - "false"
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - notifications
+ /api/v1/notifications/unread-count:
+ get:
+ operationId: getUnreadNotificationCount
+ summary: Get the unread notification count
+ tags:
+ - notifications
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Invalid request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ /api/v1/notifications/counts:
+ get:
+ operationId: getNotificationCounts
+ summary: Get per-category notification counts
+ tags:
+ - notifications
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Invalid request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ /api/v1/notifications/read:
+ post:
+ operationId: markNotificationsRead
+ tags:
+ - notifications
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ ids:
+ minItems: 1
+ type: array
+ items:
+ type: string
+ minLength: 1
+ required:
+ - ids
+ /api/v1/notifications/read-all:
+ post:
+ operationId: markAllNotificationsRead
+ summary: Mark every notification as read
+ tags:
+ - notifications
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Invalid request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ /api/v1/notifications/archive-all:
+ post:
+ operationId: archiveAllNotifications
+ summary: Archive every notification
+ tags:
+ - notifications
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Invalid request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ /api/v1/notifications/{id}/archive:
+ post:
+ operationId: archiveNotification
+ tags:
+ - notifications
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ required: true
+ /api/v1/permissions:
+ get:
+ operationId: getApiV1Permissions
+ parameters:
+ - in: query
+ name: active
+ schema:
+ type:
+ - string
+ - "null"
+ - in: query
+ name: category
+ schema:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
+ - in: query
+ name: keyword
+ schema:
+ type: string
+ - in: query
+ name: page
+ schema:
+ type: string
+ - in: query
+ name: pageSize
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ properties:
+ permissions:
+ items:
+ $ref: "#/components/schemas/Permission"
+ type: array
+ total:
+ minimum: 0
+ type: integer
+ required:
+ - permissions
+ type: object
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - permissions
+ post:
+ operationId: postApiV1Permissions
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ category:
+ type: string
+ minLength: 1
+ code:
+ type: string
+ minLength: 1
+ description:
+ type:
+ - string
+ - "null"
+ isActive:
+ default: true
+ type:
+ - boolean
+ - "null"
+ name:
+ type: string
+ minLength: 1
+ required:
+ - category
+ - code
+ - name
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/Permission"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - permissions
+ /api/v1/permissions/{id}:
+ get:
+ operationId: getApiV1PermissionsById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 16
+ maxLength: 16
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/Permission"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - permissions
+ patch:
+ operationId: patchApiV1PermissionsById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 16
+ maxLength: 16
+ required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ category:
+ type: string
+ minLength: 1
+ code:
+ type: string
+ minLength: 1
+ description:
+ type:
+ - string
+ - "null"
+ isActive:
+ default: true
+ type:
+ - boolean
+ - "null"
+ name:
+ type: string
+ minLength: 1
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/Permission"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - permissions
+ delete:
+ operationId: deleteApiV1PermissionsById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 16
+ maxLength: 16
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - permissions
+ /api/v1/providers:
+ get:
+ operationId: getApiV1Providers
+ parameters:
+ - in: query
+ name: keyword
+ schema:
+ type: string
+ - in: query
+ name: page
+ schema:
+ type: string
+ - in: query
+ name: pageSize
+ schema:
+ type: string
+ - in: query
+ name: enabled
+ schema:
+ type: boolean
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ properties:
+ providers:
+ items:
+ $ref: "#/components/schemas/Provider"
+ type: array
+ total:
+ minimum: 0
+ type: integer
+ required:
+ - providers
+ type: object
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - providers
+ post:
+ operationId: postApiV1Providers
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ checkModel:
+ type:
+ - string
+ - "null"
+ config:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ description:
+ type:
+ - string
+ - "null"
+ enabled:
+ type: boolean
+ fetchOnClient:
+ type:
+ - boolean
+ - "null"
+ keyVaults:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties:
+ type: string
+ logo:
+ type:
+ - string
+ - "null"
+ name:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
+ settings:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ sort:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ source:
+ type: string
+ enum:
+ - builtin
+ - custom
+ id:
+ type: string
+ minLength: 1
+ required:
+ - id
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/Provider"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - providers
+ /api/v1/providers/{id}:
+ get:
+ operationId: getApiV1ProvidersById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ maxLength: 64
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/Provider"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - providers
+ patch:
+ operationId: patchApiV1ProvidersById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ maxLength: 64
+ required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ checkModel:
+ type:
+ - string
+ - "null"
+ config:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ description:
+ type:
+ - string
+ - "null"
+ enabled:
+ type: boolean
+ fetchOnClient:
+ type:
+ - boolean
+ - "null"
+ keyVaults:
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties:
+ type: string
+ - type: "null"
+ logo:
+ type:
+ - string
+ - "null"
+ name:
+ anyOf:
+ - type: string
+ minLength: 1
+ - type: "null"
+ settings:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ sort:
+ anyOf:
+ - type: integer
+ minimum: -9007199254740991
+ maximum: 9007199254740991
+ - type: "null"
+ source:
+ type: string
+ enum:
+ - builtin
+ - custom
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/Provider"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - providers
+ delete:
+ operationId: deleteApiV1ProvidersById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ maxLength: 64
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - providers
+ /api/v1/responses:
+ post:
+ operationId: postApiV1Responses
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ input:
+ anyOf:
+ - type: string
+ - type: array
+ items:
+ oneOf:
+ - type: object
+ properties:
+ content:
+ anyOf:
+ - type: string
+ - type: array
+ items:
+ oneOf:
+ - type: object
+ properties:
+ text:
+ type: string
+ type:
+ type: string
+ const: input_text
+ required:
+ - text
+ - type
+ - type: object
+ properties:
+ annotations:
+ type: array
+ items: {}
+ logprobs:
+ type: array
+ items: {}
+ text:
+ type: string
+ type:
+ type: string
+ const: output_text
+ required:
+ - text
+ - type
+ - type: object
+ properties:
+ detail:
+ type: string
+ enum:
+ - auto
+ - low
+ - high
+ image_url:
+ type: string
+ type:
+ type: string
+ const: input_image
+ required:
+ - type
+ - type: object
+ properties:
+ file_data:
+ type: string
+ file_id:
+ type: string
+ filename:
+ type: string
+ type:
+ type: string
+ const: input_file
+ required:
+ - type
+ id:
+ type: string
+ role:
+ type: string
+ enum:
+ - user
+ - assistant
+ - system
+ - developer
+ status:
+ type: string
+ enum:
+ - completed
+ - in_progress
+ type:
+ type: string
+ const: message
+ required:
+ - content
+ - role
+ - type
+ additionalProperties: {}
+ - type: object
+ properties:
+ arguments:
+ type: string
+ call_id:
+ type: string
+ id:
+ type: string
+ name:
+ type: string
+ status:
+ type: string
+ enum:
+ - completed
+ - in_progress
+ type:
+ type: string
+ const: function_call
+ required:
+ - arguments
+ - name
+ - type
+ - type: object
+ properties:
+ call_id:
+ type: string
+ id:
+ type: string
+ output:
+ type: string
+ status:
+ type: string
+ enum:
+ - completed
+ - in_progress
+ - incomplete
+ type:
+ type: string
+ const: function_call_output
+ required:
+ - call_id
+ - output
+ - type
+ instructions:
+ type:
+ - string
+ - "null"
+ max_output_tokens:
+ anyOf:
+ - type: integer
+ exclusiveMinimum: 0
+ maximum: 9007199254740991
+ - type: "null"
+ metadata:
+ anyOf:
+ - type: object
+ propertyNames:
+ type: string
+ additionalProperties:
+ type: string
+ - type: "null"
+ model:
+ type: string
+ parallel_tool_calls:
+ type:
+ - boolean
+ - "null"
+ previous_response_id:
+ type:
+ - string
+ - "null"
+ reasoning:
+ anyOf:
+ - type: object
+ properties:
+ effort:
+ type: string
+ enum:
+ - low
+ - medium
+ - high
+ - type: "null"
+ stream:
+ type:
+ - boolean
+ - "null"
+ temperature:
+ anyOf:
+ - type: number
+ minimum: 0
+ maximum: 2
+ - type: "null"
+ tool_choice:
+ anyOf:
+ - anyOf:
+ - type: string
+ enum:
+ - auto
+ - required
+ - none
+ - type: object
+ properties:
+ name:
+ type: string
+ type:
+ type: string
+ const: function
+ required:
+ - name
+ - type
+ - type: "null"
+ tools:
+ anyOf:
+ - type: array
+ items:
+ anyOf:
+ - type: object
+ properties:
+ description:
+ type: string
+ name:
+ type: string
+ parameters:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ strict:
+ type: boolean
+ type:
+ type: string
+ const: function
+ required:
+ - name
+ - type
+ - type: object
+ properties:
+ type:
+ type: string
+ pattern: ^lobe-.*
+ required:
+ - type
+ - type: "null"
+ top_p:
+ anyOf:
+ - type: number
+ minimum: 0
+ maximum: 1
+ - type: "null"
+ truncation:
+ anyOf:
+ - type: object
+ properties:
+ type:
+ default: disabled
+ type: string
+ enum:
+ - auto
+ - disabled
+ - type: "null"
+ user:
+ type:
+ - string
+ - "null"
+ required:
+ - input
+ - model
+ additionalProperties: {}
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: true
+ properties:
+ id:
+ type: string
+ object:
+ const: response
+ type: string
+ output:
+ items:
+ type: object
+ type: array
+ status:
+ type: string
+ usage:
+ type:
+ - object
+ - "null"
+ required:
+ - id
+ - object
+ - output
+ - status
+ type: object
+ text/event-stream:
+ schema:
+ type: string
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - responses
+ /api/v1/roles:
+ get:
+ operationId: getApiV1Roles
+ parameters:
+ - in: query
+ name: active
+ schema:
+ type:
+ - string
+ - "null"
+ - in: query
+ name: system
+ schema:
+ type:
+ - string
+ - "null"
+ - in: query
+ name: keyword
+ schema:
+ type: string
+ - in: query
+ name: page
+ schema:
+ type: string
+ - in: query
+ name: pageSize
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ properties:
+ roles:
+ items:
+ $ref: "#/components/schemas/Role"
+ type: array
+ total:
+ minimum: 0
+ type: integer
+ required:
+ - roles
+ type: object
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - roles
+ post:
+ operationId: postApiV1Roles
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ description:
+ type:
+ - string
+ - "null"
+ displayName:
+ type: string
+ minLength: 1
+ isActive:
+ default: true
+ type:
+ - boolean
+ - "null"
+ isSystem:
+ default: false
+ type:
+ - boolean
+ - "null"
+ name:
+ type: string
+ minLength: 1
+ required:
+ - displayName
+ - name
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/Role"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - roles
+ /api/v1/roles/{id}:
+ get:
+ operationId: getApiV1RolesById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/Role"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - roles
+ patch:
+ operationId: patchApiV1RolesById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ description:
+ type:
+ - string
+ - "null"
+ displayName:
+ type: string
+ minLength: 1
+ isActive:
+ default: true
+ type:
+ - boolean
+ - "null"
+ isSystem:
+ default: false
+ type:
+ - boolean
+ - "null"
+ name:
+ type: string
+ minLength: 1
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ $ref: "#/components/schemas/Role"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - roles
+ delete:
+ operationId: deleteApiV1RolesById
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - roles
+ /api/v1/roles/{id}/permissions:
+ get:
+ operationId: getApiV1RolesByIdPermissions
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ required: true
+ - in: query
+ name: keyword
+ schema:
+ type: string
+ - in: query
+ name: page
+ schema:
+ type: string
+ - in: query
+ name: pageSize
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type: object
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - roles
+ patch:
+ operationId: patchApiV1RolesByIdPermissions
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ grant:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ minLength: 1
+ - type: "null"
+ revoke:
+ anyOf:
+ - type: array
+ items:
+ type: string
+ minLength: 1
+ - type: "null"
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type: object
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - roles
+ delete:
+ operationId: deleteApiV1RolesByIdPermissions
+ parameters:
+ - in: path
+ name: id
+ schema:
+ type: string
+ minLength: 1
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ tags:
+ - roles
+ /api/v1/signals/source-events:
+ post:
+ operationId: emitSourceEvent
+ tags:
+ - signals
+ responses:
+ "202":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ payload:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ scopeKey:
+ type: string
+ sourceId:
+ type: string
+ minLength: 1
+ sourceType:
+ type: string
+ enum:
+ - client.gateway.error
+ - client.gateway.runtime_end
+ - client.gateway.step_complete
+ - client.gateway.stream_start
+ - client.runtime.complete
+ - client.runtime.start
+ timestamp:
+ type: number
+ required:
+ - payload
+ - sourceId
+ - sourceType
+ /api/v1/signals/trigger:
+ post:
+ operationId: triggerSourceEvent
+ tags:
+ - signals
+ responses:
+ "202":
+ content:
+ application/json:
+ schema:
+ additionalProperties: false
+ properties:
+ data:
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
+ message:
+ type: string
+ success:
+ const: true
+ type: boolean
+ timestamp:
+ format: date-time
+ type: string
+ required:
+ - success
+ - timestamp
+ type: object
+ description: Successful response
+ "400":
+ description: Validation Error
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ success:
+ type: boolean
+ enum:
+ - false
+ error:
+ type: array
+ items: {}
+ data: {}
+ required:
+ - success
+ - error
+ - data
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Authentication required
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Insufficient permission
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource not found
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Resource conflict
+ "429":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Rate limit exceeded
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ApiError"
+ description: Internal server error
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ agentId:
+ type: string
+ payloadOverride:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ scopeKey:
+ type: string
+ sourceId:
+ type: string
+ sourceType:
+ type: string
+ enum:
+ - agent.nightly_review.requested
+ - agent.self_reflection.requested
+ - agent.self_feedback_intent.declared
+ - agent.user.message
+ - tool.outcome.completed
+ - tool.outcome.failed
+ timestamp:
+ type: number
+ topicId:
type: string
- minLength: 1
required:
- - displayName
- - name
+ - sourceType
+ /api/v1/signals/receipts:
+ get:
+ operationId: listSignalReceipts
+ tags:
+ - signals
responses:
"200":
content:
@@ -16723,7 +19738,11 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Role"
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -16792,18 +19811,65 @@ paths:
schema:
$ref: "#/components/schemas/ApiError"
description: Internal server error
- tags:
- - roles
- /api/v1/roles/{id}:
- get:
- operationId: getApiV1RolesById
parameters:
- - in: path
- name: id
+ - in: query
+ name: agentId
+ schema:
+ type: string
+ minLength: 1
+ required: true
+ - in: query
+ name: cursor
+ schema:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ - in: query
+ name: limit
+ schema:
+ type: integer
+ minimum: 1
+ maximum: 50
+ - in: query
+ name: sinceCreatedAt
+ schema:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ - in: query
+ name: topicId
schema:
type: string
minLength: 1
required: true
+ /api/v1/tasks:
+ get:
+ operationId: getApiV1Tasks
+ parameters:
+ - in: query
+ name: assigneeAgentId
+ schema:
+ type: string
+ - in: query
+ name: limit
+ schema:
+ type: integer
+ minimum: 1
+ maximum: 100
+ - in: query
+ name: offset
+ schema:
+ type: integer
+ minimum: 0
+ maximum: 9007199254740991
+ - in: query
+ name: projectId
+ schema:
+ type: string
+ - in: query
+ name: statuses
+ schema:
+ type: string
responses:
"200":
content:
@@ -16812,7 +19878,11 @@ paths:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Role"
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -16882,16 +19952,9 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - roles
- patch:
- operationId: patchApiV1RolesById
- parameters:
- - in: path
- name: id
- schema:
- type: string
- minLength: 1
- required: true
+ - tasks
+ post:
+ operationId: postApiV1Tasks
requestBody:
required: true
content:
@@ -16899,35 +19962,61 @@ paths:
schema:
type: object
properties:
+ assigneeAgentId:
+ type: string
+ assigneeUserId:
+ type: string
+ automationMode:
+ type: string
+ enum:
+ - heartbeat
+ - schedule
+ config:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ createdByAgentId:
+ type: string
description:
- type:
- - string
- - "null"
- displayName:
+ type: string
+ instruction:
type: string
minLength: 1
- isActive:
- default: true
- type:
- - boolean
- - "null"
- isSystem:
- default: false
- type:
- - boolean
- - "null"
name:
type: string
- minLength: 1
+ parentTaskId:
+ type: string
+ priority:
+ type: integer
+ minimum: 0
+ maximum: 4
+ projectId:
+ type: string
+ schedulePattern:
+ type: string
+ scheduleTimezone:
+ type: string
+ visibility:
+ type: string
+ enum:
+ - private
+ - public
+ required:
+ - instruction
responses:
- "200":
+ "201":
content:
application/json:
schema:
additionalProperties: false
properties:
data:
- $ref: "#/components/schemas/Role"
+ additionalProperties: true
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -16997,9 +20086,10 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - roles
- delete:
- operationId: deleteApiV1RolesById
+ - tasks
+ /api/v1/tasks/{id}:
+ get:
+ operationId: getApiV1TasksById
parameters:
- in: path
name: id
@@ -17017,6 +20107,7 @@ paths:
data:
additionalProperties: true
type:
+ - array
- object
- "null"
message:
@@ -17088,10 +20179,9 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - roles
- /api/v1/roles/{id}/permissions:
- get:
- operationId: getApiV1RolesByIdPermissions
+ - tasks
+ patch:
+ operationId: patchApiV1TasksById
parameters:
- in: path
name: id
@@ -17099,18 +20189,58 @@ paths:
type: string
minLength: 1
required: true
- - in: query
- name: keyword
- schema:
- type: string
- - in: query
- name: page
- schema:
- type: string
- - in: query
- name: pageSize
- schema:
- type: string
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ assigneeAgentId:
+ type:
+ - string
+ - "null"
+ assigneeUserId:
+ type:
+ - string
+ - "null"
+ automationMode:
+ anyOf:
+ - type: string
+ enum:
+ - heartbeat
+ - schedule
+ - type: "null"
+ config:
+ type: object
+ propertyNames:
+ type: string
+ additionalProperties: {}
+ description:
+ type:
+ - string
+ - "null"
+ instruction:
+ type: string
+ name:
+ type: string
+ parentTaskId:
+ type:
+ - string
+ - "null"
+ priority:
+ type: integer
+ minimum: 0
+ maximum: 4
+ schedulePattern:
+ type:
+ - string
+ - "null"
+ scheduleTimezone:
+ type:
+ - string
+ - "null"
+ additionalProperties: false
responses:
"200":
content:
@@ -17120,7 +20250,10 @@ paths:
properties:
data:
additionalProperties: true
- type: object
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -17190,9 +20323,9 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - roles
- patch:
- operationId: patchApiV1RolesByIdPermissions
+ - tasks
+ delete:
+ operationId: deleteApiV1TasksById
parameters:
- in: path
name: id
@@ -17200,27 +20333,6 @@ paths:
type: string
minLength: 1
required: true
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- grant:
- anyOf:
- - type: array
- items:
- type: string
- minLength: 1
- - type: "null"
- revoke:
- anyOf:
- - type: array
- items:
- type: string
- minLength: 1
- - type: "null"
responses:
"200":
content:
@@ -17230,7 +20342,10 @@ paths:
properties:
data:
additionalProperties: true
- type: object
+ type:
+ - array
+ - object
+ - "null"
message:
type: string
success:
@@ -17300,9 +20415,10 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - roles
- delete:
- operationId: deleteApiV1RolesByIdPermissions
+ - tasks
+ /api/v1/tasks/{id}/status:
+ patch:
+ operationId: patchApiV1TasksByIdStatus
parameters:
- in: path
name: id
@@ -17310,6 +20426,27 @@ paths:
type: string
minLength: 1
required: true
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ error:
+ type: string
+ status:
+ type: string
+ enum:
+ - backlog
+ - running
+ - scheduled
+ - paused
+ - completed
+ - failed
+ - canceled
+ required:
+ - status
responses:
"200":
content:
@@ -17320,6 +20457,7 @@ paths:
data:
additionalProperties: true
type:
+ - array
- object
- "null"
message:
@@ -17391,7 +20529,7 @@ paths:
$ref: "#/components/schemas/ApiError"
description: Internal server error
tags:
- - roles
+ - tasks
/api/v1/topics:
get:
operationId: getApiV1Topics
diff --git a/packages/openapi/scripts/generate-openapi.test.ts b/packages/openapi/scripts/generate-openapi.test.ts
index 89a7b4c00f8..a37a36d8035 100644
--- a/packages/openapi/scripts/generate-openapi.test.ts
+++ b/packages/openapi/scripts/generate-openapi.test.ts
@@ -86,4 +86,33 @@ describe('generate-openapi', () => {
}
}
});
+
+ it('declares the success status the handler actually returns', () => {
+ const spec = parse(readFileSync(path.join(PKG_ROOT, 'openapi.yml'), 'utf8'));
+
+ const successStatuses = (method: string, path: string) =>
+ Object.keys(spec.paths[path][method].responses).filter((status) => status.startsWith('2'));
+
+ // Creating and enqueueing are not 200 responses; the document (and the SDK
+ // generated from it) used to advertise 200 for all of them, so a
+ // status-discriminating client branched on a status the runtime never sends.
+ expect(successStatuses('post', '/api/v1/goals')).toEqual(['201']);
+ expect(successStatuses('post', '/api/v1/tasks')).toEqual(['201']);
+ expect(successStatuses('post', '/api/v1/signals/source-events')).toEqual(['202']);
+ expect(successStatuses('post', '/api/v1/signals/trigger')).toEqual(['202']);
+
+ // Exactly one success status per operation: a leftover placeholder 200 next
+ // to the real 201/202 is the same wrong contract, just harder to spot.
+ for (const [path, item] of Object.entries(
+ spec.paths as Record<string, Record<string, { responses: Record<string, unknown> }>>,
+ )) {
+ for (const [method, op] of Object.entries(item)) {
+ if (!['delete', 'get', 'patch', 'post', 'put'].includes(method)) continue;
+ expect(
+ Object.keys(op.responses).filter((status) => status.startsWith('2')),
+ `${method.toUpperCase()} ${path}`,
+ ).toHaveLength(1);
+ }
+ }
+ });
});
diff --git a/packages/openapi/src/common/base.controller.ts b/packages/openapi/src/common/base.controller.ts
index fcfd4b7e10d..6a43233f6ec 100644
--- a/packages/openapi/src/common/base.controller.ts
+++ b/packages/openapi/src/common/base.controller.ts
@@ -9,6 +9,31 @@ import type { LobeChatDatabase } from '@/database/type';
import { parseFormData } from '../helpers/file';
import type { ApiResponse } from '../types';
+/**
+ * tRPC error codes, mapped to their HTTP equivalents.
+ *
+ * The REST layer reuses server services that speak tRPC: a guard deep inside
+ * one throws `TRPCError({ code: 'NOT_FOUND' })`, and without this map every such
+ * refusal surfaces as a 500. Matching on `name`/`code` instead of importing
+ * `@trpc/server` keeps the package free of that dependency β€” `TRPCError` sets
+ * `name` to `'TRPCError'`, which is part of its own public shape.
+ */
+const TRPC_CODE_TO_STATUS: Record<string, number> = {
+ BAD_REQUEST: 400,
+ CLIENT_CLOSED_REQUEST: 499,
+ CONFLICT: 409,
+ FORBIDDEN: 403,
+ INTERNAL_SERVER_ERROR: 500,
+ METHOD_NOT_SUPPORTED: 405,
+ NOT_FOUND: 404,
+ PAYLOAD_TOO_LARGE: 413,
+ PRECONDITION_FAILED: 412,
+ TIMEOUT: 408,
+ TOO_MANY_REQUESTS: 429,
+ UNAUTHORIZED: 401,
+ UNPROCESSABLE_CONTENT: 422,
+};
+
/**
* Base Controller Class
* Provides unified response formatting, error handling, and common utility methods
@@ -78,6 +103,13 @@ export abstract class BaseController {
// Handle other known error types
if (error instanceof Error) {
+ // Refusals raised by the shared server services arrive as tRPC errors;
+ // map them back to their HTTP status so a missing agent is a 404, not a 500.
+ if (error.name === 'TRPCError') {
+ const code = (error as Error & { code?: string }).code;
+ return this.error(c, error.message, (code && TRPC_CODE_TO_STATUS[code]) || 500);
+ }
+
// Handle business logic errors
if (error.name === 'BusinessError') {
return this.error(c, error.message, 400);
diff --git a/packages/openapi/src/controllers/agent-signal.controller.ts b/packages/openapi/src/controllers/agent-signal.controller.ts
new file mode 100644
index 00000000000..c47e91db08f
--- /dev/null
+++ b/packages/openapi/src/controllers/agent-signal.controller.ts
@@ -0,0 +1,53 @@
+import type { Context } from 'hono';
+
+import { BaseController } from '../common/base.controller';
+import { AgentSignalRestService } from '../services/agent-signal.service';
+import type {
+ EmitSourceEventRequest,
+ ListReceiptsQuery,
+ TriggerSourceEventRequest,
+} from '../types/agent-signal.type';
+
+/** Agent Signal controller β€” emit or synthesise the events that wake an agent. */
+export class AgentSignalController extends BaseController {
+ private async service(c: Context): Promise<AgentSignalRestService> {
+ return new AgentSignalRestService(
+ await this.getDatabase(),
+ this.getUserId(c),
+ this.getWorkspaceId(c),
+ );
+ }
+
+ /** POST /api/v1/signals/source-events */
+ async emitSourceEvent(c: Context): Promise<Response> {
+ try {
+ const body = await this.getBody<EmitSourceEventRequest>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.emitSourceEvent(body), 'Source event enqueued', 202);
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/signals/trigger */
+ async triggerSourceEvent(c: Context): Promise<Response> {
+ try {
+ const body = await this.getBody<TriggerSourceEventRequest>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.triggerSourceEvent(body), 'Source event triggered', 202);
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** GET /api/v1/signals/receipts */
+ async listReceipts(c: Context): Promise<Response> {
+ try {
+ const query = this.getQuery<ListReceiptsQuery>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.listReceipts(query), 'Signal receipts retrieved');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+}
diff --git a/packages/openapi/src/controllers/goal.controller.ts b/packages/openapi/src/controllers/goal.controller.ts
new file mode 100644
index 00000000000..9113c308471
--- /dev/null
+++ b/packages/openapi/src/controllers/goal.controller.ts
@@ -0,0 +1,134 @@
+import type { Context } from 'hono';
+
+import { BaseController } from '../common/base.controller';
+import { GoalRestService } from '../services/goal.service';
+import type {
+ CreateGoalRequest,
+ GoalIdParam,
+ GoalListQuery,
+ RestartGoalRequest,
+ UpdateGoalRequest,
+} from '../types/goal.type';
+
+/**
+ * Goals controller.
+ * Handles HTTP concerns only β€” the coordinator behaviour lives in `GoalService`.
+ */
+export class GoalController extends BaseController {
+ private async service(c: Context): Promise<GoalRestService> {
+ return new GoalRestService(await this.getDatabase(), this.getUserId(c), this.getWorkspaceId(c));
+ }
+
+ /** GET /api/v1/goals */
+ async listGoals(c: Context): Promise<Response> {
+ try {
+ const query = this.getQuery<GoalListQuery>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.listGoals(query), 'Goal list retrieved successfully');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/goals */
+ async createGoal(c: Context): Promise<Response> {
+ try {
+ const body = await this.getBody<CreateGoalRequest>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.createGoal(body), 'Goal created', 201);
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** GET /api/v1/goals/:id */
+ async getGoal(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<GoalIdParam>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.getGoal(id), 'Goal retrieved successfully');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** GET /api/v1/goals/:id/supervision */
+ async getGoalSupervision(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<GoalIdParam>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.getSupervision(id), 'Goal supervision retrieved');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** PATCH /api/v1/goals/:id */
+ async updateGoal(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<GoalIdParam>(c);
+ const body = await this.getBody<UpdateGoalRequest>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.updateGoal(id, body), 'Goal updated');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** DELETE /api/v1/goals/:id */
+ async deleteGoal(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<GoalIdParam>(c);
+ const service = await this.service(c);
+ await service.deleteGoal(id);
+ return this.success(c, undefined, 'Goal deleted');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/goals/:id/advance */
+ async advanceGoal(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<GoalIdParam>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.advanceGoal(id), 'Goal advanced');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/goals/:id/pause */
+ async pauseGoal(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<GoalIdParam>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.pauseGoal(id), 'Goal paused');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/goals/:id/resume */
+ async resumeGoal(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<GoalIdParam>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.resumeGoal(id), 'Goal resumed');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/goals/:id/restart */
+ async restartGoal(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<GoalIdParam>(c);
+ const body = await this.getBody<RestartGoalRequest>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.restartGoal(id, body), 'Goal restarted');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+}
diff --git a/packages/openapi/src/controllers/memory.controller.ts b/packages/openapi/src/controllers/memory.controller.ts
new file mode 100644
index 00000000000..c7dd3075cf4
--- /dev/null
+++ b/packages/openapi/src/controllers/memory.controller.ts
@@ -0,0 +1,70 @@
+import type { Context } from 'hono';
+
+import { BaseController } from '../common/base.controller';
+import { MemoryRestService } from '../services/memory.service';
+import type { MemoryCategory, MemoryEntryIdParam } from '../types/memory.type';
+
+/** User memory controller β€” read the persona, inspect and prune memory entries. */
+export class MemoryController extends BaseController {
+ private async service(c: Context): Promise<MemoryRestService> {
+ return new MemoryRestService(
+ await this.getDatabase(),
+ this.getUserId(c),
+ this.getWorkspaceId(c),
+ );
+ }
+
+ /** GET /api/v1/memories/persona */
+ async getPersona(c: Context): Promise<Response> {
+ try {
+ const service = await this.service(c);
+ return this.success(c, await service.getPersona(), 'Persona retrieved');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** GET /api/v1/memories/persona/versions */
+ async listPersonaVersions(c: Context): Promise<Response> {
+ try {
+ const service = await this.service(c);
+ return this.success(c, await service.listPersonaVersions(), 'Persona versions retrieved');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** GET /api/v1/memories/:category */
+ async listCategory(c: Context): Promise<Response> {
+ try {
+ const { category } = this.getParams<{ category: MemoryCategory }>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.listCategory(category), `${category} retrieved`);
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** DELETE /api/v1/memories/:category/:id */
+ async deleteEntry(c: Context): Promise<Response> {
+ try {
+ const { category, id } = this.getParams<MemoryEntryIdParam & { category: MemoryCategory }>(c);
+ const service = await this.service(c);
+ await service.deleteEntry(category, id);
+ return this.success(c, undefined, 'Memory entry deleted');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** DELETE /api/v1/memories */
+ async deleteAll(c: Context): Promise<Response> {
+ try {
+ const service = await this.service(c);
+ await service.deleteAll();
+ return this.success(c, undefined, 'All memories deleted');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+}
diff --git a/packages/openapi/src/controllers/notification.controller.ts b/packages/openapi/src/controllers/notification.controller.ts
new file mode 100644
index 00000000000..c566669530c
--- /dev/null
+++ b/packages/openapi/src/controllers/notification.controller.ts
@@ -0,0 +1,101 @@
+import type { Context } from 'hono';
+
+import { BaseController } from '../common/base.controller';
+import { NotificationRestService } from '../services/notification.service';
+import type {
+ MarkNotificationsReadRequest,
+ NotificationIdParam,
+ NotificationListQuery,
+} from '../types/notification.type';
+
+/** Notifications controller β€” inbox reads and read/archive transitions. */
+export class NotificationController extends BaseController {
+ private async service(c: Context): Promise<NotificationRestService> {
+ return new NotificationRestService(
+ await this.getDatabase(),
+ this.getUserId(c),
+ this.getWorkspaceId(c),
+ );
+ }
+
+ /** GET /api/v1/notifications */
+ async listNotifications(c: Context): Promise<Response> {
+ try {
+ const query = this.getQuery<NotificationListQuery>(c);
+ const service = await this.service(c);
+ return this.success(
+ c,
+ await service.listNotifications(query),
+ 'Notification list retrieved successfully',
+ );
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** GET /api/v1/notifications/unread-count */
+ async getUnreadCount(c: Context): Promise<Response> {
+ try {
+ const service = await this.service(c);
+ return this.success(c, { count: await service.getUnreadCount() });
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** GET /api/v1/notifications/counts */
+ async getNavigationCounts(c: Context): Promise<Response> {
+ try {
+ const service = await this.service(c);
+ return this.success(c, await service.getNavigationCounts());
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/notifications/read */
+ async markAsRead(c: Context): Promise<Response> {
+ try {
+ const body = await this.getBody<MarkNotificationsReadRequest>(c);
+ const service = await this.service(c);
+ await service.markAsRead(body.ids);
+ return this.success(c, undefined, 'Notifications marked as read');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/notifications/read-all */
+ async markAllAsRead(c: Context): Promise<Response> {
+ try {
+ const service = await this.service(c);
+ await service.markAllAsRead();
+ return this.success(c, undefined, 'All notifications marked as read');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/notifications/archive-all */
+ async archiveAll(c: Context): Promise<Response> {
+ try {
+ const service = await this.service(c);
+ await service.archiveAll();
+ return this.success(c, undefined, 'All notifications archived');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/notifications/:id/archive */
+ async archive(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<NotificationIdParam>(c);
+ const service = await this.service(c);
+ await service.archive(id);
+ return this.success(c, undefined, 'Notification archived');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+}
diff --git a/packages/openapi/src/controllers/task.controller.ts b/packages/openapi/src/controllers/task.controller.ts
new file mode 100644
index 00000000000..bdeaea820c2
--- /dev/null
+++ b/packages/openapi/src/controllers/task.controller.ts
@@ -0,0 +1,87 @@
+import type { Context } from 'hono';
+
+import { BaseController } from '../common/base.controller';
+import { TaskRestService } from '../services/task.service';
+import type {
+ CreateTaskRequest,
+ TaskIdParam,
+ TaskListQuery,
+ UpdateTaskRequest,
+ UpdateTaskStatusRequest,
+} from '../types/task.type';
+
+/** Tasks controller β€” list, inspect, create, patch, transition and delete tasks. */
+export class TaskController extends BaseController {
+ private async service(c: Context): Promise<TaskRestService> {
+ return new TaskRestService(await this.getDatabase(), this.getUserId(c), this.getWorkspaceId(c));
+ }
+
+ /** GET /api/v1/tasks */
+ async listTasks(c: Context): Promise<Response> {
+ try {
+ const query = this.getQuery<TaskListQuery>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.listTasks(query), 'Task list retrieved successfully');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** POST /api/v1/tasks */
+ async createTask(c: Context): Promise<Response> {
+ try {
+ const body = await this.getBody<CreateTaskRequest>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.createTask(body), 'Task created', 201);
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** GET /api/v1/tasks/:id */
+ async getTask(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<TaskIdParam>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.getTask(id), 'Task retrieved successfully');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** PATCH /api/v1/tasks/:id */
+ async updateTask(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<TaskIdParam>(c);
+ const body = await this.getBody<UpdateTaskRequest>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.updateTask(id, body), 'Task updated');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** PATCH /api/v1/tasks/:id/status */
+ async updateTaskStatus(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<TaskIdParam>(c);
+ const body = await this.getBody<UpdateTaskStatusRequest>(c);
+ const service = await this.service(c);
+ return this.success(c, await service.updateTaskStatus(id, body), 'Task status updated');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+
+ /** DELETE /api/v1/tasks/:id */
+ async deleteTask(c: Context): Promise<Response> {
+ try {
+ const { id } = this.getParams<TaskIdParam>(c);
+ const service = await this.service(c);
+ await service.deleteTask(id);
+ return this.success(c, undefined, 'Task deleted');
+ } catch (error) {
+ return this.handleError(c, error);
+ }
+ }
+}
diff --git a/packages/openapi/src/routes/goals.route.test.ts b/packages/openapi/src/routes/goals.route.test.ts
new file mode 100644
index 00000000000..d8d2af871c4
--- /dev/null
+++ b/packages/openapi/src/routes/goals.route.test.ts
@@ -0,0 +1,89 @@
+import { Hono } from 'hono';
+import { describe, expect, it, vi } from 'vitest';
+
+// The route module pulls in the db graph (via the permission middleware) and the
+// better-auth graph (via `requireAuth`) at import time; this test is only about
+// the gates the route itself declares, so both are stubbed. The permission
+// middleware is deliberately NOT stubbed: the API-key scope narrowing inside it
+// is exactly what these cases exercise.
+vi.mock('@/database/core/db-adaptor', () => ({ getServerDB: vi.fn() }));
+vi.mock('@/database/models/rbac', () => ({
+ RbacModel: class {
+ hasAnyPermission = async () => true;
+ },
+}));
+vi.mock('../middleware/auth', () => ({
+ requireAuth: async (_c: any, next: any) => next(),
+}));
+vi.mock('../controllers/goal.controller', () => ({
+ GoalController: class {
+ listGoals(c: any) {
+ return c.json({ data: { goals: [] }, success: true });
+ }
+ createGoal(c: any) {
+ return c.json({ data: { id: 'goal-1' }, success: true }, 201);
+ }
+ },
+}));
+
+const { default: GoalRoutes } = await import('./goals.route');
+
+/** A request authenticated as an API key holding exactly `scopes`. */
+const requestAs = (scopes: string[], path: string, init?: { body?: unknown; method?: string }) => {
+ const app = new Hono();
+
+ app.use('*', async (c, next) => {
+ c.set('userId' as never, 'user-1' as never);
+ c.set('authType' as never, 'apikey' as never);
+ c.set('apiKeyScopes' as never, scopes as never);
+ await next();
+ });
+ app.route('/', GoalRoutes);
+
+ return app.request(path, {
+ ...(init?.body === undefined
+ ? {}
+ : { body: JSON.stringify(init.body), headers: { 'content-type': 'application/json' } }),
+ method: init?.method ?? 'GET',
+ });
+};
+
+describe('GET /goals API-key scopes', () => {
+ it('rejects a key that holds no agent scope', async () => {
+ const res = await requestAs(['chat:read'], '/');
+
+ expect(res.status).toBe(403);
+ });
+
+ it('accepts a key holding agent:read', async () => {
+ const res = await requestAs(['agent:read'], '/');
+
+ expect(res.status).toBe(200);
+ });
+});
+
+describe('POST /goals API-key scopes and validation', () => {
+ it('rejects a read-only key before the body is considered', async () => {
+ const res = await requestAs(['agent:read'], '/', {
+ body: { title: 'Ship the personal agent' },
+ method: 'POST',
+ });
+
+ expect(res.status).toBe(403);
+ });
+
+ it('accepts a key holding agent:write', async () => {
+ const res = await requestAs(['agent:write'], '/', {
+ body: { title: 'Ship the personal agent' },
+ method: 'POST',
+ });
+
+ expect(res.status).toBe(201);
+ });
+
+ it('rejects a goal without a title', async () => {
+ const res = await requestAs(['agent:write'], '/', { body: {}, method: 'POST' });
+
+ expect(res.status).toBe(400);
+ });
+});
diff --git a/packages/openapi/src/routes/goals.route.ts b/packages/openapi/src/routes/goals.route.ts
new file mode 100644
index 00000000000..ec4a30c2e4f
--- /dev/null
+++ b/packages/openapi/src/routes/goals.route.ts
@@ -0,0 +1,126 @@
+import { Hono } from 'hono';
+import { describeRoute } from 'hono-openapi';
+
+import { getAllScopePermissions } from '@/utils/rbac';
+
+import { zValidator } from '../common/validator';
+import { GoalController } from '../controllers/goal.controller';
+import { requireAuth } from '../middleware/auth';
+import { requireAnyPermission } from '../middleware/permission-check';
+import {
+ CreateGoalRequestSchema,
+ GoalIdParamSchema,
+ GoalListQuerySchema,
+ RestartGoalRequestSchema,
+ UpdateGoalRequestSchema,
+} from '../types/goal.type';
+
+/**
+ * Goal routes.
+ *
+ * Goals are long-horizon, self-advancing targets: creating one hands it to the
+ * coordinator, and the client reads progress instead of driving each step.
+ * Sub-actions carry explicit operation ids so generated SDK methods read as
+ * `goals.advanceGoal()` rather than a positional `createAdvance()`.
+ */
+const GoalRoutes = new Hono();
+
+const goalRead = requireAnyPermission(
+ getAllScopePermissions('AGENT_READ'),
+ 'You do not have permission to view goals',
+);
+const goalWrite = requireAnyPermission(
+ getAllScopePermissions('AGENT_UPDATE'),
+ 'You do not have permission to manage goals',
+);
+
+/** GET /api/v1/goals β€” list goals with their graph roll-up. */
+GoalRoutes.get('/', requireAuth, goalRead, zValidator('query', GoalListQuerySchema), async (c) =>
+ new GoalController().listGoals(c),
+);
+
+/** POST /api/v1/goals β€” create a goal and start its coordinator. */
+GoalRoutes.post(
+ '/',
+ requireAuth,
+ goalWrite,
+ zValidator('json', CreateGoalRequestSchema),
+ async (c) => new GoalController().createGoal(c),
+);
+
+/** GET /api/v1/goals/:id β€” the goal and its whole graph. */
+GoalRoutes.get('/:id', requireAuth, goalRead, zValidator('param', GoalIdParamSchema), async (c) =>
+ new GoalController().getGoal(c),
+);
+
+/** GET /api/v1/goals/:id/supervision β€” supervision toggle and current state. */
+GoalRoutes.get(
+ '/:id/supervision',
+ describeRoute({ operationId: 'getGoalSupervision', tags: ['goals'] }),
+ requireAuth,
+ goalRead,
+ zValidator('param', GoalIdParamSchema),
+ async (c) => new GoalController().getGoalSupervision(c),
+);
+
+/** PATCH /api/v1/goals/:id β€” update the acceptance requirement and/or budget. */
+GoalRoutes.patch(
+ '/:id',
+ requireAuth,
+ goalWrite,
+ zValidator('param', GoalIdParamSchema),
+ zValidator('json', UpdateGoalRequestSchema),
+ async (c) => new GoalController().updateGoal(c),
+);
+
+/** DELETE /api/v1/goals/:id β€” stop the goal and cascade its graph. */
+GoalRoutes.delete(
+ '/:id',
+ requireAuth,
+ goalWrite,
+ zValidator('param', GoalIdParamSchema),
+ async (c) => new GoalController().deleteGoal(c),
+);
+
+/** POST /api/v1/goals/:id/advance β€” run the coordinator now. */
+GoalRoutes.post(
+ '/:id/advance',
+ describeRoute({ operationId: 'advanceGoal', tags: ['goals'] }),
+ requireAuth,
+ goalWrite,
+ zValidator('param', GoalIdParamSchema),
+ async (c) => new GoalController().advanceGoal(c),
+);
+
+/** POST /api/v1/goals/:id/pause */
+GoalRoutes.post(
+ '/:id/pause',
+ describeRoute({ operationId: 'pauseGoal', tags: ['goals'] }),
+ requireAuth,
+ goalWrite,
+ zValidator('param', GoalIdParamSchema),
+ async (c) => new GoalController().pauseGoal(c),
+);
+
+/** POST /api/v1/goals/:id/resume */
+GoalRoutes.post(
+ '/:id/resume',
+ describeRoute({ operationId: 'resumeGoal', tags: ['goals'] }),
+ requireAuth,
+ goalWrite,
+ zValidator('param', GoalIdParamSchema),
+ async (c) => new GoalController().resumeGoal(c),
+);
+
+/** POST /api/v1/goals/:id/restart β€” start every unfinished task node over. */
+GoalRoutes.post(
+ '/:id/restart',
+ describeRoute({ operationId: 'restartGoal', tags: ['goals'] }),
+ requireAuth,
+ goalWrite,
+ zValidator('param', GoalIdParamSchema),
+ zValidator('json', RestartGoalRequestSchema),
+ async (c) => new GoalController().restartGoal(c),
+);
+
+export default GoalRoutes;
diff --git a/packages/openapi/src/routes/index.ts b/packages/openapi/src/routes/index.ts
index 92386d51ec4..a5ad01841a2 100644
--- a/packages/openapi/src/routes/index.ts
+++ b/packages/openapi/src/routes/index.ts
@@ -5,17 +5,22 @@ import ApiKeysRoutes from './api-keys.route';
import ChatRoutes from './chat.route';
import EvalRoutes from './eval.route';
import FileRoutes from './files.route';
+import GoalsRoutes from './goals.route';
import KnowledgeBasesRoutes from './knowledge-bases.route';
import McpServersRoutes from './mcp-servers.route';
+import MemoriesRoutes from './memories.route';
import MessageTranslationsRoutes from './message-translations.route';
import MessagesRoutes from './messages.route';
import ModelsRoutes from './models.route';
+import NotificationsRoutes from './notifications.route';
import OpenAIRoutes from './openai.route';
import PermissionsRoutes from './permissions.route';
import { PluginsRoutes } from './plugins.route';
import ProvidersRoutes from './providers.route';
import ResponsesRoutes from './responses.route';
import RolesRoutes from './roles.route';
+import AgentSignalsRoutes from './signals.route';
+import TasksRoutes from './tasks.route';
import TopicsRoutes from './topics.route';
import UsageRoutes from './usage.route';
import UsersRoutes from './users.route';
@@ -29,16 +34,21 @@ export default {
'eval': EvalRoutes,
'plugins': PluginsRoutes,
'files': FileRoutes,
+ 'goals': GoalsRoutes,
'knowledge-bases': KnowledgeBasesRoutes,
'mcp-servers': McpServersRoutes,
+ 'memories': MemoriesRoutes,
'message-translations': MessageTranslationsRoutes,
'messages': MessagesRoutes,
'models': ModelsRoutes,
+ 'notifications': NotificationsRoutes,
'openai': OpenAIRoutes,
'permissions': PermissionsRoutes,
'providers': ProvidersRoutes,
'responses': ResponsesRoutes,
'roles': RolesRoutes,
+ 'signals': AgentSignalsRoutes,
+ 'tasks': TasksRoutes,
'topics': TopicsRoutes,
'users': UsersRoutes,
'usage': UsageRoutes,
diff --git a/packages/openapi/src/routes/memories.route.test.ts b/packages/openapi/src/routes/memories.route.test.ts
new file mode 100644
index 00000000000..5013117bb34
--- /dev/null
+++ b/packages/openapi/src/routes/memories.route.test.ts
@@ -0,0 +1,105 @@
+import { Hono } from 'hono';
+import { describe, expect, it, vi } from 'vitest';
+
+// The route module pulls in the db graph (via the permission middleware) and the
+// better-auth graph (via `requireAuth`) at import time; this test is only about
+// the gates the route itself declares, so both are stubbed. The permission
+// middleware is deliberately NOT stubbed: the API-key scope narrowing inside it
+// is exactly what these cases exercise.
+vi.mock('@/database/core/db-adaptor', () => ({ getServerDB: vi.fn() }));
+vi.mock('@/database/models/rbac', () => ({
+ RbacModel: class {
+ hasAnyPermission = async () => true;
+ },
+}));
+vi.mock('../middleware/auth', () => ({
+ requireAuth: async (_c: any, next: any) => next(),
+}));
+vi.mock('../controllers/memory.controller', () => ({
+ MemoryController: class {
+ getPersona(c: any) {
+ return c.json({ data: {}, success: true });
+ }
+ listPersonaVersions(c: any) {
+ return c.json({ data: [], success: true });
+ }
+ deleteAll(c: any) {
+ return c.json({ data: { success: true }, success: true });
+ }
+ deleteEntry(c: any) {
+ return c.json({ data: { success: true }, success: true });
+ }
+ listCategory(c: any) {
+ return c.json({ data: [], success: true });
+ }
+ },
+}));
+
+const { default: MemoryRoutes } = await import('./memories.route');
+
+/** A request authenticated as an API key holding exactly `scopes`. */
+const requestAs = (scopes: string[], path: string, init?: { method?: string }) => {
+ const app = new Hono();
+
+ app.use('*', async (c, next) => {
+ c.set('userId' as never, 'user-1' as never);
+ c.set('authType' as never, 'apikey' as never);
+ c.set('apiKeyScopes' as never, scopes as never);
+ await next();
+ });
+ app.route('/', MemoryRoutes);
+
+ return app.request(path, { method: init?.method ?? 'GET' });
+};
+
+/**
+ * The delegated-key contract for `userMemory` is `user:read` / `user:write`.
+ * A restricted key must not reach memory through the `message:create` RBAC
+ * permission, which projects to `chat:write`.
+ */
+describe('GET /memories API-key scopes', () => {
+ it('rejects a key holding only an unrelated read scope', async () => {
+ const res = await requestAs(['file:read'], '/persona');
+
+ expect(res.status).toBe(403);
+ });
+
+ it('accepts a key holding user:read', async () => {
+ const res = await requestAs(['user:read'], '/persona');
+
+ expect(res.status).toBe(200);
+ });
+
+ it('gates the persona versions and per-category reads the same way', async () => {
+ expect((await requestAs(['file:read'], '/persona/versions')).status).toBe(403);
+ expect((await requestAs(['user:read'], '/persona/versions')).status).toBe(200);
+ expect((await requestAs(['file:read'], '/identities')).status).toBe(403);
+ expect((await requestAs(['user:read'], '/identities')).status).toBe(200);
+ });
+});
+
+describe('destructive memory routes', () => {
+ it('refuses a chat-only key on DELETE /memories', async () => {
+ const res = await requestAs(['chat:write'], '/', { method: 'DELETE' });
+
+ expect(res.status).toBe(403);
+ });
+
+ it('accepts a key holding user:write', async () => {
+ const res = await requestAs(['user:write'], '/', { method: 'DELETE' });
+
+ expect(res.status).toBe(200);
+ });
+
+ it('refuses a chat-only key on DELETE /memories/:category/:id', async () => {
+ const res = await requestAs(['chat:write'], '/identities/mem-1', { method: 'DELETE' });
+
+ expect(res.status).toBe(403);
+ });
+
+ it('accepts a key holding user:write on an entry delete', async () => {
+ const res = await requestAs(['user:write'], '/identities/mem-1', { method: 'DELETE' });
+
+ expect(res.status).toBe(200);
+ });
+});
diff --git a/packages/openapi/src/routes/memories.route.ts b/packages/openapi/src/routes/memories.route.ts
new file mode 100644
index 00000000000..82dafc4ce8a
--- /dev/null
+++ b/packages/openapi/src/routes/memories.route.ts
@@ -0,0 +1,97 @@
+import { Hono } from 'hono';
+import { describeRoute } from 'hono-openapi';
+
+import { getAllScopePermissions } from '@/utils/rbac';
+
+import { zValidator } from '../common/validator';
+import { MemoryController } from '../controllers/memory.controller';
+import { requireAuth } from '../middleware/auth';
+import {
+ requireAnyPermissionWithApiKeyScope,
+ requireApiKeyScope,
+} from '../middleware/permission-check';
+import { MemoryCategoryParamSchema, MemoryEntryPathParamSchema } from '../types/memory.type';
+
+/**
+ * User memory routes.
+ *
+ * This is the "durable memory" half of a personal agent: the persona the agent
+ * plans from, and the per-category entries it has learned.
+ *
+ * Both gates mirror the delegated-key contract for `userMemory` in
+ * `packages/const/src/apiKeyScope.ts`. RBAC answers "may this user touch
+ * memory", the API-key scope answers "was this key delegated that capability";
+ * `message:create` alone is not enough, because it projects to `chat:write` and
+ * would let any restricted chat key read the persona and purge every memory.
+ */
+const MemoryRoutes = new Hono();
+
+const memoryWrite = requireAnyPermissionWithApiKeyScope(
+ getAllScopePermissions('MESSAGE_CREATE'),
+ 'user:write',
+ 'You do not have permission to manage memory',
+);
+
+/** Reading the persona and learned entries is the `user:read` capability. */
+const memoryRead = requireApiKeyScope('user:read');
+
+/** GET /api/v1/memories/persona */
+MemoryRoutes.get(
+ '/persona',
+ describeRoute({
+ operationId: 'getMemoryPersona',
+ summary: 'Get the current persona document',
+ tags: ['memories'],
+ }),
+ requireAuth,
+ memoryRead,
+ async (c) => new MemoryController().getPersona(c),
+);
+
+/** GET /api/v1/memories/persona/versions */
+MemoryRoutes.get(
+ '/persona/versions',
+ describeRoute({
+ operationId: 'listMemoryPersonaVersions',
+ summary: 'List persona document versions',
+ tags: ['memories'],
+ }),
+ requireAuth,
+ memoryRead,
+ async (c) => new MemoryController().listPersonaVersions(c),
+);
+
+/** DELETE /api/v1/memories β€” purge everything and allow re-extraction. */
+MemoryRoutes.delete(
+ '/',
+ describeRoute({
+ operationId: 'deleteAllMemories',
+ summary: 'Delete all memory entries',
+ tags: ['memories'],
+ }),
+ requireAuth,
+ memoryWrite,
+ async (c) => new MemoryController().deleteAll(c),
+);
+
+/** DELETE /api/v1/memories/:category/:id */
+MemoryRoutes.delete(
+ '/:category/:id',
+ describeRoute({ operationId: 'deleteMemoryEntry', tags: ['memories'] }),
+ requireAuth,
+ memoryWrite,
+ zValidator('param', MemoryEntryPathParamSchema),
+ async (c) => new MemoryController().deleteEntry(c),
+);
+
+/** GET /api/v1/memories/:category */
+MemoryRoutes.get(
+ '/:category',
+ describeRoute({ operationId: 'listMemoryCategory', tags: ['memories'] }),
+ requireAuth,
+ memoryRead,
+ zValidator('param', MemoryCategoryParamSchema),
+ async (c) => new MemoryController().listCategory(c),
+);
+
+export default MemoryRoutes;
diff --git a/packages/openapi/src/routes/notifications.route.ts b/packages/openapi/src/routes/notifications.route.ts
new file mode 100644
index 00000000000..1b34aba0a77
--- /dev/null
+++ b/packages/openapi/src/routes/notifications.route.ts
@@ -0,0 +1,108 @@
+import { Hono } from 'hono';
+import { describeRoute } from 'hono-openapi';
+
+import { getAllScopePermissions } from '@/utils/rbac';
+
+import { zValidator } from '../common/validator';
+import { NotificationController } from '../controllers/notification.controller';
+import { requireAuth } from '../middleware/auth';
+import { requireAnyPermission } from '../middleware/permission-check';
+import {
+ MarkNotificationsReadRequestSchema,
+ NotificationIdParamSchema,
+ NotificationListQuerySchema,
+} from '../types/notification.type';
+
+/**
+ * Notification routes β€” the delivery side of proactive agent work.
+ *
+ * Reads are auth-only: the inbox is already scoped to the caller by user (and
+ * workspace) inside the model, so there is nothing narrower to check. Writes
+ * mirror the in-app `message:create` gate.
+ */
+const NotificationRoutes = new Hono();
+
+const notificationWrite = requireAnyPermission(
+ getAllScopePermissions('MESSAGE_CREATE'),
+ 'You do not have permission to manage notifications',
+);
+
+/** GET /api/v1/notifications */
+NotificationRoutes.get(
+ '/',
+ requireAuth,
+ zValidator('query', NotificationListQuerySchema),
+ async (c) => new NotificationController().listNotifications(c),
+);
+
+/** GET /api/v1/notifications/unread-count */
+NotificationRoutes.get(
+ '/unread-count',
+ describeRoute({
+ operationId: 'getUnreadNotificationCount',
+ summary: 'Get the unread notification count',
+ tags: ['notifications'],
+ }),
+ requireAuth,
+ async (c) => new NotificationController().getUnreadCount(c),
+);
+
+/** GET /api/v1/notifications/counts β€” per-category read/unread/total tallies. */
+NotificationRoutes.get(
+ '/counts',
+ describeRoute({
+ operationId: 'getNotificationCounts',
+ summary: 'Get per-category notification counts',
+ tags: ['notifications'],
+ }),
+ requireAuth,
+ async (c) => new NotificationController().getNavigationCounts(c),
+);
+
+/** POST /api/v1/notifications/read */
+NotificationRoutes.post(
+ '/read',
+ describeRoute({ operationId: 'markNotificationsRead', tags: ['notifications'] }),
+ requireAuth,
+ notificationWrite,
+ zValidator('json', MarkNotificationsReadRequestSchema),
+ async (c) => new NotificationController().markAsRead(c),
+);
+
+/** POST /api/v1/notifications/read-all */
+NotificationRoutes.post(
+ '/read-all',
+ describeRoute({
+ operationId: 'markAllNotificationsRead',
+ summary: 'Mark every notification as read',
+ tags: ['notifications'],
+ }),
+ requireAuth,
+ notificationWrite,
+ async (c) => new NotificationController().markAllAsRead(c),
+);
+
+/** POST /api/v1/notifications/archive-all */
+NotificationRoutes.post(
+ '/archive-all',
+ describeRoute({
+ operationId: 'archiveAllNotifications',
+ summary: 'Archive every notification',
+ tags: ['notifications'],
+ }),
+ requireAuth,
+ notificationWrite,
+ async (c) => new NotificationController().archiveAll(c),
+);
+
+/** POST /api/v1/notifications/:id/archive */
+NotificationRoutes.post(
+ '/:id/archive',
+ describeRoute({ operationId: 'archiveNotification', tags: ['notifications'] }),
+ requireAuth,
+ notificationWrite,
+ zValidator('param', NotificationIdParamSchema),
+ async (c) => new NotificationController().archive(c),
+);
+
+export default NotificationRoutes;
diff --git a/packages/openapi/src/routes/signals.route.test.ts b/packages/openapi/src/routes/signals.route.test.ts
new file mode 100644
index 00000000000..c43ec49e909
--- /dev/null
+++ b/packages/openapi/src/routes/signals.route.test.ts
@@ -0,0 +1,131 @@
+import { Hono } from 'hono';
+import { describe, expect, it, vi } from 'vitest';
+
+// The route module pulls in the db graph (via the permission middleware) and the
+// better-auth graph (via `requireAuth`) at import time; this test is only about
+// the gates the route itself declares, so both are stubbed. The permission
+// middleware is deliberately NOT stubbed: the API-key scope narrowing inside it
+// is exactly what these cases exercise.
+vi.mock('@/database/core/db-adaptor', () => ({ getServerDB: vi.fn() }));
+vi.mock('@/database/models/rbac', () => ({
+ RbacModel: class {
+ hasAnyPermission = async () => true;
+ },
+}));
+vi.mock('../middleware/auth', () => ({
+ requireAuth: async (_c: any, next: any) => next(),
+}));
+// The type module reads the trigger enum from this service; stubbing it keeps
+// the test off the agent-signal service graph.
+vi.mock('@/server/services/agentSignal/triggerSourceEvent', () => ({
+ AGENT_SIGNAL_TRIGGER_SOURCE_TYPES: ['manual'],
+}));
+vi.mock('../controllers/agent-signal.controller', () => ({
+ AgentSignalController: class {
+ emitSourceEvent(c: any) {
+ return c.json({ data: {}, success: true }, 202);
+ }
+ triggerSourceEvent(c: any) {
+ return c.json({ data: {}, success: true }, 202);
+ }
+ listReceipts(c: any) {
+ return c.json({ data: [], success: true });
+ }
+ },
+}));
+
+const { default: AgentSignalRoutes } = await import('./signals.route');
+const { AgentSignalClientSourceSchema, AgentSignalTriggerSourceSchema } =
+ await import('../types/agent-signal.type');
+
+/** A request authenticated as an API key holding exactly `scopes`. */
+const requestAs = (scopes: string[], path: string, init?: { body?: unknown; method?: string }) => {
+ const app = new Hono();
+
+ app.use('*', async (c, next) => {
+ c.set('userId' as never, 'user-1' as never);
+ c.set('authType' as never, 'apikey' as never);
+ c.set('apiKeyScopes' as never, scopes as never);
+ await next();
+ });
+ app.route('/', AgentSignalRoutes);
+
+ return app.request(path, {
+ ...(init?.body === undefined
+ ? {}
+ : { body: JSON.stringify(init.body), headers: { 'content-type': 'application/json' } }),
+ method: init?.method ?? 'GET',
+ });
+};
+
+const emitBody = () => ({
+ payload: {},
+ sourceId: 'src-1',
+ sourceType: AgentSignalClientSourceSchema.options[0],
+});
+
+/**
+ * `agentSignal` maps to `agent:write` in the delegated-key catalog, and
+ * `emitSourceEvent` / `triggerSourceEvent` additionally require `model:invoke`
+ * because the workflows they enqueue call a model. A `chat:write`-only key must
+ * not be able to spend model budget.
+ */
+describe('POST /signals emission API-key scopes', () => {
+ it('refuses a chat-only key', async () => {
+ const res = await requestAs(['chat:write'], '/source-events', {
+ body: emitBody(),
+ method: 'POST',
+ });
+
+ expect(res.status).toBe(403);
+ });
+
+ it('refuses a key holding agent:write without model:invoke', async () => {
+ const res = await requestAs(['agent:write'], '/source-events', {
+ body: emitBody(),
+ method: 'POST',
+ });
+
+ expect(res.status).toBe(403);
+ });
+
+ it('accepts a key holding both agent:write and model:invoke', async () => {
+ const res = await requestAs(['agent:write', 'model:invoke'], '/source-events', {
+ body: emitBody(),
+ method: 'POST',
+ });
+
+ expect(res.status).toBe(202);
+ });
+
+ it('gates the trigger route the same way', async () => {
+ const body = { sourceType: AgentSignalTriggerSourceSchema.options[0] };
+
+ expect((await requestAs(['chat:write'], '/trigger', { body, method: 'POST' })).status).toBe(
+ 403,
+ );
+ expect((await requestAs(['agent:write'], '/trigger', { body, method: 'POST' })).status).toBe(
+ 403,
+ );
+ expect(
+ (await requestAs(['agent:write', 'model:invoke'], '/trigger', { body, method: 'POST' }))
+ .status,
+ ).toBe(202);
+ });
+});
+
+describe('GET /signals/receipts API-key scopes', () => {
+ const path = '/receipts?agentId=agent-1&topicId=topic-1';
+
+ it('refuses a key that holds no agent scope', async () => {
+ const res = await requestAs(['chat:read'], path);
+
+ expect(res.status).toBe(403);
+ });
+
+ it('accepts a key holding agent:read', async () => {
+ const res = await requestAs(['agent:read'], path);
+
+ expect(res.status).toBe(200);
+ });
+});
diff --git a/packages/openapi/src/routes/signals.route.ts b/packages/openapi/src/routes/signals.route.ts
new file mode 100644
index 00000000000..ba5d66dca2e
--- /dev/null
+++ b/packages/openapi/src/routes/signals.route.ts
@@ -0,0 +1,76 @@
+import { Hono } from 'hono';
+import { describeRoute } from 'hono-openapi';
+
+import { getAllScopePermissions } from '@/utils/rbac';
+
+import { zValidator } from '../common/validator';
+import { AgentSignalController } from '../controllers/agent-signal.controller';
+import { requireAuth } from '../middleware/auth';
+import {
+ requireAnyPermissionWithApiKeyScope,
+ requireApiKeyScope,
+} from '../middleware/permission-check';
+import {
+ EmitSourceEventRequestSchema,
+ ListReceiptsQuerySchema,
+ TriggerSourceEventRequestSchema,
+} from '../types/agent-signal.type';
+
+/**
+ * Agent Signal routes.
+ *
+ * Emitting is the "wake the agent" path, so it carries the RBAC gate the in-app
+ * producer uses (`message:create`) *and* the delegated-key scopes the catalog
+ * assigns to `agentSignal`: `agent:write` for the namespace, plus
+ * `model:invoke` because both emissions enqueue workflows whose judges call a
+ * model. Without them a `chat:write`-only key could spend model budget, which
+ * the tRPC contract (`agentSignal.*` + `TRPC_PROCEDURE_EXTRA_SCOPES`) forbids.
+ * Receipts are a read of the caller's own events, so they take `agent:read`.
+ */
+const AgentSignalRoutes = new Hono();
+
+const signalWrite = requireAnyPermissionWithApiKeyScope(
+ getAllScopePermissions('MESSAGE_CREATE'),
+ 'agent:write',
+ 'You do not have permission to emit agent signals',
+);
+
+/** Enqueueing a signal can start model-backed analysis, so it needs `model:invoke`. */
+const signalRun = requireApiKeyScope('model:invoke');
+
+/** Reading your own receipts is the namespace's read capability. */
+const signalRead = requireApiKeyScope('agent:read');
+
+/** POST /api/v1/signals/source-events β€” emit a client-side event. */
+AgentSignalRoutes.post(
+ '/source-events',
+ describeRoute({ operationId: 'emitSourceEvent', tags: ['signals'] }),
+ requireAuth,
+ signalWrite,
+ signalRun,
+ zValidator('json', EmitSourceEventRequestSchema),
+ async (c) => new AgentSignalController().emitSourceEvent(c),
+);
+
+/** POST /api/v1/signals/trigger β€” synthesise and enqueue a trigger event. */
+AgentSignalRoutes.post(
+ '/trigger',
+ describeRoute({ operationId: 'triggerSourceEvent', tags: ['signals'] }),
+ requireAuth,
+ signalWrite,
+ signalRun,
+ zValidator('json', TriggerSourceEventRequestSchema),
+ async (c) => new AgentSignalController().triggerSourceEvent(c),
+);
+
+/** GET /api/v1/signals/receipts β€” processed-event receipts for a topic. */
+AgentSignalRoutes.get(
+ '/receipts',
+ describeRoute({ operationId: 'listSignalReceipts', tags: ['signals'] }),
+ requireAuth,
+ signalRead,
+ zValidator('query', ListReceiptsQuerySchema),
+ async (c) => new AgentSignalController().listReceipts(c),
+);
+
+export default AgentSignalRoutes;
diff --git a/packages/openapi/src/routes/tasks.route.ts b/packages/openapi/src/routes/tasks.route.ts
new file mode 100644
index 00000000000..29b3a09f0ee
--- /dev/null
+++ b/packages/openapi/src/routes/tasks.route.ts
@@ -0,0 +1,83 @@
+import { Hono } from 'hono';
+
+import { getAllScopePermissions } from '@/utils/rbac';
+
+import { zValidator } from '../common/validator';
+import { TaskController } from '../controllers/task.controller';
+import { requireAuth } from '../middleware/auth';
+import { requireAnyPermission } from '../middleware/permission-check';
+import {
+ CreateTaskRequestSchema,
+ TaskIdParamSchema,
+ TaskListQuerySchema,
+ UpdateTaskRequestSchema,
+ UpdateTaskStatusRequestSchema,
+} from '../types/task.type';
+
+/**
+ * Task routes.
+ *
+ * Tasks reuse the same `agent:read` / `agent:update` gate the in-app task
+ * surface applies, and every mutation goes through `TaskService`, so the
+ * assignment locks, run interruption and activity feed stay identical.
+ */
+const TaskRoutes = new Hono();
+
+const taskRead = requireAnyPermission(
+ getAllScopePermissions('AGENT_READ'),
+ 'You do not have permission to view tasks',
+);
+const taskWrite = requireAnyPermission(
+ getAllScopePermissions('AGENT_UPDATE'),
+ 'You do not have permission to manage tasks',
+);
+
+/** GET /api/v1/tasks */
+TaskRoutes.get('/', requireAuth, taskRead, zValidator('query', TaskListQuerySchema), async (c) =>
+ new TaskController().listTasks(c),
+);
+
+/** POST /api/v1/tasks */
+TaskRoutes.post(
+ '/',
+ requireAuth,
+ taskWrite,
+ zValidator('json', CreateTaskRequestSchema),
+ async (c) => new TaskController().createTask(c),
+);
+
+/** GET /api/v1/tasks/:id */
+TaskRoutes.get('/:id', requireAuth, taskRead, zValidator('param', TaskIdParamSchema), async (c) =>
+ new TaskController().getTask(c),
+);
+
+/** PATCH /api/v1/tasks/:id */
+TaskRoutes.patch(
+ '/:id',
+ requireAuth,
+ taskWrite,
+ zValidator('param', TaskIdParamSchema),
+ zValidator('json', UpdateTaskRequestSchema),
+ async (c) => new TaskController().updateTask(c),
+);
+
+/** PATCH /api/v1/tasks/:id/status */
+TaskRoutes.patch(
+ '/:id/status',
+ requireAuth,
+ taskWrite,
+ zValidator('param', TaskIdParamSchema),
+ zValidator('json', UpdateTaskStatusRequestSchema),
+ async (c) => new TaskController().updateTaskStatus(c),
+);
+
+/** DELETE /api/v1/tasks/:id */
+TaskRoutes.delete(
+ '/:id',
+ requireAuth,
+ taskWrite,
+ zValidator('param', TaskIdParamSchema),
+ async (c) => new TaskController().deleteTask(c),
+);
+
+export default TaskRoutes;
diff --git a/packages/openapi/src/services/agent-signal.service.ts b/packages/openapi/src/services/agent-signal.service.ts
new file mode 100644
index 00000000000..66526ed6632
--- /dev/null
+++ b/packages/openapi/src/services/agent-signal.service.ts
@@ -0,0 +1,71 @@
+import type {
+ AGENT_SIGNAL_CLIENT_SOURCE_TYPES,
+ AgentSignalSourceEventInput,
+} from '@lobechat/agent-signal/source';
+
+import type { LobeChatDatabase } from '@/database/type';
+import { enqueueAgentSignalSourceEvent } from '@/server/services/agentSignal';
+import { listAgentSignalReceipts } from '@/server/services/agentSignal/services/receiptService';
+import { buildTriggerSourceEvent } from '@/server/services/agentSignal/triggerSourceEvent';
+
+import { BaseService } from '../common/base.service';
+import type { ServiceResult } from '../types';
+import type {
+ EmitSourceEventRequest,
+ ListReceiptsQuery,
+ TriggerSourceEventRequest,
+} from '../types/agent-signal.type';
+
+type ClientSourceType = (typeof AGENT_SIGNAL_CLIENT_SOURCE_TYPES)[number];
+type ClientSourceEventInput = AgentSignalSourceEventInput<ClientSourceType>;
+
+/**
+ * Agent Signal REST service β€” the event-driven half of "proactive".
+ *
+ * A signal is what wakes an agent outside a conversation: an inbound mail, a
+ * calendar change, a file landing. Both endpoints reuse the same enqueue path
+ * the in-app producers use, so routing, dedupe and receipts behave identically.
+ */
+export class AgentSignalRestService extends BaseService {
+ constructor(db: LobeChatDatabase, userId: string | null, workspaceId?: string) {
+ super(db, userId, workspaceId);
+ }
+
+ async emitSourceEvent(input: EmitSourceEventRequest): ServiceResult<unknown> {
+ return enqueueAgentSignalSourceEvent(input as unknown as ClientSourceEventInput, {
+ agentId: typeof input.payload.agentId === 'string' ? input.payload.agentId : undefined,
+ userId: this.userId,
+ workspaceId: this.workspaceId,
+ });
+ }
+
+ async triggerSourceEvent(input: TriggerSourceEventRequest): ServiceResult<unknown> {
+ const sourceEvent = buildTriggerSourceEvent({
+ agentId: input.agentId,
+ payloadOverride: input.payloadOverride,
+ scopeKey: input.scopeKey,
+ sourceId: input.sourceId,
+ sourceType: input.sourceType,
+ timestamp: input.timestamp,
+ topicId: input.topicId,
+ userId: this.userId,
+ });
+
+ return enqueueAgentSignalSourceEvent(sourceEvent, {
+ agentId: input.agentId,
+ userId: this.userId,
+ workspaceId: this.workspaceId,
+ });
+ }
+
+ async listReceipts(query: ListReceiptsQuery): ServiceResult<unknown> {
+ return listAgentSignalReceipts({
+ agentId: query.agentId,
+ cursor: query.cursor,
+ limit: query.limit ?? 20,
+ sinceCreatedAt: query.sinceCreatedAt,
+ topicId: query.topicId,
+ userId: this.userId,
+ });
+ }
+}
diff --git a/packages/openapi/src/services/goal.service.test.ts b/packages/openapi/src/services/goal.service.test.ts
new file mode 100644
index 00000000000..3605a71d6e5
--- /dev/null
+++ b/packages/openapi/src/services/goal.service.test.ts
@@ -0,0 +1,203 @@
+// @vitest-environment node
+import { TRPCError } from '@trpc/server';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+import type { LobeChatDatabase } from '@/database/type';
+
+import { GoalRestService } from './goal.service';
+
+const {
+ deleteGoalMock,
+ findByIdMock,
+ goalServiceCtorMock,
+ graphMock,
+ hasAnyPermissionMock,
+ restartGoalMock,
+ scheduleGoalAdvanceMock,
+ setBudgetMock,
+ updateRequirementMock,
+} = vi.hoisted(() => ({
+ deleteGoalMock: vi.fn(),
+ findByIdMock: vi.fn(),
+ goalServiceCtorMock: vi.fn(),
+ graphMock: vi.fn(),
+ hasAnyPermissionMock: vi.fn(),
+ restartGoalMock: vi.fn(),
+ scheduleGoalAdvanceMock: vi.fn(),
+ setBudgetMock: vi.fn(),
+ updateRequirementMock: vi.fn(),
+}));
+
+vi.mock('@/const/rbac', () => ({ ALL_SCOPE: 'all' }));
+vi.mock('@lobechat/database', () => ({
+ buildWorkspacePayload: vi.fn(),
+ buildWorkspaceWhere: vi.fn(),
+}));
+vi.mock('@/database/models/rbac', () => ({
+ RbacModel: class {
+ hasAnyPermission = hasAnyPermissionMock;
+ },
+}));
+vi.mock('@/database/schemas', () => ({
+ agents: {},
+ aiModels: {},
+ aiProviders: {},
+ files: {},
+ knowledgeBases: {},
+ messages: {},
+ sessions: {},
+ topics: {},
+}));
+vi.mock('@/utils/rbac', () => ({ getScopePermissions: () => [] }));
+vi.mock('@/database/models/goal', () => ({
+ GoalModel: class {
+ findById = findByIdMock;
+ },
+}));
+vi.mock('@/server/services/goal', () => ({
+ GoalService: class {
+ constructor(...args: unknown[]) {
+ // Recorded so a test can prove the writes went through the transaction
+ // handle rather than the shared pool.
+ goalServiceCtorMock(...args);
+ }
+
+ delete = deleteGoalMock;
+ graph = graphMock;
+ restart = restartGoalMock;
+ setBudget = setBudgetMock;
+ updateRequirement = updateRequirementMock;
+ },
+}));
+vi.mock('@/server/services/goal/advanceGoal', () => ({ advanceGoal: vi.fn() }));
+vi.mock('@/server/services/goal/scheduler', () => ({
+ scheduleGoalAdvance: scheduleGoalAdvanceMock,
+}));
+
+const CALLER = 'me';
+const WORKSPACE = 'ws-1';
+
+/**
+ * `assertRowManageable` mirrors the tRPC rule: a workspace write permission says
+ * a member may change *a* goal, not *whose*. These cases pin the creator gate on
+ * the two destructive REST actions, which the reviewer flagged.
+ */
+describe('GoalRestService creator gate on restart/delete', () => {
+ const service = (workspaceId?: string) =>
+ new GoalRestService({} as LobeChatDatabase, CALLER, workspaceId);
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ // The caller holds only the `:owner` scope, not workspace-wide `:all`.
+ hasAnyPermissionMock.mockResolvedValue(false);
+ findByIdMock.mockResolvedValue({ id: 'goal-1', userId: 'other-member' });
+ });
+
+ it.each(['restartGoal', 'deleteGoal'] as const)(
+ 'refuses %s on a goal created by another workspace member',
+ async (method) => {
+ const svc = service(WORKSPACE);
+ const call =
+ method === 'restartGoal' ? svc.restartGoal('goal-1', {}) : svc.deleteGoal('goal-1');
+
+ await expect(call).rejects.toThrow(/Only the creator or a workspace owner/);
+ expect(restartGoalMock).not.toHaveBeenCalled();
+ expect(deleteGoalMock).not.toHaveBeenCalled();
+ },
+ );
+
+ it('lets a workspace-wide (:all scope) caller manage another member goal', async () => {
+ hasAnyPermissionMock.mockResolvedValue(true);
+ restartGoalMock.mockResolvedValue({ restartedTaskIds: [] });
+
+ await expect(service(WORKSPACE).restartGoal('goal-1', {})).resolves.toEqual({
+ restartedTaskIds: [],
+ });
+ expect(restartGoalMock).toHaveBeenCalledWith('goal-1', { agentId: undefined });
+ });
+
+ it('lets the creator restart and delete their own goal', async () => {
+ findByIdMock.mockResolvedValue({ id: 'goal-1', userId: CALLER });
+ restartGoalMock.mockResolvedValue({ restartedTaskIds: ['task-1'] });
+
+ const svc = service(WORKSPACE);
+ await expect(svc.restartGoal('goal-1', {})).resolves.toEqual({ restartedTaskIds: ['task-1'] });
+ await expect(svc.deleteGoal('goal-1')).resolves.toBeUndefined();
+ expect(deleteGoalMock).toHaveBeenCalledWith('goal-1');
+ });
+
+ it('keeps personal scope a hard boundary for another user goal', async () => {
+ await expect(service().deleteGoal('goal-1')).rejects.toThrow('Goal not found');
+ expect(deleteGoalMock).not.toHaveBeenCalled();
+ });
+});
+
+/**
+ * A combined patch writes the requirement and the budget, and the budget can be
+ * refused (e.g. `maxManagerTurns` on a goal with no main Agent). Both writes
+ * have to share one transaction, or the caller sees a 400 while half the patch
+ * has already been persisted.
+ */
+describe('GoalRestService combined patch atomicity', () => {
+ const TX = { tx: 'tx' };
+
+ const serviceOverTransaction = () =>
+ new GoalRestService(
+ {
+ transaction: (fn: (tx: unknown) => Promise<unknown>) => fn(TX),
+ } as unknown as LobeChatDatabase,
+ CALLER,
+ WORKSPACE,
+ );
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ hasAnyPermissionMock.mockResolvedValue(false);
+ findByIdMock.mockResolvedValue({ id: 'goal-1', userId: CALLER });
+ graphMock.mockResolvedValue({ goal: { id: 'goal-1' } });
+ updateRequirementMock.mockResolvedValue({ id: 'goal-1' });
+ setBudgetMock.mockResolvedValue({ id: 'goal-1' });
+ });
+
+ it('applies both writes through one transaction before enqueueing the advance', async () => {
+ await serviceOverTransaction().updateGoal('goal-1', {
+ budget: { maxManagerTurns: 2 },
+ requirement: 'new',
+ });
+
+ // Both writes went through the transaction handle rather than the pool, so
+ // a failure anywhere in the callback rolls them back together.
+ expect(goalServiceCtorMock).toHaveBeenCalledWith(TX, CALLER, WORKSPACE);
+ expect(updateRequirementMock).toHaveBeenCalledWith('goal-1', 'new');
+ expect(setBudgetMock).toHaveBeenCalledWith('goal-1', { maxManagerTurns: 2 });
+ expect(scheduleGoalAdvanceMock).toHaveBeenCalledTimes(1);
+ });
+
+ it('enqueues nothing and reads back no graph when the budget write is refused', async () => {
+ setBudgetMock.mockRejectedValue(
+ new TRPCError({
+ code: 'BAD_REQUEST',
+ message: 'Only a Goal with a main Agent has a turn budget',
+ }),
+ );
+
+ await expect(
+ serviceOverTransaction().updateGoal('goal-1', {
+ budget: { maxManagerTurns: 2 },
+ requirement: 'new',
+ }),
+ ).rejects.toThrow('Only a Goal with a main Agent has a turn budget');
+
+ expect(goalServiceCtorMock).toHaveBeenCalledWith(TX, CALLER, WORKSPACE);
+ expect(scheduleGoalAdvanceMock).not.toHaveBeenCalled();
+ expect(graphMock).not.toHaveBeenCalled();
+ });
+
+ it('still enqueues an advance for a budget-only patch', async () => {
+ await serviceOverTransaction().updateGoal('goal-1', { budget: { maxTotalCost: 25 } });
+
+ expect(updateRequirementMock).not.toHaveBeenCalled();
+ expect(setBudgetMock).toHaveBeenCalledWith('goal-1', { maxTotalCost: 25 });
+ expect(scheduleGoalAdvanceMock).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/packages/openapi/src/services/goal.service.ts b/packages/openapi/src/services/goal.service.ts
new file mode 100644
index 00000000000..1f0dc6e89ad
--- /dev/null
+++ b/packages/openapi/src/services/goal.service.ts
@@ -0,0 +1,188 @@
+import { GoalModel } from '@/database/models/goal';
+import type { LobeChatDatabase } from '@/database/type';
+import type { CreateGoalGraphInput } from '@/server/services/goal';
+import { GoalService } from '@/server/services/goal';
+import { advanceGoal } from '@/server/services/goal/advanceGoal';
+import { scheduleGoalAdvance } from '@/server/services/goal/scheduler';
+
+import { BaseService } from '../common/base.service';
+import type { ServiceResult } from '../types';
+import type {
+ CreateGoalRequest,
+ GoalListQuery,
+ RestartGoalRequest,
+ UpdateGoalRequest,
+} from '../types/goal.type';
+
+/**
+ * Goals REST service.
+ *
+ * Thin auth-and-transport shell over the same `GoalService` / `GoalModel` the
+ * `/goal` tool and the task scheduler drive, so a REST client sees exactly the
+ * coordinator behaviour the product already has instead of a parallel copy of
+ * it. Anything the coordinator does (dispatching tasks, opening decision gates)
+ * is the service's job; this layer only decides who may ask.
+ */
+export class GoalRestService extends BaseService {
+ private readonly goalModel: GoalModel;
+ private readonly goalService: GoalService;
+
+ constructor(db: LobeChatDatabase, userId: string | null, workspaceId?: string) {
+ super(db, userId, workspaceId);
+ this.goalModel = new GoalModel(db, userId ?? '', workspaceId);
+ this.goalService = new GoalService(db, userId ?? '', workspaceId);
+ }
+
+ /**
+ * Personal scope is a hard boundary: a goal is only addressable by its owner.
+ * Workspace scope defers to RBAC (`AGENT_UPDATE` / `AGENT_READ`), which is the
+ * same rule the tRPC surface enforces.
+ */
+ private async requireGoal(id: string) {
+ const goal = await this.goalModel.findById(id);
+ if (!goal || (!this.workspaceId && goal.userId !== this.userId)) {
+ throw this.createNotFoundError('Goal not found');
+ }
+ return goal;
+ }
+
+ async listGoals(query: GoalListQuery): ServiceResult<unknown> {
+ return this.goalModel.list({
+ agentId: query.agentId,
+ limit: query.limit,
+ offset: query.offset,
+ projectId: query.projectId,
+ statuses: query.statuses,
+ topicId: query.topicId,
+ });
+ }
+
+ /** The goal plus its whole graph (nodes, edges, roll-up). */
+ async getGoal(id: string): ServiceResult<unknown> {
+ await this.requireGoal(id);
+ return this.goalService.graph(id);
+ }
+
+ async getSupervision(id: string): ServiceResult<unknown> {
+ await this.requireGoal(id);
+ const graph = await this.goalService.graph(id);
+ const state = graph.goal.config?.supervisorState;
+ return {
+ enabled: graph.goal.config?.supervision?.enabled ?? false,
+ state,
+ };
+ }
+
+ /**
+ * Creating a goal means starting it β€” the coordinator takes over from here so
+ * no client has to hold a loop open.
+ */
+ async createGoal(input: CreateGoalRequest): ServiceResult<unknown> {
+ const { deadline, ...rest } = input;
+ const createInput: CreateGoalGraphInput = {
+ ...rest,
+ config: {
+ ...(rest.config as CreateGoalGraphInput['config']),
+ ...(deadline ? { schedule: { deadline } } : {}),
+ },
+ };
+
+ const graph = await this.goalService.create(createInput);
+ await scheduleGoalAdvance({
+ goalId: graph.goal.id,
+ trigger: 'create',
+ userId: this.userId,
+ workspaceId: this.workspaceId,
+ });
+ return graph;
+ }
+
+ /** Run the coordinator now and report where it stopped. */
+ async advanceGoal(id: string): ServiceResult<unknown> {
+ await this.requireGoal(id);
+ const { result, ticks } = await advanceGoal({
+ goalId: id,
+ trigger: 'manual',
+ userId: this.userId,
+ workspaceId: this.workspaceId,
+ });
+ return { ...result, ticks };
+ }
+
+ async pauseGoal(id: string): ServiceResult<unknown> {
+ await this.requireGoal(id);
+ return this.goalService.pause(id);
+ }
+
+ async resumeGoal(id: string): ServiceResult<unknown> {
+ await this.requireGoal(id);
+ const data = await this.goalService.resume(id);
+ await scheduleGoalAdvance({
+ goalId: id,
+ trigger: 'resume',
+ userId: this.userId,
+ workspaceId: this.workspaceId,
+ });
+ return data;
+ }
+
+ /** Restart every unfinished task node, optionally under a different agent. */
+ async restartGoal(id: string, input: RestartGoalRequest): ServiceResult<unknown> {
+ const goal = await this.requireGoal(id);
+ // `AGENT_UPDATE` says the member may change goals; it does not say whose.
+ // Without this any member could reset a colleague's goal and cancel its
+ // live runs β€” the same creator-or-owner gate the tRPC mutation applies.
+ await this.assertRowManageable(goal.userId, 'AGENT_UPDATE', 'goal');
+ const data = await this.goalService.restart(id, { agentId: input.agentId });
+ await scheduleGoalAdvance({
+ goalId: id,
+ trigger: 'restart',
+ userId: this.userId,
+ workspaceId: this.workspaceId,
+ });
+ return data;
+ }
+
+ /** Update the acceptance requirement and/or the budget in one call. */
+ async updateGoal(id: string, input: UpdateGoalRequest): ServiceResult<unknown> {
+ await this.requireGoal(id);
+
+ // Both writes land in one transaction. A budget the goal cannot take (e.g.
+ // `maxManagerTurns` on a goal with no main Agent) must not leave the new
+ // requirement persisted behind a failed response β€” the caller would see a
+ // 400 while half the patch had already been applied.
+ await this.db.transaction(async (tx) => {
+ const service = new GoalService(tx, this.userId, this.workspaceId);
+
+ if (input.requirement) {
+ await service.updateRequirement(id, input.requirement);
+ }
+
+ if (input.budget) {
+ await service.setBudget(id, input.budget);
+ }
+ });
+
+ if (input.budget) {
+ // Raising a budget is how a user un-sticks a goal that stopped on one,
+ // and only after the transaction committed β€” an enqueue must never
+ // survive a rolled-back budget.
+ await scheduleGoalAdvance({
+ goalId: id,
+ trigger: 'budget',
+ userId: this.userId,
+ workspaceId: this.workspaceId,
+ });
+ }
+
+ return this.goalService.graph(id);
+ }
+
+ async deleteGoal(id: string): ServiceResult<void> {
+ const goal = await this.requireGoal(id);
+ // Same rule as `restart`: visibility is not manageability, so only the
+ // goal's creator (or a workspace owner) may cascade its graph away.
+ await this.assertRowManageable(goal.userId, 'AGENT_UPDATE', 'goal');
+ await this.goalService.delete(id);
+ }
+}
diff --git a/packages/openapi/src/services/memory.service.ts b/packages/openapi/src/services/memory.service.ts
new file mode 100644
index 00000000000..decbf9441f1
--- /dev/null
+++ b/packages/openapi/src/services/memory.service.ts
@@ -0,0 +1,107 @@
+import { TopicModel } from '@/database/models/topic';
+import {
+ UserMemoryActivityModel,
+ UserMemoryContextModel,
+ UserMemoryExperienceModel,
+ UserMemoryModel,
+ UserMemoryPreferenceModel,
+} from '@/database/models/userMemory';
+import { UserPersonaModel } from '@/database/models/userMemory/persona';
+import type { LobeChatDatabase } from '@/database/type';
+
+import { BaseService } from '../common/base.service';
+import type { ServiceResult } from '../types';
+import type { MemoryCategory } from '../types/memory.type';
+
+/**
+ * User memory REST service β€” the durable, inspectable personal memory a
+ * personal agent plans against.
+ *
+ * Every model here is constructed with the caller's `userId` alone, so the
+ * store is intrinsically scoped to the user; there is no cross-user read path
+ * to guard. Deleting an entry immediately removes it from future retrieval,
+ * which is the contract the memory UI already promises.
+ */
+export class MemoryRestService extends BaseService {
+ private readonly activityModel: UserMemoryActivityModel;
+ private readonly contextModel: UserMemoryContextModel;
+ private readonly experienceModel: UserMemoryExperienceModel;
+ private readonly personaModel: UserPersonaModel;
+ private readonly preferenceModel: UserMemoryPreferenceModel;
+ private readonly topicModel: TopicModel;
+ private readonly userMemoryModel: UserMemoryModel;
+
+ constructor(db: LobeChatDatabase, userId: string | null, workspaceId?: string) {
+ super(db, userId, workspaceId);
+ const owner = userId ?? '';
+ this.activityModel = new UserMemoryActivityModel(db, owner);
+ this.contextModel = new UserMemoryContextModel(db, owner);
+ this.experienceModel = new UserMemoryExperienceModel(db, owner);
+ this.personaModel = new UserPersonaModel(db, owner);
+ this.preferenceModel = new UserMemoryPreferenceModel(db, owner);
+ this.topicModel = new TopicModel(db, owner, workspaceId);
+ this.userMemoryModel = new UserMemoryModel(db, owner);
+ }
+
+ /** The current persona document: its prose plus the one-line tagline. */
+ async getPersona(): ServiceResult<{ content: string; summary: string } | null> {
+ const latest = await this.personaModel.getLatestPersonaDocument();
+ if (!latest) return null;
+ return { content: latest.persona ?? '', summary: latest.tagline ?? '' };
+ }
+
+ listPersonaVersions(): ServiceResult<unknown> {
+ return this.personaModel.listVersions();
+ }
+
+ async listCategory(category: MemoryCategory): ServiceResult<unknown> {
+ switch (category) {
+ case 'identities': {
+ return this.userMemoryModel.getAllIdentities();
+ }
+ case 'preferences': {
+ return this.userMemoryModel.searchPreferences({});
+ }
+ case 'contexts': {
+ return this.userMemoryModel.searchContexts({});
+ }
+ case 'activities': {
+ return this.userMemoryModel.searchActivities({});
+ }
+ case 'experiences': {
+ return this.userMemoryModel.searchExperiences({});
+ }
+ }
+ }
+
+ async deleteEntry(category: MemoryCategory, id: string): ServiceResult<unknown> {
+ switch (category) {
+ case 'identities': {
+ return this.userMemoryModel.removeIdentityEntry(id);
+ }
+ case 'preferences': {
+ return this.preferenceModel.delete(id);
+ }
+ case 'contexts': {
+ return this.contextModel.delete(id);
+ }
+ case 'activities': {
+ return this.activityModel.delete(id);
+ }
+ case 'experiences': {
+ return this.experienceModel.delete(id);
+ }
+ }
+ }
+
+ /**
+ * Purge everything: memory entries, the persona document, and the per-topic
+ * extraction status. Resetting the status matters β€” without it every topic
+ * stays marked "extracted" and the purged memories can never come back.
+ */
+ async deleteAll(): ServiceResult<void> {
+ await this.userMemoryModel.deleteAll();
+ await this.personaModel.deletePersona();
+ await this.topicModel.resetMemoryExtractStatus();
+ }
+}
diff --git a/packages/openapi/src/services/notification.service.test.ts b/packages/openapi/src/services/notification.service.test.ts
new file mode 100644
index 00000000000..52ecf1e1938
--- /dev/null
+++ b/packages/openapi/src/services/notification.service.test.ts
@@ -0,0 +1,111 @@
+// @vitest-environment node
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+import type { LobeChatDatabase } from '@/database/type';
+
+import { NotificationRestService } from './notification.service';
+
+const { countLinkedMock, getNavigationCountsMock, getUnreadCountMock, listPendingForUserMock } =
+ vi.hoisted(() => ({
+ countLinkedMock: vi.fn(),
+ getNavigationCountsMock: vi.fn(),
+ getUnreadCountMock: vi.fn(),
+ listPendingForUserMock: vi.fn(),
+ }));
+
+vi.mock('@/const/rbac', () => ({ ALL_SCOPE: 'all' }));
+vi.mock('@lobechat/database', () => ({
+ buildWorkspacePayload: vi.fn(),
+ buildWorkspaceWhere: vi.fn(),
+}));
+vi.mock('@/database/models/rbac', () => ({
+ RbacModel: class {
+ hasAnyPermission = vi.fn().mockResolvedValue(false);
+ },
+}));
+vi.mock('@/database/schemas', () => ({
+ agents: {},
+ aiModels: {},
+ aiProviders: {},
+ files: {},
+ knowledgeBases: {},
+ messages: {},
+ sessions: {},
+ topics: {},
+}));
+vi.mock('@/utils/rbac', () => ({ getScopePermissions: () => [] }));
+vi.mock('@/database/models/notification', () => ({
+ NotificationModel: class {
+ countLinkedToTransfers = countLinkedMock;
+ getNavigationCounts = getNavigationCountsMock;
+ getUnreadCount = getUnreadCountMock;
+ },
+}));
+vi.mock('@/database/models/resourceTransferRequest', () => ({
+ ResourceTransferRequestModel: class {
+ listPendingForUser = listPendingForUserMock;
+ },
+}));
+
+const CALLER = 'me';
+const WORKSPACE = 'ws-1';
+
+/**
+ * A pending transfer keeps prompting even when its linked inbox row was read,
+ * archived or never delivered, so the REST counts must reconcile against the
+ * live request cards exactly like the tRPC inbox does β€” otherwise the SDK sees
+ * a different number than the app.
+ */
+describe('NotificationRestService live-transfer reconciliation', () => {
+ const service = (workspaceId?: string) =>
+ new NotificationRestService({} as LobeChatDatabase, CALLER, workspaceId);
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ listPendingForUserMock.mockResolvedValue([]);
+ countLinkedMock.mockResolvedValue({ total: 0, unread: 0 });
+ });
+
+ it('returns the raw unread count in personal mode', async () => {
+ getUnreadCountMock.mockResolvedValue(4);
+
+ await expect(service().getUnreadCount()).resolves.toBe(4);
+ expect(listPendingForUserMock).not.toHaveBeenCalled();
+ });
+
+ it('counts a live request whose linked row was already read', async () => {
+ listPendingForUserMock.mockResolvedValue([{ id: 'req-1' }, { id: 'req-2' }]);
+ getUnreadCountMock.mockResolvedValue(1);
+ countLinkedMock.mockResolvedValue({ total: 1, unread: 1 });
+
+ // 1 raw unread row + 2 live cards βˆ’ 1 card that already had an unread row.
+ await expect(service(WORKSPACE).getUnreadCount()).resolves.toBe(2);
+ expect(countLinkedMock).toHaveBeenCalledWith(['req-1', 'req-2']);
+ });
+
+ it('swaps the pending category over to the live request cards', async () => {
+ listPendingForUserMock.mockResolvedValue([{ id: 'req-1' }]);
+ getNavigationCountsMock.mockResolvedValue([
+ { category: 'pending', readCount: 1, totalCount: 2, unreadCount: 1 },
+ { category: 'system', readCount: 3, totalCount: 3, unreadCount: 0 },
+ ]);
+ countLinkedMock.mockResolvedValue({ total: 1, unread: 0 });
+
+ await expect(service(WORKSPACE).getNavigationCounts()).resolves.toEqual([
+ { category: 'pending', readCount: 0, totalCount: 2, unreadCount: 2 },
+ { category: 'system', readCount: 3, totalCount: 3, unreadCount: 0 },
+ ]);
+ });
+
+ it('adds a pending category when the request has no linked row at all', async () => {
+ listPendingForUserMock.mockResolvedValue([{ id: 'req-1' }]);
+ getNavigationCountsMock.mockResolvedValue([
+ { category: 'system', readCount: 3, totalCount: 3, unreadCount: 0 },
+ ]);
+
+ await expect(service(WORKSPACE).getNavigationCounts()).resolves.toEqual([
+ { category: 'system', readCount: 3, totalCount: 3, unreadCount: 0 },
+ { category: 'pending', readCount: 0, totalCount: 1, unreadCount: 1 },
+ ]);
+ });
+});
diff --git a/packages/openapi/src/services/notification.service.ts b/packages/openapi/src/services/notification.service.ts
new file mode 100644
index 00000000000..56723465ad6
--- /dev/null
+++ b/packages/openapi/src/services/notification.service.ts
@@ -0,0 +1,76 @@
+import { NotificationModel } from '@/database/models/notification';
+import type { LobeChatDatabase } from '@/database/type';
+import {
+ type InboxCountContext,
+ type NotificationNavigationCount,
+ resolveNavigationCounts,
+ resolveUnreadCount,
+} from '@/server/services/notification/inboxCounts';
+
+import { BaseService } from '../common/base.service';
+import type { ServiceResult } from '../types';
+import type { NotificationListQuery } from '../types/notification.type';
+
+/**
+ * Notifications REST service.
+ *
+ * The inbox is scoped exactly like the in-app one: personal scope sees only
+ * rows with `workspace_id IS NULL`, a workspace scope sees only its own rows,
+ * so the two contexts never leak into each other. The unread and per-category
+ * counts go through the same live-transfer reconciliation the tRPC router uses,
+ * so a pending transfer request keeps prompting here too instead of the two
+ * surfaces disagreeing.
+ */
+export class NotificationRestService extends BaseService {
+ private readonly notificationModel: NotificationModel;
+
+ constructor(db: LobeChatDatabase, userId: string | null, workspaceId?: string) {
+ super(db, userId, workspaceId);
+ this.notificationModel = new NotificationModel(db, userId ?? '', {
+ workspaceId: workspaceId ?? null,
+ });
+ }
+
+ private inboxCountContext(): InboxCountContext {
+ return {
+ notificationModel: this.notificationModel,
+ serverDB: this.db,
+ userId: this.userId,
+ workspaceId: this.workspaceId ?? null,
+ };
+ }
+
+ async listNotifications(query: NotificationListQuery): ServiceResult<unknown> {
+ return this.notificationModel.list({
+ category: query.category,
+ cursor: query.cursor,
+ isRead: query.isRead,
+ limit: query.limit,
+ unreadOnly: query.unreadOnly,
+ });
+ }
+
+ async getUnreadCount(): ServiceResult<number> {
+ return resolveUnreadCount(this.inboxCountContext());
+ }
+
+ async getNavigationCounts(): ServiceResult<NotificationNavigationCount[]> {
+ return resolveNavigationCounts(this.inboxCountContext());
+ }
+
+ async markAsRead(ids: string[]): ServiceResult<unknown> {
+ return this.notificationModel.markAsRead(ids);
+ }
+
+ async markAllAsRead(): ServiceResult<unknown> {
+ return this.notificationModel.markAllAsRead();
+ }
+
+ async archive(id: string): ServiceResult<unknown> {
+ return this.notificationModel.archive(id);
+ }
+
+ async archiveAll(): ServiceResult<unknown> {
+ return this.notificationModel.archiveAll();
+ }
+}
diff --git a/packages/openapi/src/services/task.service.test.ts b/packages/openapi/src/services/task.service.test.ts
new file mode 100644
index 00000000000..397869d41dd
--- /dev/null
+++ b/packages/openapi/src/services/task.service.test.ts
@@ -0,0 +1,277 @@
+// @vitest-environment node
+import { TRPCError } from '@trpc/server';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+import type { LobeChatDatabase } from '@/database/type';
+
+import { TaskRestService } from './task.service';
+
+const {
+ createTaskMock,
+ deleteTaskMock,
+ hasAnyPermissionMock,
+ notifyAssignedMock,
+ resolveMock,
+ resolveTaskPatchInvariantsMock,
+ updateTaskMock,
+} = vi.hoisted(() => ({
+ createTaskMock: vi.fn(),
+ deleteTaskMock: vi.fn(),
+ hasAnyPermissionMock: vi.fn(),
+ notifyAssignedMock: vi.fn(),
+ resolveMock: vi.fn(),
+ resolveTaskPatchInvariantsMock: vi.fn(),
+ updateTaskMock: vi.fn(),
+}));
+
+vi.mock('@/const/rbac', () => ({ ALL_SCOPE: 'all' }));
+vi.mock('@lobechat/database', () => ({
+ buildWorkspacePayload: vi.fn(),
+ buildWorkspaceWhere: vi.fn(),
+}));
+vi.mock('@/database/models/rbac', () => ({
+ RbacModel: class {
+ hasAnyPermission = hasAnyPermissionMock;
+ },
+}));
+vi.mock('@/database/schemas', () => ({
+ agents: {},
+ aiModels: {},
+ aiProviders: {},
+ files: {},
+ knowledgeBases: {},
+ messages: {},
+ sessions: {},
+ topics: {},
+}));
+vi.mock('@/utils/rbac', () => ({ getScopePermissions: () => [] }));
+vi.mock('@/database/models/agent', () => ({
+ AgentModel: class {
+ getAgentVisibility = vi.fn().mockResolvedValue('public');
+ },
+}));
+vi.mock('@/database/models/task', () => ({
+ TaskModel: class {
+ resolve = resolveMock;
+ },
+}));
+vi.mock('@/server/services/editLock', () => ({
+ EditLockService: class {
+ getBlockingHolder = vi.fn().mockResolvedValue(null);
+ },
+}));
+vi.mock('@/server/services/task', () => ({
+ TaskService: class {
+ createTask = createTaskMock;
+ deleteTask = deleteTaskMock;
+ updateTaskWithAssigneeLock = updateTaskMock;
+ },
+}));
+// The invariant chain itself is covered by
+// `apps/server/src/services/task/patchValidation.test.ts`; here we only pin that
+// the REST patch runs through it instead of writing the row directly.
+vi.mock('@/server/services/task/patchValidation', () => ({
+ resolveTaskPatchInvariants: resolveTaskPatchInvariantsMock,
+}));
+// The ping itself is the tRPC boundary's shared helper; here we only pin that
+// the REST create/patch actually reaches it.
+vi.mock('@/server/services/task/assignmentNotification', () => ({
+ notifyAssignedBestEffort: notifyAssignedMock,
+}));
+
+const CALLER = 'me';
+const WORKSPACE = 'ws-1';
+
+describe('TaskRestService creator gate on delete', () => {
+ const service = (workspaceId?: string) =>
+ new TaskRestService({} as LobeChatDatabase, CALLER, workspaceId);
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ hasAnyPermissionMock.mockResolvedValue(false);
+ resolveMock.mockResolvedValue({ createdByUserId: 'other-member', id: 'task-1' });
+ });
+
+ it('refuses deleting a task created by another workspace member', async () => {
+ await expect(service(WORKSPACE).deleteTask('task-1')).rejects.toThrow(
+ /Only the creator or a workspace owner/,
+ );
+ expect(deleteTaskMock).not.toHaveBeenCalled();
+ });
+
+ it('deletes a task the caller created', async () => {
+ resolveMock.mockResolvedValue({ createdByUserId: CALLER, id: 'task-1' });
+ deleteTaskMock.mockResolvedValue({ id: 'task-1' });
+
+ await expect(service(WORKSPACE).deleteTask('task-1')).resolves.toEqual({ id: 'task-1' });
+ expect(deleteTaskMock).toHaveBeenCalledWith('task-1');
+ });
+});
+
+describe('TaskRestService patch runs the shared invariants', () => {
+ const service = () => new TaskRestService({} as LobeChatDatabase, CALLER, WORKSPACE);
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ hasAnyPermissionMock.mockResolvedValue(false);
+ resolveTaskPatchInvariantsMock.mockImplementation(async () => ({
+ data: { parentTaskId: 'parent-1' },
+ resolved: { createdByUserId: CALLER, id: 'task-1' },
+ }));
+ updateTaskMock.mockResolvedValue({ id: 'task-1' });
+ });
+
+ it('writes the row the invariants resolved, not the raw path id', async () => {
+ await expect(service().updateTask('TASK-1', { parentTaskId: 'parent-1' })).resolves.toEqual({
+ id: 'task-1',
+ });
+
+ expect(resolveTaskPatchInvariantsMock).toHaveBeenCalledWith(
+ expect.objectContaining({ userId: CALLER, workspaceId: WORKSPACE }),
+ expect.objectContaining({ id: 'TASK-1', parentTaskId: 'parent-1' }),
+ );
+ expect(updateTaskMock).toHaveBeenCalledWith(
+ 'task-1',
+ { parentTaskId: 'parent-1' },
+ {
+ userId: CALLER,
+ },
+ );
+ });
+
+ it('refuses the patch when an invariant rejects it', async () => {
+ resolveTaskPatchInvariantsMock.mockRejectedValue(
+ new TRPCError({ code: 'BAD_REQUEST', message: 'Task cannot be parented to itself' }),
+ );
+
+ await expect(service().updateTask('task-1', { parentTaskId: 'task-1' })).rejects.toThrow(
+ 'Task cannot be parented to itself',
+ );
+ expect(updateTaskMock).not.toHaveBeenCalled();
+ });
+
+ it('reports a missing task instead of writing', async () => {
+ resolveTaskPatchInvariantsMock.mockRejectedValue(
+ new TRPCError({ code: 'NOT_FOUND', message: 'Task not found' }),
+ );
+
+ await expect(service().updateTask('missing', { name: 'x' })).rejects.toThrow('Task not found');
+ expect(updateTaskMock).not.toHaveBeenCalled();
+ });
+});
+
+/**
+ * The task create boundary still validates its own schedule: `createTask` has no
+ * stored row to validate against, so the field schemas plus this pair check are
+ * the whole gate.
+ */
+describe('TaskRestService write-time schedule validation', () => {
+ const service = () => new TaskRestService({} as LobeChatDatabase, CALLER, WORKSPACE);
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ hasAnyPermissionMock.mockResolvedValue(false);
+ });
+
+ it('refuses a create whose cron the dispatcher cannot evaluate', async () => {
+ await expect(
+ service().createTask({ instruction: 'ship it', schedulePattern: 'every day' }),
+ ).rejects.toThrow(/Invalid schedule/);
+ expect(createTaskMock).not.toHaveBeenCalled();
+ });
+
+ it('refuses a create with an unknown IANA timezone', async () => {
+ await expect(
+ service().createTask({ instruction: 'ship it', scheduleTimezone: 'Mars/Phobos' }),
+ ).rejects.toThrow(/Invalid schedule/);
+ expect(createTaskMock).not.toHaveBeenCalled();
+ });
+
+ it('creates with a cron pattern and timezone the dispatcher can evaluate', async () => {
+ createTaskMock.mockResolvedValue({ id: 'task-1' });
+
+ await expect(
+ service().createTask({
+ automationMode: 'schedule',
+ instruction: 'ship it',
+ schedulePattern: '0 9 * * 1-5',
+ scheduleTimezone: 'Asia/Shanghai',
+ }),
+ ).resolves.toEqual({ id: 'task-1' });
+ expect(createTaskMock).toHaveBeenCalledTimes(1);
+ });
+});
+
+/**
+ * Assigning through REST must reach the assignee's inbox the way assigning
+ * in-app does: the tRPC boundaries ping via `notifyAssignedBestEffort`, so the
+ * REST create and the REST patch have to as well, and the patch has to stay
+ * silent unless the assignee actually changed.
+ */
+describe('TaskRestService assignment notification', () => {
+ const service = () => new TaskRestService({} as LobeChatDatabase, CALLER, WORKSPACE);
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ hasAnyPermissionMock.mockResolvedValue(false);
+ });
+
+ it('notifies the member a create assigned the task to', async () => {
+ const created = {
+ assigneeUserId: 'other-member',
+ id: 'task-1',
+ identifier: 'TASK-1',
+ name: 'ship it',
+ };
+ createTaskMock.mockResolvedValue(created);
+
+ await expect(
+ service().createTask({ assigneeUserId: 'other-member', instruction: 'ship it' }),
+ ).resolves.toEqual(created);
+
+ expect(notifyAssignedMock).toHaveBeenCalledWith(
+ { userId: CALLER, workspaceId: WORKSPACE },
+ created,
+ );
+ });
+
+ it('notifies when a patch actually changes the assignee', async () => {
+ resolveTaskPatchInvariantsMock.mockResolvedValue({
+ data: { assigneeUserId: 'other-member' },
+ resolved: { assigneeUserId: null, id: 'task-1' },
+ });
+ const updated = {
+ assigneeUserId: 'other-member',
+ id: 'task-1',
+ identifier: 'TASK-1',
+ name: 'ship it',
+ };
+ updateTaskMock.mockResolvedValue(updated);
+
+ await expect(
+ service().updateTask('task-1', { assigneeUserId: 'other-member' }),
+ ).resolves.toEqual(updated);
+
+ expect(notifyAssignedMock).toHaveBeenCalledWith(
+ { userId: CALLER, workspaceId: WORKSPACE },
+ updated,
+ );
+ });
+
+ it('stays silent when the patch leaves the assignee untouched', async () => {
+ resolveTaskPatchInvariantsMock.mockResolvedValue({
+ data: { name: 'renamed' },
+ resolved: { assigneeUserId: 'other-member', id: 'task-1' },
+ });
+ updateTaskMock.mockResolvedValue({
+ assigneeUserId: 'other-member',
+ id: 'task-1',
+ identifier: 'TASK-1',
+ name: 'renamed',
+ });
+
+ await service().updateTask('task-1', { name: 'renamed' });
+
+ expect(notifyAssignedMock).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/openapi/src/services/task.service.ts b/packages/openapi/src/services/task.service.ts
new file mode 100644
index 00000000000..090ea2a6f13
--- /dev/null
+++ b/packages/openapi/src/services/task.service.ts
@@ -0,0 +1,122 @@
+import { AgentModel } from '@/database/models/agent';
+import { TaskModel } from '@/database/models/task';
+import type { LobeChatDatabase } from '@/database/type';
+import { EditLockService } from '@/server/services/editLock';
+import { TaskService } from '@/server/services/task';
+import { notifyAssignedBestEffort } from '@/server/services/task/assignmentNotification';
+import { resolveTaskPatchInvariants } from '@/server/services/task/patchValidation';
+import { assertResultingScheduleValid } from '@/server/services/task/scheduleValidation';
+
+import { BaseService } from '../common/base.service';
+import type { ServiceResult } from '../types';
+import type {
+ CreateTaskRequest,
+ TaskListQuery,
+ UpdateTaskRequest,
+ UpdateTaskStatusRequest,
+} from '../types/task.type';
+
+/**
+ * Tasks REST service.
+ *
+ * The task orchestration already lives in `TaskService` β€” assignment locks,
+ * visibility compatibility, run interruption, activity logging β€” so this layer
+ * only decides who may ask. Nothing is re-implemented here, which is why the
+ * in-app task feed and this API cannot drift apart.
+ */
+export class TaskRestService extends BaseService {
+ private readonly taskModel: TaskModel;
+ private readonly taskService: TaskService;
+
+ constructor(db: LobeChatDatabase, userId: string | null, workspaceId?: string) {
+ super(db, userId, workspaceId);
+ this.taskModel = new TaskModel(db, userId ?? '', workspaceId);
+ this.taskService = new TaskService(db, userId ?? '', workspaceId);
+ }
+
+ async listTasks(query: TaskListQuery): ServiceResult<unknown> {
+ return this.taskModel.list({
+ assigneeAgentId: query.assigneeAgentId,
+ limit: query.limit,
+ offset: query.offset,
+ projectId: query.projectId,
+ statuses: query.statuses,
+ });
+ }
+
+ async getTask(id: string): ServiceResult<unknown> {
+ const detail = await this.taskService.getTaskDetail(id);
+ if (!detail) throw this.createNotFoundError('Task not found');
+ return detail;
+ }
+
+ async createTask(input: CreateTaskRequest): ServiceResult<unknown> {
+ // The request schemas check the cron pattern and the timezone one at a
+ // time; this checks the pair the task ends up with, exactly like the tRPC
+ // create boundary, so a schedule the dispatcher cannot evaluate is refused
+ // here instead of being stored and silently never firing.
+ assertResultingScheduleValid(null, input);
+ const task = await this.taskService.createTask(input);
+ // Creating a task already assigned to another member notifies them, the way
+ // the tRPC create boundary does; self-assignment is filtered inside the
+ // helper, so this stays silent for the caller's own task.
+ notifyAssignedBestEffort({ userId: this.userId, workspaceId: this.workspaceId }, task);
+ return task;
+ }
+
+ async updateTask(id: string, input: UpdateTaskRequest): ServiceResult<unknown> {
+ // Hierarchy, visibility, assignment and schedule invariants all live in one
+ // shared place, so this patch cannot persist what the in-app editor refuses
+ // β€” a task parented to itself, a public child under a private parent, an
+ // unusable or private assignee β€” and the two boundaries cannot drift.
+ const { data, resolved } = await resolveTaskPatchInvariants(
+ {
+ agentModel: new AgentModel(this.db, this.userId, this.workspaceId),
+ editLockService: new EditLockService(this.userId),
+ serverDB: this.db,
+ taskModel: this.taskModel,
+ taskService: this.taskService,
+ userId: this.userId,
+ workspaceId: this.workspaceId,
+ },
+ { data: input, id, parentTaskId: input.parentTaskId },
+ );
+
+ // The patch is a partial row update; the model owns which columns are
+ // accepted and normalises the null-vs-undefined distinction itself.
+ const updated = await this.taskService.updateTaskWithAssigneeLock(
+ resolved.id,
+ data as Parameters<TaskModel['update']>[1],
+ { userId: this.userId },
+ );
+ if (!updated) throw this.createNotFoundError('Task not found');
+ // Only an actual assignee change notifies β€” re-saving the same assignee
+ // stays silent, exactly like the tRPC patch boundary. `resolved` is the row
+ // as it was before this patch, so the comparison cannot be fooled by a
+ // partial update that leaves the assignee untouched.
+ if (updated.assigneeUserId !== resolved.assigneeUserId) {
+ notifyAssignedBestEffort({ userId: this.userId, workspaceId: this.workspaceId }, updated);
+ }
+ return updated;
+ }
+
+ async updateTaskStatus(id: string, input: UpdateTaskStatusRequest): ServiceResult<unknown> {
+ // A person (or their agent) made this change, so it belongs in the feed β€”
+ // the service treats a missing actor as a system transition.
+ return this.taskService.updateStatus(
+ { error: input.error, id, status: input.status },
+ { userId: this.userId },
+ );
+ }
+
+ async deleteTask(id: string): ServiceResult<unknown> {
+ // `TaskModel` resolves any public task for a workspace, so `agent:update`
+ // alone would let a member delete a colleague's task and interrupt its live
+ // runs; the tRPC delete path gates this on the row's creator, and this one
+ // must not be the way around it.
+ const task = await this.taskModel.resolve(id);
+ if (!task) throw this.createNotFoundError('Task not found');
+ await this.assertRowManageable(task.createdByUserId, 'AGENT_UPDATE', 'task');
+ return this.taskService.deleteTask(task.id);
+ }
+}
diff --git a/packages/openapi/src/spec.ts b/packages/openapi/src/spec.ts
index a08fb59bc9f..b9b857b8685 100644
--- a/packages/openapi/src/spec.ts
+++ b/packages/openapi/src/spec.ts
@@ -432,6 +432,46 @@ const groupResources: Record<string, { listKey: string; schema: string }> = {
const ref = (schema: string): SchemaObject => ({ $ref: `#/components/schemas/${schema}` });
+/**
+ * Personal-agent resources whose payload is coordinator / inbox state rather
+ * than a stable CRUD row (a goal's graph snapshot, a category of memory
+ * entries, a page of receipts). The spec stays deliberately vague for these β€”
+ * same policy as unnamed sub-operations: `additionalProperties` over a guessed
+ * shape, so a generated client is never confidently mistyped.
+ */
+const PERSONAL_AGENT_GROUPS = new Set(['goals', 'memories', 'notifications', 'signals', 'tasks']);
+
+/**
+ * Handlers whose success status is not 200. A controller's return code is not
+ * visible to the generator, so every non-200 success has to be declared here β€”
+ * otherwise the document (and the SDK generated from it) advertises a status
+ * the runtime never sends, and status-discriminating clients branch wrongly.
+ */
+const CREATED_OPERATIONS = new Set([
+ 'POST agent-groups',
+ 'POST agents/{id}/duplicate',
+ 'POST api-keys',
+ 'POST eval/benchmarks',
+ 'POST eval/datasets',
+ 'POST eval/datasets/{datasetId}/test-cases',
+ 'POST goals',
+ 'POST mcp-servers',
+ 'POST tasks',
+]);
+
+const ACCEPTED_OPERATIONS = new Set([
+ 'POST eval/runs',
+ 'POST signals/source-events',
+ 'POST signals/trigger',
+]);
+
+const successStatusFor = (group: string, rest: string, method: string): number => {
+ const operation = `${method.toUpperCase()} ${group}${rest ? `/${rest}` : ''}`;
+ if (ACCEPTED_OPERATIONS.has(operation)) return 202;
+ if (CREATED_OPERATIONS.has(operation)) return 201;
+ return 200;
+};
+
const successEnvelope = (data: SchemaObject): SchemaObject => ({
additionalProperties: false,
properties: {
@@ -458,6 +498,10 @@ const getSuccessSchema = (group: string, rest: string, method: string): SchemaOb
};
}
+ if (PERSONAL_AGENT_GROUPS.has(group)) {
+ return successEnvelope({ additionalProperties: true, type: ['array', 'object', 'null'] });
+ }
+
if (group === 'responses') {
return {
additionalProperties: true,
@@ -780,16 +824,15 @@ export const buildSpecDocument = async (app: GenerateSpecsApp) => {
successContent['text/event-stream'] = { schema: { type: 'string' } };
}
- const successStatus =
- group === 'eval' && method === 'post' && rest === 'runs'
- ? 202
- : method === 'post' &&
- ((['agent-groups', 'api-keys', 'mcp-servers'].includes(group) && rest === '') ||
- (group === 'agents' && rest === '{id}/duplicate') ||
- (group === 'eval' &&
- ['benchmarks', 'datasets', 'datasets/{datasetId}/test-cases'].includes(rest)))
- ? 201
- : 200;
+ const successStatus = successStatusFor(group, rest, method);
+ // `hono-openapi` fills a contentless 200 into operations that declare a
+ // request body but no responses. When the handler actually answers
+ // 201/202 that placeholder is not a real response and must go, or the
+ // document keeps advertising a status the runtime never sends.
+ const placeholder200 = op.responses[200] as { content?: unknown } | undefined;
+ if (successStatus !== 200 && placeholder200 && !placeholder200.content) {
+ delete op.responses[200];
+ }
const currentSuccess = (op.responses[successStatus] ?? {}) as Record<string, unknown>;
op.responses[successStatus] = {
...currentSuccess,
diff --git a/packages/openapi/src/types/agent-signal.type.ts b/packages/openapi/src/types/agent-signal.type.ts
new file mode 100644
index 00000000000..967923eafdd
--- /dev/null
+++ b/packages/openapi/src/types/agent-signal.type.ts
@@ -0,0 +1,51 @@
+import { AGENT_SIGNAL_CLIENT_SOURCE_TYPES } from '@lobechat/agent-signal/source';
+import { z } from 'zod';
+
+import { AGENT_SIGNAL_TRIGGER_SOURCE_TYPES } from '@/server/services/agentSignal/triggerSourceEvent';
+
+/** Source event types the client is allowed to emit directly. */
+export const AgentSignalClientSourceSchema = z.enum(AGENT_SIGNAL_CLIENT_SOURCE_TYPES);
+/** Source event types the server can synthesise a trigger for. */
+export const AgentSignalTriggerSourceSchema = z.enum(AGENT_SIGNAL_TRIGGER_SOURCE_TYPES);
+
+export const AgentSignalReceiptIdParamSchema = z.object({
+ id: z.string().min(1),
+});
+
+export const EmitSourceEventRequestSchema = z.object({
+ /** Event body; `agentId` inside it overrides the routing agent. */
+ payload: z.record(z.string(), z.unknown()),
+ scopeKey: z.string().optional(),
+ sourceId: z.string().min(1),
+ sourceType: AgentSignalClientSourceSchema,
+ timestamp: z.number().optional(),
+});
+export type EmitSourceEventRequest = z.infer<typeof EmitSourceEventRequestSchema>;
+
+export const TriggerSourceEventRequestSchema = z.object({
+ agentId: z.string().optional(),
+ payloadOverride: z.record(z.string(), z.unknown()).optional(),
+ scopeKey: z.string().optional(),
+ sourceId: z.string().optional(),
+ sourceType: AgentSignalTriggerSourceSchema,
+ timestamp: z.number().optional(),
+ topicId: z.string().optional(),
+});
+export type TriggerSourceEventRequest = z.infer<typeof TriggerSourceEventRequestSchema>;
+
+export const ListReceiptsQuerySchema = z.object({
+ agentId: z.string().min(1),
+ cursor: z.coerce.number().int().min(0).optional(),
+ limit: z.coerce.number().int().min(1).max(50).optional(),
+ sinceCreatedAt: z.coerce.number().int().min(0).optional(),
+ topicId: z.string().min(1),
+});
+export type ListReceiptsQuery = z.infer<typeof ListReceiptsQuerySchema>;
+
+export const RollbackReceiptRequestSchema = z.object({
+ agentDocumentId: z.string().min(1).optional(),
+ documentId: z.string().min(1),
+ historyId: z.string().min(1),
+ receiptId: z.string().min(1),
+});
+export type RollbackReceiptRequest = z.infer<typeof RollbackReceiptRequestSchema>;
diff --git a/packages/openapi/src/types/goal.type.ts b/packages/openapi/src/types/goal.type.ts
new file mode 100644
index 00000000000..f912b81d682
--- /dev/null
+++ b/packages/openapi/src/types/goal.type.ts
@@ -0,0 +1,103 @@
+import { z } from 'zod';
+
+import { goalStatuses } from '@/const/goal';
+
+// ==================== Path / Query Schemas ====================
+
+export const GoalIdParamSchema = z.object({
+ id: z.string().min(1),
+});
+export type GoalIdParam = z.infer<typeof GoalIdParamSchema>;
+
+/**
+ * Query strings cannot carry repeated/typed values the way the tRPC surface can,
+ * so list filters arrive as strings: numbers are coerced and `statuses` is a
+ * comma-separated list (`?statuses=running,paused`).
+ */
+export const GoalListQuerySchema = z.object({
+ agentId: z.string().optional(),
+ limit: z.coerce.number().int().min(1).max(100).optional(),
+ offset: z.coerce.number().int().min(0).optional(),
+ projectId: z.string().optional(),
+ statuses: z
+ .string()
+ .optional()
+ .transform((value) =>
+ value
+ ?.split(',')
+ .map((status) => status.trim())
+ .filter(Boolean),
+ )
+ .pipe(z.array(z.enum(goalStatuses)).optional()),
+ topicId: z.string().optional(),
+});
+export type GoalListQuery = z.infer<typeof GoalListQuerySchema>;
+
+// ==================== Request Body Schemas ====================
+
+export const GoalCriterionSchema = z.object({
+ description: z.string().optional(),
+ instruction: z.string().optional(),
+ title: z.string().min(1),
+});
+
+export const GoalTaskSeedSchema = z.union([
+ z.string().min(1),
+ z.object({
+ description: z.string().optional(),
+ title: z.string().min(1),
+ }),
+]);
+
+export const CreateGoalRequestSchema = z.object({
+ /** The agent that supervises the goal; defaults to the authoring agent. */
+ agentId: z.string().optional(),
+ /** Coordinator config (budget, concurrency, task agent, acceptance metrics…). */
+ config: z.record(z.string(), z.unknown()).optional(),
+ /** Structured acceptance criteria, persisted as verify criteria rows. */
+ criteria: z.array(GoalCriterionSchema).optional(),
+ /** Calendar deadline for the whole goal, ISO-8601. */
+ deadline: z.string().datetime().optional(),
+ /** Cap on total spend in USD. */
+ maxTotalCost: z.number().positive().optional(),
+ problemDescription: z.string().optional(),
+ projectId: z.string().optional(),
+ requirement: z.string().optional(),
+ /** Seed task nodes. Omit to let the coordinator plan the decomposition. */
+ tasks: z.array(GoalTaskSeedSchema).optional(),
+ title: z.string().min(1),
+});
+export type CreateGoalRequest = z.infer<typeof CreateGoalRequestSchema>;
+
+/**
+ * Budget knobs mirror the `lh goal set-budget` surface: `null` clears a bound,
+ * omitting it leaves the current value in place.
+ */
+export const UpdateGoalBudgetSchema = z.object({
+ deadline: z.string().datetime().nullable().optional(),
+ maxAttemptsPerTask: z.number().int().positive().optional(),
+ maxConcurrentTasks: z.number().int().min(1).max(10).nullable().optional(),
+ maxExperiments: z.number().int().min(1).max(200).optional(),
+ maxManagerTurns: z.number().int().min(1).max(100).optional(),
+ maxRounds: z.number().int().positive().nullable().optional(),
+ maxStepsPerRun: z.number().int().positive().nullable().optional(),
+ maxTotalCost: z.number().positive().nullable().optional(),
+});
+export type UpdateGoalBudget = z.infer<typeof UpdateGoalBudgetSchema>;
+
+export const UpdateGoalRequestSchema = z
+ .object({
+ budget: UpdateGoalBudgetSchema.optional(),
+ /** Rewrites the "what counts as done" text every task's context reads. */
+ requirement: z.string().min(1).optional(),
+ })
+ .refine((value) => value.budget !== undefined || value.requirement !== undefined, {
+ message: 'Provide at least one of `requirement` or `budget`',
+ });
+export type UpdateGoalRequest = z.infer<typeof UpdateGoalRequestSchema>;
+
+export const RestartGoalRequestSchema = z.object({
+ /** Optional new agent for every unfinished task node. */
+ agentId: z.string().min(1).optional(),
+});
+export type RestartGoalRequest = z.infer<typeof RestartGoalRequestSchema>;
diff --git a/packages/openapi/src/types/memory.type.ts b/packages/openapi/src/types/memory.type.ts
new file mode 100644
index 00000000000..318f7a8f3f8
--- /dev/null
+++ b/packages/openapi/src/types/memory.type.ts
@@ -0,0 +1,28 @@
+import { z } from 'zod';
+
+/** Id of a single memory entry inside its category. */
+export const MemoryEntryIdParamSchema = z.object({
+ id: z.string().min(1),
+});
+export type MemoryEntryIdParam = z.infer<typeof MemoryEntryIdParamSchema>;
+
+/** The six memory categories a client can read and prune individually. */
+export const MEMORY_CATEGORIES = [
+ 'identities',
+ 'preferences',
+ 'contexts',
+ 'activities',
+ 'experiences',
+] as const;
+
+export type MemoryCategory = (typeof MEMORY_CATEGORIES)[number];
+
+export const MemoryCategoryParamSchema = z.object({
+ category: z.enum(MEMORY_CATEGORIES),
+});
+export type MemoryCategoryParam = z.infer<typeof MemoryCategoryParamSchema>;
+
+export const MemoryEntryPathParamSchema = MemoryCategoryParamSchema.extend(
+ MemoryEntryIdParamSchema.shape,
+);
+export type MemoryEntryPathParam = z.infer<typeof MemoryEntryPathParamSchema>;
diff --git a/packages/openapi/src/types/notification.type.ts b/packages/openapi/src/types/notification.type.ts
new file mode 100644
index 00000000000..2ccf90f478b
--- /dev/null
+++ b/packages/openapi/src/types/notification.type.ts
@@ -0,0 +1,27 @@
+import { z } from 'zod';
+
+export const NotificationIdParamSchema = z.object({
+ id: z.string().min(1),
+});
+export type NotificationIdParam = z.infer<typeof NotificationIdParamSchema>;
+
+/** Query strings carry booleans as text; coerce them back before hitting the model. */
+const booleanQuery = z
+ .union([z.boolean(), z.enum(['true', 'false'])])
+ .transform((value) => value === true || value === 'true')
+ .optional();
+
+export const NotificationListQuerySchema = z.object({
+ category: z.string().optional(),
+ /** Opaque cursor: the `id` of the last row from the previous page. */
+ cursor: z.string().optional(),
+ isRead: booleanQuery,
+ limit: z.coerce.number().int().min(1).max(50).optional(),
+ unreadOnly: booleanQuery,
+});
+export type NotificationListQuery = z.infer<typeof NotificationListQuerySchema>;
+
+export const MarkNotificationsReadRequestSchema = z.object({
+ ids: z.array(z.string().min(1)).min(1),
+});
+export type MarkNotificationsReadRequest = z.infer<typeof MarkNotificationsReadRequestSchema>;
diff --git a/packages/openapi/src/types/task.type.test.ts b/packages/openapi/src/types/task.type.test.ts
new file mode 100644
index 00000000000..7a6c3e73fca
--- /dev/null
+++ b/packages/openapi/src/types/task.type.test.ts
@@ -0,0 +1,46 @@
+import { describe, expect, it } from 'vitest';
+
+import { CreateTaskRequestSchema, UpdateTaskRequestSchema } from './task.type';
+
+/**
+ * A schedule the dispatcher cannot evaluate must be refused at the boundary:
+ * `TaskService.createTask` assumes the caller already validated it, so an
+ * accepted-but-unusable pattern is stored and then silently never fires.
+ */
+describe('task schedule field schemas', () => {
+ it('rejects a create whose cron the dispatcher cannot evaluate', () => {
+ expect(
+ CreateTaskRequestSchema.safeParse({ instruction: 'ship it', schedulePattern: 'every day' })
+ .success,
+ ).toBe(false);
+ });
+
+ it('accepts a create with a standard cron pattern and IANA timezone', () => {
+ expect(
+ CreateTaskRequestSchema.safeParse({
+ automationMode: 'schedule',
+ instruction: 'ship it',
+ schedulePattern: '0 9 * * 1-5',
+ scheduleTimezone: 'Asia/Shanghai',
+ }).success,
+ ).toBe(true);
+ });
+
+ it('rejects a create with an unknown timezone', () => {
+ expect(
+ CreateTaskRequestSchema.safeParse({ instruction: 'ship it', scheduleTimezone: 'Mars/Phobos' })
+ .success,
+ ).toBe(false);
+ });
+
+ it('applies the same checks to a patch', () => {
+ expect(UpdateTaskRequestSchema.safeParse({ schedulePattern: 'every day' }).success).toBe(false);
+ expect(UpdateTaskRequestSchema.safeParse({ scheduleTimezone: 'Mars/Phobos' }).success).toBe(
+ false,
+ );
+ expect(UpdateTaskRequestSchema.safeParse({ schedulePattern: '0 9 * * 1-5' }).success).toBe(
+ true,
+ );
+ expect(UpdateTaskRequestSchema.safeParse({ schedulePattern: null }).success).toBe(true);
+ });
+});
diff --git a/packages/openapi/src/types/task.type.ts b/packages/openapi/src/types/task.type.ts
new file mode 100644
index 00000000000..cf246329a97
--- /dev/null
+++ b/packages/openapi/src/types/task.type.ts
@@ -0,0 +1,79 @@
+import { TASK_STATUSES } from '@lobechat/builtin-tool-task';
+import { z } from 'zod';
+
+import {
+ schedulePatternSchema,
+ scheduleTimezoneSchema,
+} from '@/server/services/task/scheduleValidation';
+
+export const TaskIdParamSchema = z.object({
+ id: z.string().min(1),
+});
+export type TaskIdParam = z.infer<typeof TaskIdParamSchema>;
+
+/** Query strings carry lists as comma-separated text: `?statuses=running,paused`. */
+export const TaskListQuerySchema = z.object({
+ assigneeAgentId: z.string().optional(),
+ limit: z.coerce.number().int().min(1).max(100).optional(),
+ offset: z.coerce.number().int().min(0).optional(),
+ projectId: z.string().optional(),
+ statuses: z
+ .string()
+ .optional()
+ .transform((value) =>
+ value
+ ?.split(',')
+ .map((status) => status.trim())
+ .filter(Boolean),
+ )
+ .pipe(z.array(z.enum(TASK_STATUSES)).optional()),
+});
+export type TaskListQuery = z.infer<typeof TaskListQuerySchema>;
+
+export const CreateTaskRequestSchema = z.object({
+ assigneeAgentId: z.string().optional(),
+ assigneeUserId: z.string().optional(),
+ automationMode: z.enum(['heartbeat', 'schedule']).optional(),
+ config: z.record(z.string(), z.unknown()).optional(),
+ createdByAgentId: z.string().optional(),
+ description: z.string().optional(),
+ /** What the task must accomplish; the only required field. */
+ instruction: z.string().min(1),
+ name: z.string().optional(),
+ parentTaskId: z.string().optional(),
+ priority: z.number().int().min(0).max(4).optional(),
+ projectId: z.string().optional(),
+ // Same write-time cron/timezone validation as the tRPC create boundary, so a
+ // schedule the dispatcher cannot evaluate is refused instead of stored.
+ schedulePattern: schedulePatternSchema.optional(),
+ scheduleTimezone: scheduleTimezoneSchema.optional(),
+ visibility: z.enum(['private', 'public']).optional(),
+});
+export type CreateTaskRequest = z.infer<typeof CreateTaskRequestSchema>;
+
+export const UpdateTaskRequestSchema = z
+ .object({
+ assigneeAgentId: z.string().nullish(),
+ assigneeUserId: z.string().nullish(),
+ automationMode: z.enum(['heartbeat', 'schedule']).nullish(),
+ config: z.record(z.string(), z.unknown()).optional(),
+ description: z.string().nullish(),
+ instruction: z.string().optional(),
+ name: z.string().optional(),
+ parentTaskId: z.string().nullish(),
+ priority: z.number().int().min(0).max(4).optional(),
+ schedulePattern: schedulePatternSchema.nullish(),
+ scheduleTimezone: scheduleTimezoneSchema.nullish(),
+ })
+ .strict()
+ .refine((value) => Object.keys(value).length > 0, {
+ message: 'Provide at least one field to update',
+ });
+export type UpdateTaskRequest = z.infer<typeof UpdateTaskRequestSchema>;
+
+export const UpdateTaskStatusRequestSchema = z.object({
+ /** Only meaningful with `failed`; rejected otherwise. */
+ error: z.string().optional(),
+ status: z.enum(TASK_STATUSES),
+});
+export type UpdateTaskStatusRequest = z.infer<typeof UpdateTaskStatusRequestSchema>;
diff --git a/packages/sdk/openapi-ts.config.ts b/packages/sdk/openapi-ts.config.ts
index 38310966deb..23f211c1670 100644
--- a/packages/sdk/openapi-ts.config.ts
+++ b/packages/sdk/openapi-ts.config.ts
@@ -25,6 +25,23 @@ const METHOD_NAME_OVERRIDES: Record<string, string> = {
'POST /api/v1/knowledge-bases/{id}/files/batch': 'addFiles',
'POST /api/v1/knowledge-bases/{id}/files/move': 'moveFiles',
'POST /api/v1/messages/replies': 'createReply',
+ // Personal-agent sub-actions: the `{method} {path}` rule would call these
+ // `createAdvance` / `createPause`, and the two memory DELETEs both reduce to
+ // `delete` (colliding into `delete2`), so each needs an explicit name.
+ 'DELETE /api/v1/memories': 'deleteAll',
+ 'DELETE /api/v1/memories/{category}/{id}': 'deleteEntry',
+ 'GET /api/v1/memories/{category}': 'listCategory',
+ 'GET /api/v1/notifications/counts': 'getCounts',
+ 'POST /api/v1/goals/{id}/advance': 'advance',
+ 'POST /api/v1/goals/{id}/pause': 'pause',
+ 'POST /api/v1/goals/{id}/restart': 'restart',
+ 'POST /api/v1/goals/{id}/resume': 'resume',
+ 'POST /api/v1/notifications/archive-all': 'archiveAll',
+ 'POST /api/v1/notifications/read': 'markRead',
+ 'POST /api/v1/notifications/read-all': 'markAllRead',
+ 'POST /api/v1/notifications/{id}/archive': 'archive',
+ 'POST /api/v1/signals/source-events': 'emit',
+ 'POST /api/v1/signals/trigger': 'trigger',
};
const pascal = (segment: string) =>
diff --git a/packages/sdk/src/generated/index.ts b/packages/sdk/src/generated/index.ts
index 574c8fc4fec..ea983ab0d0d 100644
--- a/packages/sdk/src/generated/index.ts
+++ b/packages/sdk/src/generated/index.ts
@@ -1,4 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts
-export { AgentGroups, Agents, ApiKeys, Chat, Eval, Files, Health, KnowledgeBases, LobeHub, McpServers, Messages, MessageTranslations, Models, type Options, Permissions, Plugins, Providers, Responses, Roles, Topics, Usage as Usage2, Users } from './sdk.gen';
-export type { Agent, AgentGroup, ApiError, ApiKey, ChatResponse, ClientOptions, DeleteApiV1AgentGroupsByIdData, DeleteApiV1AgentGroupsByIdError, DeleteApiV1AgentGroupsByIdErrors, DeleteApiV1AgentGroupsByIdResponse, DeleteApiV1AgentGroupsByIdResponses, DeleteApiV1AgentsByIdData, DeleteApiV1AgentsByIdError, DeleteApiV1AgentsByIdErrors, DeleteApiV1AgentsByIdResponse, DeleteApiV1AgentsByIdResponses, DeleteApiV1ApiKeysByIdData, DeleteApiV1ApiKeysByIdError, DeleteApiV1ApiKeysByIdErrors, DeleteApiV1ApiKeysByIdResponse, DeleteApiV1ApiKeysByIdResponses, DeleteApiV1EvalBenchmarksByIdData, DeleteApiV1EvalBenchmarksByIdError, DeleteApiV1EvalBenchmarksByIdErrors, DeleteApiV1EvalBenchmarksByIdResponse, DeleteApiV1EvalBenchmarksByIdResponses, DeleteApiV1EvalDatasetsByIdData, DeleteApiV1EvalDatasetsByIdError, DeleteApiV1EvalDatasetsByIdErrors, DeleteApiV1EvalDatasetsByIdResponse, DeleteApiV1EvalDatasetsByIdResponses, DeleteApiV1EvalTestCasesByIdData, DeleteApiV1EvalTestCasesByIdError, DeleteApiV1EvalTestCasesByIdErrors, DeleteApiV1EvalTestCasesByIdResponse, DeleteApiV1EvalTestCasesByIdResponses, DeleteApiV1FilesByIdData, DeleteApiV1FilesByIdError, DeleteApiV1FilesByIdErrors, DeleteApiV1FilesByIdResponse, DeleteApiV1FilesByIdResponses, DeleteApiV1KnowledgeBasesByIdData, DeleteApiV1KnowledgeBasesByIdError, DeleteApiV1KnowledgeBasesByIdErrors, DeleteApiV1KnowledgeBasesByIdFilesBatchData, DeleteApiV1KnowledgeBasesByIdFilesBatchError, DeleteApiV1KnowledgeBasesByIdFilesBatchErrors, DeleteApiV1KnowledgeBasesByIdFilesBatchResponse, DeleteApiV1KnowledgeBasesByIdFilesBatchResponses, DeleteApiV1KnowledgeBasesByIdResponse, DeleteApiV1KnowledgeBasesByIdResponses, DeleteApiV1McpServersByIdData, DeleteApiV1McpServersByIdError, DeleteApiV1McpServersByIdErrors, DeleteApiV1McpServersByIdResponse, DeleteApiV1McpServersByIdResponses, DeleteApiV1MessagesByIdData, DeleteApiV1MessagesByIdError, DeleteApiV1MessagesByIdErrors, DeleteApiV1MessagesByIdResponse, DeleteApiV1MessagesByIdResponses, DeleteApiV1MessagesData, DeleteApiV1MessagesError, DeleteApiV1MessagesErrors, DeleteApiV1MessagesResponse, DeleteApiV1MessagesResponses, DeleteApiV1MessageTranslationsByMessageIdData, DeleteApiV1MessageTranslationsByMessageIdError, DeleteApiV1MessageTranslationsByMessageIdErrors, DeleteApiV1MessageTranslationsByMessageIdResponse, DeleteApiV1MessageTranslationsByMessageIdResponses, DeleteApiV1PermissionsByIdData, DeleteApiV1PermissionsByIdError, DeleteApiV1PermissionsByIdErrors, DeleteApiV1PermissionsByIdResponse, DeleteApiV1PermissionsByIdResponses, DeleteApiV1ProvidersByIdData, DeleteApiV1ProvidersByIdError, DeleteApiV1ProvidersByIdErrors, DeleteApiV1ProvidersByIdResponse, DeleteApiV1ProvidersByIdResponses, DeleteApiV1RolesByIdData, DeleteApiV1RolesByIdError, DeleteApiV1RolesByIdErrors, DeleteApiV1RolesByIdPermissionsData, DeleteApiV1RolesByIdPermissionsError, DeleteApiV1RolesByIdPermissionsErrors, DeleteApiV1RolesByIdPermissionsResponse, DeleteApiV1RolesByIdPermissionsResponses, DeleteApiV1RolesByIdResponse, DeleteApiV1RolesByIdResponses, DeleteApiV1TopicsByIdData, DeleteApiV1TopicsByIdError, DeleteApiV1TopicsByIdErrors, DeleteApiV1TopicsByIdResponse, DeleteApiV1TopicsByIdResponses, DeleteApiV1UsersByIdData, DeleteApiV1UsersByIdError, DeleteApiV1UsersByIdErrors, DeleteApiV1UsersByIdResponse, DeleteApiV1UsersByIdResponses, DeleteApiV1UsersByIdRolesData, DeleteApiV1UsersByIdRolesError, DeleteApiV1UsersByIdRolesErrors, DeleteApiV1UsersByIdRolesResponse, DeleteApiV1UsersByIdRolesResponses, EvalRun, EvalRunResult, File, GetApiV1AgentGroupsByIdData, GetApiV1AgentGroupsByIdError, GetApiV1AgentGroupsByIdErrors, GetApiV1AgentGroupsByIdResponse, GetApiV1AgentGroupsByIdResponses, GetApiV1AgentGroupsData, GetApiV1AgentGroupsError, GetApiV1AgentGroupsErrors, GetApiV1AgentGroupsResponse, GetApiV1AgentGroupsResponses, GetApiV1AgentsByIdData, GetApiV1AgentsByIdError, GetApiV1AgentsByIdErrors, GetApiV1AgentsByIdResponse, GetApiV1AgentsByIdResponses, GetApiV1AgentsData, GetApiV1AgentsError, GetApiV1AgentsErrors, GetApiV1AgentsResponse, GetApiV1AgentsResponses, GetApiV1ApiKeysByIdData, GetApiV1ApiKeysByIdError, GetApiV1ApiKeysByIdErrors, GetApiV1ApiKeysByIdResponse, GetApiV1ApiKeysByIdResponses, GetApiV1ApiKeysData, GetApiV1ApiKeysError, GetApiV1ApiKeysErrors, GetApiV1ApiKeysResponse, GetApiV1ApiKeysResponses, GetApiV1EvalBenchmarksByIdData, GetApiV1EvalBenchmarksByIdError, GetApiV1EvalBenchmarksByIdErrors, GetApiV1EvalBenchmarksByIdResponse, GetApiV1EvalBenchmarksByIdResponses, GetApiV1EvalBenchmarksData, GetApiV1EvalBenchmarksError, GetApiV1EvalBenchmarksErrors, GetApiV1EvalBenchmarksResponse, GetApiV1EvalBenchmarksResponses, GetApiV1EvalDatasetsByDatasetIdTestCasesData, GetApiV1EvalDatasetsByDatasetIdTestCasesError, GetApiV1EvalDatasetsByDatasetIdTestCasesErrors, GetApiV1EvalDatasetsByDatasetIdTestCasesResponse, GetApiV1EvalDatasetsByDatasetIdTestCasesResponses, GetApiV1EvalDatasetsByIdData, GetApiV1EvalDatasetsByIdError, GetApiV1EvalDatasetsByIdErrors, GetApiV1EvalDatasetsByIdResponse, GetApiV1EvalDatasetsByIdResponses, GetApiV1EvalDatasetsData, GetApiV1EvalDatasetsError, GetApiV1EvalDatasetsErrors, GetApiV1EvalDatasetsResponse, GetApiV1EvalDatasetsResponses, GetApiV1EvalRunsByIdData, GetApiV1EvalRunsByIdError, GetApiV1EvalRunsByIdErrors, GetApiV1EvalRunsByIdResponse, GetApiV1EvalRunsByIdResponses, GetApiV1EvalRunsByIdResultsData, GetApiV1EvalRunsByIdResultsError, GetApiV1EvalRunsByIdResultsErrors, GetApiV1EvalRunsByIdResultsResponse, GetApiV1EvalRunsByIdResultsResponses, GetApiV1EvalRunsByIdTopicsData, GetApiV1EvalRunsByIdTopicsError, GetApiV1EvalRunsByIdTopicsErrors, GetApiV1EvalRunsByIdTopicsResponse, GetApiV1EvalRunsByIdTopicsResponses, GetApiV1EvalRunsData, GetApiV1EvalRunsError, GetApiV1EvalRunsErrors, GetApiV1EvalRunsResponse, GetApiV1EvalRunsResponses, GetApiV1EvalTestCasesByIdData, GetApiV1EvalTestCasesByIdError, GetApiV1EvalTestCasesByIdErrors, GetApiV1EvalTestCasesByIdResponse, GetApiV1EvalTestCasesByIdResponses, GetApiV1FilesByIdChunksData, GetApiV1FilesByIdChunksError, GetApiV1FilesByIdChunksErrors, GetApiV1FilesByIdChunksResponse, GetApiV1FilesByIdChunksResponses, GetApiV1FilesByIdData, GetApiV1FilesByIdError, GetApiV1FilesByIdErrors, GetApiV1FilesByIdResponse, GetApiV1FilesByIdResponses, GetApiV1FilesByIdUrlData, GetApiV1FilesByIdUrlError, GetApiV1FilesByIdUrlErrors, GetApiV1FilesByIdUrlResponse, GetApiV1FilesByIdUrlResponses, GetApiV1FilesData, GetApiV1FilesError, GetApiV1FilesErrors, GetApiV1FilesResponse, GetApiV1FilesResponses, GetApiV1HealthData, GetApiV1HealthError, GetApiV1HealthErrors, GetApiV1HealthResponse, GetApiV1HealthResponses, GetApiV1KnowledgeBasesByIdData, GetApiV1KnowledgeBasesByIdError, GetApiV1KnowledgeBasesByIdErrors, GetApiV1KnowledgeBasesByIdFilesData, GetApiV1KnowledgeBasesByIdFilesError, GetApiV1KnowledgeBasesByIdFilesErrors, GetApiV1KnowledgeBasesByIdFilesResponse, GetApiV1KnowledgeBasesByIdFilesResponses, GetApiV1KnowledgeBasesByIdResponse, GetApiV1KnowledgeBasesByIdResponses, GetApiV1KnowledgeBasesData, GetApiV1KnowledgeBasesError, GetApiV1KnowledgeBasesErrors, GetApiV1KnowledgeBasesResponse, GetApiV1KnowledgeBasesResponses, GetApiV1McpServersByIdData, GetApiV1McpServersByIdError, GetApiV1McpServersByIdErrors, GetApiV1McpServersByIdResponse, GetApiV1McpServersByIdResponses, GetApiV1McpServersData, GetApiV1McpServersError, GetApiV1McpServersErrors, GetApiV1McpServersResponse, GetApiV1McpServersResponses, GetApiV1MessagesByIdData, GetApiV1MessagesByIdError, GetApiV1MessagesByIdErrors, GetApiV1MessagesByIdResponse, GetApiV1MessagesByIdResponses, GetApiV1MessagesCountData, GetApiV1MessagesCountError, GetApiV1MessagesCountErrors, GetApiV1MessagesCountResponse, GetApiV1MessagesCountResponses, GetApiV1MessagesData, GetApiV1MessagesError, GetApiV1MessagesErrors, GetApiV1MessagesResponse, GetApiV1MessagesResponses, GetApiV1MessageTranslationsByMessageIdData, GetApiV1MessageTranslationsByMessageIdError, GetApiV1MessageTranslationsByMessageIdErrors, GetApiV1MessageTranslationsByMessageIdResponse, GetApiV1MessageTranslationsByMessageIdResponses, GetApiV1ModelsByProviderIdByModelIdData, GetApiV1ModelsByProviderIdByModelIdError, GetApiV1ModelsByProviderIdByModelIdErrors, GetApiV1ModelsByProviderIdByModelIdResponse, GetApiV1ModelsByProviderIdByModelIdResponses, GetApiV1ModelsData, GetApiV1ModelsError, GetApiV1ModelsErrors, GetApiV1ModelsResponse, GetApiV1ModelsResponses, GetApiV1PermissionsByIdData, GetApiV1PermissionsByIdError, GetApiV1PermissionsByIdErrors, GetApiV1PermissionsByIdResponse, GetApiV1PermissionsByIdResponses, GetApiV1PermissionsData, GetApiV1PermissionsError, GetApiV1PermissionsErrors, GetApiV1PermissionsResponse, GetApiV1PermissionsResponses, GetApiV1PluginsData, GetApiV1PluginsError, GetApiV1PluginsErrors, GetApiV1PluginsResponse, GetApiV1PluginsResponses, GetApiV1ProvidersByIdData, GetApiV1ProvidersByIdError, GetApiV1ProvidersByIdErrors, GetApiV1ProvidersByIdResponse, GetApiV1ProvidersByIdResponses, GetApiV1ProvidersData, GetApiV1ProvidersError, GetApiV1ProvidersErrors, GetApiV1ProvidersResponse, GetApiV1ProvidersResponses, GetApiV1RolesByIdData, GetApiV1RolesByIdError, GetApiV1RolesByIdErrors, GetApiV1RolesByIdPermissionsData, GetApiV1RolesByIdPermissionsError, GetApiV1RolesByIdPermissionsErrors, GetApiV1RolesByIdPermissionsResponse, GetApiV1RolesByIdPermissionsResponses, GetApiV1RolesByIdResponse, GetApiV1RolesByIdResponses, GetApiV1RolesData, GetApiV1RolesError, GetApiV1RolesErrors, GetApiV1RolesResponse, GetApiV1RolesResponses, GetApiV1TopicsByIdData, GetApiV1TopicsByIdError, GetApiV1TopicsByIdErrors, GetApiV1TopicsByIdResponse, GetApiV1TopicsByIdResponses, GetApiV1TopicsByTopicIdThreadsData, GetApiV1TopicsByTopicIdThreadsError, GetApiV1TopicsByTopicIdThreadsErrors, GetApiV1TopicsByTopicIdThreadsResponse, GetApiV1TopicsByTopicIdThreadsResponses, GetApiV1TopicsData, GetApiV1TopicsError, GetApiV1TopicsErrors, GetApiV1TopicsResponse, GetApiV1TopicsResponses, GetApiV1UsageData, GetApiV1UsageError, GetApiV1UsageErrors, GetApiV1UsageResponse, GetApiV1UsageResponses, GetApiV1UsersByIdData, GetApiV1UsersByIdError, GetApiV1UsersByIdErrors, GetApiV1UsersByIdResponse, GetApiV1UsersByIdResponses, GetApiV1UsersByIdRolesData, GetApiV1UsersByIdRolesError, GetApiV1UsersByIdRolesErrors, GetApiV1UsersByIdRolesResponse, GetApiV1UsersByIdRolesResponses, GetApiV1UsersData, GetApiV1UsersError, GetApiV1UsersErrors, GetApiV1UsersMeData, GetApiV1UsersMeError, GetApiV1UsersMeErrors, GetApiV1UsersMeResponse, GetApiV1UsersMeResponses, GetApiV1UsersResponse, GetApiV1UsersResponses, KnowledgeBase, McpServer, Message, Model, PatchApiV1AgentGroupsByIdData, PatchApiV1AgentGroupsByIdError, PatchApiV1AgentGroupsByIdErrors, PatchApiV1AgentGroupsByIdResponse, PatchApiV1AgentGroupsByIdResponses, PatchApiV1AgentsByIdData, PatchApiV1AgentsByIdError, PatchApiV1AgentsByIdErrors, PatchApiV1AgentsByIdResponse, PatchApiV1AgentsByIdResponses, PatchApiV1ApiKeysByIdData, PatchApiV1ApiKeysByIdError, PatchApiV1ApiKeysByIdErrors, PatchApiV1ApiKeysByIdResponse, PatchApiV1ApiKeysByIdResponses, PatchApiV1EvalBenchmarksByIdData, PatchApiV1EvalBenchmarksByIdError, PatchApiV1EvalBenchmarksByIdErrors, PatchApiV1EvalBenchmarksByIdResponse, PatchApiV1EvalBenchmarksByIdResponses, PatchApiV1EvalDatasetsByIdData, PatchApiV1EvalDatasetsByIdError, PatchApiV1EvalDatasetsByIdErrors, PatchApiV1EvalDatasetsByIdResponse, PatchApiV1EvalDatasetsByIdResponses, PatchApiV1EvalRunsByIdStatusData, PatchApiV1EvalRunsByIdStatusError, PatchApiV1EvalRunsByIdStatusErrors, PatchApiV1EvalRunsByIdStatusResponse, PatchApiV1EvalRunsByIdStatusResponses, PatchApiV1EvalTestCasesByIdData, PatchApiV1EvalTestCasesByIdError, PatchApiV1EvalTestCasesByIdErrors, PatchApiV1EvalTestCasesByIdResponse, PatchApiV1EvalTestCasesByIdResponses, PatchApiV1FilesByIdData, PatchApiV1FilesByIdError, PatchApiV1FilesByIdErrors, PatchApiV1FilesByIdResponse, PatchApiV1FilesByIdResponses, PatchApiV1KnowledgeBasesByIdData, PatchApiV1KnowledgeBasesByIdError, PatchApiV1KnowledgeBasesByIdErrors, PatchApiV1KnowledgeBasesByIdResponse, PatchApiV1KnowledgeBasesByIdResponses, PatchApiV1McpServersByIdData, PatchApiV1McpServersByIdError, PatchApiV1McpServersByIdErrors, PatchApiV1McpServersByIdResponse, PatchApiV1McpServersByIdResponses, PatchApiV1MessageTranslationsByMessageIdData, PatchApiV1MessageTranslationsByMessageIdError, PatchApiV1MessageTranslationsByMessageIdErrors, PatchApiV1MessageTranslationsByMessageIdResponse, PatchApiV1MessageTranslationsByMessageIdResponses, PatchApiV1ModelsByProviderIdByModelIdData, PatchApiV1ModelsByProviderIdByModelIdError, PatchApiV1ModelsByProviderIdByModelIdErrors, PatchApiV1ModelsByProviderIdByModelIdResponse, PatchApiV1ModelsByProviderIdByModelIdResponses, PatchApiV1PermissionsByIdData, PatchApiV1PermissionsByIdError, PatchApiV1PermissionsByIdErrors, PatchApiV1PermissionsByIdResponse, PatchApiV1PermissionsByIdResponses, PatchApiV1ProvidersByIdData, PatchApiV1ProvidersByIdError, PatchApiV1ProvidersByIdErrors, PatchApiV1ProvidersByIdResponse, PatchApiV1ProvidersByIdResponses, PatchApiV1RolesByIdData, PatchApiV1RolesByIdError, PatchApiV1RolesByIdErrors, PatchApiV1RolesByIdPermissionsData, PatchApiV1RolesByIdPermissionsError, PatchApiV1RolesByIdPermissionsErrors, PatchApiV1RolesByIdPermissionsResponse, PatchApiV1RolesByIdPermissionsResponses, PatchApiV1RolesByIdResponse, PatchApiV1RolesByIdResponses, PatchApiV1TopicsByIdData, PatchApiV1TopicsByIdError, PatchApiV1TopicsByIdErrors, PatchApiV1TopicsByIdResponse, PatchApiV1TopicsByIdResponses, PatchApiV1UsersByIdData, PatchApiV1UsersByIdError, PatchApiV1UsersByIdErrors, PatchApiV1UsersByIdResponse, PatchApiV1UsersByIdResponses, PatchApiV1UsersByIdRolesData, PatchApiV1UsersByIdRolesError, PatchApiV1UsersByIdRolesErrors, PatchApiV1UsersByIdRolesResponse, PatchApiV1UsersByIdRolesResponses, Permission, PostApiV1AgentGroupsData, PostApiV1AgentGroupsError, PostApiV1AgentGroupsErrors, PostApiV1AgentGroupsResponse, PostApiV1AgentGroupsResponses, PostApiV1AgentsByIdDuplicateData, PostApiV1AgentsByIdDuplicateError, PostApiV1AgentsByIdDuplicateErrors, PostApiV1AgentsByIdDuplicateResponse, PostApiV1AgentsByIdDuplicateResponses, PostApiV1AgentsData, PostApiV1AgentsError, PostApiV1AgentsErrors, PostApiV1AgentsResponse, PostApiV1AgentsResponses, PostApiV1ApiKeysData, PostApiV1ApiKeysError, PostApiV1ApiKeysErrors, PostApiV1ApiKeysResponse, PostApiV1ApiKeysResponses, PostApiV1ChatData, PostApiV1ChatError, PostApiV1ChatErrors, PostApiV1ChatGenerateReplyData, PostApiV1ChatGenerateReplyError, PostApiV1ChatGenerateReplyErrors, PostApiV1ChatGenerateReplyResponse, PostApiV1ChatGenerateReplyResponses, PostApiV1ChatResponse, PostApiV1ChatResponses, PostApiV1ChatTranslateData, PostApiV1ChatTranslateError, PostApiV1ChatTranslateErrors, PostApiV1ChatTranslateResponse, PostApiV1ChatTranslateResponses, PostApiV1EvalBenchmarksData, PostApiV1EvalBenchmarksError, PostApiV1EvalBenchmarksErrors, PostApiV1EvalBenchmarksResponse, PostApiV1EvalBenchmarksResponses, PostApiV1EvalDatasetsByDatasetIdTestCasesData, PostApiV1EvalDatasetsByDatasetIdTestCasesError, PostApiV1EvalDatasetsByDatasetIdTestCasesErrors, PostApiV1EvalDatasetsByDatasetIdTestCasesResponse, PostApiV1EvalDatasetsByDatasetIdTestCasesResponses, PostApiV1EvalDatasetsData, PostApiV1EvalDatasetsError, PostApiV1EvalDatasetsErrors, PostApiV1EvalDatasetsResponse, PostApiV1EvalDatasetsResponses, PostApiV1EvalRunsByIdClaimData, PostApiV1EvalRunsByIdClaimError, PostApiV1EvalRunsByIdClaimErrors, PostApiV1EvalRunsByIdClaimResponse, PostApiV1EvalRunsByIdClaimResponses, PostApiV1EvalRunsByIdResultsData, PostApiV1EvalRunsByIdResultsError, PostApiV1EvalRunsByIdResultsErrors, PostApiV1EvalRunsByIdResultsResponse, PostApiV1EvalRunsByIdResultsResponses, PostApiV1EvalRunsByIdRetryErrorsData, PostApiV1EvalRunsByIdRetryErrorsError, PostApiV1EvalRunsByIdRetryErrorsErrors, PostApiV1EvalRunsByIdRetryErrorsResponse, PostApiV1EvalRunsByIdRetryErrorsResponses, PostApiV1EvalRunsData, PostApiV1EvalRunsError, PostApiV1EvalRunsErrors, PostApiV1EvalRunsResponse, PostApiV1EvalRunsResponses, PostApiV1FilesBatchesData, PostApiV1FilesBatchesError, PostApiV1FilesBatchesErrors, PostApiV1FilesBatchesResponse, PostApiV1FilesBatchesResponses, PostApiV1FilesByIdChunksData, PostApiV1FilesByIdChunksError, PostApiV1FilesByIdChunksErrors, PostApiV1FilesByIdChunksResponse, PostApiV1FilesByIdChunksResponses, PostApiV1FilesByIdParsesData, PostApiV1FilesByIdParsesError, PostApiV1FilesByIdParsesErrors, PostApiV1FilesByIdParsesResponse, PostApiV1FilesByIdParsesResponses, PostApiV1FilesData, PostApiV1FilesError, PostApiV1FilesErrors, PostApiV1FilesQueriesData, PostApiV1FilesQueriesError, PostApiV1FilesQueriesErrors, PostApiV1FilesQueriesResponse, PostApiV1FilesQueriesResponses, PostApiV1FilesResponse, PostApiV1FilesResponses, PostApiV1KnowledgeBasesByIdFilesBatchData, PostApiV1KnowledgeBasesByIdFilesBatchError, PostApiV1KnowledgeBasesByIdFilesBatchErrors, PostApiV1KnowledgeBasesByIdFilesBatchResponse, PostApiV1KnowledgeBasesByIdFilesBatchResponses, PostApiV1KnowledgeBasesByIdFilesMoveData, PostApiV1KnowledgeBasesByIdFilesMoveError, PostApiV1KnowledgeBasesByIdFilesMoveErrors, PostApiV1KnowledgeBasesByIdFilesMoveResponse, PostApiV1KnowledgeBasesByIdFilesMoveResponses, PostApiV1KnowledgeBasesData, PostApiV1KnowledgeBasesError, PostApiV1KnowledgeBasesErrors, PostApiV1KnowledgeBasesResponse, PostApiV1KnowledgeBasesResponses, PostApiV1McpServersByIdSyncData, PostApiV1McpServersByIdSyncError, PostApiV1McpServersByIdSyncErrors, PostApiV1McpServersByIdSyncResponse, PostApiV1McpServersByIdSyncResponses, PostApiV1McpServersData, PostApiV1McpServersError, PostApiV1McpServersErrors, PostApiV1McpServersResponse, PostApiV1McpServersResponses, PostApiV1MessagesData, PostApiV1MessagesError, PostApiV1MessagesErrors, PostApiV1MessagesRepliesData, PostApiV1MessagesRepliesError, PostApiV1MessagesRepliesErrors, PostApiV1MessagesRepliesResponse, PostApiV1MessagesRepliesResponses, PostApiV1MessagesResponse, PostApiV1MessagesResponses, PostApiV1MessageTranslationsByMessageIdData, PostApiV1MessageTranslationsByMessageIdError, PostApiV1MessageTranslationsByMessageIdErrors, PostApiV1MessageTranslationsByMessageIdResponse, PostApiV1MessageTranslationsByMessageIdResponses, PostApiV1ModelsData, PostApiV1ModelsError, PostApiV1ModelsErrors, PostApiV1ModelsResponse, PostApiV1ModelsResponses, PostApiV1PermissionsData, PostApiV1PermissionsError, PostApiV1PermissionsErrors, PostApiV1PermissionsResponse, PostApiV1PermissionsResponses, PostApiV1ProvidersData, PostApiV1ProvidersError, PostApiV1ProvidersErrors, PostApiV1ProvidersResponse, PostApiV1ProvidersResponses, PostApiV1ResponsesData, PostApiV1ResponsesError, PostApiV1ResponsesErrors, PostApiV1ResponsesResponse, PostApiV1ResponsesResponses, PostApiV1RolesData, PostApiV1RolesError, PostApiV1RolesErrors, PostApiV1RolesResponse, PostApiV1RolesResponses, PostApiV1TopicsData, PostApiV1TopicsError, PostApiV1TopicsErrors, PostApiV1TopicsResponse, PostApiV1TopicsResponses, PostApiV1UsersData, PostApiV1UsersError, PostApiV1UsersErrors, PostApiV1UsersResponse, PostApiV1UsersResponses, Provider, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultData, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultError, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultErrors, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultResponse, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultResponses, Role, Topic, Usage, User } from './types.gen';
+export { AgentGroups, Agents, ApiKeys, Chat, Eval, Files, Goals, Health, KnowledgeBases, LobeHub, McpServers, Memories, Messages, MessageTranslations, Models, Notifications, type Options, Permissions, Plugins, Providers, Responses, Roles, Signals, Tasks, Topics, Usage as Usage2, Users } from './sdk.gen';
+export type { Agent, AgentGroup, ApiError, ApiKey, ChatResponse, ClientOptions, DeleteApiV1AgentGroupsByIdData, DeleteApiV1AgentGroupsByIdError, DeleteApiV1AgentGroupsByIdErrors, DeleteApiV1AgentGroupsByIdResponse, DeleteApiV1AgentGroupsByIdResponses, DeleteApiV1AgentsByIdData, DeleteApiV1AgentsByIdError, DeleteApiV1AgentsByIdErrors, DeleteApiV1AgentsByIdResponse, DeleteApiV1AgentsByIdResponses, DeleteApiV1ApiKeysByIdData, DeleteApiV1ApiKeysByIdError, DeleteApiV1ApiKeysByIdErrors, DeleteApiV1ApiKeysByIdResponse, DeleteApiV1ApiKeysByIdResponses, DeleteApiV1EvalBenchmarksByIdData, DeleteApiV1EvalBenchmarksByIdError, DeleteApiV1EvalBenchmarksByIdErrors, DeleteApiV1EvalBenchmarksByIdResponse, DeleteApiV1EvalBenchmarksByIdResponses, DeleteApiV1EvalDatasetsByIdData, DeleteApiV1EvalDatasetsByIdError, DeleteApiV1EvalDatasetsByIdErrors, DeleteApiV1EvalDatasetsByIdResponse, DeleteApiV1EvalDatasetsByIdResponses, DeleteApiV1EvalTestCasesByIdData, DeleteApiV1EvalTestCasesByIdError, DeleteApiV1EvalTestCasesByIdErrors, DeleteApiV1EvalTestCasesByIdResponse, DeleteApiV1EvalTestCasesByIdResponses, DeleteApiV1FilesByIdData, DeleteApiV1FilesByIdError, DeleteApiV1FilesByIdErrors, DeleteApiV1FilesByIdResponse, DeleteApiV1FilesByIdResponses, DeleteApiV1GoalsByIdData, DeleteApiV1GoalsByIdError, DeleteApiV1GoalsByIdErrors, DeleteApiV1GoalsByIdResponse, DeleteApiV1GoalsByIdResponses, DeleteApiV1KnowledgeBasesByIdData, DeleteApiV1KnowledgeBasesByIdError, DeleteApiV1KnowledgeBasesByIdErrors, DeleteApiV1KnowledgeBasesByIdFilesBatchData, DeleteApiV1KnowledgeBasesByIdFilesBatchError, DeleteApiV1KnowledgeBasesByIdFilesBatchErrors, DeleteApiV1KnowledgeBasesByIdFilesBatchResponse, DeleteApiV1KnowledgeBasesByIdFilesBatchResponses, DeleteApiV1KnowledgeBasesByIdResponse, DeleteApiV1KnowledgeBasesByIdResponses, DeleteApiV1McpServersByIdData, DeleteApiV1McpServersByIdError, DeleteApiV1McpServersByIdErrors, DeleteApiV1McpServersByIdResponse, DeleteApiV1McpServersByIdResponses, DeleteApiV1MemoriesByCategoryByIdData, DeleteApiV1MemoriesByCategoryByIdError, DeleteApiV1MemoriesByCategoryByIdErrors, DeleteApiV1MemoriesByCategoryByIdResponse, DeleteApiV1MemoriesByCategoryByIdResponses, DeleteApiV1MemoriesData, DeleteApiV1MemoriesError, DeleteApiV1MemoriesErrors, DeleteApiV1MemoriesResponse, DeleteApiV1MemoriesResponses, DeleteApiV1MessagesByIdData, DeleteApiV1MessagesByIdError, DeleteApiV1MessagesByIdErrors, DeleteApiV1MessagesByIdResponse, DeleteApiV1MessagesByIdResponses, DeleteApiV1MessagesData, DeleteApiV1MessagesError, DeleteApiV1MessagesErrors, DeleteApiV1MessagesResponse, DeleteApiV1MessagesResponses, DeleteApiV1MessageTranslationsByMessageIdData, DeleteApiV1MessageTranslationsByMessageIdError, DeleteApiV1MessageTranslationsByMessageIdErrors, DeleteApiV1MessageTranslationsByMessageIdResponse, DeleteApiV1MessageTranslationsByMessageIdResponses, DeleteApiV1PermissionsByIdData, DeleteApiV1PermissionsByIdError, DeleteApiV1PermissionsByIdErrors, DeleteApiV1PermissionsByIdResponse, DeleteApiV1PermissionsByIdResponses, DeleteApiV1ProvidersByIdData, DeleteApiV1ProvidersByIdError, DeleteApiV1ProvidersByIdErrors, DeleteApiV1ProvidersByIdResponse, DeleteApiV1ProvidersByIdResponses, DeleteApiV1RolesByIdData, DeleteApiV1RolesByIdError, DeleteApiV1RolesByIdErrors, DeleteApiV1RolesByIdPermissionsData, DeleteApiV1RolesByIdPermissionsError, DeleteApiV1RolesByIdPermissionsErrors, DeleteApiV1RolesByIdPermissionsResponse, DeleteApiV1RolesByIdPermissionsResponses, DeleteApiV1RolesByIdResponse, DeleteApiV1RolesByIdResponses, DeleteApiV1TasksByIdData, DeleteApiV1TasksByIdError, DeleteApiV1TasksByIdErrors, DeleteApiV1TasksByIdResponse, DeleteApiV1TasksByIdResponses, DeleteApiV1TopicsByIdData, DeleteApiV1TopicsByIdError, DeleteApiV1TopicsByIdErrors, DeleteApiV1TopicsByIdResponse, DeleteApiV1TopicsByIdResponses, DeleteApiV1UsersByIdData, DeleteApiV1UsersByIdError, DeleteApiV1UsersByIdErrors, DeleteApiV1UsersByIdResponse, DeleteApiV1UsersByIdResponses, DeleteApiV1UsersByIdRolesData, DeleteApiV1UsersByIdRolesError, DeleteApiV1UsersByIdRolesErrors, DeleteApiV1UsersByIdRolesResponse, DeleteApiV1UsersByIdRolesResponses, EvalRun, EvalRunResult, File, GetApiV1AgentGroupsByIdData, GetApiV1AgentGroupsByIdError, GetApiV1AgentGroupsByIdErrors, GetApiV1AgentGroupsByIdResponse, GetApiV1AgentGroupsByIdResponses, GetApiV1AgentGroupsData, GetApiV1AgentGroupsError, GetApiV1AgentGroupsErrors, GetApiV1AgentGroupsResponse, GetApiV1AgentGroupsResponses, GetApiV1AgentsByIdData, GetApiV1AgentsByIdError, GetApiV1AgentsByIdErrors, GetApiV1AgentsByIdResponse, GetApiV1AgentsByIdResponses, GetApiV1AgentsData, GetApiV1AgentsError, GetApiV1AgentsErrors, GetApiV1AgentsResponse, GetApiV1AgentsResponses, GetApiV1ApiKeysByIdData, GetApiV1ApiKeysByIdError, GetApiV1ApiKeysByIdErrors, GetApiV1ApiKeysByIdResponse, GetApiV1ApiKeysByIdResponses, GetApiV1ApiKeysData, GetApiV1ApiKeysError, GetApiV1ApiKeysErrors, GetApiV1ApiKeysResponse, GetApiV1ApiKeysResponses, GetApiV1EvalBenchmarksByIdData, GetApiV1EvalBenchmarksByIdError, GetApiV1EvalBenchmarksByIdErrors, GetApiV1EvalBenchmarksByIdResponse, GetApiV1EvalBenchmarksByIdResponses, GetApiV1EvalBenchmarksData, GetApiV1EvalBenchmarksError, GetApiV1EvalBenchmarksErrors, GetApiV1EvalBenchmarksResponse, GetApiV1EvalBenchmarksResponses, GetApiV1EvalDatasetsByDatasetIdTestCasesData, GetApiV1EvalDatasetsByDatasetIdTestCasesError, GetApiV1EvalDatasetsByDatasetIdTestCasesErrors, GetApiV1EvalDatasetsByDatasetIdTestCasesResponse, GetApiV1EvalDatasetsByDatasetIdTestCasesResponses, GetApiV1EvalDatasetsByIdData, GetApiV1EvalDatasetsByIdError, GetApiV1EvalDatasetsByIdErrors, GetApiV1EvalDatasetsByIdResponse, GetApiV1EvalDatasetsByIdResponses, GetApiV1EvalDatasetsData, GetApiV1EvalDatasetsError, GetApiV1EvalDatasetsErrors, GetApiV1EvalDatasetsResponse, GetApiV1EvalDatasetsResponses, GetApiV1EvalRunsByIdData, GetApiV1EvalRunsByIdError, GetApiV1EvalRunsByIdErrors, GetApiV1EvalRunsByIdResponse, GetApiV1EvalRunsByIdResponses, GetApiV1EvalRunsByIdResultsData, GetApiV1EvalRunsByIdResultsError, GetApiV1EvalRunsByIdResultsErrors, GetApiV1EvalRunsByIdResultsResponse, GetApiV1EvalRunsByIdResultsResponses, GetApiV1EvalRunsByIdTopicsData, GetApiV1EvalRunsByIdTopicsError, GetApiV1EvalRunsByIdTopicsErrors, GetApiV1EvalRunsByIdTopicsResponse, GetApiV1EvalRunsByIdTopicsResponses, GetApiV1EvalRunsData, GetApiV1EvalRunsError, GetApiV1EvalRunsErrors, GetApiV1EvalRunsResponse, GetApiV1EvalRunsResponses, GetApiV1EvalTestCasesByIdData, GetApiV1EvalTestCasesByIdError, GetApiV1EvalTestCasesByIdErrors, GetApiV1EvalTestCasesByIdResponse, GetApiV1EvalTestCasesByIdResponses, GetApiV1FilesByIdChunksData, GetApiV1FilesByIdChunksError, GetApiV1FilesByIdChunksErrors, GetApiV1FilesByIdChunksResponse, GetApiV1FilesByIdChunksResponses, GetApiV1FilesByIdData, GetApiV1FilesByIdError, GetApiV1FilesByIdErrors, GetApiV1FilesByIdResponse, GetApiV1FilesByIdResponses, GetApiV1FilesByIdUrlData, GetApiV1FilesByIdUrlError, GetApiV1FilesByIdUrlErrors, GetApiV1FilesByIdUrlResponse, GetApiV1FilesByIdUrlResponses, GetApiV1FilesData, GetApiV1FilesError, GetApiV1FilesErrors, GetApiV1FilesResponse, GetApiV1FilesResponses, GetApiV1GoalsByIdData, GetApiV1GoalsByIdError, GetApiV1GoalsByIdErrors, GetApiV1GoalsByIdResponse, GetApiV1GoalsByIdResponses, GetApiV1GoalsByIdSupervisionData, GetApiV1GoalsByIdSupervisionError, GetApiV1GoalsByIdSupervisionErrors, GetApiV1GoalsByIdSupervisionResponse, GetApiV1GoalsByIdSupervisionResponses, GetApiV1GoalsData, GetApiV1GoalsError, GetApiV1GoalsErrors, GetApiV1GoalsResponse, GetApiV1GoalsResponses, GetApiV1HealthData, GetApiV1HealthError, GetApiV1HealthErrors, GetApiV1HealthResponse, GetApiV1HealthResponses, GetApiV1KnowledgeBasesByIdData, GetApiV1KnowledgeBasesByIdError, GetApiV1KnowledgeBasesByIdErrors, GetApiV1KnowledgeBasesByIdFilesData, GetApiV1KnowledgeBasesByIdFilesError, GetApiV1KnowledgeBasesByIdFilesErrors, GetApiV1KnowledgeBasesByIdFilesResponse, GetApiV1KnowledgeBasesByIdFilesResponses, GetApiV1KnowledgeBasesByIdResponse, GetApiV1KnowledgeBasesByIdResponses, GetApiV1KnowledgeBasesData, GetApiV1KnowledgeBasesError, GetApiV1KnowledgeBasesErrors, GetApiV1KnowledgeBasesResponse, GetApiV1KnowledgeBasesResponses, GetApiV1McpServersByIdData, GetApiV1McpServersByIdError, GetApiV1McpServersByIdErrors, GetApiV1McpServersByIdResponse, GetApiV1McpServersByIdResponses, GetApiV1McpServersData, GetApiV1McpServersError, GetApiV1McpServersErrors, GetApiV1McpServersResponse, GetApiV1McpServersResponses, GetApiV1MemoriesByCategoryData, GetApiV1MemoriesByCategoryError, GetApiV1MemoriesByCategoryErrors, GetApiV1MemoriesByCategoryResponse, GetApiV1MemoriesByCategoryResponses, GetApiV1MemoriesPersonaData, GetApiV1MemoriesPersonaError, GetApiV1MemoriesPersonaErrors, GetApiV1MemoriesPersonaResponse, GetApiV1MemoriesPersonaResponses, GetApiV1MemoriesPersonaVersionsData, GetApiV1MemoriesPersonaVersionsError, GetApiV1MemoriesPersonaVersionsErrors, GetApiV1MemoriesPersonaVersionsResponse, GetApiV1MemoriesPersonaVersionsResponses, GetApiV1MessagesByIdData, GetApiV1MessagesByIdError, GetApiV1MessagesByIdErrors, GetApiV1MessagesByIdResponse, GetApiV1MessagesByIdResponses, GetApiV1MessagesCountData, GetApiV1MessagesCountError, GetApiV1MessagesCountErrors, GetApiV1MessagesCountResponse, GetApiV1MessagesCountResponses, GetApiV1MessagesData, GetApiV1MessagesError, GetApiV1MessagesErrors, GetApiV1MessagesResponse, GetApiV1MessagesResponses, GetApiV1MessageTranslationsByMessageIdData, GetApiV1MessageTranslationsByMessageIdError, GetApiV1MessageTranslationsByMessageIdErrors, GetApiV1MessageTranslationsByMessageIdResponse, GetApiV1MessageTranslationsByMessageIdResponses, GetApiV1ModelsByProviderIdByModelIdData, GetApiV1ModelsByProviderIdByModelIdError, GetApiV1ModelsByProviderIdByModelIdErrors, GetApiV1ModelsByProviderIdByModelIdResponse, GetApiV1ModelsByProviderIdByModelIdResponses, GetApiV1ModelsData, GetApiV1ModelsError, GetApiV1ModelsErrors, GetApiV1ModelsResponse, GetApiV1ModelsResponses, GetApiV1NotificationsCountsData, GetApiV1NotificationsCountsError, GetApiV1NotificationsCountsErrors, GetApiV1NotificationsCountsResponse, GetApiV1NotificationsCountsResponses, GetApiV1NotificationsData, GetApiV1NotificationsError, GetApiV1NotificationsErrors, GetApiV1NotificationsResponse, GetApiV1NotificationsResponses, GetApiV1NotificationsUnreadCountData, GetApiV1NotificationsUnreadCountError, GetApiV1NotificationsUnreadCountErrors, GetApiV1NotificationsUnreadCountResponse, GetApiV1NotificationsUnreadCountResponses, GetApiV1PermissionsByIdData, GetApiV1PermissionsByIdError, GetApiV1PermissionsByIdErrors, GetApiV1PermissionsByIdResponse, GetApiV1PermissionsByIdResponses, GetApiV1PermissionsData, GetApiV1PermissionsError, GetApiV1PermissionsErrors, GetApiV1PermissionsResponse, GetApiV1PermissionsResponses, GetApiV1PluginsData, GetApiV1PluginsError, GetApiV1PluginsErrors, GetApiV1PluginsResponse, GetApiV1PluginsResponses, GetApiV1ProvidersByIdData, GetApiV1ProvidersByIdError, GetApiV1ProvidersByIdErrors, GetApiV1ProvidersByIdResponse, GetApiV1ProvidersByIdResponses, GetApiV1ProvidersData, GetApiV1ProvidersError, GetApiV1ProvidersErrors, GetApiV1ProvidersResponse, GetApiV1ProvidersResponses, GetApiV1RolesByIdData, GetApiV1RolesByIdError, GetApiV1RolesByIdErrors, GetApiV1RolesByIdPermissionsData, GetApiV1RolesByIdPermissionsError, GetApiV1RolesByIdPermissionsErrors, GetApiV1RolesByIdPermissionsResponse, GetApiV1RolesByIdPermissionsResponses, GetApiV1RolesByIdResponse, GetApiV1RolesByIdResponses, GetApiV1RolesData, GetApiV1RolesError, GetApiV1RolesErrors, GetApiV1RolesResponse, GetApiV1RolesResponses, GetApiV1SignalsReceiptsData, GetApiV1SignalsReceiptsError, GetApiV1SignalsReceiptsErrors, GetApiV1SignalsReceiptsResponse, GetApiV1SignalsReceiptsResponses, GetApiV1TasksByIdData, GetApiV1TasksByIdError, GetApiV1TasksByIdErrors, GetApiV1TasksByIdResponse, GetApiV1TasksByIdResponses, GetApiV1TasksData, GetApiV1TasksError, GetApiV1TasksErrors, GetApiV1TasksResponse, GetApiV1TasksResponses, GetApiV1TopicsByIdData, GetApiV1TopicsByIdError, GetApiV1TopicsByIdErrors, GetApiV1TopicsByIdResponse, GetApiV1TopicsByIdResponses, GetApiV1TopicsByTopicIdThreadsData, GetApiV1TopicsByTopicIdThreadsError, GetApiV1TopicsByTopicIdThreadsErrors, GetApiV1TopicsByTopicIdThreadsResponse, GetApiV1TopicsByTopicIdThreadsResponses, GetApiV1TopicsData, GetApiV1TopicsError, GetApiV1TopicsErrors, GetApiV1TopicsResponse, GetApiV1TopicsResponses, GetApiV1UsageData, GetApiV1UsageError, GetApiV1UsageErrors, GetApiV1UsageResponse, GetApiV1UsageResponses, GetApiV1UsersByIdData, GetApiV1UsersByIdError, GetApiV1UsersByIdErrors, GetApiV1UsersByIdResponse, GetApiV1UsersByIdResponses, GetApiV1UsersByIdRolesData, GetApiV1UsersByIdRolesError, GetApiV1UsersByIdRolesErrors, GetApiV1UsersByIdRolesResponse, GetApiV1UsersByIdRolesResponses, GetApiV1UsersData, GetApiV1UsersError, GetApiV1UsersErrors, GetApiV1UsersMeData, GetApiV1UsersMeError, GetApiV1UsersMeErrors, GetApiV1UsersMeResponse, GetApiV1UsersMeResponses, GetApiV1UsersResponse, GetApiV1UsersResponses, KnowledgeBase, McpServer, Message, Model, PatchApiV1AgentGroupsByIdData, PatchApiV1AgentGroupsByIdError, PatchApiV1AgentGroupsByIdErrors, PatchApiV1AgentGroupsByIdResponse, PatchApiV1AgentGroupsByIdResponses, PatchApiV1AgentsByIdData, PatchApiV1AgentsByIdError, PatchApiV1AgentsByIdErrors, PatchApiV1AgentsByIdResponse, PatchApiV1AgentsByIdResponses, PatchApiV1ApiKeysByIdData, PatchApiV1ApiKeysByIdError, PatchApiV1ApiKeysByIdErrors, PatchApiV1ApiKeysByIdResponse, PatchApiV1ApiKeysByIdResponses, PatchApiV1EvalBenchmarksByIdData, PatchApiV1EvalBenchmarksByIdError, PatchApiV1EvalBenchmarksByIdErrors, PatchApiV1EvalBenchmarksByIdResponse, PatchApiV1EvalBenchmarksByIdResponses, PatchApiV1EvalDatasetsByIdData, PatchApiV1EvalDatasetsByIdError, PatchApiV1EvalDatasetsByIdErrors, PatchApiV1EvalDatasetsByIdResponse, PatchApiV1EvalDatasetsByIdResponses, PatchApiV1EvalRunsByIdStatusData, PatchApiV1EvalRunsByIdStatusError, PatchApiV1EvalRunsByIdStatusErrors, PatchApiV1EvalRunsByIdStatusResponse, PatchApiV1EvalRunsByIdStatusResponses, PatchApiV1EvalTestCasesByIdData, PatchApiV1EvalTestCasesByIdError, PatchApiV1EvalTestCasesByIdErrors, PatchApiV1EvalTestCasesByIdResponse, PatchApiV1EvalTestCasesByIdResponses, PatchApiV1FilesByIdData, PatchApiV1FilesByIdError, PatchApiV1FilesByIdErrors, PatchApiV1FilesByIdResponse, PatchApiV1FilesByIdResponses, PatchApiV1GoalsByIdData, PatchApiV1GoalsByIdError, PatchApiV1GoalsByIdErrors, PatchApiV1GoalsByIdResponse, PatchApiV1GoalsByIdResponses, PatchApiV1KnowledgeBasesByIdData, PatchApiV1KnowledgeBasesByIdError, PatchApiV1KnowledgeBasesByIdErrors, PatchApiV1KnowledgeBasesByIdResponse, PatchApiV1KnowledgeBasesByIdResponses, PatchApiV1McpServersByIdData, PatchApiV1McpServersByIdError, PatchApiV1McpServersByIdErrors, PatchApiV1McpServersByIdResponse, PatchApiV1McpServersByIdResponses, PatchApiV1MessageTranslationsByMessageIdData, PatchApiV1MessageTranslationsByMessageIdError, PatchApiV1MessageTranslationsByMessageIdErrors, PatchApiV1MessageTranslationsByMessageIdResponse, PatchApiV1MessageTranslationsByMessageIdResponses, PatchApiV1ModelsByProviderIdByModelIdData, PatchApiV1ModelsByProviderIdByModelIdError, PatchApiV1ModelsByProviderIdByModelIdErrors, PatchApiV1ModelsByProviderIdByModelIdResponse, PatchApiV1ModelsByProviderIdByModelIdResponses, PatchApiV1PermissionsByIdData, PatchApiV1PermissionsByIdError, PatchApiV1PermissionsByIdErrors, PatchApiV1PermissionsByIdResponse, PatchApiV1PermissionsByIdResponses, PatchApiV1ProvidersByIdData, PatchApiV1ProvidersByIdError, PatchApiV1ProvidersByIdErrors, PatchApiV1ProvidersByIdResponse, PatchApiV1ProvidersByIdResponses, PatchApiV1RolesByIdData, PatchApiV1RolesByIdError, PatchApiV1RolesByIdErrors, PatchApiV1RolesByIdPermissionsData, PatchApiV1RolesByIdPermissionsError, PatchApiV1RolesByIdPermissionsErrors, PatchApiV1RolesByIdPermissionsResponse, PatchApiV1RolesByIdPermissionsResponses, PatchApiV1RolesByIdResponse, PatchApiV1RolesByIdResponses, PatchApiV1TasksByIdData, PatchApiV1TasksByIdError, PatchApiV1TasksByIdErrors, PatchApiV1TasksByIdResponse, PatchApiV1TasksByIdResponses, PatchApiV1TasksByIdStatusData, PatchApiV1TasksByIdStatusError, PatchApiV1TasksByIdStatusErrors, PatchApiV1TasksByIdStatusResponse, PatchApiV1TasksByIdStatusResponses, PatchApiV1TopicsByIdData, PatchApiV1TopicsByIdError, PatchApiV1TopicsByIdErrors, PatchApiV1TopicsByIdResponse, PatchApiV1TopicsByIdResponses, PatchApiV1UsersByIdData, PatchApiV1UsersByIdError, PatchApiV1UsersByIdErrors, PatchApiV1UsersByIdResponse, PatchApiV1UsersByIdResponses, PatchApiV1UsersByIdRolesData, PatchApiV1UsersByIdRolesError, PatchApiV1UsersByIdRolesErrors, PatchApiV1UsersByIdRolesResponse, PatchApiV1UsersByIdRolesResponses, Permission, PostApiV1AgentGroupsData, PostApiV1AgentGroupsError, PostApiV1AgentGroupsErrors, PostApiV1AgentGroupsResponse, PostApiV1AgentGroupsResponses, PostApiV1AgentsByIdDuplicateData, PostApiV1AgentsByIdDuplicateError, PostApiV1AgentsByIdDuplicateErrors, PostApiV1AgentsByIdDuplicateResponse, PostApiV1AgentsByIdDuplicateResponses, PostApiV1AgentsData, PostApiV1AgentsError, PostApiV1AgentsErrors, PostApiV1AgentsResponse, PostApiV1AgentsResponses, PostApiV1ApiKeysData, PostApiV1ApiKeysError, PostApiV1ApiKeysErrors, PostApiV1ApiKeysResponse, PostApiV1ApiKeysResponses, PostApiV1ChatData, PostApiV1ChatError, PostApiV1ChatErrors, PostApiV1ChatGenerateReplyData, PostApiV1ChatGenerateReplyError, PostApiV1ChatGenerateReplyErrors, PostApiV1ChatGenerateReplyResponse, PostApiV1ChatGenerateReplyResponses, PostApiV1ChatResponse, PostApiV1ChatResponses, PostApiV1ChatTranslateData, PostApiV1ChatTranslateError, PostApiV1ChatTranslateErrors, PostApiV1ChatTranslateResponse, PostApiV1ChatTranslateResponses, PostApiV1EvalBenchmarksData, PostApiV1EvalBenchmarksError, PostApiV1EvalBenchmarksErrors, PostApiV1EvalBenchmarksResponse, PostApiV1EvalBenchmarksResponses, PostApiV1EvalDatasetsByDatasetIdTestCasesData, PostApiV1EvalDatasetsByDatasetIdTestCasesError, PostApiV1EvalDatasetsByDatasetIdTestCasesErrors, PostApiV1EvalDatasetsByDatasetIdTestCasesResponse, PostApiV1EvalDatasetsByDatasetIdTestCasesResponses, PostApiV1EvalDatasetsData, PostApiV1EvalDatasetsError, PostApiV1EvalDatasetsErrors, PostApiV1EvalDatasetsResponse, PostApiV1EvalDatasetsResponses, PostApiV1EvalRunsByIdClaimData, PostApiV1EvalRunsByIdClaimError, PostApiV1EvalRunsByIdClaimErrors, PostApiV1EvalRunsByIdClaimResponse, PostApiV1EvalRunsByIdClaimResponses, PostApiV1EvalRunsByIdResultsData, PostApiV1EvalRunsByIdResultsError, PostApiV1EvalRunsByIdResultsErrors, PostApiV1EvalRunsByIdResultsResponse, PostApiV1EvalRunsByIdResultsResponses, PostApiV1EvalRunsByIdRetryErrorsData, PostApiV1EvalRunsByIdRetryErrorsError, PostApiV1EvalRunsByIdRetryErrorsErrors, PostApiV1EvalRunsByIdRetryErrorsResponse, PostApiV1EvalRunsByIdRetryErrorsResponses, PostApiV1EvalRunsData, PostApiV1EvalRunsError, PostApiV1EvalRunsErrors, PostApiV1EvalRunsResponse, PostApiV1EvalRunsResponses, PostApiV1FilesBatchesData, PostApiV1FilesBatchesError, PostApiV1FilesBatchesErrors, PostApiV1FilesBatchesResponse, PostApiV1FilesBatchesResponses, PostApiV1FilesByIdChunksData, PostApiV1FilesByIdChunksError, PostApiV1FilesByIdChunksErrors, PostApiV1FilesByIdChunksResponse, PostApiV1FilesByIdChunksResponses, PostApiV1FilesByIdParsesData, PostApiV1FilesByIdParsesError, PostApiV1FilesByIdParsesErrors, PostApiV1FilesByIdParsesResponse, PostApiV1FilesByIdParsesResponses, PostApiV1FilesData, PostApiV1FilesError, PostApiV1FilesErrors, PostApiV1FilesQueriesData, PostApiV1FilesQueriesError, PostApiV1FilesQueriesErrors, PostApiV1FilesQueriesResponse, PostApiV1FilesQueriesResponses, PostApiV1FilesResponse, PostApiV1FilesResponses, PostApiV1GoalsByIdAdvanceData, PostApiV1GoalsByIdAdvanceError, PostApiV1GoalsByIdAdvanceErrors, PostApiV1GoalsByIdAdvanceResponse, PostApiV1GoalsByIdAdvanceResponses, PostApiV1GoalsByIdPauseData, PostApiV1GoalsByIdPauseError, PostApiV1GoalsByIdPauseErrors, PostApiV1GoalsByIdPauseResponse, PostApiV1GoalsByIdPauseResponses, PostApiV1GoalsByIdRestartData, PostApiV1GoalsByIdRestartError, PostApiV1GoalsByIdRestartErrors, PostApiV1GoalsByIdRestartResponse, PostApiV1GoalsByIdRestartResponses, PostApiV1GoalsByIdResumeData, PostApiV1GoalsByIdResumeError, PostApiV1GoalsByIdResumeErrors, PostApiV1GoalsByIdResumeResponse, PostApiV1GoalsByIdResumeResponses, PostApiV1GoalsData, PostApiV1GoalsError, PostApiV1GoalsErrors, PostApiV1GoalsResponse, PostApiV1GoalsResponses, PostApiV1KnowledgeBasesByIdFilesBatchData, PostApiV1KnowledgeBasesByIdFilesBatchError, PostApiV1KnowledgeBasesByIdFilesBatchErrors, PostApiV1KnowledgeBasesByIdFilesBatchResponse, PostApiV1KnowledgeBasesByIdFilesBatchResponses, PostApiV1KnowledgeBasesByIdFilesMoveData, PostApiV1KnowledgeBasesByIdFilesMoveError, PostApiV1KnowledgeBasesByIdFilesMoveErrors, PostApiV1KnowledgeBasesByIdFilesMoveResponse, PostApiV1KnowledgeBasesByIdFilesMoveResponses, PostApiV1KnowledgeBasesData, PostApiV1KnowledgeBasesError, PostApiV1KnowledgeBasesErrors, PostApiV1KnowledgeBasesResponse, PostApiV1KnowledgeBasesResponses, PostApiV1McpServersByIdSyncData, PostApiV1McpServersByIdSyncError, PostApiV1McpServersByIdSyncErrors, PostApiV1McpServersByIdSyncResponse, PostApiV1McpServersByIdSyncResponses, PostApiV1McpServersData, PostApiV1McpServersError, PostApiV1McpServersErrors, PostApiV1McpServersResponse, PostApiV1McpServersResponses, PostApiV1MessagesData, PostApiV1MessagesError, PostApiV1MessagesErrors, PostApiV1MessagesRepliesData, PostApiV1MessagesRepliesError, PostApiV1MessagesRepliesErrors, PostApiV1MessagesRepliesResponse, PostApiV1MessagesRepliesResponses, PostApiV1MessagesResponse, PostApiV1MessagesResponses, PostApiV1MessageTranslationsByMessageIdData, PostApiV1MessageTranslationsByMessageIdError, PostApiV1MessageTranslationsByMessageIdErrors, PostApiV1MessageTranslationsByMessageIdResponse, PostApiV1MessageTranslationsByMessageIdResponses, PostApiV1ModelsData, PostApiV1ModelsError, PostApiV1ModelsErrors, PostApiV1ModelsResponse, PostApiV1ModelsResponses, PostApiV1NotificationsArchiveAllData, PostApiV1NotificationsArchiveAllError, PostApiV1NotificationsArchiveAllErrors, PostApiV1NotificationsArchiveAllResponse, PostApiV1NotificationsArchiveAllResponses, PostApiV1NotificationsByIdArchiveData, PostApiV1NotificationsByIdArchiveError, PostApiV1NotificationsByIdArchiveErrors, PostApiV1NotificationsByIdArchiveResponse, PostApiV1NotificationsByIdArchiveResponses, PostApiV1NotificationsReadAllData, PostApiV1NotificationsReadAllError, PostApiV1NotificationsReadAllErrors, PostApiV1NotificationsReadAllResponse, PostApiV1NotificationsReadAllResponses, PostApiV1NotificationsReadData, PostApiV1NotificationsReadError, PostApiV1NotificationsReadErrors, PostApiV1NotificationsReadResponse, PostApiV1NotificationsReadResponses, PostApiV1PermissionsData, PostApiV1PermissionsError, PostApiV1PermissionsErrors, PostApiV1PermissionsResponse, PostApiV1PermissionsResponses, PostApiV1ProvidersData, PostApiV1ProvidersError, PostApiV1ProvidersErrors, PostApiV1ProvidersResponse, PostApiV1ProvidersResponses, PostApiV1ResponsesData, PostApiV1ResponsesError, PostApiV1ResponsesErrors, PostApiV1ResponsesResponse, PostApiV1ResponsesResponses, PostApiV1RolesData, PostApiV1RolesError, PostApiV1RolesErrors, PostApiV1RolesResponse, PostApiV1RolesResponses, PostApiV1SignalsSourceEventsData, PostApiV1SignalsSourceEventsError, PostApiV1SignalsSourceEventsErrors, PostApiV1SignalsSourceEventsResponse, PostApiV1SignalsSourceEventsResponses, PostApiV1SignalsTriggerData, PostApiV1SignalsTriggerError, PostApiV1SignalsTriggerErrors, PostApiV1SignalsTriggerResponse, PostApiV1SignalsTriggerResponses, PostApiV1TasksData, PostApiV1TasksError, PostApiV1TasksErrors, PostApiV1TasksResponse, PostApiV1TasksResponses, PostApiV1TopicsData, PostApiV1TopicsError, PostApiV1TopicsErrors, PostApiV1TopicsResponse, PostApiV1TopicsResponses, PostApiV1UsersData, PostApiV1UsersError, PostApiV1UsersErrors, PostApiV1UsersResponse, PostApiV1UsersResponses, Provider, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultData, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultError, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultErrors, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultResponse, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultResponses, Role, Topic, Usage, User } from './types.gen';
diff --git a/packages/sdk/src/generated/sdk.gen.ts b/packages/sdk/src/generated/sdk.gen.ts
index 46c33107610..dfba84e0aec 100644
--- a/packages/sdk/src/generated/sdk.gen.ts
+++ b/packages/sdk/src/generated/sdk.gen.ts
@@ -2,7 +2,7 @@
import { type Client, type ClientMeta, formDataBodySerializer, type Options as Options2, type RequestResult, type TDataShape } from './client';
import { client } from './client.gen';
-import type { DeleteApiV1AgentGroupsByIdData, DeleteApiV1AgentGroupsByIdErrors, DeleteApiV1AgentGroupsByIdResponses, DeleteApiV1AgentsByIdData, DeleteApiV1AgentsByIdErrors, DeleteApiV1AgentsByIdResponses, DeleteApiV1ApiKeysByIdData, DeleteApiV1ApiKeysByIdErrors, DeleteApiV1ApiKeysByIdResponses, DeleteApiV1EvalBenchmarksByIdData, DeleteApiV1EvalBenchmarksByIdErrors, DeleteApiV1EvalBenchmarksByIdResponses, DeleteApiV1EvalDatasetsByIdData, DeleteApiV1EvalDatasetsByIdErrors, DeleteApiV1EvalDatasetsByIdResponses, DeleteApiV1EvalTestCasesByIdData, DeleteApiV1EvalTestCasesByIdErrors, DeleteApiV1EvalTestCasesByIdResponses, DeleteApiV1FilesByIdData, DeleteApiV1FilesByIdErrors, DeleteApiV1FilesByIdResponses, DeleteApiV1KnowledgeBasesByIdData, DeleteApiV1KnowledgeBasesByIdErrors, DeleteApiV1KnowledgeBasesByIdFilesBatchData, DeleteApiV1KnowledgeBasesByIdFilesBatchErrors, DeleteApiV1KnowledgeBasesByIdFilesBatchResponses, DeleteApiV1KnowledgeBasesByIdResponses, DeleteApiV1McpServersByIdData, DeleteApiV1McpServersByIdErrors, DeleteApiV1McpServersByIdResponses, DeleteApiV1MessagesByIdData, DeleteApiV1MessagesByIdErrors, DeleteApiV1MessagesByIdResponses, DeleteApiV1MessagesData, DeleteApiV1MessagesErrors, DeleteApiV1MessagesResponses, DeleteApiV1MessageTranslationsByMessageIdData, DeleteApiV1MessageTranslationsByMessageIdErrors, DeleteApiV1MessageTranslationsByMessageIdResponses, DeleteApiV1PermissionsByIdData, DeleteApiV1PermissionsByIdErrors, DeleteApiV1PermissionsByIdResponses, DeleteApiV1ProvidersByIdData, DeleteApiV1ProvidersByIdErrors, DeleteApiV1ProvidersByIdResponses, DeleteApiV1RolesByIdData, DeleteApiV1RolesByIdErrors, DeleteApiV1RolesByIdPermissionsData, DeleteApiV1RolesByIdPermissionsErrors, DeleteApiV1RolesByIdPermissionsResponses, DeleteApiV1RolesByIdResponses, DeleteApiV1TopicsByIdData, DeleteApiV1TopicsByIdErrors, DeleteApiV1TopicsByIdResponses, DeleteApiV1UsersByIdData, DeleteApiV1UsersByIdErrors, DeleteApiV1UsersByIdResponses, DeleteApiV1UsersByIdRolesData, DeleteApiV1UsersByIdRolesErrors, DeleteApiV1UsersByIdRolesResponses, GetApiV1AgentGroupsByIdData, GetApiV1AgentGroupsByIdErrors, GetApiV1AgentGroupsByIdResponses, GetApiV1AgentGroupsData, GetApiV1AgentGroupsErrors, GetApiV1AgentGroupsResponses, GetApiV1AgentsByIdData, GetApiV1AgentsByIdErrors, GetApiV1AgentsByIdResponses, GetApiV1AgentsData, GetApiV1AgentsErrors, GetApiV1AgentsResponses, GetApiV1ApiKeysByIdData, GetApiV1ApiKeysByIdErrors, GetApiV1ApiKeysByIdResponses, GetApiV1ApiKeysData, GetApiV1ApiKeysErrors, GetApiV1ApiKeysResponses, GetApiV1EvalBenchmarksByIdData, GetApiV1EvalBenchmarksByIdErrors, GetApiV1EvalBenchmarksByIdResponses, GetApiV1EvalBenchmarksData, GetApiV1EvalBenchmarksErrors, GetApiV1EvalBenchmarksResponses, GetApiV1EvalDatasetsByDatasetIdTestCasesData, GetApiV1EvalDatasetsByDatasetIdTestCasesErrors, GetApiV1EvalDatasetsByDatasetIdTestCasesResponses, GetApiV1EvalDatasetsByIdData, GetApiV1EvalDatasetsByIdErrors, GetApiV1EvalDatasetsByIdResponses, GetApiV1EvalDatasetsData, GetApiV1EvalDatasetsErrors, GetApiV1EvalDatasetsResponses, GetApiV1EvalRunsByIdData, GetApiV1EvalRunsByIdErrors, GetApiV1EvalRunsByIdResponses, GetApiV1EvalRunsByIdResultsData, GetApiV1EvalRunsByIdResultsErrors, GetApiV1EvalRunsByIdResultsResponses, GetApiV1EvalRunsByIdTopicsData, GetApiV1EvalRunsByIdTopicsErrors, GetApiV1EvalRunsByIdTopicsResponses, GetApiV1EvalRunsData, GetApiV1EvalRunsErrors, GetApiV1EvalRunsResponses, GetApiV1EvalTestCasesByIdData, GetApiV1EvalTestCasesByIdErrors, GetApiV1EvalTestCasesByIdResponses, GetApiV1FilesByIdChunksData, GetApiV1FilesByIdChunksErrors, GetApiV1FilesByIdChunksResponses, GetApiV1FilesByIdData, GetApiV1FilesByIdErrors, GetApiV1FilesByIdResponses, GetApiV1FilesByIdUrlData, GetApiV1FilesByIdUrlErrors, GetApiV1FilesByIdUrlResponses, GetApiV1FilesData, GetApiV1FilesErrors, GetApiV1FilesResponses, GetApiV1HealthData, GetApiV1HealthErrors, GetApiV1HealthResponses, GetApiV1KnowledgeBasesByIdData, GetApiV1KnowledgeBasesByIdErrors, GetApiV1KnowledgeBasesByIdFilesData, GetApiV1KnowledgeBasesByIdFilesErrors, GetApiV1KnowledgeBasesByIdFilesResponses, GetApiV1KnowledgeBasesByIdResponses, GetApiV1KnowledgeBasesData, GetApiV1KnowledgeBasesErrors, GetApiV1KnowledgeBasesResponses, GetApiV1McpServersByIdData, GetApiV1McpServersByIdErrors, GetApiV1McpServersByIdResponses, GetApiV1McpServersData, GetApiV1McpServersErrors, GetApiV1McpServersResponses, GetApiV1MessagesByIdData, GetApiV1MessagesByIdErrors, GetApiV1MessagesByIdResponses, GetApiV1MessagesCountData, GetApiV1MessagesCountErrors, GetApiV1MessagesCountResponses, GetApiV1MessagesData, GetApiV1MessagesErrors, GetApiV1MessagesResponses, GetApiV1MessageTranslationsByMessageIdData, GetApiV1MessageTranslationsByMessageIdErrors, GetApiV1MessageTranslationsByMessageIdResponses, GetApiV1ModelsByProviderIdByModelIdData, GetApiV1ModelsByProviderIdByModelIdErrors, GetApiV1ModelsByProviderIdByModelIdResponses, GetApiV1ModelsData, GetApiV1ModelsErrors, GetApiV1ModelsResponses, GetApiV1PermissionsByIdData, GetApiV1PermissionsByIdErrors, GetApiV1PermissionsByIdResponses, GetApiV1PermissionsData, GetApiV1PermissionsErrors, GetApiV1PermissionsResponses, GetApiV1PluginsData, GetApiV1PluginsErrors, GetApiV1PluginsResponses, GetApiV1ProvidersByIdData, GetApiV1ProvidersByIdErrors, GetApiV1ProvidersByIdResponses, GetApiV1ProvidersData, GetApiV1ProvidersErrors, GetApiV1ProvidersResponses, GetApiV1RolesByIdData, GetApiV1RolesByIdErrors, GetApiV1RolesByIdPermissionsData, GetApiV1RolesByIdPermissionsErrors, GetApiV1RolesByIdPermissionsResponses, GetApiV1RolesByIdResponses, GetApiV1RolesData, GetApiV1RolesErrors, GetApiV1RolesResponses, GetApiV1TopicsByIdData, GetApiV1TopicsByIdErrors, GetApiV1TopicsByIdResponses, GetApiV1TopicsByTopicIdThreadsData, GetApiV1TopicsByTopicIdThreadsErrors, GetApiV1TopicsByTopicIdThreadsResponses, GetApiV1TopicsData, GetApiV1TopicsErrors, GetApiV1TopicsResponses, GetApiV1UsageData, GetApiV1UsageErrors, GetApiV1UsageResponses, GetApiV1UsersByIdData, GetApiV1UsersByIdErrors, GetApiV1UsersByIdResponses, GetApiV1UsersByIdRolesData, GetApiV1UsersByIdRolesErrors, GetApiV1UsersByIdRolesResponses, GetApiV1UsersData, GetApiV1UsersErrors, GetApiV1UsersMeData, GetApiV1UsersMeErrors, GetApiV1UsersMeResponses, GetApiV1UsersResponses, PatchApiV1AgentGroupsByIdData, PatchApiV1AgentGroupsByIdErrors, PatchApiV1AgentGroupsByIdResponses, PatchApiV1AgentsByIdData, PatchApiV1AgentsByIdErrors, PatchApiV1AgentsByIdResponses, PatchApiV1ApiKeysByIdData, PatchApiV1ApiKeysByIdErrors, PatchApiV1ApiKeysByIdResponses, PatchApiV1EvalBenchmarksByIdData, PatchApiV1EvalBenchmarksByIdErrors, PatchApiV1EvalBenchmarksByIdResponses, PatchApiV1EvalDatasetsByIdData, PatchApiV1EvalDatasetsByIdErrors, PatchApiV1EvalDatasetsByIdResponses, PatchApiV1EvalRunsByIdStatusData, PatchApiV1EvalRunsByIdStatusErrors, PatchApiV1EvalRunsByIdStatusResponses, PatchApiV1EvalTestCasesByIdData, PatchApiV1EvalTestCasesByIdErrors, PatchApiV1EvalTestCasesByIdResponses, PatchApiV1FilesByIdData, PatchApiV1FilesByIdErrors, PatchApiV1FilesByIdResponses, PatchApiV1KnowledgeBasesByIdData, PatchApiV1KnowledgeBasesByIdErrors, PatchApiV1KnowledgeBasesByIdResponses, PatchApiV1McpServersByIdData, PatchApiV1McpServersByIdErrors, PatchApiV1McpServersByIdResponses, PatchApiV1MessageTranslationsByMessageIdData, PatchApiV1MessageTranslationsByMessageIdErrors, PatchApiV1MessageTranslationsByMessageIdResponses, PatchApiV1ModelsByProviderIdByModelIdData, PatchApiV1ModelsByProviderIdByModelIdErrors, PatchApiV1ModelsByProviderIdByModelIdResponses, PatchApiV1PermissionsByIdData, PatchApiV1PermissionsByIdErrors, PatchApiV1PermissionsByIdResponses, PatchApiV1ProvidersByIdData, PatchApiV1ProvidersByIdErrors, PatchApiV1ProvidersByIdResponses, PatchApiV1RolesByIdData, PatchApiV1RolesByIdErrors, PatchApiV1RolesByIdPermissionsData, PatchApiV1RolesByIdPermissionsErrors, PatchApiV1RolesByIdPermissionsResponses, PatchApiV1RolesByIdResponses, PatchApiV1TopicsByIdData, PatchApiV1TopicsByIdErrors, PatchApiV1TopicsByIdResponses, PatchApiV1UsersByIdData, PatchApiV1UsersByIdErrors, PatchApiV1UsersByIdResponses, PatchApiV1UsersByIdRolesData, PatchApiV1UsersByIdRolesErrors, PatchApiV1UsersByIdRolesResponses, PostApiV1AgentGroupsData, PostApiV1AgentGroupsErrors, PostApiV1AgentGroupsResponses, PostApiV1AgentsByIdDuplicateData, PostApiV1AgentsByIdDuplicateErrors, PostApiV1AgentsByIdDuplicateResponses, PostApiV1AgentsData, PostApiV1AgentsErrors, PostApiV1AgentsResponses, PostApiV1ApiKeysData, PostApiV1ApiKeysErrors, PostApiV1ApiKeysResponses, PostApiV1ChatData, PostApiV1ChatErrors, PostApiV1ChatGenerateReplyData, PostApiV1ChatGenerateReplyErrors, PostApiV1ChatGenerateReplyResponses, PostApiV1ChatResponses, PostApiV1ChatTranslateData, PostApiV1ChatTranslateErrors, PostApiV1ChatTranslateResponses, PostApiV1EvalBenchmarksData, PostApiV1EvalBenchmarksErrors, PostApiV1EvalBenchmarksResponses, PostApiV1EvalDatasetsByDatasetIdTestCasesData, PostApiV1EvalDatasetsByDatasetIdTestCasesErrors, PostApiV1EvalDatasetsByDatasetIdTestCasesResponses, PostApiV1EvalDatasetsData, PostApiV1EvalDatasetsErrors, PostApiV1EvalDatasetsResponses, PostApiV1EvalRunsByIdClaimData, PostApiV1EvalRunsByIdClaimErrors, PostApiV1EvalRunsByIdClaimResponses, PostApiV1EvalRunsByIdResultsData, PostApiV1EvalRunsByIdResultsErrors, PostApiV1EvalRunsByIdResultsResponses, PostApiV1EvalRunsByIdRetryErrorsData, PostApiV1EvalRunsByIdRetryErrorsErrors, PostApiV1EvalRunsByIdRetryErrorsResponses, PostApiV1EvalRunsData, PostApiV1EvalRunsErrors, PostApiV1EvalRunsResponses, PostApiV1FilesBatchesData, PostApiV1FilesBatchesErrors, PostApiV1FilesBatchesResponses, PostApiV1FilesByIdChunksData, PostApiV1FilesByIdChunksErrors, PostApiV1FilesByIdChunksResponses, PostApiV1FilesByIdParsesData, PostApiV1FilesByIdParsesErrors, PostApiV1FilesByIdParsesResponses, PostApiV1FilesData, PostApiV1FilesErrors, PostApiV1FilesQueriesData, PostApiV1FilesQueriesErrors, PostApiV1FilesQueriesResponses, PostApiV1FilesResponses, PostApiV1KnowledgeBasesByIdFilesBatchData, PostApiV1KnowledgeBasesByIdFilesBatchErrors, PostApiV1KnowledgeBasesByIdFilesBatchResponses, PostApiV1KnowledgeBasesByIdFilesMoveData, PostApiV1KnowledgeBasesByIdFilesMoveErrors, PostApiV1KnowledgeBasesByIdFilesMoveResponses, PostApiV1KnowledgeBasesData, PostApiV1KnowledgeBasesErrors, PostApiV1KnowledgeBasesResponses, PostApiV1McpServersByIdSyncData, PostApiV1McpServersByIdSyncErrors, PostApiV1McpServersByIdSyncResponses, PostApiV1McpServersData, PostApiV1McpServersErrors, PostApiV1McpServersResponses, PostApiV1MessagesData, PostApiV1MessagesErrors, PostApiV1MessagesRepliesData, PostApiV1MessagesRepliesErrors, PostApiV1MessagesRepliesResponses, PostApiV1MessagesResponses, PostApiV1MessageTranslationsByMessageIdData, PostApiV1MessageTranslationsByMessageIdErrors, PostApiV1MessageTranslationsByMessageIdResponses, PostApiV1ModelsData, PostApiV1ModelsErrors, PostApiV1ModelsResponses, PostApiV1PermissionsData, PostApiV1PermissionsErrors, PostApiV1PermissionsResponses, PostApiV1ProvidersData, PostApiV1ProvidersErrors, PostApiV1ProvidersResponses, PostApiV1ResponsesData, PostApiV1ResponsesErrors, PostApiV1ResponsesResponses, PostApiV1RolesData, PostApiV1RolesErrors, PostApiV1RolesResponses, PostApiV1TopicsData, PostApiV1TopicsErrors, PostApiV1TopicsResponses, PostApiV1UsersData, PostApiV1UsersErrors, PostApiV1UsersResponses, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultData, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultErrors, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultResponses } from './types.gen';
+import type { DeleteApiV1AgentGroupsByIdData, DeleteApiV1AgentGroupsByIdErrors, DeleteApiV1AgentGroupsByIdResponses, DeleteApiV1AgentsByIdData, DeleteApiV1AgentsByIdErrors, DeleteApiV1AgentsByIdResponses, DeleteApiV1ApiKeysByIdData, DeleteApiV1ApiKeysByIdErrors, DeleteApiV1ApiKeysByIdResponses, DeleteApiV1EvalBenchmarksByIdData, DeleteApiV1EvalBenchmarksByIdErrors, DeleteApiV1EvalBenchmarksByIdResponses, DeleteApiV1EvalDatasetsByIdData, DeleteApiV1EvalDatasetsByIdErrors, DeleteApiV1EvalDatasetsByIdResponses, DeleteApiV1EvalTestCasesByIdData, DeleteApiV1EvalTestCasesByIdErrors, DeleteApiV1EvalTestCasesByIdResponses, DeleteApiV1FilesByIdData, DeleteApiV1FilesByIdErrors, DeleteApiV1FilesByIdResponses, DeleteApiV1GoalsByIdData, DeleteApiV1GoalsByIdErrors, DeleteApiV1GoalsByIdResponses, DeleteApiV1KnowledgeBasesByIdData, DeleteApiV1KnowledgeBasesByIdErrors, DeleteApiV1KnowledgeBasesByIdFilesBatchData, DeleteApiV1KnowledgeBasesByIdFilesBatchErrors, DeleteApiV1KnowledgeBasesByIdFilesBatchResponses, DeleteApiV1KnowledgeBasesByIdResponses, DeleteApiV1McpServersByIdData, DeleteApiV1McpServersByIdErrors, DeleteApiV1McpServersByIdResponses, DeleteApiV1MemoriesByCategoryByIdData, DeleteApiV1MemoriesByCategoryByIdErrors, DeleteApiV1MemoriesByCategoryByIdResponses, DeleteApiV1MemoriesData, DeleteApiV1MemoriesErrors, DeleteApiV1MemoriesResponses, DeleteApiV1MessagesByIdData, DeleteApiV1MessagesByIdErrors, DeleteApiV1MessagesByIdResponses, DeleteApiV1MessagesData, DeleteApiV1MessagesErrors, DeleteApiV1MessagesResponses, DeleteApiV1MessageTranslationsByMessageIdData, DeleteApiV1MessageTranslationsByMessageIdErrors, DeleteApiV1MessageTranslationsByMessageIdResponses, DeleteApiV1PermissionsByIdData, DeleteApiV1PermissionsByIdErrors, DeleteApiV1PermissionsByIdResponses, DeleteApiV1ProvidersByIdData, DeleteApiV1ProvidersByIdErrors, DeleteApiV1ProvidersByIdResponses, DeleteApiV1RolesByIdData, DeleteApiV1RolesByIdErrors, DeleteApiV1RolesByIdPermissionsData, DeleteApiV1RolesByIdPermissionsErrors, DeleteApiV1RolesByIdPermissionsResponses, DeleteApiV1RolesByIdResponses, DeleteApiV1TasksByIdData, DeleteApiV1TasksByIdErrors, DeleteApiV1TasksByIdResponses, DeleteApiV1TopicsByIdData, DeleteApiV1TopicsByIdErrors, DeleteApiV1TopicsByIdResponses, DeleteApiV1UsersByIdData, DeleteApiV1UsersByIdErrors, DeleteApiV1UsersByIdResponses, DeleteApiV1UsersByIdRolesData, DeleteApiV1UsersByIdRolesErrors, DeleteApiV1UsersByIdRolesResponses, GetApiV1AgentGroupsByIdData, GetApiV1AgentGroupsByIdErrors, GetApiV1AgentGroupsByIdResponses, GetApiV1AgentGroupsData, GetApiV1AgentGroupsErrors, GetApiV1AgentGroupsResponses, GetApiV1AgentsByIdData, GetApiV1AgentsByIdErrors, GetApiV1AgentsByIdResponses, GetApiV1AgentsData, GetApiV1AgentsErrors, GetApiV1AgentsResponses, GetApiV1ApiKeysByIdData, GetApiV1ApiKeysByIdErrors, GetApiV1ApiKeysByIdResponses, GetApiV1ApiKeysData, GetApiV1ApiKeysErrors, GetApiV1ApiKeysResponses, GetApiV1EvalBenchmarksByIdData, GetApiV1EvalBenchmarksByIdErrors, GetApiV1EvalBenchmarksByIdResponses, GetApiV1EvalBenchmarksData, GetApiV1EvalBenchmarksErrors, GetApiV1EvalBenchmarksResponses, GetApiV1EvalDatasetsByDatasetIdTestCasesData, GetApiV1EvalDatasetsByDatasetIdTestCasesErrors, GetApiV1EvalDatasetsByDatasetIdTestCasesResponses, GetApiV1EvalDatasetsByIdData, GetApiV1EvalDatasetsByIdErrors, GetApiV1EvalDatasetsByIdResponses, GetApiV1EvalDatasetsData, GetApiV1EvalDatasetsErrors, GetApiV1EvalDatasetsResponses, GetApiV1EvalRunsByIdData, GetApiV1EvalRunsByIdErrors, GetApiV1EvalRunsByIdResponses, GetApiV1EvalRunsByIdResultsData, GetApiV1EvalRunsByIdResultsErrors, GetApiV1EvalRunsByIdResultsResponses, GetApiV1EvalRunsByIdTopicsData, GetApiV1EvalRunsByIdTopicsErrors, GetApiV1EvalRunsByIdTopicsResponses, GetApiV1EvalRunsData, GetApiV1EvalRunsErrors, GetApiV1EvalRunsResponses, GetApiV1EvalTestCasesByIdData, GetApiV1EvalTestCasesByIdErrors, GetApiV1EvalTestCasesByIdResponses, GetApiV1FilesByIdChunksData, GetApiV1FilesByIdChunksErrors, GetApiV1FilesByIdChunksResponses, GetApiV1FilesByIdData, GetApiV1FilesByIdErrors, GetApiV1FilesByIdResponses, GetApiV1FilesByIdUrlData, GetApiV1FilesByIdUrlErrors, GetApiV1FilesByIdUrlResponses, GetApiV1FilesData, GetApiV1FilesErrors, GetApiV1FilesResponses, GetApiV1GoalsByIdData, GetApiV1GoalsByIdErrors, GetApiV1GoalsByIdResponses, GetApiV1GoalsByIdSupervisionData, GetApiV1GoalsByIdSupervisionErrors, GetApiV1GoalsByIdSupervisionResponses, GetApiV1GoalsData, GetApiV1GoalsErrors, GetApiV1GoalsResponses, GetApiV1HealthData, GetApiV1HealthErrors, GetApiV1HealthResponses, GetApiV1KnowledgeBasesByIdData, GetApiV1KnowledgeBasesByIdErrors, GetApiV1KnowledgeBasesByIdFilesData, GetApiV1KnowledgeBasesByIdFilesErrors, GetApiV1KnowledgeBasesByIdFilesResponses, GetApiV1KnowledgeBasesByIdResponses, GetApiV1KnowledgeBasesData, GetApiV1KnowledgeBasesErrors, GetApiV1KnowledgeBasesResponses, GetApiV1McpServersByIdData, GetApiV1McpServersByIdErrors, GetApiV1McpServersByIdResponses, GetApiV1McpServersData, GetApiV1McpServersErrors, GetApiV1McpServersResponses, GetApiV1MemoriesByCategoryData, GetApiV1MemoriesByCategoryErrors, GetApiV1MemoriesByCategoryResponses, GetApiV1MemoriesPersonaData, GetApiV1MemoriesPersonaErrors, GetApiV1MemoriesPersonaResponses, GetApiV1MemoriesPersonaVersionsData, GetApiV1MemoriesPersonaVersionsErrors, GetApiV1MemoriesPersonaVersionsResponses, GetApiV1MessagesByIdData, GetApiV1MessagesByIdErrors, GetApiV1MessagesByIdResponses, GetApiV1MessagesCountData, GetApiV1MessagesCountErrors, GetApiV1MessagesCountResponses, GetApiV1MessagesData, GetApiV1MessagesErrors, GetApiV1MessagesResponses, GetApiV1MessageTranslationsByMessageIdData, GetApiV1MessageTranslationsByMessageIdErrors, GetApiV1MessageTranslationsByMessageIdResponses, GetApiV1ModelsByProviderIdByModelIdData, GetApiV1ModelsByProviderIdByModelIdErrors, GetApiV1ModelsByProviderIdByModelIdResponses, GetApiV1ModelsData, GetApiV1ModelsErrors, GetApiV1ModelsResponses, GetApiV1NotificationsCountsData, GetApiV1NotificationsCountsErrors, GetApiV1NotificationsCountsResponses, GetApiV1NotificationsData, GetApiV1NotificationsErrors, GetApiV1NotificationsResponses, GetApiV1NotificationsUnreadCountData, GetApiV1NotificationsUnreadCountErrors, GetApiV1NotificationsUnreadCountResponses, GetApiV1PermissionsByIdData, GetApiV1PermissionsByIdErrors, GetApiV1PermissionsByIdResponses, GetApiV1PermissionsData, GetApiV1PermissionsErrors, GetApiV1PermissionsResponses, GetApiV1PluginsData, GetApiV1PluginsErrors, GetApiV1PluginsResponses, GetApiV1ProvidersByIdData, GetApiV1ProvidersByIdErrors, GetApiV1ProvidersByIdResponses, GetApiV1ProvidersData, GetApiV1ProvidersErrors, GetApiV1ProvidersResponses, GetApiV1RolesByIdData, GetApiV1RolesByIdErrors, GetApiV1RolesByIdPermissionsData, GetApiV1RolesByIdPermissionsErrors, GetApiV1RolesByIdPermissionsResponses, GetApiV1RolesByIdResponses, GetApiV1RolesData, GetApiV1RolesErrors, GetApiV1RolesResponses, GetApiV1SignalsReceiptsData, GetApiV1SignalsReceiptsErrors, GetApiV1SignalsReceiptsResponses, GetApiV1TasksByIdData, GetApiV1TasksByIdErrors, GetApiV1TasksByIdResponses, GetApiV1TasksData, GetApiV1TasksErrors, GetApiV1TasksResponses, GetApiV1TopicsByIdData, GetApiV1TopicsByIdErrors, GetApiV1TopicsByIdResponses, GetApiV1TopicsByTopicIdThreadsData, GetApiV1TopicsByTopicIdThreadsErrors, GetApiV1TopicsByTopicIdThreadsResponses, GetApiV1TopicsData, GetApiV1TopicsErrors, GetApiV1TopicsResponses, GetApiV1UsageData, GetApiV1UsageErrors, GetApiV1UsageResponses, GetApiV1UsersByIdData, GetApiV1UsersByIdErrors, GetApiV1UsersByIdResponses, GetApiV1UsersByIdRolesData, GetApiV1UsersByIdRolesErrors, GetApiV1UsersByIdRolesResponses, GetApiV1UsersData, GetApiV1UsersErrors, GetApiV1UsersMeData, GetApiV1UsersMeErrors, GetApiV1UsersMeResponses, GetApiV1UsersResponses, PatchApiV1AgentGroupsByIdData, PatchApiV1AgentGroupsByIdErrors, PatchApiV1AgentGroupsByIdResponses, PatchApiV1AgentsByIdData, PatchApiV1AgentsByIdErrors, PatchApiV1AgentsByIdResponses, PatchApiV1ApiKeysByIdData, PatchApiV1ApiKeysByIdErrors, PatchApiV1ApiKeysByIdResponses, PatchApiV1EvalBenchmarksByIdData, PatchApiV1EvalBenchmarksByIdErrors, PatchApiV1EvalBenchmarksByIdResponses, PatchApiV1EvalDatasetsByIdData, PatchApiV1EvalDatasetsByIdErrors, PatchApiV1EvalDatasetsByIdResponses, PatchApiV1EvalRunsByIdStatusData, PatchApiV1EvalRunsByIdStatusErrors, PatchApiV1EvalRunsByIdStatusResponses, PatchApiV1EvalTestCasesByIdData, PatchApiV1EvalTestCasesByIdErrors, PatchApiV1EvalTestCasesByIdResponses, PatchApiV1FilesByIdData, PatchApiV1FilesByIdErrors, PatchApiV1FilesByIdResponses, PatchApiV1GoalsByIdData, PatchApiV1GoalsByIdErrors, PatchApiV1GoalsByIdResponses, PatchApiV1KnowledgeBasesByIdData, PatchApiV1KnowledgeBasesByIdErrors, PatchApiV1KnowledgeBasesByIdResponses, PatchApiV1McpServersByIdData, PatchApiV1McpServersByIdErrors, PatchApiV1McpServersByIdResponses, PatchApiV1MessageTranslationsByMessageIdData, PatchApiV1MessageTranslationsByMessageIdErrors, PatchApiV1MessageTranslationsByMessageIdResponses, PatchApiV1ModelsByProviderIdByModelIdData, PatchApiV1ModelsByProviderIdByModelIdErrors, PatchApiV1ModelsByProviderIdByModelIdResponses, PatchApiV1PermissionsByIdData, PatchApiV1PermissionsByIdErrors, PatchApiV1PermissionsByIdResponses, PatchApiV1ProvidersByIdData, PatchApiV1ProvidersByIdErrors, PatchApiV1ProvidersByIdResponses, PatchApiV1RolesByIdData, PatchApiV1RolesByIdErrors, PatchApiV1RolesByIdPermissionsData, PatchApiV1RolesByIdPermissionsErrors, PatchApiV1RolesByIdPermissionsResponses, PatchApiV1RolesByIdResponses, PatchApiV1TasksByIdData, PatchApiV1TasksByIdErrors, PatchApiV1TasksByIdResponses, PatchApiV1TasksByIdStatusData, PatchApiV1TasksByIdStatusErrors, PatchApiV1TasksByIdStatusResponses, PatchApiV1TopicsByIdData, PatchApiV1TopicsByIdErrors, PatchApiV1TopicsByIdResponses, PatchApiV1UsersByIdData, PatchApiV1UsersByIdErrors, PatchApiV1UsersByIdResponses, PatchApiV1UsersByIdRolesData, PatchApiV1UsersByIdRolesErrors, PatchApiV1UsersByIdRolesResponses, PostApiV1AgentGroupsData, PostApiV1AgentGroupsErrors, PostApiV1AgentGroupsResponses, PostApiV1AgentsByIdDuplicateData, PostApiV1AgentsByIdDuplicateErrors, PostApiV1AgentsByIdDuplicateResponses, PostApiV1AgentsData, PostApiV1AgentsErrors, PostApiV1AgentsResponses, PostApiV1ApiKeysData, PostApiV1ApiKeysErrors, PostApiV1ApiKeysResponses, PostApiV1ChatData, PostApiV1ChatErrors, PostApiV1ChatGenerateReplyData, PostApiV1ChatGenerateReplyErrors, PostApiV1ChatGenerateReplyResponses, PostApiV1ChatResponses, PostApiV1ChatTranslateData, PostApiV1ChatTranslateErrors, PostApiV1ChatTranslateResponses, PostApiV1EvalBenchmarksData, PostApiV1EvalBenchmarksErrors, PostApiV1EvalBenchmarksResponses, PostApiV1EvalDatasetsByDatasetIdTestCasesData, PostApiV1EvalDatasetsByDatasetIdTestCasesErrors, PostApiV1EvalDatasetsByDatasetIdTestCasesResponses, PostApiV1EvalDatasetsData, PostApiV1EvalDatasetsErrors, PostApiV1EvalDatasetsResponses, PostApiV1EvalRunsByIdClaimData, PostApiV1EvalRunsByIdClaimErrors, PostApiV1EvalRunsByIdClaimResponses, PostApiV1EvalRunsByIdResultsData, PostApiV1EvalRunsByIdResultsErrors, PostApiV1EvalRunsByIdResultsResponses, PostApiV1EvalRunsByIdRetryErrorsData, PostApiV1EvalRunsByIdRetryErrorsErrors, PostApiV1EvalRunsByIdRetryErrorsResponses, PostApiV1EvalRunsData, PostApiV1EvalRunsErrors, PostApiV1EvalRunsResponses, PostApiV1FilesBatchesData, PostApiV1FilesBatchesErrors, PostApiV1FilesBatchesResponses, PostApiV1FilesByIdChunksData, PostApiV1FilesByIdChunksErrors, PostApiV1FilesByIdChunksResponses, PostApiV1FilesByIdParsesData, PostApiV1FilesByIdParsesErrors, PostApiV1FilesByIdParsesResponses, PostApiV1FilesData, PostApiV1FilesErrors, PostApiV1FilesQueriesData, PostApiV1FilesQueriesErrors, PostApiV1FilesQueriesResponses, PostApiV1FilesResponses, PostApiV1GoalsByIdAdvanceData, PostApiV1GoalsByIdAdvanceErrors, PostApiV1GoalsByIdAdvanceResponses, PostApiV1GoalsByIdPauseData, PostApiV1GoalsByIdPauseErrors, PostApiV1GoalsByIdPauseResponses, PostApiV1GoalsByIdRestartData, PostApiV1GoalsByIdRestartErrors, PostApiV1GoalsByIdRestartResponses, PostApiV1GoalsByIdResumeData, PostApiV1GoalsByIdResumeErrors, PostApiV1GoalsByIdResumeResponses, PostApiV1GoalsData, PostApiV1GoalsErrors, PostApiV1GoalsResponses, PostApiV1KnowledgeBasesByIdFilesBatchData, PostApiV1KnowledgeBasesByIdFilesBatchErrors, PostApiV1KnowledgeBasesByIdFilesBatchResponses, PostApiV1KnowledgeBasesByIdFilesMoveData, PostApiV1KnowledgeBasesByIdFilesMoveErrors, PostApiV1KnowledgeBasesByIdFilesMoveResponses, PostApiV1KnowledgeBasesData, PostApiV1KnowledgeBasesErrors, PostApiV1KnowledgeBasesResponses, PostApiV1McpServersByIdSyncData, PostApiV1McpServersByIdSyncErrors, PostApiV1McpServersByIdSyncResponses, PostApiV1McpServersData, PostApiV1McpServersErrors, PostApiV1McpServersResponses, PostApiV1MessagesData, PostApiV1MessagesErrors, PostApiV1MessagesRepliesData, PostApiV1MessagesRepliesErrors, PostApiV1MessagesRepliesResponses, PostApiV1MessagesResponses, PostApiV1MessageTranslationsByMessageIdData, PostApiV1MessageTranslationsByMessageIdErrors, PostApiV1MessageTranslationsByMessageIdResponses, PostApiV1ModelsData, PostApiV1ModelsErrors, PostApiV1ModelsResponses, PostApiV1NotificationsArchiveAllData, PostApiV1NotificationsArchiveAllErrors, PostApiV1NotificationsArchiveAllResponses, PostApiV1NotificationsByIdArchiveData, PostApiV1NotificationsByIdArchiveErrors, PostApiV1NotificationsByIdArchiveResponses, PostApiV1NotificationsReadAllData, PostApiV1NotificationsReadAllErrors, PostApiV1NotificationsReadAllResponses, PostApiV1NotificationsReadData, PostApiV1NotificationsReadErrors, PostApiV1NotificationsReadResponses, PostApiV1PermissionsData, PostApiV1PermissionsErrors, PostApiV1PermissionsResponses, PostApiV1ProvidersData, PostApiV1ProvidersErrors, PostApiV1ProvidersResponses, PostApiV1ResponsesData, PostApiV1ResponsesErrors, PostApiV1ResponsesResponses, PostApiV1RolesData, PostApiV1RolesErrors, PostApiV1RolesResponses, PostApiV1SignalsSourceEventsData, PostApiV1SignalsSourceEventsErrors, PostApiV1SignalsSourceEventsResponses, PostApiV1SignalsTriggerData, PostApiV1SignalsTriggerErrors, PostApiV1SignalsTriggerResponses, PostApiV1TasksData, PostApiV1TasksErrors, PostApiV1TasksResponses, PostApiV1TopicsData, PostApiV1TopicsErrors, PostApiV1TopicsResponses, PostApiV1UsersData, PostApiV1UsersErrors, PostApiV1UsersResponses, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultData, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultErrors, PutApiV1EvalRunsByRunIdTopicsByTopicIdResultResponses } from './types.gen';
const mergeMethodHeaders = (
defaults: Record<string, unknown>,
@@ -692,6 +692,91 @@ export class Files extends HeyApiClient {
}
}
+export class Goals extends HeyApiClient {
+ public list<ThrowOnError extends boolean = false>(options?: Options<GetApiV1GoalsData, ThrowOnError>): RequestResult<GetApiV1GoalsResponses, GetApiV1GoalsErrors, ThrowOnError> {
+ return (options?.client ?? this.client).get<GetApiV1GoalsResponses, GetApiV1GoalsErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/goals',
+ ...options
+ });
+ }
+
+ public create<ThrowOnError extends boolean = false>(options: Options<PostApiV1GoalsData, ThrowOnError>): RequestResult<PostApiV1GoalsResponses, PostApiV1GoalsErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<PostApiV1GoalsResponses, PostApiV1GoalsErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/goals',
+ ...options,
+ headers: mergeMethodHeaders({ 'Content-Type': 'application/json' }, options.headers)
+ });
+ }
+
+ public delete<ThrowOnError extends boolean = false>(options: Options<DeleteApiV1GoalsByIdData, ThrowOnError>): RequestResult<DeleteApiV1GoalsByIdResponses, DeleteApiV1GoalsByIdErrors, ThrowOnError> {
+ return (options.client ?? this.client).delete<DeleteApiV1GoalsByIdResponses, DeleteApiV1GoalsByIdErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/goals/{id}',
+ ...options
+ });
+ }
+
+ public get<ThrowOnError extends boolean = false>(options: Options<GetApiV1GoalsByIdData, ThrowOnError>): RequestResult<GetApiV1GoalsByIdResponses, GetApiV1GoalsByIdErrors, ThrowOnError> {
+ return (options.client ?? this.client).get<GetApiV1GoalsByIdResponses, GetApiV1GoalsByIdErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/goals/{id}',
+ ...options
+ });
+ }
+
+ public update<ThrowOnError extends boolean = false>(options: Options<PatchApiV1GoalsByIdData, ThrowOnError>): RequestResult<PatchApiV1GoalsByIdResponses, PatchApiV1GoalsByIdErrors, ThrowOnError> {
+ return (options.client ?? this.client).patch<PatchApiV1GoalsByIdResponses, PatchApiV1GoalsByIdErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/goals/{id}',
+ ...options,
+ headers: mergeMethodHeaders({ 'Content-Type': 'application/json' }, options.headers)
+ });
+ }
+
+ public getSupervision<ThrowOnError extends boolean = false>(options: Options<GetApiV1GoalsByIdSupervisionData, ThrowOnError>): RequestResult<GetApiV1GoalsByIdSupervisionResponses, GetApiV1GoalsByIdSupervisionErrors, ThrowOnError> {
+ return (options.client ?? this.client).get<GetApiV1GoalsByIdSupervisionResponses, GetApiV1GoalsByIdSupervisionErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/goals/{id}/supervision',
+ ...options
+ });
+ }
+
+ public advance<ThrowOnError extends boolean = false>(options: Options<PostApiV1GoalsByIdAdvanceData, ThrowOnError>): RequestResult<PostApiV1GoalsByIdAdvanceResponses, PostApiV1GoalsByIdAdvanceErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<PostApiV1GoalsByIdAdvanceResponses, PostApiV1GoalsByIdAdvanceErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/goals/{id}/advance',
+ ...options
+ });
+ }
+
+ public pause<ThrowOnError extends boolean = false>(options: Options<PostApiV1GoalsByIdPauseData, ThrowOnError>): RequestResult<PostApiV1GoalsByIdPauseResponses, PostApiV1GoalsByIdPauseErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<PostApiV1GoalsByIdPauseResponses, PostApiV1GoalsByIdPauseErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/goals/{id}/pause',
+ ...options
+ });
+ }
+
+ public resume<ThrowOnError extends boolean = false>(options: Options<PostApiV1GoalsByIdResumeData, ThrowOnError>): RequestResult<PostApiV1GoalsByIdResumeResponses, PostApiV1GoalsByIdResumeErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<PostApiV1GoalsByIdResumeResponses, PostApiV1GoalsByIdResumeErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/goals/{id}/resume',
+ ...options
+ });
+ }
+
+ public restart<ThrowOnError extends boolean = false>(options: Options<PostApiV1GoalsByIdRestartData, ThrowOnError>): RequestResult<PostApiV1GoalsByIdRestartResponses, PostApiV1GoalsByIdRestartErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<PostApiV1GoalsByIdRestartResponses, PostApiV1GoalsByIdRestartErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/goals/{id}/restart',
+ ...options,
+ headers: mergeMethodHeaders({ 'Content-Type': 'application/json' }, options.headers)
+ });
+ }
+}
+
export class KnowledgeBases extends HeyApiClient {
public list<ThrowOnError extends boolean = false>(options?: Options<GetApiV1KnowledgeBasesData, ThrowOnError>): RequestResult<GetApiV1KnowledgeBasesResponses, GetApiV1KnowledgeBasesErrors, ThrowOnError> {
return (options?.client ?? this.client).get<GetApiV1KnowledgeBasesResponses, GetApiV1KnowledgeBasesErrors, ThrowOnError>({
@@ -832,6 +917,57 @@ export class McpServers extends HeyApiClient {
}
}
+export class Memories extends HeyApiClient {
+ /**
+ * Get the current persona document
+ */
+ public getPersona<ThrowOnError extends boolean = false>(options?: Options<GetApiV1MemoriesPersonaData, ThrowOnError>): RequestResult<GetApiV1MemoriesPersonaResponses, GetApiV1MemoriesPersonaErrors, ThrowOnError> {
+ return (options?.client ?? this.client).get<GetApiV1MemoriesPersonaResponses, GetApiV1MemoriesPersonaErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/memories/persona',
+ ...options
+ });
+ }
+
+ /**
+ * List persona document versions
+ */
+ public listPersonaVersions<ThrowOnError extends boolean = false>(options?: Options<GetApiV1MemoriesPersonaVersionsData, ThrowOnError>): RequestResult<GetApiV1MemoriesPersonaVersionsResponses, GetApiV1MemoriesPersonaVersionsErrors, ThrowOnError> {
+ return (options?.client ?? this.client).get<GetApiV1MemoriesPersonaVersionsResponses, GetApiV1MemoriesPersonaVersionsErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/memories/persona/versions',
+ ...options
+ });
+ }
+
+ /**
+ * Delete all memory entries
+ */
+ public deleteAll<ThrowOnError extends boolean = false>(options?: Options<DeleteApiV1MemoriesData, ThrowOnError>): RequestResult<DeleteApiV1MemoriesResponses, DeleteApiV1MemoriesErrors, ThrowOnError> {
+ return (options?.client ?? this.client).delete<DeleteApiV1MemoriesResponses, DeleteApiV1MemoriesErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/memories',
+ ...options
+ });
+ }
+
+ public deleteEntry<ThrowOnError extends boolean = false>(options: Options<DeleteApiV1MemoriesByCategoryByIdData, ThrowOnError>): RequestResult<DeleteApiV1MemoriesByCategoryByIdResponses, DeleteApiV1MemoriesByCategoryByIdErrors, ThrowOnError> {
+ return (options.client ?? this.client).delete<DeleteApiV1MemoriesByCategoryByIdResponses, DeleteApiV1MemoriesByCategoryByIdErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/memories/{category}/{id}',
+ ...options
+ });
+ }
+
+ public listCategory<ThrowOnError extends boolean = false>(options: Options<GetApiV1MemoriesByCategoryData, ThrowOnError>): RequestResult<GetApiV1MemoriesByCategoryResponses, GetApiV1MemoriesByCategoryErrors, ThrowOnError> {
+ return (options.client ?? this.client).get<GetApiV1MemoriesByCategoryResponses, GetApiV1MemoriesByCategoryErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/memories/{category}',
+ ...options
+ });
+ }
+}
+
export class MessageTranslations extends HeyApiClient {
public delete<ThrowOnError extends boolean = false>(options: Options<DeleteApiV1MessageTranslationsByMessageIdData, ThrowOnError>): RequestResult<DeleteApiV1MessageTranslationsByMessageIdResponses, DeleteApiV1MessageTranslationsByMessageIdErrors, ThrowOnError> {
return (options.client ?? this.client).delete<DeleteApiV1MessageTranslationsByMessageIdResponses, DeleteApiV1MessageTranslationsByMessageIdErrors, ThrowOnError>({
@@ -965,6 +1101,77 @@ export class Models extends HeyApiClient {
}
}
+export class Notifications extends HeyApiClient {
+ public list<ThrowOnError extends boolean = false>(options?: Options<GetApiV1NotificationsData, ThrowOnError>): RequestResult<GetApiV1NotificationsResponses, GetApiV1NotificationsErrors, ThrowOnError> {
+ return (options?.client ?? this.client).get<GetApiV1NotificationsResponses, GetApiV1NotificationsErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/notifications',
+ ...options
+ });
+ }
+
+ /**
+ * Get the unread notification count
+ */
+ public getUnreadCount<ThrowOnError extends boolean = false>(options?: Options<GetApiV1NotificationsUnreadCountData, ThrowOnError>): RequestResult<GetApiV1NotificationsUnreadCountResponses, GetApiV1NotificationsUnreadCountErrors, ThrowOnError> {
+ return (options?.client ?? this.client).get<GetApiV1NotificationsUnreadCountResponses, GetApiV1NotificationsUnreadCountErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/notifications/unread-count',
+ ...options
+ });
+ }
+
+ /**
+ * Get per-category notification counts
+ */
+ public getCounts<ThrowOnError extends boolean = false>(options?: Options<GetApiV1NotificationsCountsData, ThrowOnError>): RequestResult<GetApiV1NotificationsCountsResponses, GetApiV1NotificationsCountsErrors, ThrowOnError> {
+ return (options?.client ?? this.client).get<GetApiV1NotificationsCountsResponses, GetApiV1NotificationsCountsErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/notifications/counts',
+ ...options
+ });
+ }
+
+ public markRead<ThrowOnError extends boolean = false>(options: Options<PostApiV1NotificationsReadData, ThrowOnError>): RequestResult<PostApiV1NotificationsReadResponses, PostApiV1NotificationsReadErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<PostApiV1NotificationsReadResponses, PostApiV1NotificationsReadErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/notifications/read',
+ ...options,
+ headers: mergeMethodHeaders({ 'Content-Type': 'application/json' }, options.headers)
+ });
+ }
+
+ /**
+ * Mark every notification as read
+ */
+ public markAllRead<ThrowOnError extends boolean = false>(options?: Options<PostApiV1NotificationsReadAllData, ThrowOnError>): RequestResult<PostApiV1NotificationsReadAllResponses, PostApiV1NotificationsReadAllErrors, ThrowOnError> {
+ return (options?.client ?? this.client).post<PostApiV1NotificationsReadAllResponses, PostApiV1NotificationsReadAllErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/notifications/read-all',
+ ...options
+ });
+ }
+
+ /**
+ * Archive every notification
+ */
+ public archiveAll<ThrowOnError extends boolean = false>(options?: Options<PostApiV1NotificationsArchiveAllData, ThrowOnError>): RequestResult<PostApiV1NotificationsArchiveAllResponses, PostApiV1NotificationsArchiveAllErrors, ThrowOnError> {
+ return (options?.client ?? this.client).post<PostApiV1NotificationsArchiveAllResponses, PostApiV1NotificationsArchiveAllErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/notifications/archive-all',
+ ...options
+ });
+ }
+
+ public archive<ThrowOnError extends boolean = false>(options: Options<PostApiV1NotificationsByIdArchiveData, ThrowOnError>): RequestResult<PostApiV1NotificationsByIdArchiveResponses, PostApiV1NotificationsByIdArchiveErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<PostApiV1NotificationsByIdArchiveResponses, PostApiV1NotificationsByIdArchiveErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/notifications/{id}/archive',
+ ...options
+ });
+ }
+}
+
export class Permissions extends HeyApiClient {
public list<ThrowOnError extends boolean = false>(options?: Options<GetApiV1PermissionsData, ThrowOnError>): RequestResult<GetApiV1PermissionsResponses, GetApiV1PermissionsErrors, ThrowOnError> {
return (options?.client ?? this.client).get<GetApiV1PermissionsResponses, GetApiV1PermissionsErrors, ThrowOnError>({
@@ -1133,6 +1340,87 @@ export class Roles extends HeyApiClient {
}
}
+export class Signals extends HeyApiClient {
+ public emit<ThrowOnError extends boolean = false>(options: Options<PostApiV1SignalsSourceEventsData, ThrowOnError>): RequestResult<PostApiV1SignalsSourceEventsResponses, PostApiV1SignalsSourceEventsErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<PostApiV1SignalsSourceEventsResponses, PostApiV1SignalsSourceEventsErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/signals/source-events',
+ ...options,
+ headers: mergeMethodHeaders({ 'Content-Type': 'application/json' }, options.headers)
+ });
+ }
+
+ public trigger<ThrowOnError extends boolean = false>(options: Options<PostApiV1SignalsTriggerData, ThrowOnError>): RequestResult<PostApiV1SignalsTriggerResponses, PostApiV1SignalsTriggerErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<PostApiV1SignalsTriggerResponses, PostApiV1SignalsTriggerErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/signals/trigger',
+ ...options,
+ headers: mergeMethodHeaders({ 'Content-Type': 'application/json' }, options.headers)
+ });
+ }
+
+ public listReceipts<ThrowOnError extends boolean = false>(options: Options<GetApiV1SignalsReceiptsData, ThrowOnError>): RequestResult<GetApiV1SignalsReceiptsResponses, GetApiV1SignalsReceiptsErrors, ThrowOnError> {
+ return (options.client ?? this.client).get<GetApiV1SignalsReceiptsResponses, GetApiV1SignalsReceiptsErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/signals/receipts',
+ ...options
+ });
+ }
+}
+
+export class Tasks extends HeyApiClient {
+ public list<ThrowOnError extends boolean = false>(options?: Options<GetApiV1TasksData, ThrowOnError>): RequestResult<GetApiV1TasksResponses, GetApiV1TasksErrors, ThrowOnError> {
+ return (options?.client ?? this.client).get<GetApiV1TasksResponses, GetApiV1TasksErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/tasks',
+ ...options
+ });
+ }
+
+ public create<ThrowOnError extends boolean = false>(options: Options<PostApiV1TasksData, ThrowOnError>): RequestResult<PostApiV1TasksResponses, PostApiV1TasksErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<PostApiV1TasksResponses, PostApiV1TasksErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/tasks',
+ ...options,
+ headers: mergeMethodHeaders({ 'Content-Type': 'application/json' }, options.headers)
+ });
+ }
+
+ public delete<ThrowOnError extends boolean = false>(options: Options<DeleteApiV1TasksByIdData, ThrowOnError>): RequestResult<DeleteApiV1TasksByIdResponses, DeleteApiV1TasksByIdErrors, ThrowOnError> {
+ return (options.client ?? this.client).delete<DeleteApiV1TasksByIdResponses, DeleteApiV1TasksByIdErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/tasks/{id}',
+ ...options
+ });
+ }
+
+ public get<ThrowOnError extends boolean = false>(options: Options<GetApiV1TasksByIdData, ThrowOnError>): RequestResult<GetApiV1TasksByIdResponses, GetApiV1TasksByIdErrors, ThrowOnError> {
+ return (options.client ?? this.client).get<GetApiV1TasksByIdResponses, GetApiV1TasksByIdErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/tasks/{id}',
+ ...options
+ });
+ }
+
+ public update<ThrowOnError extends boolean = false>(options: Options<PatchApiV1TasksByIdData, ThrowOnError>): RequestResult<PatchApiV1TasksByIdResponses, PatchApiV1TasksByIdErrors, ThrowOnError> {
+ return (options.client ?? this.client).patch<PatchApiV1TasksByIdResponses, PatchApiV1TasksByIdErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/tasks/{id}',
+ ...options,
+ headers: mergeMethodHeaders({ 'Content-Type': 'application/json' }, options.headers)
+ });
+ }
+
+ public updateStatus<ThrowOnError extends boolean = false>(options: Options<PatchApiV1TasksByIdStatusData, ThrowOnError>): RequestResult<PatchApiV1TasksByIdStatusResponses, PatchApiV1TasksByIdStatusErrors, ThrowOnError> {
+ return (options.client ?? this.client).patch<PatchApiV1TasksByIdStatusResponses, PatchApiV1TasksByIdStatusErrors, ThrowOnError>({
+ security: [{ scheme: 'bearer', type: 'http' }],
+ url: '/api/v1/tasks/{id}/status',
+ ...options,
+ headers: mergeMethodHeaders({ 'Content-Type': 'application/json' }, options.headers)
+ });
+ }
+}
+
export class Topics extends HeyApiClient {
public list<ThrowOnError extends boolean = false>(options?: Options<GetApiV1TopicsData, ThrowOnError>): RequestResult<GetApiV1TopicsResponses, GetApiV1TopicsErrors, ThrowOnError> {
return (options?.client ?? this.client).get<GetApiV1TopicsResponses, GetApiV1TopicsErrors, ThrowOnError>({
@@ -1332,6 +1620,11 @@ export class LobeHub extends HeyApiClient {
return this._files ??= new Files({ client: this.client });
}
+ private _goals?: Goals;
+ get goals(): Goals {
+ return this._goals ??= new Goals({ client: this.client });
+ }
+
private _knowledgeBases?: KnowledgeBases;
get knowledgeBases(): KnowledgeBases {
return this._knowledgeBases ??= new KnowledgeBases({ client: this.client });
@@ -1342,6 +1635,11 @@ export class LobeHub extends HeyApiClient {
return this._mcpServers ??= new McpServers({ client: this.client });
}
+ private _memories?: Memories;
+ get memories(): Memories {
+ return this._memories ??= new Memories({ client: this.client });
+ }
+
private _messageTranslations?: MessageTranslations;
get messageTranslations(): MessageTranslations {
return this._messageTranslations ??= new MessageTranslations({ client: this.client });
@@ -1357,6 +1655,11 @@ export class LobeHub extends HeyApiClient {
return this._models ??= new Models({ client: this.client });
}
+ private _notifications?: Notifications;
+ get notifications(): Notifications {
+ return this._notifications ??= new Notifications({ client: this.client });
+ }
+
private _permissions?: Permissions;
get permissions(): Permissions {
return this._permissions ??= new Permissions({ client: this.client });
@@ -1377,6 +1680,16 @@ export class LobeHub extends HeyApiClient {
return this._roles ??= new Roles({ client: this.client });
}
+ private _signals?: Signals;
+ get signals(): Signals {
+ return this._signals ??= new Signals({ client: this.client });
+ }
+
+ private _tasks?: Tasks;
+ get tasks(): Tasks {
+ return this._tasks ??= new Tasks({ client: this.client });
+ }
+
private _topics?: Topics;
get topics(): Topics {
return this._topics ??= new Topics({ client: this.client });
diff --git a/packages/sdk/src/generated/types.gen.ts b/packages/sdk/src/generated/types.gen.ts
index 71309053a17..a8199bc5633 100644
--- a/packages/sdk/src/generated/types.gen.ts
+++ b/packages/sdk/src/generated/types.gen.ts
@@ -477,10 +477,6 @@ export type PostApiV1AgentGroupsErrors = {
export type PostApiV1AgentGroupsError = PostApiV1AgentGroupsErrors[keyof PostApiV1AgentGroupsErrors];
export type PostApiV1AgentGroupsResponses = {
- /**
- * Response
- */
- 200: unknown;
/**
* Successful response
*/
@@ -1314,10 +1310,6 @@ export type PostApiV1ApiKeysErrors = {
export type PostApiV1ApiKeysError = PostApiV1ApiKeysErrors[keyof PostApiV1ApiKeysErrors];
export type PostApiV1ApiKeysResponses = {
- /**
- * Response
- */
- 200: unknown;
/**
* Successful response
*/
@@ -5215,18 +5207,21 @@ export type PostApiV1FilesQueriesResponses = {
export type PostApiV1FilesQueriesResponse = PostApiV1FilesQueriesResponses[keyof PostApiV1FilesQueriesResponses];
-export type GetApiV1KnowledgeBasesData = {
+export type GetApiV1GoalsData = {
body?: never;
path?: never;
query?: {
- keyword?: string;
- page?: string;
- pageSize?: string;
+ agentId?: string;
+ limit?: number;
+ offset?: number;
+ projectId?: string;
+ statuses?: string;
+ topicId?: string;
};
- url: '/api/v1/knowledge-bases';
+ url: '/api/v1/goals';
};
-export type GetApiV1KnowledgeBasesErrors = {
+export type GetApiV1GoalsErrors = {
/**
* Validation Error
*/
@@ -5261,38 +5256,52 @@ export type GetApiV1KnowledgeBasesErrors = {
500: ApiError;
};
-export type GetApiV1KnowledgeBasesError = GetApiV1KnowledgeBasesErrors[keyof GetApiV1KnowledgeBasesErrors];
+export type GetApiV1GoalsError = GetApiV1GoalsErrors[keyof GetApiV1GoalsErrors];
-export type GetApiV1KnowledgeBasesResponses = {
+export type GetApiV1GoalsResponses = {
/**
* Successful response
*/
200: {
- data?: {
- knowledgeBases: Array<KnowledgeBase>;
- total?: number;
+ data?: Array<unknown> | {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1KnowledgeBasesResponse = GetApiV1KnowledgeBasesResponses[keyof GetApiV1KnowledgeBasesResponses];
+export type GetApiV1GoalsResponse = GetApiV1GoalsResponses[keyof GetApiV1GoalsResponses];
-export type PostApiV1KnowledgeBasesData = {
+export type PostApiV1GoalsData = {
body: {
- avatar?: string;
- description?: string;
- name: string;
+ agentId?: string;
+ config?: {
+ [key: string]: unknown;
+ };
+ criteria?: Array<{
+ description?: string;
+ instruction?: string;
+ title: string;
+ }>;
+ deadline?: string;
+ maxTotalCost?: number;
+ problemDescription?: string;
+ projectId?: string;
+ requirement?: string;
+ tasks?: Array<string | {
+ description?: string;
+ title: string;
+ }>;
+ title: string;
};
path?: never;
query?: never;
- url: '/api/v1/knowledge-bases';
+ url: '/api/v1/goals';
};
-export type PostApiV1KnowledgeBasesErrors = {
+export type PostApiV1GoalsErrors = {
/**
* Validation Error
*/
@@ -5327,32 +5336,34 @@ export type PostApiV1KnowledgeBasesErrors = {
500: ApiError;
};
-export type PostApiV1KnowledgeBasesError = PostApiV1KnowledgeBasesErrors[keyof PostApiV1KnowledgeBasesErrors];
+export type PostApiV1GoalsError = PostApiV1GoalsErrors[keyof PostApiV1GoalsErrors];
-export type PostApiV1KnowledgeBasesResponses = {
+export type PostApiV1GoalsResponses = {
/**
* Successful response
*/
- 200: {
- data?: KnowledgeBase;
+ 201: {
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1KnowledgeBasesResponse = PostApiV1KnowledgeBasesResponses[keyof PostApiV1KnowledgeBasesResponses];
+export type PostApiV1GoalsResponse = PostApiV1GoalsResponses[keyof PostApiV1GoalsResponses];
-export type DeleteApiV1KnowledgeBasesByIdData = {
+export type DeleteApiV1GoalsByIdData = {
body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/knowledge-bases/{id}';
+ url: '/api/v1/goals/{id}';
};
-export type DeleteApiV1KnowledgeBasesByIdErrors = {
+export type DeleteApiV1GoalsByIdErrors = {
/**
* Validation Error
*/
@@ -5387,14 +5398,14 @@ export type DeleteApiV1KnowledgeBasesByIdErrors = {
500: ApiError;
};
-export type DeleteApiV1KnowledgeBasesByIdError = DeleteApiV1KnowledgeBasesByIdErrors[keyof DeleteApiV1KnowledgeBasesByIdErrors];
+export type DeleteApiV1GoalsByIdError = DeleteApiV1GoalsByIdErrors[keyof DeleteApiV1GoalsByIdErrors];
-export type DeleteApiV1KnowledgeBasesByIdResponses = {
+export type DeleteApiV1GoalsByIdResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
} | null;
message?: string;
@@ -5403,18 +5414,18 @@ export type DeleteApiV1KnowledgeBasesByIdResponses = {
};
};
-export type DeleteApiV1KnowledgeBasesByIdResponse = DeleteApiV1KnowledgeBasesByIdResponses[keyof DeleteApiV1KnowledgeBasesByIdResponses];
+export type DeleteApiV1GoalsByIdResponse = DeleteApiV1GoalsByIdResponses[keyof DeleteApiV1GoalsByIdResponses];
-export type GetApiV1KnowledgeBasesByIdData = {
+export type GetApiV1GoalsByIdData = {
body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/knowledge-bases/{id}';
+ url: '/api/v1/goals/{id}';
};
-export type GetApiV1KnowledgeBasesByIdErrors = {
+export type GetApiV1GoalsByIdErrors = {
/**
* Validation Error
*/
@@ -5449,36 +5460,46 @@ export type GetApiV1KnowledgeBasesByIdErrors = {
500: ApiError;
};
-export type GetApiV1KnowledgeBasesByIdError = GetApiV1KnowledgeBasesByIdErrors[keyof GetApiV1KnowledgeBasesByIdErrors];
+export type GetApiV1GoalsByIdError = GetApiV1GoalsByIdErrors[keyof GetApiV1GoalsByIdErrors];
-export type GetApiV1KnowledgeBasesByIdResponses = {
+export type GetApiV1GoalsByIdResponses = {
/**
* Successful response
*/
200: {
- data?: KnowledgeBase;
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1KnowledgeBasesByIdResponse = GetApiV1KnowledgeBasesByIdResponses[keyof GetApiV1KnowledgeBasesByIdResponses];
+export type GetApiV1GoalsByIdResponse = GetApiV1GoalsByIdResponses[keyof GetApiV1GoalsByIdResponses];
-export type PatchApiV1KnowledgeBasesByIdData = {
+export type PatchApiV1GoalsByIdData = {
body: {
- avatar?: string;
- description?: string;
- name?: string;
+ budget?: {
+ deadline?: string | null;
+ maxAttemptsPerTask?: number;
+ maxConcurrentTasks?: number | null;
+ maxExperiments?: number;
+ maxManagerTurns?: number;
+ maxRounds?: number | null;
+ maxStepsPerRun?: number | null;
+ maxTotalCost?: number | null;
+ };
+ requirement?: string;
};
path: {
id: string;
};
query?: never;
- url: '/api/v1/knowledge-bases/{id}';
+ url: '/api/v1/goals/{id}';
};
-export type PatchApiV1KnowledgeBasesByIdErrors = {
+export type PatchApiV1GoalsByIdErrors = {
/**
* Validation Error
*/
@@ -5513,37 +5534,34 @@ export type PatchApiV1KnowledgeBasesByIdErrors = {
500: ApiError;
};
-export type PatchApiV1KnowledgeBasesByIdError = PatchApiV1KnowledgeBasesByIdErrors[keyof PatchApiV1KnowledgeBasesByIdErrors];
+export type PatchApiV1GoalsByIdError = PatchApiV1GoalsByIdErrors[keyof PatchApiV1GoalsByIdErrors];
-export type PatchApiV1KnowledgeBasesByIdResponses = {
+export type PatchApiV1GoalsByIdResponses = {
/**
* Successful response
*/
200: {
- data?: KnowledgeBase;
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PatchApiV1KnowledgeBasesByIdResponse = PatchApiV1KnowledgeBasesByIdResponses[keyof PatchApiV1KnowledgeBasesByIdResponses];
+export type PatchApiV1GoalsByIdResponse = PatchApiV1GoalsByIdResponses[keyof PatchApiV1GoalsByIdResponses];
-export type GetApiV1KnowledgeBasesByIdFilesData = {
+export type GetApiV1GoalsByIdSupervisionData = {
body?: never;
path: {
id: string;
};
- query?: {
- keyword?: string;
- page?: string;
- pageSize?: string;
- fileType?: string | null;
- };
- url: '/api/v1/knowledge-bases/{id}/files';
+ query?: never;
+ url: '/api/v1/goals/{id}/supervision';
};
-export type GetApiV1KnowledgeBasesByIdFilesErrors = {
+export type GetApiV1GoalsByIdSupervisionErrors = {
/**
* Validation Error
*/
@@ -5578,36 +5596,34 @@ export type GetApiV1KnowledgeBasesByIdFilesErrors = {
500: ApiError;
};
-export type GetApiV1KnowledgeBasesByIdFilesError = GetApiV1KnowledgeBasesByIdFilesErrors[keyof GetApiV1KnowledgeBasesByIdFilesErrors];
+export type GetApiV1GoalsByIdSupervisionError = GetApiV1GoalsByIdSupervisionErrors[keyof GetApiV1GoalsByIdSupervisionErrors];
-export type GetApiV1KnowledgeBasesByIdFilesResponses = {
+export type GetApiV1GoalsByIdSupervisionResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1KnowledgeBasesByIdFilesResponse = GetApiV1KnowledgeBasesByIdFilesResponses[keyof GetApiV1KnowledgeBasesByIdFilesResponses];
+export type GetApiV1GoalsByIdSupervisionResponse = GetApiV1GoalsByIdSupervisionResponses[keyof GetApiV1GoalsByIdSupervisionResponses];
-export type DeleteApiV1KnowledgeBasesByIdFilesBatchData = {
- body: {
- fileIds: Array<string>;
- };
+export type PostApiV1GoalsByIdAdvanceData = {
+ body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/knowledge-bases/{id}/files/batch';
+ url: '/api/v1/goals/{id}/advance';
};
-export type DeleteApiV1KnowledgeBasesByIdFilesBatchErrors = {
+export type PostApiV1GoalsByIdAdvanceErrors = {
/**
* Validation Error
*/
@@ -5642,14 +5658,14 @@ export type DeleteApiV1KnowledgeBasesByIdFilesBatchErrors = {
500: ApiError;
};
-export type DeleteApiV1KnowledgeBasesByIdFilesBatchError = DeleteApiV1KnowledgeBasesByIdFilesBatchErrors[keyof DeleteApiV1KnowledgeBasesByIdFilesBatchErrors];
+export type PostApiV1GoalsByIdAdvanceError = PostApiV1GoalsByIdAdvanceErrors[keyof PostApiV1GoalsByIdAdvanceErrors];
-export type DeleteApiV1KnowledgeBasesByIdFilesBatchResponses = {
+export type PostApiV1GoalsByIdAdvanceResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
} | null;
message?: string;
@@ -5658,20 +5674,18 @@ export type DeleteApiV1KnowledgeBasesByIdFilesBatchResponses = {
};
};
-export type DeleteApiV1KnowledgeBasesByIdFilesBatchResponse = DeleteApiV1KnowledgeBasesByIdFilesBatchResponses[keyof DeleteApiV1KnowledgeBasesByIdFilesBatchResponses];
+export type PostApiV1GoalsByIdAdvanceResponse = PostApiV1GoalsByIdAdvanceResponses[keyof PostApiV1GoalsByIdAdvanceResponses];
-export type PostApiV1KnowledgeBasesByIdFilesBatchData = {
- body: {
- fileIds: Array<string>;
- };
+export type PostApiV1GoalsByIdPauseData = {
+ body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/knowledge-bases/{id}/files/batch';
+ url: '/api/v1/goals/{id}/pause';
};
-export type PostApiV1KnowledgeBasesByIdFilesBatchErrors = {
+export type PostApiV1GoalsByIdPauseErrors = {
/**
* Validation Error
*/
@@ -5706,37 +5720,34 @@ export type PostApiV1KnowledgeBasesByIdFilesBatchErrors = {
500: ApiError;
};
-export type PostApiV1KnowledgeBasesByIdFilesBatchError = PostApiV1KnowledgeBasesByIdFilesBatchErrors[keyof PostApiV1KnowledgeBasesByIdFilesBatchErrors];
+export type PostApiV1GoalsByIdPauseError = PostApiV1GoalsByIdPauseErrors[keyof PostApiV1GoalsByIdPauseErrors];
-export type PostApiV1KnowledgeBasesByIdFilesBatchResponses = {
+export type PostApiV1GoalsByIdPauseResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1KnowledgeBasesByIdFilesBatchResponse = PostApiV1KnowledgeBasesByIdFilesBatchResponses[keyof PostApiV1KnowledgeBasesByIdFilesBatchResponses];
+export type PostApiV1GoalsByIdPauseResponse = PostApiV1GoalsByIdPauseResponses[keyof PostApiV1GoalsByIdPauseResponses];
-export type PostApiV1KnowledgeBasesByIdFilesMoveData = {
- body: {
- fileIds: Array<string>;
- targetKnowledgeBaseId: string;
- };
+export type PostApiV1GoalsByIdResumeData = {
+ body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/knowledge-bases/{id}/files/move';
+ url: '/api/v1/goals/{id}/resume';
};
-export type PostApiV1KnowledgeBasesByIdFilesMoveErrors = {
+export type PostApiV1GoalsByIdResumeErrors = {
/**
* Validation Error
*/
@@ -5771,36 +5782,44 @@ export type PostApiV1KnowledgeBasesByIdFilesMoveErrors = {
500: ApiError;
};
-export type PostApiV1KnowledgeBasesByIdFilesMoveError = PostApiV1KnowledgeBasesByIdFilesMoveErrors[keyof PostApiV1KnowledgeBasesByIdFilesMoveErrors];
+export type PostApiV1GoalsByIdResumeError = PostApiV1GoalsByIdResumeErrors[keyof PostApiV1GoalsByIdResumeErrors];
-export type PostApiV1KnowledgeBasesByIdFilesMoveResponses = {
+export type PostApiV1GoalsByIdResumeResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1KnowledgeBasesByIdFilesMoveResponse = PostApiV1KnowledgeBasesByIdFilesMoveResponses[keyof PostApiV1KnowledgeBasesByIdFilesMoveResponses];
+export type PostApiV1GoalsByIdResumeResponse = PostApiV1GoalsByIdResumeResponses[keyof PostApiV1GoalsByIdResumeResponses];
-export type GetApiV1McpServersData = {
- body?: never;
- path?: never;
+export type PostApiV1GoalsByIdRestartData = {
+ body: {
+ agentId?: string;
+ };
+ path: {
+ id: string;
+ };
query?: never;
- url: '/api/v1/mcp-servers';
+ url: '/api/v1/goals/{id}/restart';
};
-export type GetApiV1McpServersErrors = {
+export type PostApiV1GoalsByIdRestartErrors = {
/**
- * Invalid request
+ * Validation Error
*/
- 400: ApiError;
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
/**
* Authentication required
*/
@@ -5827,48 +5846,36 @@ export type GetApiV1McpServersErrors = {
500: ApiError;
};
-export type GetApiV1McpServersError = GetApiV1McpServersErrors[keyof GetApiV1McpServersErrors];
+export type PostApiV1GoalsByIdRestartError = PostApiV1GoalsByIdRestartErrors[keyof PostApiV1GoalsByIdRestartErrors];
-export type GetApiV1McpServersResponses = {
+export type PostApiV1GoalsByIdRestartResponses = {
/**
* Successful response
*/
200: {
- data?: Array<McpServer>;
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1McpServersResponse = GetApiV1McpServersResponses[keyof GetApiV1McpServersResponses];
+export type PostApiV1GoalsByIdRestartResponse = PostApiV1GoalsByIdRestartResponses[keyof PostApiV1GoalsByIdRestartResponses];
-export type PostApiV1McpServersData = {
- body: {
- credentials?: {
- token: string;
- type: 'bearer';
- } | {
- apiKey: string;
- type: 'apikey';
- } | {
- headers: {
- [key: string]: string;
- };
- type: 'header';
- };
- description?: string;
- identifier: string;
- isEnabled?: boolean;
- name: string;
- serverUrl: string;
- };
+export type GetApiV1KnowledgeBasesData = {
+ body?: never;
path?: never;
- query?: never;
- url: '/api/v1/mcp-servers';
+ query?: {
+ keyword?: string;
+ page?: string;
+ pageSize?: string;
+ };
+ url: '/api/v1/knowledge-bases';
};
-export type PostApiV1McpServersErrors = {
+export type GetApiV1KnowledgeBasesErrors = {
/**
* Validation Error
*/
@@ -5903,32 +5910,38 @@ export type PostApiV1McpServersErrors = {
500: ApiError;
};
-export type PostApiV1McpServersError = PostApiV1McpServersErrors[keyof PostApiV1McpServersErrors];
+export type GetApiV1KnowledgeBasesError = GetApiV1KnowledgeBasesErrors[keyof GetApiV1KnowledgeBasesErrors];
-export type PostApiV1McpServersResponses = {
+export type GetApiV1KnowledgeBasesResponses = {
/**
* Successful response
*/
- 201: {
- data?: McpServer;
+ 200: {
+ data?: {
+ knowledgeBases: Array<KnowledgeBase>;
+ total?: number;
+ [key: string]: unknown;
+ };
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1McpServersResponse = PostApiV1McpServersResponses[keyof PostApiV1McpServersResponses];
+export type GetApiV1KnowledgeBasesResponse = GetApiV1KnowledgeBasesResponses[keyof GetApiV1KnowledgeBasesResponses];
-export type DeleteApiV1McpServersByIdData = {
- body?: never;
- path: {
- id: string;
+export type PostApiV1KnowledgeBasesData = {
+ body: {
+ avatar?: string;
+ description?: string;
+ name: string;
};
+ path?: never;
query?: never;
- url: '/api/v1/mcp-servers/{id}';
+ url: '/api/v1/knowledge-bases';
};
-export type DeleteApiV1McpServersByIdErrors = {
+export type PostApiV1KnowledgeBasesErrors = {
/**
* Validation Error
*/
@@ -5963,34 +5976,32 @@ export type DeleteApiV1McpServersByIdErrors = {
500: ApiError;
};
-export type DeleteApiV1McpServersByIdError = DeleteApiV1McpServersByIdErrors[keyof DeleteApiV1McpServersByIdErrors];
+export type PostApiV1KnowledgeBasesError = PostApiV1KnowledgeBasesErrors[keyof PostApiV1KnowledgeBasesErrors];
-export type DeleteApiV1McpServersByIdResponses = {
+export type PostApiV1KnowledgeBasesResponses = {
/**
* Successful response
*/
200: {
- data?: {
- [key: string]: unknown;
- } | null;
+ data?: KnowledgeBase;
message?: string;
success: true;
timestamp: string;
};
};
-export type DeleteApiV1McpServersByIdResponse = DeleteApiV1McpServersByIdResponses[keyof DeleteApiV1McpServersByIdResponses];
+export type PostApiV1KnowledgeBasesResponse = PostApiV1KnowledgeBasesResponses[keyof PostApiV1KnowledgeBasesResponses];
-export type GetApiV1McpServersByIdData = {
+export type DeleteApiV1KnowledgeBasesByIdData = {
body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/mcp-servers/{id}';
+ url: '/api/v1/knowledge-bases/{id}';
};
-export type GetApiV1McpServersByIdErrors = {
+export type DeleteApiV1KnowledgeBasesByIdErrors = {
/**
* Validation Error
*/
@@ -6025,49 +6036,34 @@ export type GetApiV1McpServersByIdErrors = {
500: ApiError;
};
-export type GetApiV1McpServersByIdError = GetApiV1McpServersByIdErrors[keyof GetApiV1McpServersByIdErrors];
+export type DeleteApiV1KnowledgeBasesByIdError = DeleteApiV1KnowledgeBasesByIdErrors[keyof DeleteApiV1KnowledgeBasesByIdErrors];
-export type GetApiV1McpServersByIdResponses = {
+export type DeleteApiV1KnowledgeBasesByIdResponses = {
/**
* Successful response
*/
200: {
- data?: McpServer;
+ data?: {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1McpServersByIdResponse = GetApiV1McpServersByIdResponses[keyof GetApiV1McpServersByIdResponses];
+export type DeleteApiV1KnowledgeBasesByIdResponse = DeleteApiV1KnowledgeBasesByIdResponses[keyof DeleteApiV1KnowledgeBasesByIdResponses];
-export type PatchApiV1McpServersByIdData = {
- body: {
- credentials?: {
- token: string;
- type: 'bearer';
- } | {
- apiKey: string;
- type: 'apikey';
- } | {
- headers: {
- [key: string]: string;
- };
- type: 'header';
- } | null;
- description?: string | null;
- isEnabled?: boolean;
- name?: string;
- serverUrl?: string;
- };
+export type GetApiV1KnowledgeBasesByIdData = {
+ body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/mcp-servers/{id}';
+ url: '/api/v1/knowledge-bases/{id}';
};
-export type PatchApiV1McpServersByIdErrors = {
+export type GetApiV1KnowledgeBasesByIdErrors = {
/**
* Validation Error
*/
@@ -6102,32 +6098,36 @@ export type PatchApiV1McpServersByIdErrors = {
500: ApiError;
};
-export type PatchApiV1McpServersByIdError = PatchApiV1McpServersByIdErrors[keyof PatchApiV1McpServersByIdErrors];
+export type GetApiV1KnowledgeBasesByIdError = GetApiV1KnowledgeBasesByIdErrors[keyof GetApiV1KnowledgeBasesByIdErrors];
-export type PatchApiV1McpServersByIdResponses = {
+export type GetApiV1KnowledgeBasesByIdResponses = {
/**
* Successful response
*/
200: {
- data?: McpServer;
+ data?: KnowledgeBase;
message?: string;
success: true;
timestamp: string;
};
};
-export type PatchApiV1McpServersByIdResponse = PatchApiV1McpServersByIdResponses[keyof PatchApiV1McpServersByIdResponses];
+export type GetApiV1KnowledgeBasesByIdResponse = GetApiV1KnowledgeBasesByIdResponses[keyof GetApiV1KnowledgeBasesByIdResponses];
-export type PostApiV1McpServersByIdSyncData = {
- body?: never;
+export type PatchApiV1KnowledgeBasesByIdData = {
+ body: {
+ avatar?: string;
+ description?: string;
+ name?: string;
+ };
path: {
id: string;
};
query?: never;
- url: '/api/v1/mcp-servers/{id}/sync';
+ url: '/api/v1/knowledge-bases/{id}';
};
-export type PostApiV1McpServersByIdSyncErrors = {
+export type PatchApiV1KnowledgeBasesByIdErrors = {
/**
* Validation Error
*/
@@ -6162,36 +6162,37 @@ export type PostApiV1McpServersByIdSyncErrors = {
500: ApiError;
};
-export type PostApiV1McpServersByIdSyncError = PostApiV1McpServersByIdSyncErrors[keyof PostApiV1McpServersByIdSyncErrors];
+export type PatchApiV1KnowledgeBasesByIdError = PatchApiV1KnowledgeBasesByIdErrors[keyof PatchApiV1KnowledgeBasesByIdErrors];
-export type PostApiV1McpServersByIdSyncResponses = {
+export type PatchApiV1KnowledgeBasesByIdResponses = {
/**
* Successful response
*/
200: {
- data?: {
- id: string;
- status: 'connected';
- toolCount: number;
- };
+ data?: KnowledgeBase;
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1McpServersByIdSyncResponse = PostApiV1McpServersByIdSyncResponses[keyof PostApiV1McpServersByIdSyncResponses];
+export type PatchApiV1KnowledgeBasesByIdResponse = PatchApiV1KnowledgeBasesByIdResponses[keyof PatchApiV1KnowledgeBasesByIdResponses];
-export type DeleteApiV1MessageTranslationsByMessageIdData = {
+export type GetApiV1KnowledgeBasesByIdFilesData = {
body?: never;
path: {
- messageId: string;
+ id: string;
};
- query?: never;
- url: '/api/v1/message-translations/{messageId}';
+ query?: {
+ keyword?: string;
+ page?: string;
+ pageSize?: string;
+ fileType?: string | null;
+ };
+ url: '/api/v1/knowledge-bases/{id}/files';
};
-export type DeleteApiV1MessageTranslationsByMessageIdErrors = {
+export type GetApiV1KnowledgeBasesByIdFilesErrors = {
/**
* Validation Error
*/
@@ -6226,9 +6227,9 @@ export type DeleteApiV1MessageTranslationsByMessageIdErrors = {
500: ApiError;
};
-export type DeleteApiV1MessageTranslationsByMessageIdError = DeleteApiV1MessageTranslationsByMessageIdErrors[keyof DeleteApiV1MessageTranslationsByMessageIdErrors];
+export type GetApiV1KnowledgeBasesByIdFilesError = GetApiV1KnowledgeBasesByIdFilesErrors[keyof GetApiV1KnowledgeBasesByIdFilesErrors];
-export type DeleteApiV1MessageTranslationsByMessageIdResponses = {
+export type GetApiV1KnowledgeBasesByIdFilesResponses = {
/**
* Successful response
*/
@@ -6242,18 +6243,20 @@ export type DeleteApiV1MessageTranslationsByMessageIdResponses = {
};
};
-export type DeleteApiV1MessageTranslationsByMessageIdResponse = DeleteApiV1MessageTranslationsByMessageIdResponses[keyof DeleteApiV1MessageTranslationsByMessageIdResponses];
+export type GetApiV1KnowledgeBasesByIdFilesResponse = GetApiV1KnowledgeBasesByIdFilesResponses[keyof GetApiV1KnowledgeBasesByIdFilesResponses];
-export type GetApiV1MessageTranslationsByMessageIdData = {
- body?: never;
+export type DeleteApiV1KnowledgeBasesByIdFilesBatchData = {
+ body: {
+ fileIds: Array<string>;
+ };
path: {
- messageId: string;
+ id: string;
};
query?: never;
- url: '/api/v1/message-translations/{messageId}';
+ url: '/api/v1/knowledge-bases/{id}/files/batch';
};
-export type GetApiV1MessageTranslationsByMessageIdErrors = {
+export type DeleteApiV1KnowledgeBasesByIdFilesBatchErrors = {
/**
* Validation Error
*/
@@ -6288,40 +6291,36 @@ export type GetApiV1MessageTranslationsByMessageIdErrors = {
500: ApiError;
};
-export type GetApiV1MessageTranslationsByMessageIdError = GetApiV1MessageTranslationsByMessageIdErrors[keyof GetApiV1MessageTranslationsByMessageIdErrors];
+export type DeleteApiV1KnowledgeBasesByIdFilesBatchError = DeleteApiV1KnowledgeBasesByIdFilesBatchErrors[keyof DeleteApiV1KnowledgeBasesByIdFilesBatchErrors];
-export type GetApiV1MessageTranslationsByMessageIdResponses = {
+export type DeleteApiV1KnowledgeBasesByIdFilesBatchResponses = {
/**
* Successful response
*/
200: {
data?: {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1MessageTranslationsByMessageIdResponse = GetApiV1MessageTranslationsByMessageIdResponses[keyof GetApiV1MessageTranslationsByMessageIdResponses];
+export type DeleteApiV1KnowledgeBasesByIdFilesBatchResponse = DeleteApiV1KnowledgeBasesByIdFilesBatchResponses[keyof DeleteApiV1KnowledgeBasesByIdFilesBatchResponses];
-export type PatchApiV1MessageTranslationsByMessageIdData = {
+export type PostApiV1KnowledgeBasesByIdFilesBatchData = {
body: {
- from?: string;
- model?: string | null;
- provider?: string | null;
- to: string;
- content?: string;
+ fileIds: Array<string>;
};
path: {
- messageId: string;
+ id: string;
};
query?: never;
- url: '/api/v1/message-translations/{messageId}';
+ url: '/api/v1/knowledge-bases/{id}/files/batch';
};
-export type PatchApiV1MessageTranslationsByMessageIdErrors = {
+export type PostApiV1KnowledgeBasesByIdFilesBatchErrors = {
/**
* Validation Error
*/
@@ -6356,9 +6355,9 @@ export type PatchApiV1MessageTranslationsByMessageIdErrors = {
500: ApiError;
};
-export type PatchApiV1MessageTranslationsByMessageIdError = PatchApiV1MessageTranslationsByMessageIdErrors[keyof PatchApiV1MessageTranslationsByMessageIdErrors];
+export type PostApiV1KnowledgeBasesByIdFilesBatchError = PostApiV1KnowledgeBasesByIdFilesBatchErrors[keyof PostApiV1KnowledgeBasesByIdFilesBatchErrors];
-export type PatchApiV1MessageTranslationsByMessageIdResponses = {
+export type PostApiV1KnowledgeBasesByIdFilesBatchResponses = {
/**
* Successful response
*/
@@ -6372,23 +6371,21 @@ export type PatchApiV1MessageTranslationsByMessageIdResponses = {
};
};
-export type PatchApiV1MessageTranslationsByMessageIdResponse = PatchApiV1MessageTranslationsByMessageIdResponses[keyof PatchApiV1MessageTranslationsByMessageIdResponses];
+export type PostApiV1KnowledgeBasesByIdFilesBatchResponse = PostApiV1KnowledgeBasesByIdFilesBatchResponses[keyof PostApiV1KnowledgeBasesByIdFilesBatchResponses];
-export type PostApiV1MessageTranslationsByMessageIdData = {
+export type PostApiV1KnowledgeBasesByIdFilesMoveData = {
body: {
- from?: string;
- model?: string | null;
- provider?: string | null;
- to: string;
+ fileIds: Array<string>;
+ targetKnowledgeBaseId: string;
};
path: {
- messageId: string;
+ id: string;
};
query?: never;
- url: '/api/v1/message-translations/{messageId}';
+ url: '/api/v1/knowledge-bases/{id}/files/move';
};
-export type PostApiV1MessageTranslationsByMessageIdErrors = {
+export type PostApiV1KnowledgeBasesByIdFilesMoveErrors = {
/**
* Validation Error
*/
@@ -6423,9 +6420,9 @@ export type PostApiV1MessageTranslationsByMessageIdErrors = {
500: ApiError;
};
-export type PostApiV1MessageTranslationsByMessageIdError = PostApiV1MessageTranslationsByMessageIdErrors[keyof PostApiV1MessageTranslationsByMessageIdErrors];
+export type PostApiV1KnowledgeBasesByIdFilesMoveError = PostApiV1KnowledgeBasesByIdFilesMoveErrors[keyof PostApiV1KnowledgeBasesByIdFilesMoveErrors];
-export type PostApiV1MessageTranslationsByMessageIdResponses = {
+export type PostApiV1KnowledgeBasesByIdFilesMoveResponses = {
/**
* Successful response
*/
@@ -6439,29 +6436,20 @@ export type PostApiV1MessageTranslationsByMessageIdResponses = {
};
};
-export type PostApiV1MessageTranslationsByMessageIdResponse = PostApiV1MessageTranslationsByMessageIdResponses[keyof PostApiV1MessageTranslationsByMessageIdResponses];
+export type PostApiV1KnowledgeBasesByIdFilesMoveResponse = PostApiV1KnowledgeBasesByIdFilesMoveResponses[keyof PostApiV1KnowledgeBasesByIdFilesMoveResponses];
-export type GetApiV1MessagesCountData = {
+export type GetApiV1McpServersData = {
body?: never;
path?: never;
- query?: {
- topicId?: string;
- threadId?: string;
- topicIds?: string | null;
- userId?: string | null;
- };
- url: '/api/v1/messages/count';
+ query?: never;
+ url: '/api/v1/mcp-servers';
};
-export type GetApiV1MessagesCountErrors = {
+export type GetApiV1McpServersErrors = {
/**
- * Validation Error
+ * Invalid request
*/
- 400: {
- success: false;
- error: Array<unknown>;
- data: unknown;
- };
+ 400: ApiError;
/**
* Authentication required
*/
@@ -6488,34 +6476,48 @@ export type GetApiV1MessagesCountErrors = {
500: ApiError;
};
-export type GetApiV1MessagesCountError = GetApiV1MessagesCountErrors[keyof GetApiV1MessagesCountErrors];
+export type GetApiV1McpServersError = GetApiV1McpServersErrors[keyof GetApiV1McpServersErrors];
-export type GetApiV1MessagesCountResponses = {
+export type GetApiV1McpServersResponses = {
/**
* Successful response
*/
200: {
- data?: {
- count: number;
- };
+ data?: Array<McpServer>;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1MessagesCountResponse = GetApiV1MessagesCountResponses[keyof GetApiV1MessagesCountResponses];
+export type GetApiV1McpServersResponse = GetApiV1McpServersResponses[keyof GetApiV1McpServersResponses];
-export type DeleteApiV1MessagesData = {
+export type PostApiV1McpServersData = {
body: {
- messageIds: Array<string>;
+ credentials?: {
+ token: string;
+ type: 'bearer';
+ } | {
+ apiKey: string;
+ type: 'apikey';
+ } | {
+ headers: {
+ [key: string]: string;
+ };
+ type: 'header';
+ };
+ description?: string;
+ identifier: string;
+ isEnabled?: boolean;
+ name: string;
+ serverUrl: string;
};
path?: never;
query?: never;
- url: '/api/v1/messages';
+ url: '/api/v1/mcp-servers';
};
-export type DeleteApiV1MessagesErrors = {
+export type PostApiV1McpServersErrors = {
/**
* Validation Error
*/
@@ -6550,42 +6552,32 @@ export type DeleteApiV1MessagesErrors = {
500: ApiError;
};
-export type DeleteApiV1MessagesError = DeleteApiV1MessagesErrors[keyof DeleteApiV1MessagesErrors];
+export type PostApiV1McpServersError = PostApiV1McpServersErrors[keyof PostApiV1McpServersErrors];
-export type DeleteApiV1MessagesResponses = {
+export type PostApiV1McpServersResponses = {
/**
* Successful response
*/
- 200: {
- data?: {
- [key: string]: unknown;
- } | null;
+ 201: {
+ data?: McpServer;
message?: string;
success: true;
timestamp: string;
};
};
-export type DeleteApiV1MessagesResponse = DeleteApiV1MessagesResponses[keyof DeleteApiV1MessagesResponses];
+export type PostApiV1McpServersResponse = PostApiV1McpServersResponses[keyof PostApiV1McpServersResponses];
-export type GetApiV1MessagesData = {
+export type DeleteApiV1McpServersByIdData = {
body?: never;
- path?: never;
- query?: {
- threadId?: string;
- topicId?: string | null;
- userId?: string | null;
- role?: 'user' | 'system' | 'assistant' | 'tool' | null;
- keyword?: string;
- page?: number;
- pageSize?: number;
- limit?: number;
- offset?: number;
+ path: {
+ id: string;
};
- url: '/api/v1/messages';
+ query?: never;
+ url: '/api/v1/mcp-servers/{id}';
};
-export type GetApiV1MessagesErrors = {
+export type DeleteApiV1McpServersByIdErrors = {
/**
* Validation Error
*/
@@ -6620,53 +6612,34 @@ export type GetApiV1MessagesErrors = {
500: ApiError;
};
-export type GetApiV1MessagesError = GetApiV1MessagesErrors[keyof GetApiV1MessagesErrors];
+export type DeleteApiV1McpServersByIdError = DeleteApiV1McpServersByIdErrors[keyof DeleteApiV1McpServersByIdErrors];
-export type GetApiV1MessagesResponses = {
+export type DeleteApiV1McpServersByIdResponses = {
/**
* Successful response
*/
200: {
data?: {
- messages: Array<Message>;
- total?: number;
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1MessagesResponse = GetApiV1MessagesResponses[keyof GetApiV1MessagesResponses];
+export type DeleteApiV1McpServersByIdResponse = DeleteApiV1McpServersByIdResponses[keyof DeleteApiV1McpServersByIdResponses];
-export type PostApiV1MessagesData = {
- body: {
- content: string;
- role: 'user' | 'system' | 'assistant' | 'tool';
- model?: string | null;
- provider?: string | null;
- topicId?: string | null;
- threadId?: string | null;
- parentId?: string | null;
- quotaId?: string | null;
- agentId?: string | null;
- clientId?: string | null;
- metadata?: unknown | null;
- reasoning?: unknown | null;
- search?: unknown | null;
- tools?: unknown | null;
- traceId?: string | null;
- observationId?: string | null;
- files?: Array<string> | null;
- favorite?: boolean | null;
+export type GetApiV1McpServersByIdData = {
+ body?: never;
+ path: {
+ id: string;
};
- path?: never;
query?: never;
- url: '/api/v1/messages';
+ url: '/api/v1/mcp-servers/{id}';
};
-export type PostApiV1MessagesErrors = {
+export type GetApiV1McpServersByIdErrors = {
/**
* Validation Error
*/
@@ -6701,32 +6674,49 @@ export type PostApiV1MessagesErrors = {
500: ApiError;
};
-export type PostApiV1MessagesError = PostApiV1MessagesErrors[keyof PostApiV1MessagesErrors];
+export type GetApiV1McpServersByIdError = GetApiV1McpServersByIdErrors[keyof GetApiV1McpServersByIdErrors];
-export type PostApiV1MessagesResponses = {
+export type GetApiV1McpServersByIdResponses = {
/**
* Successful response
*/
200: {
- data?: Message;
+ data?: McpServer;
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1MessagesResponse = PostApiV1MessagesResponses[keyof PostApiV1MessagesResponses];
+export type GetApiV1McpServersByIdResponse = GetApiV1McpServersByIdResponses[keyof GetApiV1McpServersByIdResponses];
-export type DeleteApiV1MessagesByIdData = {
- body?: never;
+export type PatchApiV1McpServersByIdData = {
+ body: {
+ credentials?: {
+ token: string;
+ type: 'bearer';
+ } | {
+ apiKey: string;
+ type: 'apikey';
+ } | {
+ headers: {
+ [key: string]: string;
+ };
+ type: 'header';
+ } | null;
+ description?: string | null;
+ isEnabled?: boolean;
+ name?: string;
+ serverUrl?: string;
+ };
path: {
id: string;
};
query?: never;
- url: '/api/v1/messages/{id}';
+ url: '/api/v1/mcp-servers/{id}';
};
-export type DeleteApiV1MessagesByIdErrors = {
+export type PatchApiV1McpServersByIdErrors = {
/**
* Validation Error
*/
@@ -6761,34 +6751,32 @@ export type DeleteApiV1MessagesByIdErrors = {
500: ApiError;
};
-export type DeleteApiV1MessagesByIdError = DeleteApiV1MessagesByIdErrors[keyof DeleteApiV1MessagesByIdErrors];
+export type PatchApiV1McpServersByIdError = PatchApiV1McpServersByIdErrors[keyof PatchApiV1McpServersByIdErrors];
-export type DeleteApiV1MessagesByIdResponses = {
+export type PatchApiV1McpServersByIdResponses = {
/**
* Successful response
*/
200: {
- data?: {
- [key: string]: unknown;
- } | null;
+ data?: McpServer;
message?: string;
success: true;
timestamp: string;
};
};
-export type DeleteApiV1MessagesByIdResponse = DeleteApiV1MessagesByIdResponses[keyof DeleteApiV1MessagesByIdResponses];
+export type PatchApiV1McpServersByIdResponse = PatchApiV1McpServersByIdResponses[keyof PatchApiV1McpServersByIdResponses];
-export type GetApiV1MessagesByIdData = {
+export type PostApiV1McpServersByIdSyncData = {
body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/messages/{id}';
+ url: '/api/v1/mcp-servers/{id}/sync';
};
-export type GetApiV1MessagesByIdErrors = {
+export type PostApiV1McpServersByIdSyncErrors = {
/**
* Validation Error
*/
@@ -6823,57 +6811,38 @@ export type GetApiV1MessagesByIdErrors = {
500: ApiError;
};
-export type GetApiV1MessagesByIdError = GetApiV1MessagesByIdErrors[keyof GetApiV1MessagesByIdErrors];
+export type PostApiV1McpServersByIdSyncError = PostApiV1McpServersByIdSyncErrors[keyof PostApiV1McpServersByIdSyncErrors];
-export type GetApiV1MessagesByIdResponses = {
+export type PostApiV1McpServersByIdSyncResponses = {
/**
* Successful response
*/
200: {
- data?: Message;
+ data?: {
+ id: string;
+ status: 'connected';
+ toolCount: number;
+ };
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1MessagesByIdResponse = GetApiV1MessagesByIdResponses[keyof GetApiV1MessagesByIdResponses];
+export type PostApiV1McpServersByIdSyncResponse = PostApiV1McpServersByIdSyncResponses[keyof PostApiV1McpServersByIdSyncResponses];
-export type PostApiV1MessagesRepliesData = {
- body: {
- content: string;
- role: 'user';
- model?: string | null;
- provider?: string | null;
- topicId?: string | null;
- threadId?: string | null;
- parentId?: string | null;
- quotaId?: string | null;
- agentId?: string | null;
- clientId?: string | null;
- metadata?: unknown | null;
- reasoning?: unknown | null;
- search?: unknown | null;
- tools?: unknown | null;
- traceId?: string | null;
- observationId?: string | null;
- files?: Array<string> | null;
- favorite?: boolean | null;
- };
+export type GetApiV1MemoriesPersonaData = {
+ body?: never;
path?: never;
query?: never;
- url: '/api/v1/messages/replies';
+ url: '/api/v1/memories/persona';
};
-export type PostApiV1MessagesRepliesErrors = {
+export type GetApiV1MemoriesPersonaErrors = {
/**
- * Validation Error
+ * Invalid request
*/
- 400: {
- success: false;
- error: Array<unknown>;
- data: unknown;
- };
+ 400: ApiError;
/**
* Authentication required
*/
@@ -6900,45 +6869,36 @@ export type PostApiV1MessagesRepliesErrors = {
500: ApiError;
};
-export type PostApiV1MessagesRepliesError = PostApiV1MessagesRepliesErrors[keyof PostApiV1MessagesRepliesErrors];
+export type GetApiV1MemoriesPersonaError = GetApiV1MemoriesPersonaErrors[keyof GetApiV1MemoriesPersonaErrors];
-export type PostApiV1MessagesRepliesResponses = {
+export type GetApiV1MemoriesPersonaResponses = {
/**
* Successful response
*/
200: {
- data?: Message | null;
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1MessagesRepliesResponse = PostApiV1MessagesRepliesResponses[keyof PostApiV1MessagesRepliesResponses];
+export type GetApiV1MemoriesPersonaResponse = GetApiV1MemoriesPersonaResponses[keyof GetApiV1MemoriesPersonaResponses];
-export type GetApiV1ModelsData = {
+export type GetApiV1MemoriesPersonaVersionsData = {
body?: never;
path?: never;
- query?: {
- keyword?: string;
- page?: string;
- pageSize?: string;
- enabled?: string | null;
- provider?: string | null;
- type?: 'chat' | 'embedding' | 'tts' | 'asr' | 'image' | 'text2video' | 'text2music' | 'realtime' | 'stt' | null;
- };
- url: '/api/v1/models';
+ query?: never;
+ url: '/api/v1/memories/persona/versions';
};
-export type GetApiV1ModelsErrors = {
+export type GetApiV1MemoriesPersonaVersionsErrors = {
/**
- * Validation Error
+ * Invalid request
*/
- 400: {
- success: false;
- error: Array<unknown>;
- data: unknown;
- };
+ 400: ApiError;
/**
* Authentication required
*/
@@ -6965,66 +6925,36 @@ export type GetApiV1ModelsErrors = {
500: ApiError;
};
-export type GetApiV1ModelsError = GetApiV1ModelsErrors[keyof GetApiV1ModelsErrors];
+export type GetApiV1MemoriesPersonaVersionsError = GetApiV1MemoriesPersonaVersionsErrors[keyof GetApiV1MemoriesPersonaVersionsErrors];
-export type GetApiV1ModelsResponses = {
+export type GetApiV1MemoriesPersonaVersionsResponses = {
/**
* Successful response
*/
200: {
- data?: {
- models: Array<Model>;
- total?: number;
+ data?: Array<unknown> | {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1ModelsResponse = GetApiV1ModelsResponses[keyof GetApiV1ModelsResponses];
+export type GetApiV1MemoriesPersonaVersionsResponse = GetApiV1MemoriesPersonaVersionsResponses[keyof GetApiV1MemoriesPersonaVersionsResponses];
-export type PostApiV1ModelsData = {
- body: {
- abilities?: {
- [key: string]: unknown;
- } | null;
- config?: {
- [key: string]: unknown;
- } | null;
- contextWindowTokens?: number | null;
- description?: string | null;
- displayName: string;
- enabled?: boolean | null;
- organization?: string | null;
- parameters?: {
- [key: string]: unknown;
- } | null;
- pricing?: {
- [key: string]: unknown;
- } | null;
- releasedAt?: string | null;
- sort?: number | null;
- source?: 'remote' | 'custom' | 'builtin' | null;
- type?: 'chat' | 'embedding' | 'tts' | 'asr' | 'image' | 'text2video' | 'text2music' | 'realtime' | 'stt' | null;
- id: string;
- providerId: string;
- };
+export type DeleteApiV1MemoriesData = {
+ body?: never;
path?: never;
query?: never;
- url: '/api/v1/models';
+ url: '/api/v1/memories';
};
-export type PostApiV1ModelsErrors = {
+export type DeleteApiV1MemoriesErrors = {
/**
- * Validation Error
+ * Invalid request
*/
- 400: {
- success: false;
- error: Array<unknown>;
- data: unknown;
- };
+ 400: ApiError;
/**
* Authentication required
*/
@@ -7051,33 +6981,35 @@ export type PostApiV1ModelsErrors = {
500: ApiError;
};
-export type PostApiV1ModelsError = PostApiV1ModelsErrors[keyof PostApiV1ModelsErrors];
+export type DeleteApiV1MemoriesError = DeleteApiV1MemoriesErrors[keyof DeleteApiV1MemoriesErrors];
-export type PostApiV1ModelsResponses = {
+export type DeleteApiV1MemoriesResponses = {
/**
* Successful response
*/
200: {
- data?: Model;
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1ModelsResponse = PostApiV1ModelsResponses[keyof PostApiV1ModelsResponses];
+export type DeleteApiV1MemoriesResponse = DeleteApiV1MemoriesResponses[keyof DeleteApiV1MemoriesResponses];
-export type GetApiV1ModelsByProviderIdByModelIdData = {
+export type DeleteApiV1MemoriesByCategoryByIdData = {
body?: never;
path: {
- modelId: string;
- providerId: string;
+ category: 'identities' | 'preferences' | 'contexts' | 'activities' | 'experiences';
+ id: string;
};
query?: never;
- url: '/api/v1/models/{providerId}/{modelId}';
+ url: '/api/v1/memories/{category}/{id}';
};
-export type GetApiV1ModelsByProviderIdByModelIdErrors = {
+export type DeleteApiV1MemoriesByCategoryByIdErrors = {
/**
* Validation Error
*/
@@ -7112,57 +7044,34 @@ export type GetApiV1ModelsByProviderIdByModelIdErrors = {
500: ApiError;
};
-export type GetApiV1ModelsByProviderIdByModelIdError = GetApiV1ModelsByProviderIdByModelIdErrors[keyof GetApiV1ModelsByProviderIdByModelIdErrors];
+export type DeleteApiV1MemoriesByCategoryByIdError = DeleteApiV1MemoriesByCategoryByIdErrors[keyof DeleteApiV1MemoriesByCategoryByIdErrors];
-export type GetApiV1ModelsByProviderIdByModelIdResponses = {
+export type DeleteApiV1MemoriesByCategoryByIdResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1ModelsByProviderIdByModelIdResponse = GetApiV1ModelsByProviderIdByModelIdResponses[keyof GetApiV1ModelsByProviderIdByModelIdResponses];
+export type DeleteApiV1MemoriesByCategoryByIdResponse = DeleteApiV1MemoriesByCategoryByIdResponses[keyof DeleteApiV1MemoriesByCategoryByIdResponses];
-export type PatchApiV1ModelsByProviderIdByModelIdData = {
- body: {
- abilities?: {
- [key: string]: unknown;
- } | null;
- config?: {
- [key: string]: unknown;
- } | null;
- contextWindowTokens?: number | null;
- description?: string | null;
- displayName?: string;
- enabled?: boolean | null;
- organization?: string | null;
- parameters?: {
- [key: string]: unknown;
- } | null;
- pricing?: {
- [key: string]: unknown;
- } | null;
- releasedAt?: string | null;
- sort?: number | null;
- source?: 'remote' | 'custom' | 'builtin' | null;
- type?: 'chat' | 'embedding' | 'tts' | 'asr' | 'image' | 'text2video' | 'text2music' | 'realtime' | 'stt' | null;
- };
+export type GetApiV1MemoriesByCategoryData = {
+ body?: never;
path: {
- modelId: string;
- providerId: string;
+ category: 'identities' | 'preferences' | 'contexts' | 'activities' | 'experiences';
};
query?: never;
- url: '/api/v1/models/{providerId}/{modelId}';
+ url: '/api/v1/memories/{category}';
};
-export type PatchApiV1ModelsByProviderIdByModelIdErrors = {
+export type GetApiV1MemoriesByCategoryErrors = {
/**
* Validation Error
*/
@@ -7197,38 +7106,34 @@ export type PatchApiV1ModelsByProviderIdByModelIdErrors = {
500: ApiError;
};
-export type PatchApiV1ModelsByProviderIdByModelIdError = PatchApiV1ModelsByProviderIdByModelIdErrors[keyof PatchApiV1ModelsByProviderIdByModelIdErrors];
+export type GetApiV1MemoriesByCategoryError = GetApiV1MemoriesByCategoryErrors[keyof GetApiV1MemoriesByCategoryErrors];
-export type PatchApiV1ModelsByProviderIdByModelIdResponses = {
+export type GetApiV1MemoriesByCategoryResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PatchApiV1ModelsByProviderIdByModelIdResponse = PatchApiV1ModelsByProviderIdByModelIdResponses[keyof PatchApiV1ModelsByProviderIdByModelIdResponses];
+export type GetApiV1MemoriesByCategoryResponse = GetApiV1MemoriesByCategoryResponses[keyof GetApiV1MemoriesByCategoryResponses];
-export type GetApiV1PermissionsData = {
+export type DeleteApiV1MessageTranslationsByMessageIdData = {
body?: never;
- path?: never;
- query?: {
- active?: string | null;
- category?: string | null;
- keyword?: string;
- page?: string;
- pageSize?: string;
+ path: {
+ messageId: string;
};
- url: '/api/v1/permissions';
+ query?: never;
+ url: '/api/v1/message-translations/{messageId}';
};
-export type GetApiV1PermissionsErrors = {
+export type DeleteApiV1MessageTranslationsByMessageIdErrors = {
/**
* Validation Error
*/
@@ -7263,16 +7168,14 @@ export type GetApiV1PermissionsErrors = {
500: ApiError;
};
-export type GetApiV1PermissionsError = GetApiV1PermissionsErrors[keyof GetApiV1PermissionsErrors];
+export type DeleteApiV1MessageTranslationsByMessageIdError = DeleteApiV1MessageTranslationsByMessageIdErrors[keyof DeleteApiV1MessageTranslationsByMessageIdErrors];
-export type GetApiV1PermissionsResponses = {
+export type DeleteApiV1MessageTranslationsByMessageIdResponses = {
/**
* Successful response
*/
200: {
data?: {
- permissions: Array<Permission>;
- total?: number;
[key: string]: unknown;
};
message?: string;
@@ -7281,22 +7184,18 @@ export type GetApiV1PermissionsResponses = {
};
};
-export type GetApiV1PermissionsResponse = GetApiV1PermissionsResponses[keyof GetApiV1PermissionsResponses];
+export type DeleteApiV1MessageTranslationsByMessageIdResponse = DeleteApiV1MessageTranslationsByMessageIdResponses[keyof DeleteApiV1MessageTranslationsByMessageIdResponses];
-export type PostApiV1PermissionsData = {
- body: {
- category: string;
- code: string;
- description?: string | null;
- isActive?: boolean | null;
- name: string;
+export type GetApiV1MessageTranslationsByMessageIdData = {
+ body?: never;
+ path: {
+ messageId: string;
};
- path?: never;
query?: never;
- url: '/api/v1/permissions';
+ url: '/api/v1/message-translations/{messageId}';
};
-export type PostApiV1PermissionsErrors = {
+export type GetApiV1MessageTranslationsByMessageIdErrors = {
/**
* Validation Error
*/
@@ -7331,32 +7230,40 @@ export type PostApiV1PermissionsErrors = {
500: ApiError;
};
-export type PostApiV1PermissionsError = PostApiV1PermissionsErrors[keyof PostApiV1PermissionsErrors];
+export type GetApiV1MessageTranslationsByMessageIdError = GetApiV1MessageTranslationsByMessageIdErrors[keyof GetApiV1MessageTranslationsByMessageIdErrors];
-export type PostApiV1PermissionsResponses = {
+export type GetApiV1MessageTranslationsByMessageIdResponses = {
/**
* Successful response
*/
200: {
- data?: Permission;
+ data?: {
+ [key: string]: unknown;
+ };
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1PermissionsResponse = PostApiV1PermissionsResponses[keyof PostApiV1PermissionsResponses];
+export type GetApiV1MessageTranslationsByMessageIdResponse = GetApiV1MessageTranslationsByMessageIdResponses[keyof GetApiV1MessageTranslationsByMessageIdResponses];
-export type DeleteApiV1PermissionsByIdData = {
- body?: never;
+export type PatchApiV1MessageTranslationsByMessageIdData = {
+ body: {
+ from?: string;
+ model?: string | null;
+ provider?: string | null;
+ to: string;
+ content?: string;
+ };
path: {
- id: string;
+ messageId: string;
};
query?: never;
- url: '/api/v1/permissions/{id}';
+ url: '/api/v1/message-translations/{messageId}';
};
-export type DeleteApiV1PermissionsByIdErrors = {
+export type PatchApiV1MessageTranslationsByMessageIdErrors = {
/**
* Validation Error
*/
@@ -7391,34 +7298,39 @@ export type DeleteApiV1PermissionsByIdErrors = {
500: ApiError;
};
-export type DeleteApiV1PermissionsByIdError = DeleteApiV1PermissionsByIdErrors[keyof DeleteApiV1PermissionsByIdErrors];
+export type PatchApiV1MessageTranslationsByMessageIdError = PatchApiV1MessageTranslationsByMessageIdErrors[keyof PatchApiV1MessageTranslationsByMessageIdErrors];
-export type DeleteApiV1PermissionsByIdResponses = {
+export type PatchApiV1MessageTranslationsByMessageIdResponses = {
/**
* Successful response
*/
200: {
data?: {
[key: string]: unknown;
- } | null;
+ };
message?: string;
success: true;
timestamp: string;
};
};
-export type DeleteApiV1PermissionsByIdResponse = DeleteApiV1PermissionsByIdResponses[keyof DeleteApiV1PermissionsByIdResponses];
+export type PatchApiV1MessageTranslationsByMessageIdResponse = PatchApiV1MessageTranslationsByMessageIdResponses[keyof PatchApiV1MessageTranslationsByMessageIdResponses];
-export type GetApiV1PermissionsByIdData = {
- body?: never;
+export type PostApiV1MessageTranslationsByMessageIdData = {
+ body: {
+ from?: string;
+ model?: string | null;
+ provider?: string | null;
+ to: string;
+ };
path: {
- id: string;
+ messageId: string;
};
query?: never;
- url: '/api/v1/permissions/{id}';
+ url: '/api/v1/message-translations/{messageId}';
};
-export type GetApiV1PermissionsByIdErrors = {
+export type PostApiV1MessageTranslationsByMessageIdErrors = {
/**
* Validation Error
*/
@@ -7453,38 +7365,99 @@ export type GetApiV1PermissionsByIdErrors = {
500: ApiError;
};
-export type GetApiV1PermissionsByIdError = GetApiV1PermissionsByIdErrors[keyof GetApiV1PermissionsByIdErrors];
+export type PostApiV1MessageTranslationsByMessageIdError = PostApiV1MessageTranslationsByMessageIdErrors[keyof PostApiV1MessageTranslationsByMessageIdErrors];
-export type GetApiV1PermissionsByIdResponses = {
+export type PostApiV1MessageTranslationsByMessageIdResponses = {
/**
* Successful response
*/
200: {
- data?: Permission;
+ data?: {
+ [key: string]: unknown;
+ };
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1PermissionsByIdResponse = GetApiV1PermissionsByIdResponses[keyof GetApiV1PermissionsByIdResponses];
+export type PostApiV1MessageTranslationsByMessageIdResponse = PostApiV1MessageTranslationsByMessageIdResponses[keyof PostApiV1MessageTranslationsByMessageIdResponses];
-export type PatchApiV1PermissionsByIdData = {
- body: {
- category?: string;
- code?: string;
- description?: string | null;
- isActive?: boolean | null;
- name?: string;
+export type GetApiV1MessagesCountData = {
+ body?: never;
+ path?: never;
+ query?: {
+ topicId?: string;
+ threadId?: string;
+ topicIds?: string | null;
+ userId?: string | null;
};
- path: {
- id: string;
+ url: '/api/v1/messages/count';
+};
+
+export type GetApiV1MessagesCountErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1MessagesCountError = GetApiV1MessagesCountErrors[keyof GetApiV1MessagesCountErrors];
+
+export type GetApiV1MessagesCountResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ count: number;
+ };
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1MessagesCountResponse = GetApiV1MessagesCountResponses[keyof GetApiV1MessagesCountResponses];
+
+export type DeleteApiV1MessagesData = {
+ body: {
+ messageIds: Array<string>;
};
+ path?: never;
query?: never;
- url: '/api/v1/permissions/{id}';
+ url: '/api/v1/messages';
};
-export type PatchApiV1PermissionsByIdErrors = {
+export type DeleteApiV1MessagesErrors = {
/**
* Validation Error
*/
@@ -7519,35 +7492,42 @@ export type PatchApiV1PermissionsByIdErrors = {
500: ApiError;
};
-export type PatchApiV1PermissionsByIdError = PatchApiV1PermissionsByIdErrors[keyof PatchApiV1PermissionsByIdErrors];
+export type DeleteApiV1MessagesError = DeleteApiV1MessagesErrors[keyof DeleteApiV1MessagesErrors];
-export type PatchApiV1PermissionsByIdResponses = {
+export type DeleteApiV1MessagesResponses = {
/**
* Successful response
*/
200: {
- data?: Permission;
+ data?: {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PatchApiV1PermissionsByIdResponse = PatchApiV1PermissionsByIdResponses[keyof PatchApiV1PermissionsByIdResponses];
+export type DeleteApiV1MessagesResponse = DeleteApiV1MessagesResponses[keyof DeleteApiV1MessagesResponses];
-export type GetApiV1ProvidersData = {
+export type GetApiV1MessagesData = {
body?: never;
path?: never;
query?: {
+ threadId?: string;
+ topicId?: string | null;
+ userId?: string | null;
+ role?: 'user' | 'system' | 'assistant' | 'tool' | null;
keyword?: string;
- page?: string;
- pageSize?: string;
- enabled?: boolean;
+ page?: number;
+ pageSize?: number;
+ limit?: number;
+ offset?: number;
};
- url: '/api/v1/providers';
+ url: '/api/v1/messages';
};
-export type GetApiV1ProvidersErrors = {
+export type GetApiV1MessagesErrors = {
/**
* Validation Error
*/
@@ -7582,15 +7562,15 @@ export type GetApiV1ProvidersErrors = {
500: ApiError;
};
-export type GetApiV1ProvidersError = GetApiV1ProvidersErrors[keyof GetApiV1ProvidersErrors];
+export type GetApiV1MessagesError = GetApiV1MessagesErrors[keyof GetApiV1MessagesErrors];
-export type GetApiV1ProvidersResponses = {
+export type GetApiV1MessagesResponses = {
/**
* Successful response
*/
200: {
data?: {
- providers: Array<Provider>;
+ messages: Array<Message>;
total?: number;
[key: string]: unknown;
};
@@ -7600,35 +7580,35 @@ export type GetApiV1ProvidersResponses = {
};
};
-export type GetApiV1ProvidersResponse = GetApiV1ProvidersResponses[keyof GetApiV1ProvidersResponses];
+export type GetApiV1MessagesResponse = GetApiV1MessagesResponses[keyof GetApiV1MessagesResponses];
-export type PostApiV1ProvidersData = {
+export type PostApiV1MessagesData = {
body: {
- checkModel?: string | null;
- config?: {
- [key: string]: unknown;
- };
- description?: string | null;
- enabled?: boolean;
- fetchOnClient?: boolean | null;
- keyVaults?: {
- [key: string]: string;
- };
- logo?: string | null;
- name?: string | null;
- settings?: {
- [key: string]: unknown;
- };
- sort?: number | null;
- source?: 'builtin' | 'custom';
- id: string;
+ content: string;
+ role: 'user' | 'system' | 'assistant' | 'tool';
+ model?: string | null;
+ provider?: string | null;
+ topicId?: string | null;
+ threadId?: string | null;
+ parentId?: string | null;
+ quotaId?: string | null;
+ agentId?: string | null;
+ clientId?: string | null;
+ metadata?: unknown | null;
+ reasoning?: unknown | null;
+ search?: unknown | null;
+ tools?: unknown | null;
+ traceId?: string | null;
+ observationId?: string | null;
+ files?: Array<string> | null;
+ favorite?: boolean | null;
};
path?: never;
query?: never;
- url: '/api/v1/providers';
+ url: '/api/v1/messages';
};
-export type PostApiV1ProvidersErrors = {
+export type PostApiV1MessagesErrors = {
/**
* Validation Error
*/
@@ -7663,32 +7643,32 @@ export type PostApiV1ProvidersErrors = {
500: ApiError;
};
-export type PostApiV1ProvidersError = PostApiV1ProvidersErrors[keyof PostApiV1ProvidersErrors];
+export type PostApiV1MessagesError = PostApiV1MessagesErrors[keyof PostApiV1MessagesErrors];
-export type PostApiV1ProvidersResponses = {
+export type PostApiV1MessagesResponses = {
/**
* Successful response
*/
200: {
- data?: Provider;
+ data?: Message;
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1ProvidersResponse = PostApiV1ProvidersResponses[keyof PostApiV1ProvidersResponses];
+export type PostApiV1MessagesResponse = PostApiV1MessagesResponses[keyof PostApiV1MessagesResponses];
-export type DeleteApiV1ProvidersByIdData = {
+export type DeleteApiV1MessagesByIdData = {
body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/providers/{id}';
+ url: '/api/v1/messages/{id}';
};
-export type DeleteApiV1ProvidersByIdErrors = {
+export type DeleteApiV1MessagesByIdErrors = {
/**
* Validation Error
*/
@@ -7723,9 +7703,9 @@ export type DeleteApiV1ProvidersByIdErrors = {
500: ApiError;
};
-export type DeleteApiV1ProvidersByIdError = DeleteApiV1ProvidersByIdErrors[keyof DeleteApiV1ProvidersByIdErrors];
+export type DeleteApiV1MessagesByIdError = DeleteApiV1MessagesByIdErrors[keyof DeleteApiV1MessagesByIdErrors];
-export type DeleteApiV1ProvidersByIdResponses = {
+export type DeleteApiV1MessagesByIdResponses = {
/**
* Successful response
*/
@@ -7739,18 +7719,18 @@ export type DeleteApiV1ProvidersByIdResponses = {
};
};
-export type DeleteApiV1ProvidersByIdResponse = DeleteApiV1ProvidersByIdResponses[keyof DeleteApiV1ProvidersByIdResponses];
+export type DeleteApiV1MessagesByIdResponse = DeleteApiV1MessagesByIdResponses[keyof DeleteApiV1MessagesByIdResponses];
-export type GetApiV1ProvidersByIdData = {
+export type GetApiV1MessagesByIdData = {
body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/providers/{id}';
+ url: '/api/v1/messages/{id}';
};
-export type GetApiV1ProvidersByIdErrors = {
+export type GetApiV1MessagesByIdErrors = {
/**
* Validation Error
*/
@@ -7785,50 +7765,2074 @@ export type GetApiV1ProvidersByIdErrors = {
500: ApiError;
};
-export type GetApiV1ProvidersByIdError = GetApiV1ProvidersByIdErrors[keyof GetApiV1ProvidersByIdErrors];
+export type GetApiV1MessagesByIdError = GetApiV1MessagesByIdErrors[keyof GetApiV1MessagesByIdErrors];
-export type GetApiV1ProvidersByIdResponses = {
+export type GetApiV1MessagesByIdResponses = {
/**
* Successful response
*/
200: {
- data?: Provider;
+ data?: Message;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1ProvidersByIdResponse = GetApiV1ProvidersByIdResponses[keyof GetApiV1ProvidersByIdResponses];
+export type GetApiV1MessagesByIdResponse = GetApiV1MessagesByIdResponses[keyof GetApiV1MessagesByIdResponses];
-export type PatchApiV1ProvidersByIdData = {
+export type PostApiV1MessagesRepliesData = {
body: {
- checkModel?: string | null;
- config?: {
- [key: string]: unknown;
- };
- description?: string | null;
- enabled?: boolean;
- fetchOnClient?: boolean | null;
- keyVaults?: {
- [key: string]: string;
- } | null;
- logo?: string | null;
- name?: string | null;
- settings?: {
+ content: string;
+ role: 'user';
+ model?: string | null;
+ provider?: string | null;
+ topicId?: string | null;
+ threadId?: string | null;
+ parentId?: string | null;
+ quotaId?: string | null;
+ agentId?: string | null;
+ clientId?: string | null;
+ metadata?: unknown | null;
+ reasoning?: unknown | null;
+ search?: unknown | null;
+ tools?: unknown | null;
+ traceId?: string | null;
+ observationId?: string | null;
+ files?: Array<string> | null;
+ favorite?: boolean | null;
+ };
+ path?: never;
+ query?: never;
+ url: '/api/v1/messages/replies';
+};
+
+export type PostApiV1MessagesRepliesErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PostApiV1MessagesRepliesError = PostApiV1MessagesRepliesErrors[keyof PostApiV1MessagesRepliesErrors];
+
+export type PostApiV1MessagesRepliesResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Message | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PostApiV1MessagesRepliesResponse = PostApiV1MessagesRepliesResponses[keyof PostApiV1MessagesRepliesResponses];
+
+export type GetApiV1ModelsData = {
+ body?: never;
+ path?: never;
+ query?: {
+ keyword?: string;
+ page?: string;
+ pageSize?: string;
+ enabled?: string | null;
+ provider?: string | null;
+ type?: 'chat' | 'embedding' | 'tts' | 'asr' | 'image' | 'text2video' | 'text2music' | 'realtime' | 'stt' | null;
+ };
+ url: '/api/v1/models';
+};
+
+export type GetApiV1ModelsErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1ModelsError = GetApiV1ModelsErrors[keyof GetApiV1ModelsErrors];
+
+export type GetApiV1ModelsResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ models: Array<Model>;
+ total?: number;
[key: string]: unknown;
};
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1ModelsResponse = GetApiV1ModelsResponses[keyof GetApiV1ModelsResponses];
+
+export type PostApiV1ModelsData = {
+ body: {
+ abilities?: {
+ [key: string]: unknown;
+ } | null;
+ config?: {
+ [key: string]: unknown;
+ } | null;
+ contextWindowTokens?: number | null;
+ description?: string | null;
+ displayName: string;
+ enabled?: boolean | null;
+ organization?: string | null;
+ parameters?: {
+ [key: string]: unknown;
+ } | null;
+ pricing?: {
+ [key: string]: unknown;
+ } | null;
+ releasedAt?: string | null;
sort?: number | null;
- source?: 'builtin' | 'custom';
+ source?: 'remote' | 'custom' | 'builtin' | null;
+ type?: 'chat' | 'embedding' | 'tts' | 'asr' | 'image' | 'text2video' | 'text2music' | 'realtime' | 'stt' | null;
+ id: string;
+ providerId: string;
+ };
+ path?: never;
+ query?: never;
+ url: '/api/v1/models';
+};
+
+export type PostApiV1ModelsErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PostApiV1ModelsError = PostApiV1ModelsErrors[keyof PostApiV1ModelsErrors];
+
+export type PostApiV1ModelsResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Model;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PostApiV1ModelsResponse = PostApiV1ModelsResponses[keyof PostApiV1ModelsResponses];
+
+export type GetApiV1ModelsByProviderIdByModelIdData = {
+ body?: never;
+ path: {
+ modelId: string;
+ providerId: string;
+ };
+ query?: never;
+ url: '/api/v1/models/{providerId}/{modelId}';
+};
+
+export type GetApiV1ModelsByProviderIdByModelIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1ModelsByProviderIdByModelIdError = GetApiV1ModelsByProviderIdByModelIdErrors[keyof GetApiV1ModelsByProviderIdByModelIdErrors];
+
+export type GetApiV1ModelsByProviderIdByModelIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ [key: string]: unknown;
+ };
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1ModelsByProviderIdByModelIdResponse = GetApiV1ModelsByProviderIdByModelIdResponses[keyof GetApiV1ModelsByProviderIdByModelIdResponses];
+
+export type PatchApiV1ModelsByProviderIdByModelIdData = {
+ body: {
+ abilities?: {
+ [key: string]: unknown;
+ } | null;
+ config?: {
+ [key: string]: unknown;
+ } | null;
+ contextWindowTokens?: number | null;
+ description?: string | null;
+ displayName?: string;
+ enabled?: boolean | null;
+ organization?: string | null;
+ parameters?: {
+ [key: string]: unknown;
+ } | null;
+ pricing?: {
+ [key: string]: unknown;
+ } | null;
+ releasedAt?: string | null;
+ sort?: number | null;
+ source?: 'remote' | 'custom' | 'builtin' | null;
+ type?: 'chat' | 'embedding' | 'tts' | 'asr' | 'image' | 'text2video' | 'text2music' | 'realtime' | 'stt' | null;
+ };
+ path: {
+ modelId: string;
+ providerId: string;
+ };
+ query?: never;
+ url: '/api/v1/models/{providerId}/{modelId}';
+};
+
+export type PatchApiV1ModelsByProviderIdByModelIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PatchApiV1ModelsByProviderIdByModelIdError = PatchApiV1ModelsByProviderIdByModelIdErrors[keyof PatchApiV1ModelsByProviderIdByModelIdErrors];
+
+export type PatchApiV1ModelsByProviderIdByModelIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ [key: string]: unknown;
+ };
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PatchApiV1ModelsByProviderIdByModelIdResponse = PatchApiV1ModelsByProviderIdByModelIdResponses[keyof PatchApiV1ModelsByProviderIdByModelIdResponses];
+
+export type GetApiV1NotificationsData = {
+ body?: never;
+ path?: never;
+ query?: {
+ category?: string;
+ cursor?: string;
+ isRead?: boolean | 'true' | 'false';
+ limit?: number;
+ unreadOnly?: boolean | 'true' | 'false';
+ };
+ url: '/api/v1/notifications';
+};
+
+export type GetApiV1NotificationsErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1NotificationsError = GetApiV1NotificationsErrors[keyof GetApiV1NotificationsErrors];
+
+export type GetApiV1NotificationsResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1NotificationsResponse = GetApiV1NotificationsResponses[keyof GetApiV1NotificationsResponses];
+
+export type GetApiV1NotificationsUnreadCountData = {
+ body?: never;
+ path?: never;
+ query?: never;
+ url: '/api/v1/notifications/unread-count';
+};
+
+export type GetApiV1NotificationsUnreadCountErrors = {
+ /**
+ * Invalid request
+ */
+ 400: ApiError;
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1NotificationsUnreadCountError = GetApiV1NotificationsUnreadCountErrors[keyof GetApiV1NotificationsUnreadCountErrors];
+
+export type GetApiV1NotificationsUnreadCountResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1NotificationsUnreadCountResponse = GetApiV1NotificationsUnreadCountResponses[keyof GetApiV1NotificationsUnreadCountResponses];
+
+export type GetApiV1NotificationsCountsData = {
+ body?: never;
+ path?: never;
+ query?: never;
+ url: '/api/v1/notifications/counts';
+};
+
+export type GetApiV1NotificationsCountsErrors = {
+ /**
+ * Invalid request
+ */
+ 400: ApiError;
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1NotificationsCountsError = GetApiV1NotificationsCountsErrors[keyof GetApiV1NotificationsCountsErrors];
+
+export type GetApiV1NotificationsCountsResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1NotificationsCountsResponse = GetApiV1NotificationsCountsResponses[keyof GetApiV1NotificationsCountsResponses];
+
+export type PostApiV1NotificationsReadData = {
+ body: {
+ ids: Array<string>;
+ };
+ path?: never;
+ query?: never;
+ url: '/api/v1/notifications/read';
+};
+
+export type PostApiV1NotificationsReadErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PostApiV1NotificationsReadError = PostApiV1NotificationsReadErrors[keyof PostApiV1NotificationsReadErrors];
+
+export type PostApiV1NotificationsReadResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PostApiV1NotificationsReadResponse = PostApiV1NotificationsReadResponses[keyof PostApiV1NotificationsReadResponses];
+
+export type PostApiV1NotificationsReadAllData = {
+ body?: never;
+ path?: never;
+ query?: never;
+ url: '/api/v1/notifications/read-all';
+};
+
+export type PostApiV1NotificationsReadAllErrors = {
+ /**
+ * Invalid request
+ */
+ 400: ApiError;
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PostApiV1NotificationsReadAllError = PostApiV1NotificationsReadAllErrors[keyof PostApiV1NotificationsReadAllErrors];
+
+export type PostApiV1NotificationsReadAllResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PostApiV1NotificationsReadAllResponse = PostApiV1NotificationsReadAllResponses[keyof PostApiV1NotificationsReadAllResponses];
+
+export type PostApiV1NotificationsArchiveAllData = {
+ body?: never;
+ path?: never;
+ query?: never;
+ url: '/api/v1/notifications/archive-all';
+};
+
+export type PostApiV1NotificationsArchiveAllErrors = {
+ /**
+ * Invalid request
+ */
+ 400: ApiError;
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PostApiV1NotificationsArchiveAllError = PostApiV1NotificationsArchiveAllErrors[keyof PostApiV1NotificationsArchiveAllErrors];
+
+export type PostApiV1NotificationsArchiveAllResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PostApiV1NotificationsArchiveAllResponse = PostApiV1NotificationsArchiveAllResponses[keyof PostApiV1NotificationsArchiveAllResponses];
+
+export type PostApiV1NotificationsByIdArchiveData = {
+ body?: never;
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/notifications/{id}/archive';
+};
+
+export type PostApiV1NotificationsByIdArchiveErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PostApiV1NotificationsByIdArchiveError = PostApiV1NotificationsByIdArchiveErrors[keyof PostApiV1NotificationsByIdArchiveErrors];
+
+export type PostApiV1NotificationsByIdArchiveResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PostApiV1NotificationsByIdArchiveResponse = PostApiV1NotificationsByIdArchiveResponses[keyof PostApiV1NotificationsByIdArchiveResponses];
+
+export type GetApiV1PermissionsData = {
+ body?: never;
+ path?: never;
+ query?: {
+ active?: string | null;
+ category?: string | null;
+ keyword?: string;
+ page?: string;
+ pageSize?: string;
+ };
+ url: '/api/v1/permissions';
+};
+
+export type GetApiV1PermissionsErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1PermissionsError = GetApiV1PermissionsErrors[keyof GetApiV1PermissionsErrors];
+
+export type GetApiV1PermissionsResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ permissions: Array<Permission>;
+ total?: number;
+ [key: string]: unknown;
+ };
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1PermissionsResponse = GetApiV1PermissionsResponses[keyof GetApiV1PermissionsResponses];
+
+export type PostApiV1PermissionsData = {
+ body: {
+ category: string;
+ code: string;
+ description?: string | null;
+ isActive?: boolean | null;
+ name: string;
+ };
+ path?: never;
+ query?: never;
+ url: '/api/v1/permissions';
+};
+
+export type PostApiV1PermissionsErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PostApiV1PermissionsError = PostApiV1PermissionsErrors[keyof PostApiV1PermissionsErrors];
+
+export type PostApiV1PermissionsResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Permission;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PostApiV1PermissionsResponse = PostApiV1PermissionsResponses[keyof PostApiV1PermissionsResponses];
+
+export type DeleteApiV1PermissionsByIdData = {
+ body?: never;
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/permissions/{id}';
+};
+
+export type DeleteApiV1PermissionsByIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type DeleteApiV1PermissionsByIdError = DeleteApiV1PermissionsByIdErrors[keyof DeleteApiV1PermissionsByIdErrors];
+
+export type DeleteApiV1PermissionsByIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type DeleteApiV1PermissionsByIdResponse = DeleteApiV1PermissionsByIdResponses[keyof DeleteApiV1PermissionsByIdResponses];
+
+export type GetApiV1PermissionsByIdData = {
+ body?: never;
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/permissions/{id}';
+};
+
+export type GetApiV1PermissionsByIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1PermissionsByIdError = GetApiV1PermissionsByIdErrors[keyof GetApiV1PermissionsByIdErrors];
+
+export type GetApiV1PermissionsByIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Permission;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1PermissionsByIdResponse = GetApiV1PermissionsByIdResponses[keyof GetApiV1PermissionsByIdResponses];
+
+export type PatchApiV1PermissionsByIdData = {
+ body: {
+ category?: string;
+ code?: string;
+ description?: string | null;
+ isActive?: boolean | null;
+ name?: string;
+ };
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/permissions/{id}';
+};
+
+export type PatchApiV1PermissionsByIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PatchApiV1PermissionsByIdError = PatchApiV1PermissionsByIdErrors[keyof PatchApiV1PermissionsByIdErrors];
+
+export type PatchApiV1PermissionsByIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Permission;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PatchApiV1PermissionsByIdResponse = PatchApiV1PermissionsByIdResponses[keyof PatchApiV1PermissionsByIdResponses];
+
+export type GetApiV1ProvidersData = {
+ body?: never;
+ path?: never;
+ query?: {
+ keyword?: string;
+ page?: string;
+ pageSize?: string;
+ enabled?: boolean;
+ };
+ url: '/api/v1/providers';
+};
+
+export type GetApiV1ProvidersErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1ProvidersError = GetApiV1ProvidersErrors[keyof GetApiV1ProvidersErrors];
+
+export type GetApiV1ProvidersResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ providers: Array<Provider>;
+ total?: number;
+ [key: string]: unknown;
+ };
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1ProvidersResponse = GetApiV1ProvidersResponses[keyof GetApiV1ProvidersResponses];
+
+export type PostApiV1ProvidersData = {
+ body: {
+ checkModel?: string | null;
+ config?: {
+ [key: string]: unknown;
+ };
+ description?: string | null;
+ enabled?: boolean;
+ fetchOnClient?: boolean | null;
+ keyVaults?: {
+ [key: string]: string;
+ };
+ logo?: string | null;
+ name?: string | null;
+ settings?: {
+ [key: string]: unknown;
+ };
+ sort?: number | null;
+ source?: 'builtin' | 'custom';
+ id: string;
+ };
+ path?: never;
+ query?: never;
+ url: '/api/v1/providers';
+};
+
+export type PostApiV1ProvidersErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PostApiV1ProvidersError = PostApiV1ProvidersErrors[keyof PostApiV1ProvidersErrors];
+
+export type PostApiV1ProvidersResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Provider;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PostApiV1ProvidersResponse = PostApiV1ProvidersResponses[keyof PostApiV1ProvidersResponses];
+
+export type DeleteApiV1ProvidersByIdData = {
+ body?: never;
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/providers/{id}';
+};
+
+export type DeleteApiV1ProvidersByIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type DeleteApiV1ProvidersByIdError = DeleteApiV1ProvidersByIdErrors[keyof DeleteApiV1ProvidersByIdErrors];
+
+export type DeleteApiV1ProvidersByIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type DeleteApiV1ProvidersByIdResponse = DeleteApiV1ProvidersByIdResponses[keyof DeleteApiV1ProvidersByIdResponses];
+
+export type GetApiV1ProvidersByIdData = {
+ body?: never;
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/providers/{id}';
+};
+
+export type GetApiV1ProvidersByIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1ProvidersByIdError = GetApiV1ProvidersByIdErrors[keyof GetApiV1ProvidersByIdErrors];
+
+export type GetApiV1ProvidersByIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Provider;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1ProvidersByIdResponse = GetApiV1ProvidersByIdResponses[keyof GetApiV1ProvidersByIdResponses];
+
+export type PatchApiV1ProvidersByIdData = {
+ body: {
+ checkModel?: string | null;
+ config?: {
+ [key: string]: unknown;
+ };
+ description?: string | null;
+ enabled?: boolean;
+ fetchOnClient?: boolean | null;
+ keyVaults?: {
+ [key: string]: string;
+ } | null;
+ logo?: string | null;
+ name?: string | null;
+ settings?: {
+ [key: string]: unknown;
+ };
+ sort?: number | null;
+ source?: 'builtin' | 'custom';
+ };
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/providers/{id}';
+};
+
+export type PatchApiV1ProvidersByIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PatchApiV1ProvidersByIdError = PatchApiV1ProvidersByIdErrors[keyof PatchApiV1ProvidersByIdErrors];
+
+export type PatchApiV1ProvidersByIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Provider;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PatchApiV1ProvidersByIdResponse = PatchApiV1ProvidersByIdResponses[keyof PatchApiV1ProvidersByIdResponses];
+
+export type PostApiV1ResponsesData = {
+ body: {
+ input: string | Array<{
+ content: string | Array<{
+ text: string;
+ type: 'input_text';
+ } | {
+ annotations?: Array<unknown>;
+ logprobs?: Array<unknown>;
+ text: string;
+ type: 'output_text';
+ } | {
+ detail?: 'auto' | 'low' | 'high';
+ image_url?: string;
+ type: 'input_image';
+ } | {
+ file_data?: string;
+ file_id?: string;
+ filename?: string;
+ type: 'input_file';
+ }>;
+ id?: string;
+ role: 'user' | 'assistant' | 'system' | 'developer';
+ status?: 'completed' | 'in_progress';
+ type: 'message';
+ [key: string]: unknown;
+ } | {
+ arguments: string;
+ call_id?: string;
+ id?: string;
+ name: string;
+ status?: 'completed' | 'in_progress';
+ type: 'function_call';
+ } | {
+ call_id: string;
+ id?: string;
+ output: string;
+ status?: 'completed' | 'in_progress' | 'incomplete';
+ type: 'function_call_output';
+ }>;
+ instructions?: string | null;
+ max_output_tokens?: number | null;
+ metadata?: {
+ [key: string]: string;
+ } | null;
+ model: string;
+ parallel_tool_calls?: boolean | null;
+ previous_response_id?: string | null;
+ reasoning?: {
+ effort?: 'low' | 'medium' | 'high';
+ } | null;
+ stream?: boolean | null;
+ temperature?: number | null;
+ tool_choice?: 'auto' | 'required' | 'none' | {
+ name: string;
+ type: 'function';
+ } | null;
+ tools?: Array<{
+ description?: string;
+ name: string;
+ parameters?: {
+ [key: string]: unknown;
+ };
+ strict?: boolean;
+ type: 'function';
+ } | {
+ type: string;
+ }> | null;
+ top_p?: number | null;
+ truncation?: {
+ type?: 'auto' | 'disabled';
+ } | null;
+ user?: string | null;
+ [key: string]: unknown;
+ };
+ path?: never;
+ query?: never;
+ url: '/api/v1/responses';
+};
+
+export type PostApiV1ResponsesErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PostApiV1ResponsesError = PostApiV1ResponsesErrors[keyof PostApiV1ResponsesErrors];
+
+export type PostApiV1ResponsesResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ id: string;
+ object: 'response';
+ output: Array<{
+ [key: string]: unknown;
+ }>;
+ status: string;
+ usage?: {
+ [key: string]: unknown;
+ } | null;
+ [key: string]: unknown;
+ };
+};
+
+export type PostApiV1ResponsesResponse = PostApiV1ResponsesResponses[keyof PostApiV1ResponsesResponses];
+
+export type GetApiV1RolesData = {
+ body?: never;
+ path?: never;
+ query?: {
+ active?: string | null;
+ system?: string | null;
+ keyword?: string;
+ page?: string;
+ pageSize?: string;
+ };
+ url: '/api/v1/roles';
+};
+
+export type GetApiV1RolesErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1RolesError = GetApiV1RolesErrors[keyof GetApiV1RolesErrors];
+
+export type GetApiV1RolesResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ roles: Array<Role>;
+ total?: number;
+ [key: string]: unknown;
+ };
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1RolesResponse = GetApiV1RolesResponses[keyof GetApiV1RolesResponses];
+
+export type PostApiV1RolesData = {
+ body: {
+ description?: string | null;
+ displayName: string;
+ isActive?: boolean | null;
+ isSystem?: boolean | null;
+ name: string;
+ };
+ path?: never;
+ query?: never;
+ url: '/api/v1/roles';
+};
+
+export type PostApiV1RolesErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PostApiV1RolesError = PostApiV1RolesErrors[keyof PostApiV1RolesErrors];
+
+export type PostApiV1RolesResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Role;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PostApiV1RolesResponse = PostApiV1RolesResponses[keyof PostApiV1RolesResponses];
+
+export type DeleteApiV1RolesByIdData = {
+ body?: never;
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/roles/{id}';
+};
+
+export type DeleteApiV1RolesByIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type DeleteApiV1RolesByIdError = DeleteApiV1RolesByIdErrors[keyof DeleteApiV1RolesByIdErrors];
+
+export type DeleteApiV1RolesByIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type DeleteApiV1RolesByIdResponse = DeleteApiV1RolesByIdResponses[keyof DeleteApiV1RolesByIdResponses];
+
+export type GetApiV1RolesByIdData = {
+ body?: never;
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/roles/{id}';
+};
+
+export type GetApiV1RolesByIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1RolesByIdError = GetApiV1RolesByIdErrors[keyof GetApiV1RolesByIdErrors];
+
+export type GetApiV1RolesByIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Role;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1RolesByIdResponse = GetApiV1RolesByIdResponses[keyof GetApiV1RolesByIdResponses];
+
+export type PatchApiV1RolesByIdData = {
+ body: {
+ description?: string | null;
+ displayName?: string;
+ isActive?: boolean | null;
+ isSystem?: boolean | null;
+ name?: string;
+ };
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/roles/{id}';
+};
+
+export type PatchApiV1RolesByIdErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type PatchApiV1RolesByIdError = PatchApiV1RolesByIdErrors[keyof PatchApiV1RolesByIdErrors];
+
+export type PatchApiV1RolesByIdResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: Role;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type PatchApiV1RolesByIdResponse = PatchApiV1RolesByIdResponses[keyof PatchApiV1RolesByIdResponses];
+
+export type DeleteApiV1RolesByIdPermissionsData = {
+ body?: never;
+ path: {
+ id: string;
+ };
+ query?: never;
+ url: '/api/v1/roles/{id}/permissions';
+};
+
+export type DeleteApiV1RolesByIdPermissionsErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type DeleteApiV1RolesByIdPermissionsError = DeleteApiV1RolesByIdPermissionsErrors[keyof DeleteApiV1RolesByIdPermissionsErrors];
+
+export type DeleteApiV1RolesByIdPermissionsResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ [key: string]: unknown;
+ } | null;
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type DeleteApiV1RolesByIdPermissionsResponse = DeleteApiV1RolesByIdPermissionsResponses[keyof DeleteApiV1RolesByIdPermissionsResponses];
+
+export type GetApiV1RolesByIdPermissionsData = {
+ body?: never;
+ path: {
+ id: string;
+ };
+ query?: {
+ keyword?: string;
+ page?: string;
+ pageSize?: string;
+ };
+ url: '/api/v1/roles/{id}/permissions';
+};
+
+export type GetApiV1RolesByIdPermissionsErrors = {
+ /**
+ * Validation Error
+ */
+ 400: {
+ success: false;
+ error: Array<unknown>;
+ data: unknown;
+ };
+ /**
+ * Authentication required
+ */
+ 401: ApiError;
+ /**
+ * Insufficient permission
+ */
+ 403: ApiError;
+ /**
+ * Resource not found
+ */
+ 404: ApiError;
+ /**
+ * Resource conflict
+ */
+ 409: ApiError;
+ /**
+ * Rate limit exceeded
+ */
+ 429: ApiError;
+ /**
+ * Internal server error
+ */
+ 500: ApiError;
+};
+
+export type GetApiV1RolesByIdPermissionsError = GetApiV1RolesByIdPermissionsErrors[keyof GetApiV1RolesByIdPermissionsErrors];
+
+export type GetApiV1RolesByIdPermissionsResponses = {
+ /**
+ * Successful response
+ */
+ 200: {
+ data?: {
+ [key: string]: unknown;
+ };
+ message?: string;
+ success: true;
+ timestamp: string;
+ };
+};
+
+export type GetApiV1RolesByIdPermissionsResponse = GetApiV1RolesByIdPermissionsResponses[keyof GetApiV1RolesByIdPermissionsResponses];
+
+export type PatchApiV1RolesByIdPermissionsData = {
+ body: {
+ grant?: Array<string> | null;
+ revoke?: Array<string> | null;
};
path: {
id: string;
};
query?: never;
- url: '/api/v1/providers/{id}';
+ url: '/api/v1/roles/{id}/permissions';
};
-export type PatchApiV1ProvidersByIdErrors = {
+export type PatchApiV1RolesByIdPermissionsErrors = {
/**
* Validation Error
*/
@@ -7863,103 +9867,40 @@ export type PatchApiV1ProvidersByIdErrors = {
500: ApiError;
};
-export type PatchApiV1ProvidersByIdError = PatchApiV1ProvidersByIdErrors[keyof PatchApiV1ProvidersByIdErrors];
+export type PatchApiV1RolesByIdPermissionsError = PatchApiV1RolesByIdPermissionsErrors[keyof PatchApiV1RolesByIdPermissionsErrors];
-export type PatchApiV1ProvidersByIdResponses = {
+export type PatchApiV1RolesByIdPermissionsResponses = {
/**
* Successful response
*/
200: {
- data?: Provider;
+ data?: {
+ [key: string]: unknown;
+ };
message?: string;
success: true;
timestamp: string;
};
};
-export type PatchApiV1ProvidersByIdResponse = PatchApiV1ProvidersByIdResponses[keyof PatchApiV1ProvidersByIdResponses];
+export type PatchApiV1RolesByIdPermissionsResponse = PatchApiV1RolesByIdPermissionsResponses[keyof PatchApiV1RolesByIdPermissionsResponses];
-export type PostApiV1ResponsesData = {
+export type PostApiV1SignalsSourceEventsData = {
body: {
- input: string | Array<{
- content: string | Array<{
- text: string;
- type: 'input_text';
- } | {
- annotations?: Array<unknown>;
- logprobs?: Array<unknown>;
- text: string;
- type: 'output_text';
- } | {
- detail?: 'auto' | 'low' | 'high';
- image_url?: string;
- type: 'input_image';
- } | {
- file_data?: string;
- file_id?: string;
- filename?: string;
- type: 'input_file';
- }>;
- id?: string;
- role: 'user' | 'assistant' | 'system' | 'developer';
- status?: 'completed' | 'in_progress';
- type: 'message';
+ payload: {
[key: string]: unknown;
- } | {
- arguments: string;
- call_id?: string;
- id?: string;
- name: string;
- status?: 'completed' | 'in_progress';
- type: 'function_call';
- } | {
- call_id: string;
- id?: string;
- output: string;
- status?: 'completed' | 'in_progress' | 'incomplete';
- type: 'function_call_output';
- }>;
- instructions?: string | null;
- max_output_tokens?: number | null;
- metadata?: {
- [key: string]: string;
- } | null;
- model: string;
- parallel_tool_calls?: boolean | null;
- previous_response_id?: string | null;
- reasoning?: {
- effort?: 'low' | 'medium' | 'high';
- } | null;
- stream?: boolean | null;
- temperature?: number | null;
- tool_choice?: 'auto' | 'required' | 'none' | {
- name: string;
- type: 'function';
- } | null;
- tools?: Array<{
- description?: string;
- name: string;
- parameters?: {
- [key: string]: unknown;
- };
- strict?: boolean;
- type: 'function';
- } | {
- type: string;
- }> | null;
- top_p?: number | null;
- truncation?: {
- type?: 'auto' | 'disabled';
- } | null;
- user?: string | null;
- [key: string]: unknown;
+ };
+ scopeKey?: string;
+ sourceId: string;
+ sourceType: 'client.gateway.error' | 'client.gateway.runtime_end' | 'client.gateway.step_complete' | 'client.gateway.stream_start' | 'client.runtime.complete' | 'client.runtime.start';
+ timestamp?: number;
};
path?: never;
query?: never;
- url: '/api/v1/responses';
+ url: '/api/v1/signals/source-events';
};
-export type PostApiV1ResponsesErrors = {
+export type PostApiV1SignalsSourceEventsErrors = {
/**
* Validation Error
*/
@@ -7994,42 +9935,42 @@ export type PostApiV1ResponsesErrors = {
500: ApiError;
};
-export type PostApiV1ResponsesError = PostApiV1ResponsesErrors[keyof PostApiV1ResponsesErrors];
+export type PostApiV1SignalsSourceEventsError = PostApiV1SignalsSourceEventsErrors[keyof PostApiV1SignalsSourceEventsErrors];
-export type PostApiV1ResponsesResponses = {
+export type PostApiV1SignalsSourceEventsResponses = {
/**
* Successful response
*/
- 200: {
- id: string;
- object: 'response';
- output: Array<{
- [key: string]: unknown;
- }>;
- status: string;
- usage?: {
+ 202: {
+ data?: Array<unknown> | {
[key: string]: unknown;
} | null;
- [key: string]: unknown;
+ message?: string;
+ success: true;
+ timestamp: string;
};
};
-export type PostApiV1ResponsesResponse = PostApiV1ResponsesResponses[keyof PostApiV1ResponsesResponses];
+export type PostApiV1SignalsSourceEventsResponse = PostApiV1SignalsSourceEventsResponses[keyof PostApiV1SignalsSourceEventsResponses];
-export type GetApiV1RolesData = {
- body?: never;
- path?: never;
- query?: {
- active?: string | null;
- system?: string | null;
- keyword?: string;
- page?: string;
- pageSize?: string;
+export type PostApiV1SignalsTriggerData = {
+ body: {
+ agentId?: string;
+ payloadOverride?: {
+ [key: string]: unknown;
+ };
+ scopeKey?: string;
+ sourceId?: string;
+ sourceType: 'agent.nightly_review.requested' | 'agent.self_reflection.requested' | 'agent.self_feedback_intent.declared' | 'agent.user.message' | 'tool.outcome.completed' | 'tool.outcome.failed';
+ timestamp?: number;
+ topicId?: string;
};
- url: '/api/v1/roles';
+ path?: never;
+ query?: never;
+ url: '/api/v1/signals/trigger';
};
-export type GetApiV1RolesErrors = {
+export type PostApiV1SignalsTriggerErrors = {
/**
* Validation Error
*/
@@ -8064,40 +10005,38 @@ export type GetApiV1RolesErrors = {
500: ApiError;
};
-export type GetApiV1RolesError = GetApiV1RolesErrors[keyof GetApiV1RolesErrors];
+export type PostApiV1SignalsTriggerError = PostApiV1SignalsTriggerErrors[keyof PostApiV1SignalsTriggerErrors];
-export type GetApiV1RolesResponses = {
+export type PostApiV1SignalsTriggerResponses = {
/**
* Successful response
*/
- 200: {
- data?: {
- roles: Array<Role>;
- total?: number;
+ 202: {
+ data?: Array<unknown> | {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1RolesResponse = GetApiV1RolesResponses[keyof GetApiV1RolesResponses];
+export type PostApiV1SignalsTriggerResponse = PostApiV1SignalsTriggerResponses[keyof PostApiV1SignalsTriggerResponses];
-export type PostApiV1RolesData = {
- body: {
- description?: string | null;
- displayName: string;
- isActive?: boolean | null;
- isSystem?: boolean | null;
- name: string;
- };
+export type GetApiV1SignalsReceiptsData = {
+ body?: never;
path?: never;
- query?: never;
- url: '/api/v1/roles';
+ query: {
+ agentId: string;
+ cursor?: number;
+ limit?: number;
+ sinceCreatedAt?: number;
+ topicId: string;
+ };
+ url: '/api/v1/signals/receipts';
};
-export type PostApiV1RolesErrors = {
+export type GetApiV1SignalsReceiptsErrors = {
/**
* Validation Error
*/
@@ -8132,32 +10071,38 @@ export type PostApiV1RolesErrors = {
500: ApiError;
};
-export type PostApiV1RolesError = PostApiV1RolesErrors[keyof PostApiV1RolesErrors];
+export type GetApiV1SignalsReceiptsError = GetApiV1SignalsReceiptsErrors[keyof GetApiV1SignalsReceiptsErrors];
-export type PostApiV1RolesResponses = {
+export type GetApiV1SignalsReceiptsResponses = {
/**
* Successful response
*/
200: {
- data?: Role;
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PostApiV1RolesResponse = PostApiV1RolesResponses[keyof PostApiV1RolesResponses];
+export type GetApiV1SignalsReceiptsResponse = GetApiV1SignalsReceiptsResponses[keyof GetApiV1SignalsReceiptsResponses];
-export type DeleteApiV1RolesByIdData = {
+export type GetApiV1TasksData = {
body?: never;
- path: {
- id: string;
+ path?: never;
+ query?: {
+ assigneeAgentId?: string;
+ limit?: number;
+ offset?: number;
+ projectId?: string;
+ statuses?: string;
};
- query?: never;
- url: '/api/v1/roles/{id}';
+ url: '/api/v1/tasks';
};
-export type DeleteApiV1RolesByIdErrors = {
+export type GetApiV1TasksErrors = {
/**
* Validation Error
*/
@@ -8192,14 +10137,14 @@ export type DeleteApiV1RolesByIdErrors = {
500: ApiError;
};
-export type DeleteApiV1RolesByIdError = DeleteApiV1RolesByIdErrors[keyof DeleteApiV1RolesByIdErrors];
+export type GetApiV1TasksError = GetApiV1TasksErrors[keyof GetApiV1TasksErrors];
-export type DeleteApiV1RolesByIdResponses = {
+export type GetApiV1TasksResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
} | null;
message?: string;
@@ -8208,18 +10153,33 @@ export type DeleteApiV1RolesByIdResponses = {
};
};
-export type DeleteApiV1RolesByIdResponse = DeleteApiV1RolesByIdResponses[keyof DeleteApiV1RolesByIdResponses];
+export type GetApiV1TasksResponse = GetApiV1TasksResponses[keyof GetApiV1TasksResponses];
-export type GetApiV1RolesByIdData = {
- body?: never;
- path: {
- id: string;
+export type PostApiV1TasksData = {
+ body: {
+ assigneeAgentId?: string;
+ assigneeUserId?: string;
+ automationMode?: 'heartbeat' | 'schedule';
+ config?: {
+ [key: string]: unknown;
+ };
+ createdByAgentId?: string;
+ description?: string;
+ instruction: string;
+ name?: string;
+ parentTaskId?: string;
+ priority?: number;
+ projectId?: string;
+ schedulePattern?: string;
+ scheduleTimezone?: string;
+ visibility?: 'private' | 'public';
};
+ path?: never;
query?: never;
- url: '/api/v1/roles/{id}';
+ url: '/api/v1/tasks';
};
-export type GetApiV1RolesByIdErrors = {
+export type PostApiV1TasksErrors = {
/**
* Validation Error
*/
@@ -8254,38 +10214,34 @@ export type GetApiV1RolesByIdErrors = {
500: ApiError;
};
-export type GetApiV1RolesByIdError = GetApiV1RolesByIdErrors[keyof GetApiV1RolesByIdErrors];
+export type PostApiV1TasksError = PostApiV1TasksErrors[keyof PostApiV1TasksErrors];
-export type GetApiV1RolesByIdResponses = {
+export type PostApiV1TasksResponses = {
/**
* Successful response
*/
- 200: {
- data?: Role;
+ 201: {
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1RolesByIdResponse = GetApiV1RolesByIdResponses[keyof GetApiV1RolesByIdResponses];
+export type PostApiV1TasksResponse = PostApiV1TasksResponses[keyof PostApiV1TasksResponses];
-export type PatchApiV1RolesByIdData = {
- body: {
- description?: string | null;
- displayName?: string;
- isActive?: boolean | null;
- isSystem?: boolean | null;
- name?: string;
- };
+export type DeleteApiV1TasksByIdData = {
+ body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/roles/{id}';
+ url: '/api/v1/tasks/{id}';
};
-export type PatchApiV1RolesByIdErrors = {
+export type DeleteApiV1TasksByIdErrors = {
/**
* Validation Error
*/
@@ -8320,32 +10276,34 @@ export type PatchApiV1RolesByIdErrors = {
500: ApiError;
};
-export type PatchApiV1RolesByIdError = PatchApiV1RolesByIdErrors[keyof PatchApiV1RolesByIdErrors];
+export type DeleteApiV1TasksByIdError = DeleteApiV1TasksByIdErrors[keyof DeleteApiV1TasksByIdErrors];
-export type PatchApiV1RolesByIdResponses = {
+export type DeleteApiV1TasksByIdResponses = {
/**
* Successful response
*/
200: {
- data?: Role;
+ data?: Array<unknown> | {
+ [key: string]: unknown;
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PatchApiV1RolesByIdResponse = PatchApiV1RolesByIdResponses[keyof PatchApiV1RolesByIdResponses];
+export type DeleteApiV1TasksByIdResponse = DeleteApiV1TasksByIdResponses[keyof DeleteApiV1TasksByIdResponses];
-export type DeleteApiV1RolesByIdPermissionsData = {
+export type GetApiV1TasksByIdData = {
body?: never;
path: {
id: string;
};
query?: never;
- url: '/api/v1/roles/{id}/permissions';
+ url: '/api/v1/tasks/{id}';
};
-export type DeleteApiV1RolesByIdPermissionsErrors = {
+export type GetApiV1TasksByIdErrors = {
/**
* Validation Error
*/
@@ -8380,14 +10338,14 @@ export type DeleteApiV1RolesByIdPermissionsErrors = {
500: ApiError;
};
-export type DeleteApiV1RolesByIdPermissionsError = DeleteApiV1RolesByIdPermissionsErrors[keyof DeleteApiV1RolesByIdPermissionsErrors];
+export type GetApiV1TasksByIdError = GetApiV1TasksByIdErrors[keyof GetApiV1TasksByIdErrors];
-export type DeleteApiV1RolesByIdPermissionsResponses = {
+export type GetApiV1TasksByIdResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
} | null;
message?: string;
@@ -8396,22 +10354,32 @@ export type DeleteApiV1RolesByIdPermissionsResponses = {
};
};
-export type DeleteApiV1RolesByIdPermissionsResponse = DeleteApiV1RolesByIdPermissionsResponses[keyof DeleteApiV1RolesByIdPermissionsResponses];
+export type GetApiV1TasksByIdResponse = GetApiV1TasksByIdResponses[keyof GetApiV1TasksByIdResponses];
-export type GetApiV1RolesByIdPermissionsData = {
- body?: never;
+export type PatchApiV1TasksByIdData = {
+ body: {
+ assigneeAgentId?: string | null;
+ assigneeUserId?: string | null;
+ automationMode?: 'heartbeat' | 'schedule' | null;
+ config?: {
+ [key: string]: unknown;
+ };
+ description?: string | null;
+ instruction?: string;
+ name?: string;
+ parentTaskId?: string | null;
+ priority?: number;
+ schedulePattern?: string | null;
+ scheduleTimezone?: string | null;
+ };
path: {
id: string;
};
- query?: {
- keyword?: string;
- page?: string;
- pageSize?: string;
- };
- url: '/api/v1/roles/{id}/permissions';
+ query?: never;
+ url: '/api/v1/tasks/{id}';
};
-export type GetApiV1RolesByIdPermissionsErrors = {
+export type PatchApiV1TasksByIdErrors = {
/**
* Validation Error
*/
@@ -8446,37 +10414,37 @@ export type GetApiV1RolesByIdPermissionsErrors = {
500: ApiError;
};
-export type GetApiV1RolesByIdPermissionsError = GetApiV1RolesByIdPermissionsErrors[keyof GetApiV1RolesByIdPermissionsErrors];
+export type PatchApiV1TasksByIdError = PatchApiV1TasksByIdErrors[keyof PatchApiV1TasksByIdErrors];
-export type GetApiV1RolesByIdPermissionsResponses = {
+export type PatchApiV1TasksByIdResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type GetApiV1RolesByIdPermissionsResponse = GetApiV1RolesByIdPermissionsResponses[keyof GetApiV1RolesByIdPermissionsResponses];
+export type PatchApiV1TasksByIdResponse = PatchApiV1TasksByIdResponses[keyof PatchApiV1TasksByIdResponses];
-export type PatchApiV1RolesByIdPermissionsData = {
+export type PatchApiV1TasksByIdStatusData = {
body: {
- grant?: Array<string> | null;
- revoke?: Array<string> | null;
+ error?: string;
+ status: 'backlog' | 'running' | 'scheduled' | 'paused' | 'completed' | 'failed' | 'canceled';
};
path: {
id: string;
};
query?: never;
- url: '/api/v1/roles/{id}/permissions';
+ url: '/api/v1/tasks/{id}/status';
};
-export type PatchApiV1RolesByIdPermissionsErrors = {
+export type PatchApiV1TasksByIdStatusErrors = {
/**
* Validation Error
*/
@@ -8511,23 +10479,23 @@ export type PatchApiV1RolesByIdPermissionsErrors = {
500: ApiError;
};
-export type PatchApiV1RolesByIdPermissionsError = PatchApiV1RolesByIdPermissionsErrors[keyof PatchApiV1RolesByIdPermissionsErrors];
+export type PatchApiV1TasksByIdStatusError = PatchApiV1TasksByIdStatusErrors[keyof PatchApiV1TasksByIdStatusErrors];
-export type PatchApiV1RolesByIdPermissionsResponses = {
+export type PatchApiV1TasksByIdStatusResponses = {
/**
* Successful response
*/
200: {
- data?: {
+ data?: Array<unknown> | {
[key: string]: unknown;
- };
+ } | null;
message?: string;
success: true;
timestamp: string;
};
};
-export type PatchApiV1RolesByIdPermissionsResponse = PatchApiV1RolesByIdPermissionsResponses[keyof PatchApiV1RolesByIdPermissionsResponses];
+export type PatchApiV1TasksByIdStatusResponse = PatchApiV1TasksByIdStatusResponses[keyof PatchApiV1TasksByIdStatusResponses];
export type GetApiV1TopicsData = {
body?: never;