🤯 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.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
✨ feat: organize workspace agents with labels and a shared sidebar (#17848)
Rdmclin2d6efc87777db
diff --git a/apps/server/src/routers/lambda/__tests__/agent.test.ts b/apps/server/src/routers/lambda/__tests__/agent.test.tsindex 7efa10417a8..220795485db 100644--- a/apps/server/src/routers/lambda/__tests__/agent.test.ts+++ b/apps/server/src/routers/lambda/__tests__/agent.test.ts@@ -123,8 +123,8 @@ describe('agentRouter', () => {};vi.mocked(ResourcePermissionModel).mockImplementation(() => resourcePermissionModelMock);workspaceUserSettingsModelMock = {- copySidebarGroupAssignment: vi.fn(),- setSidebarGroupAssignment: vi.fn(),+ getPreference: vi.fn().mockResolvedValue({}),+ updatePreference: vi.fn(),};vi.mocked(WorkspaceUserSettingsModel).mockImplementation(() => workspaceUserSettingsModelMock);@@ -499,12 +499,9 @@ describe('agentRouter', () => {'use',userId,);- // Folder placement is per-member in workspace mode — the duplicate must- // inherit the caller's own assignment for the source agent.- expect(workspaceUserSettingsModelMock.copySidebarGroupAssignment).toHaveBeenCalledWith(- 'public-agent',- 'copied-agent',- );+ // Folder placement is shared state, carried by AgentModel.duplicate's+ // `sessionGroupId` copy — no per-member bookkeeping on top.+ expect(workspaceUserSettingsModelMock.updatePreference).not.toHaveBeenCalled();});});diff --git a/apps/server/src/routers/lambda/__tests__/agentLabel.test.ts b/apps/server/src/routers/lambda/__tests__/agentLabel.test.tsnew file mode 100644index 00000000000..0e419e6fa45--- /dev/null+++ b/apps/server/src/routers/lambda/__tests__/agentLabel.test.ts@@ -0,0 +1,90 @@+// @vitest-environment node+import { beforeEach, describe, expect, it, vi } from 'vitest';++// serverDatabase middleware calls getServerDB(); stub it (the model mock+// ignores the db handle anyway).+vi.mock('@/database/core/db-adaptor', () => ({+ getServerDB: vi.fn(() => ({})),+}));++vi.mock('@/business/server/trpc-middlewares/rbacPermission', () => ({+ withScopedPermission: vi.fn(() => (opts: any) => opts.next({ ctx: opts.ctx })),+}));++const mockCreate = vi.fn();+const mockUpdate = vi.fn();+const mockSetAgentLabels = vi.fn();++vi.mock('@/database/models/agentLabel', () => ({+ AgentLabelModel: vi.fn(() => ({+ create: mockCreate,+ setAgentLabels: mockSetAgentLabels,+ update: mockUpdate,+ })),+}));++const { agentLabelRouter } = await import('../agentLabel');++/** Shaped like the driver error drizzle surfaces, nested behind `cause`. */+const uniqueViolation = (constraint: string) => {+ const error = new Error('duplicate key value violates unique constraint');+ (error as any).cause = { code: '23505', constraint };+ return error;+};++describe('agentLabelRouter', () => {+ const ctx: any = { serverDB: {}, userId: 'user-1', workspaceId: 'ws-1' };++ beforeEach(() => {+ vi.clearAllMocks();+ mockSetAgentLabels.mockResolvedValue(['label-1']);+ });++ describe('setAgentLabels', () => {+ it('writes without requiring per-agent edit rights', async () => {+ // Labelling is list organization, not configuration, so it gates on the+ // `agent:update` role scope alone — a member may tag any agent they can+ // see, which is the point of a shared, groupable list. The viewer role+ // holds no such grant, and the model's `agentOwnership()` still keeps+ // another member's private agents unreachable.+ const caller = agentLabelRouter.createCaller(ctx);++ await caller.setAgentLabels({ agentId: 'agent-1', labelIds: ['label-1'] });++ expect(mockSetAgentLabels).toHaveBeenCalledWith('agent-1', ['label-1']);+ });+ });++ describe('duplicate label names', () => {+ it.each([['agent_labels_user_id_name_unique'], ['agent_labels_workspace_id_name_unique']])(+ 'maps a %s violation on create to CONFLICT',+ async (constraint) => {+ mockCreate.mockRejectedValue(uniqueViolation(constraint));+ const caller = agentLabelRouter.createCaller(ctx);++ await expect(caller.createLabel({ name: 'Design' })).rejects.toMatchObject({+ code: 'CONFLICT',+ message: 'DUPLICATE_LABEL_NAME',+ });+ },+ );++ it('maps a violation on update to CONFLICT, covering rename and un-archive', async () => {+ mockUpdate.mockRejectedValue(uniqueViolation('agent_labels_workspace_id_name_unique'));+ const caller = agentLabelRouter.createCaller(ctx);++ await expect(+ caller.updateLabel({ id: 'label-1', value: { archived: false } }),+ ).rejects.toMatchObject({ code: 'CONFLICT', message: 'DUPLICATE_LABEL_NAME' });+ });++ it('leaves unrelated failures untouched', async () => {+ mockUpdate.mockRejectedValue(uniqueViolation('some_other_unique_index'));+ const caller = agentLabelRouter.createCaller(ctx);++ await expect(+ caller.updateLabel({ id: 'label-1', value: { name: 'Design' } }),+ ).rejects.not.toMatchObject({ code: 'CONFLICT' });+ });+ });+});diff --git a/apps/server/src/routers/lambda/_template.ts b/apps/server/src/routers/lambda/_template.tsindex dcdccb3122f..70edb7483f7 100644--- a/apps/server/src/routers/lambda/_template.ts+++ b/apps/server/src/routers/lambda/_template.ts@@ -1,7 +1,6 @@import { z } from 'zod';import { SessionGroupModel } from '@/database/models/sessionGroup';-import { insertSessionGroupSchema } from '@/database/schemas';import { authedProcedure, router } from '@/libs/trpc/lambda';import { serverDatabase } from '@/libs/trpc/lambda/middleware';import { type SessionGroupItem } from '@/types/session';@@ -16,6 +15,20 @@ const sessionProcedure = authedProcedure.use(serverDatabase).use(async (opts) =>});});+/**+ * Renaming and reordering only. Deliberately NOT `insertSessionGroupSchema.partial()`:+ * that carries `userId`, `workspaceId` and `visibility`, and folders are now+ * workspace-shared, so the ownership predicate matches every public folder in+ * the workspace. A member could otherwise take another member's Category+ * private, reassign it, or move it out of the workspace — breaking the shared+ * sidebar for everyone and putting the row out of the victim's own reach.+ * Publishing has its own one-way procedure; there is no un-publish by design.+ */+const updatableSessionGroupFields = z.object({+ name: z.string().optional(),+ sort: z.number().nullable().optional(),+});+export const sessionGroupRouter = router({createSessionGroup: sessionProcedure.input(@@ -47,7 +60,7 @@ export const sessionGroupRouter = router({.input(z.object({id: z.string(),- value: insertSessionGroupSchema.partial(),+ value: updatableSessionGroupFields,}),).mutation(async ({ input, ctx }) => {diff --git a/apps/server/src/routers/lambda/agent.ts b/apps/server/src/routers/lambda/agent.tsindex 070144456ce..fb925869d10 100644--- a/apps/server/src/routers/lambda/agent.ts+++ b/apps/server/src/routers/lambda/agent.ts@@ -16,7 +16,6 @@ import { SessionModel } from '@/database/models/session';import { TaskModel } from '@/database/models/task';import { TOPIC_COMMENT_TRANSFER_HAS_FOREIGN_AUTHORS } from '@/database/models/topicComment';import { UserModel } from '@/database/models/user';-import { WorkspaceUserSettingsModel } from '@/database/models/workspaceUserSettings';import type { ResourceAccessLevel } from '@/database/schemas';import { DEFAULT_RESOURCE_ACCESS_LEVELS, RESOURCE_ACCESS_LEVELS_BY_TYPE } from '@/database/schemas';import { router } from '@/libs/trpc/lambda';@@ -129,6 +128,25 @@ export const agentRouter = router({}),).mutation(async ({ input, ctx }) => {+ // Creating inside a Category has to land in that Category. The folder's+ // visibility decides the new agent's, rather than the other way round:+ // the sidebar resolves a public agent's folder only against public+ // folders (and a private agent's only against private ones), so a+ // default-public agent created from a private Category would render in+ // Ungrouped — for its creator too. The "New Agent" action inside a+ // private Category sends only `{ groupId }`, so this is the normal path,+ // not a crafted one. An explicit conflicting `visibility` is refused+ // rather than silently overridden.+ const folderVisibility = input.groupId+ ? await ctx.agentModel.getAssignableSessionGroupVisibility(input.groupId)+ : undefined;++ if (folderVisibility && input.visibility && input.visibility !== folderVisibility)+ throw new TRPCError({+ code: 'BAD_REQUEST',+ message: `A ${input.visibility} agent cannot be created in a ${folderVisibility} folder`,+ });+const agent = await ctx.agentModel.create({...input.config,// The DB-layer AgentItem (packages/database/src/schemas/agent.ts) is@@ -140,7 +158,9 @@ export const agentRouter = router({// Router-level `visibility` wins over any nested config value so the// sidebar's "Create in Private" entry can't be overridden by a stale// default config.- ...(input.visibility ? { visibility: input.visibility } : {}),+ ...(input.visibility || folderVisibility+ ? { visibility: input.visibility ?? folderVisibility }+ : {}),});if (ctx.workspaceId && agent.visibility !== 'private') {@@ -152,17 +172,6 @@ export const agentRouter = router({);}- // Folder placement is per-member in workspace mode (the shared- // `sessionGroupId` column is ignored there), so a create-in-folder must- // also record the caller's own assignment for the new agent.- if (ctx.workspaceId && input.groupId) {- await new WorkspaceUserSettingsModel(- ctx.serverDB,- ctx.userId,- ctx.workspaceId,- ).setSidebarGroupAssignment(agent.id, input.groupId);- }-return { agentId: agent.id };}),@@ -495,13 +504,6 @@ export const agentRouter = router({DEFAULT_RESOURCE_ACCESS_LEVELS.agent,ctx.userId,);- // Folder placement is per-member in workspace mode: keep the copy in- // the caller's folder when they had assigned the source agent there.- await new WorkspaceUserSettingsModel(- ctx.serverDB,- ctx.userId,- ctx.workspaceId,- ).copySidebarGroupAssignment(input.agentId, result.agentId);}return result;}),diff --git a/apps/server/src/routers/lambda/agentGroup.ts b/apps/server/src/routers/lambda/agentGroup.tsindex 0ab6af37c00..b36e87200d1 100644--- a/apps/server/src/routers/lambda/agentGroup.ts+++ b/apps/server/src/routers/lambda/agentGroup.ts@@ -9,7 +9,6 @@ import { ChatGroupModel } from '@/database/models/chatGroup';import { ResourcePermissionModel } from '@/database/models/resourcePermission';import { TOPIC_COMMENT_TRANSFER_HAS_FOREIGN_AUTHORS } from '@/database/models/topicComment';import { UserModel } from '@/database/models/user';-import { WorkspaceUserSettingsModel } from '@/database/models/workspaceUserSettings';import { AgentGroupRepository } from '@/database/repositories/agentGroup';import { DEFAULT_RESOURCE_ACCESS_LEVELS, RESOURCE_ACCESS_LEVELS_BY_TYPE } from '@/database/schemas';import { type ChatGroupConfig } from '@/database/types/chatGroup';@@ -289,17 +288,6 @@ export const agentGroupRouter = router({]);}- // Folder placement is per-member in workspace mode (the shared- // `chat_groups.groupId` column is ignored there), so a create-in-folder- // must also record the caller's own assignment for the new group.- if (ctx.workspaceId && input.groupId) {- await new WorkspaceUserSettingsModel(- ctx.serverDB,- ctx.userId,- ctx.workspaceId,- ).setSidebarGroupAssignment(group.id, input.groupId);- }-return { group, supervisorAgentId };}),@@ -335,6 +323,31 @@ export const agentGroupRouter = router({}),).mutation(async ({ input, ctx }) => {+ // Resolve the folder BEFORE creating the member agents. The same check+ // runs inside `createGroupWithSupervisor`, but that happens after these+ // inserts and outside their transaction, so a bad folder id would leave+ // orphaned virtual agents behind.+ const groupFolderId = input.groupConfig?.groupId;+ let folderVisibility: 'private' | 'public' | undefined;++ if (groupFolderId) {+ folderVisibility = await ctx.agentGroupRepo.getAssignableFolderVisibility(groupFolderId);+ const requested = input.groupConfig?.visibility;++ if (requested && requested !== folderVisibility)+ throw new TRPCError({+ code: 'BAD_REQUEST',+ message: `A ${requested} chat group cannot be created in a ${folderVisibility} folder`,+ });+ }++ // The synthetic members inherit the group's visibility, the same way the+ // supervisor does. Left to the column default they would be public+ // workspace resources while their group is private — visible to+ // permission checks that look agents up by id rather than through the+ // group. Must match `createGroupWithSupervisor`'s own derivation.+ const groupVisibility = input.groupConfig?.visibility ?? folderVisibility ?? undefined;+// 1. Batch create virtual member agentsconst memberConfigs = input.members.map((member) => ({...member,@@ -343,6 +356,7 @@ export const agentGroupRouter = router({plugins: member.plugins as unknown as string[] | undefined,tags: member.tags as string[] | undefined,virtual: true,+ ...(groupVisibility ? { visibility: groupVisibility } : {}),}));const createdAgents = await ctx.agentModel.batchCreate(memberConfigs);@@ -395,15 +409,6 @@ export const agentGroupRouter = router({]);}- // Same per-member folder rule as `createGroup` above.- if (ctx.workspaceId && input.groupConfig.groupId) {- await new WorkspaceUserSettingsModel(- ctx.serverDB,- ctx.userId,- ctx.workspaceId,- ).setSidebarGroupAssignment(group.id, input.groupConfig.groupId);- }-return { agentIds: memberAgentIds, groupId: group.id, supervisorAgentId };}),@@ -484,13 +489,6 @@ export const agentGroupRouter = router({ctx.userId,),]);- // Folder placement is per-member in workspace mode: keep the copy in- // the caller's folder when they had assigned the source group there.- await new WorkspaceUserSettingsModel(- ctx.serverDB,- ctx.userId,- ctx.workspaceId,- ).copySidebarGroupAssignment(input.groupId, result.groupId);}return result;}),@@ -765,6 +763,22 @@ export const agentGroupRouter = router({publishGroupToWorkspace: agentGroupProcedureWrite.input(z.object({ id: z.string() })).mutation(async ({ input, ctx }) => {+ // Same rule `setGroupVisibility` enforces, on the other route to the same+ // transition: a private group may hold the creator's private member+ // agents, and publishing the group without them leaves everyone else+ // with a group whose members they cannot see. Guarding only one of two+ // publish paths guards neither.+ if (ctx.workspaceId) {+ const privateMembers = await ctx.chatGroupModel.countPrivateGroupAgents(input.id);++ if (privateMembers > 0)+ throw new TRPCError({+ code: 'BAD_REQUEST',+ message:+ 'Cannot publish a group that still contains private agents. Publish or remove those agents first.',+ });+ }+const result = await ctx.chatGroupModel.publishToWorkspace(input.id);if (ctx.workspaceId) {await new ResourcePermissionModel(ctx.serverDB, ctx.workspaceId).setAccessLevel(diff --git a/apps/server/src/routers/lambda/agentLabel.ts b/apps/server/src/routers/lambda/agentLabel.tsnew file mode 100644index 00000000000..52dcb2446ce--- /dev/null+++ b/apps/server/src/routers/lambda/agentLabel.ts@@ -0,0 +1,158 @@+import { TRPCError } from '@trpc/server';+import { z } from 'zod';++import { withScopedPermission } from '@/business/server/trpc-middlewares/rbacPermission';+import { wsCompatProcedure } from '@/business/server/trpc-middlewares/workspaceAuth';+import { AgentLabelModel } from '@/database/models/agentLabel';+import { router } from '@/libs/trpc/lambda';+import { serverDatabase } from '@/libs/trpc/lambda/middleware';++/**+ * `color` is rendered straight into an inline `background` on label tags, the+ * settings list and the picker dots, so an arbitrary string is a CSS injection+ * point — `url(https://…)` alone would make every member who can see the+ * shared label fetch an attacker-controlled resource. Constrain it to a hex+ * literal at the only two places it can be written.+ */+const hexColor = z+ .string()+ .regex(/^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i, 'INVALID_LABEL_COLOR');++/** Both partial unique indexes that guard active label names, per scope. */+const LABEL_NAME_CONSTRAINTS = new Set([+ 'agent_labels_user_id_name_unique',+ 'agent_labels_workspace_id_name_unique',+]);++/** Postgres surfaces the driver error somewhere down the `cause` chain. */+const getPostgresErrorField = (error: unknown, field: string): string | undefined => {+ let current: unknown = error;++ while (current && typeof current === 'object') {+ const value = (current as Record<string, unknown>)[field];+ if (typeof value === 'string') return value;++ current = (current as { cause?: unknown }).cause;+ }+};++/**+ * A name collision is a normal outcome the UI recovers from (rename, or+ * rename-and-restore for an archived label), so it must arrive as CONFLICT+ * rather than a generic 500 the client can only show as "operation failed".+ */+const rethrowDuplicateLabelName = (error: unknown): never => {+ if (+ getPostgresErrorField(error, 'code') === '23505' &&+ LABEL_NAME_CONSTRAINTS.has(getPostgresErrorField(error, 'constraint') ?? '')+ ) {+ throw new TRPCError({ cause: error, code: 'CONFLICT', message: 'DUPLICATE_LABEL_NAME' });+ }++ throw error;+};++const labelProcedure = wsCompatProcedure.use(serverDatabase).use(async (opts) => {+ const { ctx } = opts;+ const wsId = ctx.workspaceId ?? undefined;++ return opts.next({+ ctx: {+ agentLabelModel: new AgentLabelModel(ctx.serverDB, ctx.userId, wsId),+ },+ });+});++export const agentLabelRouter = router({+ createLabel: labelProcedure+ .use(withScopedPermission('agent_label:create'))+ .input(+ z.object({+ color: hexColor.optional(),+ description: z.string().optional(),+ name: z.string().trim().min(1),+ }),+ )+ .mutation(async ({ input, ctx }) => {+ const data = await ctx.agentLabelModel.create(input).catch(rethrowDuplicateLabelName);++ return data?.id;+ }),++ getLabels: labelProcedure+ // The registry is workspace-shared, so reading it is what `agent_label:read`+ // exists to gate. Without this the permission is declared but unenforceable,+ // and a custom role denied it could still enumerate every label.+ .use(withScopedPermission('agent_label:read'))+ .query(async ({ ctx }) => {+ return ctx.agentLabelModel.query();+ }),++ removeLabel: labelProcedure+ .use(withScopedPermission('agent_label:delete'))+ .input(z.object({ id: z.string() }))+ .mutation(async ({ input, ctx }) => {+ return ctx.agentLabelModel.delete(input.id);+ }),++ /**+ * Labelling is list organization, not agent configuration — the same bucket+ * as pinning and moving to a group, which members may already do to any+ * agent they can see. It therefore gates on the workspace-wide+ * `agent:update` role scope and deliberately NOT on the agent's own+ * permission row: requiring per-agent edit rights would stop a member+ * tagging most of the workspace's agents, which is exactly the shared list+ * they need to organize.+ *+ * Labels are shared, so this does let one member change state others see.+ * That is the intended collaborative trade-off — the operation is cheap,+ * reversible, and grants no configuration or data access. Two lines still+ * hold: the viewer role carries no `agent:update` grant at all, and+ * `agentOwnership()` in the model keeps another member's *private* agents+ * out of reach entirely.+ */+ setAgentLabels: labelProcedure+ .use(withScopedPermission('agent:update'))+ // Assigning requires reading too: the call takes label ids and returns the+ // effective set, so a role denied `agent_label:read` could otherwise probe+ // the registry through it — which would leave the read guards on+ // `getLabels` and the sidebar only half closing the door.+ .use(withScopedPermission('agent_label:read'))+ .input(z.object({ agentId: z.string(), labelIds: z.array(z.string()) }))+ .mutation(async ({ input, ctx }) => {+ return ctx.agentLabelModel.setAgentLabels(input.agentId, input.labelIds);+ }),++ /**+ * Single-label delta. Same guards as `setAgentLabels`, but expresses one+ * toggle so a concurrent editor's change is not clobbered.+ */+ toggleAgentLabel: labelProcedure+ .use(withScopedPermission('agent:update'))+ .use(withScopedPermission('agent_label:read'))+ .input(z.object({ agentId: z.string(), assigned: z.boolean(), labelId: z.string() }))+ .mutation(async ({ input, ctx }) => {+ return ctx.agentLabelModel.toggleAgentLabel(input.agentId, input.labelId, input.assigned);+ }),++ updateLabel: labelProcedure+ .use(withScopedPermission('agent_label:update'))+ .input(+ z.object({+ id: z.string(),+ value: z.object({+ archived: z.boolean().optional(),+ color: hexColor.nullable().optional(),+ description: z.string().nullable().optional(),+ name: z.string().trim().min(1).optional(),+ }),+ }),+ )+ .mutation(async ({ input, ctx }) => {+ // Covers both a straight rename and un-archiving into a name that has+ // since been taken — the partial unique index only spans active rows.+ return ctx.agentLabelModel.update(input.id, input.value).catch(rethrowDuplicateLabelName);+ }),+});++export type AgentLabelRouter = typeof agentLabelRouter;diff --git a/apps/server/src/routers/lambda/home.ts b/apps/server/src/routers/lambda/home.tsindex 78a1504792c..7a8ba95a18a 100644--- a/apps/server/src/routers/lambda/home.ts+++ b/apps/server/src/routers/lambda/home.ts@@ -8,6 +8,7 @@ import { HomeRepository } from '@/database/repositories/home';import { router } from '@/libs/trpc/lambda';import { serverDatabase } from '@/libs/trpc/lambda/middleware';import { type HomeBriefData, HomeService } from '@/server/services/home';+import { hasWorkspaceScopedPermission } from '@/server/services/workspacePermission';import { after } from '@/server/utils/scheduleAfterResponse';const homeProcedure = wsCompatProcedure.use(serverDatabase).use(async (opts) => {@@ -30,7 +31,34 @@ export const homeRouter = router({),getSidebarAgentList: homeProcedure.query(async ({ ctx }) => {- const result = await ctx.homeRepository.getSidebarAgentList();+ // The sidebar payload carries applied label names and colors, so it has to+ // respect the same grant as the label registry itself — otherwise denying+ // `agent_label:read` only closes the front door. Personal scope has no+ // workspace roles, so it always includes them.+ const includeLabels = ctx.workspaceId+ ? await hasWorkspaceScopedPermission({+ action: 'AGENT_LABEL_READ',+ db: ctx.serverDB,+ userId: ctx.userId,+ workspaceId: ctx.workspaceId,+ })+ : true;++ // Same reasoning for folders: this payload carries every shared Category's+ // id, name and order, so denying `session_group:read` has to close this+ // door too. Omitted rather than rejected — the agent list itself is not+ // gated on it, and losing the whole sidebar over a folder grant would be+ // worse than losing the folders.+ const includeGroups = ctx.workspaceId+ ? await hasWorkspaceScopedPermission({+ action: 'SESSION_GROUP_READ',+ db: ctx.serverDB,+ userId: ctx.userId,+ workspaceId: ctx.workspaceId,+ })+ : true;++ const result = await ctx.homeRepository.getSidebarAgentList(includeLabels, includeGroups);// Runtime migration: backfill sessionGroupId for legacy agentsconst runMigration = async () => {diff --git a/apps/server/src/routers/lambda/index.ts b/apps/server/src/routers/lambda/index.tsindex ba073dadca3..66ac266e537 100644--- a/apps/server/src/routers/lambda/index.ts+++ b/apps/server/src/routers/lambda/index.ts@@ -26,6 +26,7 @@ import { agentDocumentRouter } from './agentDocument';import { agentEvalRouter } from './agentEval';import { agentEvalExternalRouter } from './agentEvalExternal';import { agentGroupRouter } from './agentGroup';+import { agentLabelRouter } from './agentLabel';import { agentNotifyRouter } from './agentNotify';import { agentQuotaRouter } from './agentQuota';import { agentSignalRouter } from './agentSignal';@@ -99,6 +100,7 @@ export const lambdaRouter = router({agentDocument: agentDocumentRouter,agentEval: agentEvalRouter,agentEvalExternal: agentEvalExternalRouter,+ agentLabel: agentLabelRouter,agentSkills: agentSkillsRouter,agentSignal: agentSignalRouter,task: taskRouter,diff --git a/apps/server/src/routers/lambda/sessionGroup.ts b/apps/server/src/routers/lambda/sessionGroup.tsindex 8d0fb251956..e3d504c7c77 100644--- a/apps/server/src/routers/lambda/sessionGroup.ts+++ b/apps/server/src/routers/lambda/sessionGroup.ts@@ -3,7 +3,6 @@ import { z } from 'zod';import { withScopedPermission } from '@/business/server/trpc-middlewares/rbacPermission';import { wsCompatProcedure } from '@/business/server/trpc-middlewares/workspaceAuth';import { SessionGroupModel } from '@/database/models/sessionGroup';-import { insertSessionGroupSchema } from '@/database/schemas';import { router } from '@/libs/trpc/lambda';import { serverDatabase } from '@/libs/trpc/lambda/middleware';import { type SessionGroupItem } from '@/types/session';@@ -19,6 +18,20 @@ const sessionProcedure = wsCompatProcedure.use(serverDatabase).use(async (opts)});});+/**+ * Renaming and reordering only. Deliberately NOT `insertSessionGroupSchema.partial()`:+ * that carries `userId`, `workspaceId` and `visibility`, and folders are now+ * workspace-shared, so the ownership predicate matches every public folder in+ * the workspace. A member could otherwise take another member's Category+ * private, reassign it, or move it out of the workspace — breaking the shared+ * sidebar for everyone and putting the row out of the victim's own reach.+ * Publishing has its own one-way procedure; there is no un-publish by design.+ */+const updatableSessionGroupFields = z.object({+ name: z.string().optional(),+ sort: z.number().nullable().optional(),+});+export const sessionGroupRouter = router({createSessionGroup: sessionProcedure.use(withScopedPermission('session_group:create'))@@ -51,9 +64,14 @@ export const sessionGroupRouter = router({return ctx.sessionGroupModel.publishToWorkspace(input.id);}),- getSessionGroup: sessionProcedure.query(async ({ ctx }): Promise<SessionGroupItem[]> => {- return ctx.sessionGroupModel.query() as any;- }),+ getSessionGroup: sessionProcedure+ // Folders are shared workspace structure now, so listing them is what+ // `session_group:read` exists to gate. Without this the permission is+ // declared but unenforceable.+ .use(withScopedPermission('session_group:read'))+ .query(async ({ ctx }): Promise<SessionGroupItem[]> => {+ return ctx.sessionGroupModel.query() as any;+ }),// NOTE: no row-level creator check on the mutations below (unlike other// workspace-shared resources). Sidebar organization is a per-member concern@@ -72,7 +90,7 @@ export const sessionGroupRouter = router({.input(z.object({id: z.string(),- value: insertSessionGroupSchema.partial(),+ value: updatableSessionGroupFields,}),).mutation(async ({ input, ctx }) => {diff --git a/locales/ar/chat.json b/locales/ar/chat.jsonindex 96a6a997ab9..8799f469ad9 100644--- a/locales/ar/chat.json+++ b/locales/ar/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "تم الإنشاء بنجاح","sessionGroup.creatingAgent": "جارٍ إنشاء الوكيل...","sessionGroup.groupName": "اسم المجموعة",+ "sessionGroup.hideFromSidebar": "إخفاء من الشريط الجانبي الخاص بي","sessionGroup.inputPlaceholder": "يرجى إدخال اسم المجموعة...","sessionGroup.manageCategory": "إدارة الفئة","sessionGroup.moveGroup": "نقل إلى مجموعة",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "تمت إعادة التسمية بنجاح","sessionGroup.searchAgents": "البحث عن وكلاء","sessionGroup.selectedAgents": "الوكلاء المحددون ({{count}})",+ "sessionGroup.showInSidebar": "إظهار في الشريط الجانبي الخاص بي","sessionGroup.sortSuccess": "تم الترتيب بنجاح","sessionGroup.sorting": "جارٍ تحديث ترتيب المجموعات...","sessionGroup.tooLong": "يجب أن يتراوح طول اسم المجموعة بين 1 و20 حرفًا",diff --git a/locales/ar/common.json b/locales/ar/common.jsonindex 5fce9e51b07..ac895425605 100644--- a/locales/ar/common.json+++ b/locales/ar/common.json@@ -2,6 +2,9 @@"about": "حول","addNew": "إضافة جديد","advanceSettings": "الإعدادات المتقدمة",+ "agentLabel.create": "تسمية جديدة",+ "agentLabel.manage": "إدارة التسميات",+ "agentLabel.menuTitle": "التسميات","agentViewAll.addToSidebar": "عرض في الشريط الجانبي","agentViewAll.columns.author": "المؤلف","agentViewAll.columns.name": "الاسم",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "الترتيب","agentViewAll.form.showSidebarHidden": "عرض الوكلاء المخفيين من الشريط الجانبي","agentViewAll.groupBy.author": "المؤلف",+ "agentViewAll.groupBy.label": "تسمية",+ "agentViewAll.groupBy.noLabel": "بدون تسمية","agentViewAll.groupBy.none": "بدون تجميع","agentViewAll.groupBy.unknownAuthor": "مؤلف غير معروف","agentViewAll.myAgents": "وكلائي",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "العنوان","agentViewAll.orderBy.updatedAt": "تم التحديث في","agentViewAll.removeFromSidebar": "إخفاء من الشريط الجانبي",+ "agentViewAll.sidebarSection.collapse": "طي",+ "agentViewAll.sidebarSection.expand": "فتح",+ "agentViewAll.sidebarSection.title": "في الشريط الجانبي","agentViewAll.title": "الوكلاء","agentViewAll.untitled": "وكيل بدون عنوان","agentViewAll.view.card": "بطاقة",diff --git a/locales/ar/setting.json b/locales/ar/setting.jsonindex ef590d20f54..2a86afeb73c 100644--- a/locales/ar/setting.json+++ b/locales/ar/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "بيانات الاعتماد، الأسرار، OAuth","settingsSearch.tabKeywords.devices": "الأجهزة، الجلسات، الأجهزة المسجلة الدخول","settingsSearch.tabKeywords.hotkey": "مفتاح الاختصار، اختصار، لوحة المفاتيح",+ "settingsSearch.tabKeywords.labels": "التسميات، العلامات، التجميع","settingsSearch.tabKeywords.memory": "الذاكرة، الذكريات، التخصيص","settingsSearch.tabKeywords.messenger": "الرسائل، منصة الدردشة، الروبوت","settingsSearch.tabKeywords.notification": "الإشعارات، البريد الإلكتروني، الدفع، التنبيهات",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "استيراد من مستودع GitHub عام","tab.importFromUrl": "استيراد من رابط","tab.importFromUrl.desc": "استيراد عبر رابط مباشر إلى SKILL.md",+ "tab.labels": "التسميات","tab.llm": "نموذج اللغة","tab.manualFill": "التعبئة اليدوية","tab.manualFill.desc": "تكوين مهارة MCP مخصصة يدويًا",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "الإدارة","workspaceSetting.group.agent": "الوكيل","workspaceSetting.group.general": "عام",+ "workspaceSetting.labels.actions.archive": "أرشفة",+ "workspaceSetting.labels.actions.create": "تصنيف جديد",+ "workspaceSetting.labels.actions.unarchive": "استعادة",+ "workspaceSetting.labels.archive.desc": "لن يكون هذا التصنيف متاحًا للتطبيق على الوكلاء. سيظل الوكلاء الذين تم تطبيق التصنيف عليهم بالفعل دون تغيير.",+ "workspaceSetting.labels.archive.success": "تمت أرشفة التصنيف",+ "workspaceSetting.labels.archive.title": "أرشفة \"{{name}}\"؟",+ "workspaceSetting.labels.archivedEmpty": "لا توجد تصنيفات مؤرشفة",+ "workspaceSetting.labels.columns.created": "تاريخ الإنشاء",+ "workspaceSetting.labels.columns.description": "الوصف",+ "workspaceSetting.labels.columns.name": "الاسم",+ "workspaceSetting.labels.columns.usage": "الوكلاء",+ "workspaceSetting.labels.delete.archiveHint": "لمنع التطبيق المستقبلي لهذا التصنيف، قم بأرشفته بدلاً من حذفه.",+ "workspaceSetting.labels.delete.confirmHint": "للتأكيد، اكتب \"حذف\" أدناه:",+ "workspaceSetting.labels.delete.desc": "لا يمكن التراجع عن الحذف.",+ "workspaceSetting.labels.delete.descUsed": "سيتم إزالة هذا التصنيف من {{count}} وكيل. لا يمكن التراجع عن الحذف.",+ "workspaceSetting.labels.delete.success": "تم حذف التصنيف",+ "workspaceSetting.labels.delete.title": "حذف التصنيف \"{{name}}\"؟",+ "workspaceSetting.labels.empty": "لا توجد تصنيفات حتى الآن. قم بإنشاء واحد لتنظيم وكلائك.",+ "workspaceSetting.labels.filterEmpty": "لا توجد تصنيفات تطابق الفلتر",+ "workspaceSetting.labels.filterPlaceholder": "تصفية حسب الاسم...",+ "workspaceSetting.labels.form.color": "اللون",+ "workspaceSetting.labels.form.createTitle": "تصنيف جديد",+ "workspaceSetting.labels.form.description": "الوصف",+ "workspaceSetting.labels.form.descriptionPlaceholder": "وصف اختياري",+ "workspaceSetting.labels.form.duplicateName": "يوجد بالفعل تسمية بهذا الاسم",+ "workspaceSetting.labels.form.editTitle": "تعديل التصنيف",+ "workspaceSetting.labels.form.name": "الاسم",+ "workspaceSetting.labels.form.namePlaceholder": "اسم التصنيف",+ "workspaceSetting.labels.form.restoreTitle": "إعادة التسمية للاستعادة",+ "workspaceSetting.labels.loadFailed": "تعذر تحميل التصنيفات",+ "workspaceSetting.labels.manageBlocked": "يمكن فقط لمسؤولي مساحة العمل إدارة التصنيفات",+ "workspaceSetting.labels.scope.archived": "مؤرشف",+ "workspaceSetting.labels.scope.personal": "شخصي",+ "workspaceSetting.labels.scope.workspace": "مساحة العمل",+ "workspaceSetting.labels.usage": "{{count}} وكيل","workspaceSetting.storage.comingSoon": "استيراد وتصدير البيانات على مستوى مساحة العمل قريبًا.","workspaceSetting.storage.danger.reset.confirm.content": "سيتم إعادة كل إعدادات مساحة العمل إلى الوضع الافتراضي، للجميع في مساحة العمل. لن يتم المساس بالوكلاء أو المحادثات أو الملفات.","workspaceSetting.storage.danger.reset.confirm.ok": "إعادة تعيين الإعدادات",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "سجلات التدقيق","workspaceSetting.tab.connector": "الموصلات","workspaceSetting.tab.general": "عام",+ "workspaceSetting.tab.labels": "التصنيفات","workspaceSetting.tab.members": "الأعضاء","workspaceSetting.tab.skill": "المهارات"}diff --git a/locales/ar/subscription.json b/locales/ar/subscription.jsonindex 4961840962a..4f03867f82d 100644--- a/locales/ar/subscription.json+++ b/locales/ar/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "الحد الافتراضي لميزانية العضو","credits.memberBudget.defaultLimitHint": "الأعضاء الذين ليس لديهم قاعدة مخصصة يستخدمون هذا الحد في كل دورة فوترة.","credits.memberBudget.desc": "حدد عدد الاعتمادات التي يمكن لكل عضو استخدامها في دورة الفوترة الحالية",+ "credits.memberBudget.details.action": "عرض التفاصيل",+ "credits.memberBudget.details.title": "استخدام العضو","credits.memberBudget.effectiveBudget": "الميزانية الفعالة","credits.memberBudget.empty": "لا يوجد أعضاء في مساحة العمل حتى الآن","credits.memberBudget.globalBadge": "عام",diff --git a/locales/bg-BG/chat.json b/locales/bg-BG/chat.jsonindex ecaf28eb5f3..5dcbe084400 100644--- a/locales/bg-BG/chat.json+++ b/locales/bg-BG/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Успешно създадено","sessionGroup.creatingAgent": "Създаване на агент...","sessionGroup.groupName": "Име на групата",+ "sessionGroup.hideFromSidebar": "Скрий от моята странична лента","sessionGroup.inputPlaceholder": "Въведете име на групата...","sessionGroup.manageCategory": "Управление на категория","sessionGroup.moveGroup": "Премести в група",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Успешно преименуване","sessionGroup.searchAgents": "Търсене на агенти","sessionGroup.selectedAgents": "Избрани агенти ({{count}})",+ "sessionGroup.showInSidebar": "Покажи в моята странична лента","sessionGroup.sortSuccess": "Успешно пренареждане","sessionGroup.sorting": "Актуализиране на подредбата на групата...","sessionGroup.tooLong": "Името на групата трябва да е между 1 и 20 символа",diff --git a/locales/bg-BG/common.json b/locales/bg-BG/common.jsonindex 416333046de..7b8028250c5 100644--- a/locales/bg-BG/common.json+++ b/locales/bg-BG/common.json@@ -2,6 +2,9 @@"about": "Относно","addNew": "Добави ново","advanceSettings": "Разширени настройки",+ "agentLabel.create": "Нов етикет",+ "agentLabel.manage": "Управление на етикети",+ "agentLabel.menuTitle": "Етикети","agentViewAll.addToSidebar": "Показване в страничната лента","agentViewAll.columns.author": "Автор","agentViewAll.columns.name": "Име",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Подреждане","agentViewAll.form.showSidebarHidden": "Показване на агенти, скрити от страничната лента","agentViewAll.groupBy.author": "Автор",+ "agentViewAll.groupBy.label": "Етикет",+ "agentViewAll.groupBy.noLabel": "Без етикет","agentViewAll.groupBy.none": "Без групиране","agentViewAll.groupBy.unknownAuthor": "Неизвестен автор","agentViewAll.myAgents": "Моите агенти",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Заглавие","agentViewAll.orderBy.updatedAt": "Актуализирано на","agentViewAll.removeFromSidebar": "Скриване от страничната лента",+ "agentViewAll.sidebarSection.collapse": "Сгъни",+ "agentViewAll.sidebarSection.expand": "Разгъни",+ "agentViewAll.sidebarSection.title": "В страничната лента","agentViewAll.title": "Агенти","agentViewAll.untitled": "Агент без заглавие","agentViewAll.view.card": "Картичка",diff --git a/locales/bg-BG/setting.json b/locales/bg-BG/setting.jsonindex a229fdf330b..101586fe234 100644--- a/locales/bg-BG/setting.json+++ b/locales/bg-BG/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "учредителни данни, тайни, oauth","settingsSearch.tabKeywords.devices": "устройства, сесии, влезли устройства","settingsSearch.tabKeywords.hotkey": "горещ клавиш, пряк път, клавиатура",+ "settingsSearch.tabKeywords.labels": "етикети, тагове, групиране","settingsSearch.tabKeywords.memory": "памет, спомени, персонализация","settingsSearch.tabKeywords.messenger": "месинджър, чат платформа, бот","settingsSearch.tabKeywords.notification": "известие, имейл, push, сигнали",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Импортиране от публично GitHub хранилище","tab.importFromUrl": "Импортиране от URL","tab.importFromUrl.desc": "Импортиране чрез директен линк към SKILL.md",+ "tab.labels": "Етикети","tab.llm": "Езиков модел","tab.manualFill": "Ръчно попълване","tab.manualFill.desc": "Ръчно конфигуриране на персонализирано MCP умение",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Администратор","workspaceSetting.group.agent": "Агент","workspaceSetting.group.general": "Общи",+ "workspaceSetting.labels.actions.archive": "Архивирай",+ "workspaceSetting.labels.actions.create": "Нов етикет",+ "workspaceSetting.labels.actions.unarchive": "Възстанови",+ "workspaceSetting.labels.archive.desc": "Този етикет вече няма да бъде достъпен за прилагане към агентите. Агентите, на които вече е приложен етикетът, ще останат непроменени.",+ "workspaceSetting.labels.archive.success": "Етикетът е архивиран",+ "workspaceSetting.labels.archive.title": "Архивиране на \"{{name}}\"?",+ "workspaceSetting.labels.archivedEmpty": "Няма архивирани етикети",+ "workspaceSetting.labels.columns.created": "Създаден",+ "workspaceSetting.labels.columns.description": "Описание",+ "workspaceSetting.labels.columns.name": "Име",+ "workspaceSetting.labels.columns.usage": "Агенти",+ "workspaceSetting.labels.delete.archiveHint": "За да предотвратите бъдещо прилагане на този етикет, архивирайте го вместо това.",+ "workspaceSetting.labels.delete.confirmHint": "За потвърждение, въведете \"delete\" по-долу:",+ "workspaceSetting.labels.delete.desc": "Изтриването не може да бъде отменено.",+ "workspaceSetting.labels.delete.descUsed": "Този етикет ще бъде премахнат от {{count}} агенти. Изтриването не може да бъде отменено.",+ "workspaceSetting.labels.delete.success": "Етикетът е изтрит",+ "workspaceSetting.labels.delete.title": "Изтриване на етикета \"{{name}}\"?",+ "workspaceSetting.labels.empty": "Все още няма етикети. Създайте един, за да организирате вашите агенти.",+ "workspaceSetting.labels.filterEmpty": "Няма етикети, които съответстват на филтъра",+ "workspaceSetting.labels.filterPlaceholder": "Филтрирай по име...",+ "workspaceSetting.labels.form.color": "Цвят",+ "workspaceSetting.labels.form.createTitle": "Нов етикет",+ "workspaceSetting.labels.form.description": "Описание",+ "workspaceSetting.labels.form.descriptionPlaceholder": "По избор описание",+ "workspaceSetting.labels.form.duplicateName": "Етикет с това име вече съществува",+ "workspaceSetting.labels.form.editTitle": "Редактиране на етикет",+ "workspaceSetting.labels.form.name": "Име",+ "workspaceSetting.labels.form.namePlaceholder": "Име на етикета",+ "workspaceSetting.labels.form.restoreTitle": "Преименувайте, за да възстановите",+ "workspaceSetting.labels.loadFailed": "Не можа да се заредят етикетите",+ "workspaceSetting.labels.manageBlocked": "Само администраторите на работното пространство могат да управляват етикети",+ "workspaceSetting.labels.scope.archived": "Архивирани",+ "workspaceSetting.labels.scope.personal": "Лични",+ "workspaceSetting.labels.scope.workspace": "Работно пространство",+ "workspaceSetting.labels.usage": "{{count}} агенти","workspaceSetting.storage.comingSoon": "Импортиране и експортиране на данни, обхващащи работното пространство, скоро.","workspaceSetting.storage.danger.reset.confirm.content": "Всички настройки на работното пространство ще се върнат към своите стойности по подразбиране за всички в работното пространство. Агенти, разговори и файлове няма да бъдат засегнати.","workspaceSetting.storage.danger.reset.confirm.ok": "Нулиране на настройките",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Записи за одит","workspaceSetting.tab.connector": "Конектори","workspaceSetting.tab.general": "Общи",+ "workspaceSetting.tab.labels": "Етикети","workspaceSetting.tab.members": "Членове","workspaceSetting.tab.skill": "Умения"}diff --git a/locales/bg-BG/subscription.json b/locales/bg-BG/subscription.jsonindex 00c953a1869..291d592bc8b 100644--- a/locales/bg-BG/subscription.json+++ b/locales/bg-BG/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Стандартен бюджет за членове","credits.memberBudget.defaultLimitHint": "Членовете без персонализирано правило използват този лимит за всеки цикъл на фактуриране.","credits.memberBudget.desc": "Ограничете колко кредити на работното пространство може да използва всеки член в текущия цикъл на фактуриране",+ "credits.memberBudget.details.action": "Вижте подробности",+ "credits.memberBudget.details.title": "Използване от членове","credits.memberBudget.effectiveBudget": "Ефективен бюджет","credits.memberBudget.empty": "Все още няма членове на работното пространство","credits.memberBudget.globalBadge": "Глобално",diff --git a/locales/de-DE/chat.json b/locales/de-DE/chat.jsonindex 69254b112a0..9ac1f208ab6 100644--- a/locales/de-DE/chat.json+++ b/locales/de-DE/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Erfolgreich erstellt","sessionGroup.creatingAgent": "Agent wird erstellt...","sessionGroup.groupName": "Gruppenname",+ "sessionGroup.hideFromSidebar": "Aus meiner Seitenleiste ausblenden","sessionGroup.inputPlaceholder": "Bitte Gruppennamen eingeben...","sessionGroup.manageCategory": "Kategorie verwalten","sessionGroup.moveGroup": "In Gruppe verschieben",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Erfolgreich umbenannt","sessionGroup.searchAgents": "Agenten suchen","sessionGroup.selectedAgents": "Ausgewählte Agenten ({{count}})",+ "sessionGroup.showInSidebar": "In meiner Seitenleiste anzeigen","sessionGroup.sortSuccess": "Sortierung erfolgreich","sessionGroup.sorting": "Gruppensortierung wird aktualisiert...","sessionGroup.tooLong": "Gruppenname muss zwischen 1 und 20 Zeichen lang sein",diff --git a/locales/de-DE/common.json b/locales/de-DE/common.jsonindex 6278014e528..496203957d1 100644--- a/locales/de-DE/common.json+++ b/locales/de-DE/common.json@@ -2,6 +2,9 @@"about": "Über","addNew": "Neu hinzufügen","advanceSettings": "Erweiterte Einstellungen",+ "agentLabel.create": "Neue Bezeichnung",+ "agentLabel.manage": "Bezeichnungen verwalten",+ "agentLabel.menuTitle": "Bezeichnungen","agentViewAll.addToSidebar": "Im Seitenbereich anzeigen","agentViewAll.columns.author": "Autor","agentViewAll.columns.name": "Name",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Sortierung","agentViewAll.form.showSidebarHidden": "Agenten anzeigen, die im Seitenbereich ausgeblendet sind","agentViewAll.groupBy.author": "Autor",+ "agentViewAll.groupBy.label": "Bezeichnung",+ "agentViewAll.groupBy.noLabel": "Keine Bezeichnung","agentViewAll.groupBy.none": "Keine Gruppierung","agentViewAll.groupBy.unknownAuthor": "Unbekannter Autor","agentViewAll.myAgents": "Meine Agenten",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Titel","agentViewAll.orderBy.updatedAt": "Aktualisiert am","agentViewAll.removeFromSidebar": "Im Seitenbereich ausblenden",+ "agentViewAll.sidebarSection.collapse": "Einklappen",+ "agentViewAll.sidebarSection.expand": "Ausklappen",+ "agentViewAll.sidebarSection.title": "Im Seitenbereich","agentViewAll.title": "Agenten","agentViewAll.untitled": "Unbenannter Agent","agentViewAll.view.card": "Karte",diff --git a/locales/de-DE/setting.json b/locales/de-DE/setting.jsonindex be4100db145..f382f72ca8a 100644--- a/locales/de-DE/setting.json+++ b/locales/de-DE/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "Anmeldedaten, Geheimnisse, OAuth","settingsSearch.tabKeywords.devices": "Geräte, Sitzungen, angemeldete Geräte","settingsSearch.tabKeywords.hotkey": "Hotkey, Shortcut, Tastatur",+ "settingsSearch.tabKeywords.labels": "Labels, Tags, Gruppierung","settingsSearch.tabKeywords.memory": "Speicher, Erinnerungen, Personalisierung","settingsSearch.tabKeywords.messenger": "Messenger, Chat-Plattform, Bot","settingsSearch.tabKeywords.notification": "Benachrichtigung, E-Mail, Push, Warnungen",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Importieren aus einem öffentlichen GitHub-Repository","tab.importFromUrl": "Aus URL importieren","tab.importFromUrl.desc": "Importieren über einen direkten Link zu SKILL.md",+ "tab.labels": "Labels","tab.llm": "Sprachmodell","tab.manualFill": "Manuell ausfüllen","tab.manualFill.desc": "Konfigurieren Sie einen benutzerdefinierten MCP-Skill manuell",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Admin","workspaceSetting.group.agent": "Agent","workspaceSetting.group.general": "Allgemein",+ "workspaceSetting.labels.actions.archive": "Archivieren",+ "workspaceSetting.labels.actions.create": "Neue Bezeichnung",+ "workspaceSetting.labels.actions.unarchive": "Wiederherstellen",+ "workspaceSetting.labels.archive.desc": "Diese Bezeichnung kann nicht mehr auf Agenten angewendet werden. Agenten, denen die Bezeichnung bereits zugewiesen wurde, bleiben unverändert.",+ "workspaceSetting.labels.archive.success": "Bezeichnung archiviert",+ "workspaceSetting.labels.archive.title": "„{{name}}“ archivieren?",+ "workspaceSetting.labels.archivedEmpty": "Keine archivierten Bezeichnungen",+ "workspaceSetting.labels.columns.created": "Erstellt",+ "workspaceSetting.labels.columns.description": "Beschreibung",+ "workspaceSetting.labels.columns.name": "Name",+ "workspaceSetting.labels.columns.usage": "Agenten",+ "workspaceSetting.labels.delete.archiveHint": "Um die zukünftige Anwendung dieser Bezeichnung zu verhindern, archivieren Sie die Bezeichnung stattdessen.",+ "workspaceSetting.labels.delete.confirmHint": "Zum Bestätigen geben Sie unten „löschen“ ein:",+ "workspaceSetting.labels.delete.desc": "Das Löschen kann nicht rückgängig gemacht werden.",+ "workspaceSetting.labels.delete.descUsed": "Diese Bezeichnung wird von {{count}} Agenten entfernt. Das Löschen kann nicht rückgängig gemacht werden.",+ "workspaceSetting.labels.delete.success": "Bezeichnung gelöscht",+ "workspaceSetting.labels.delete.title": "Die Bezeichnung „{{name}}“ löschen?",+ "workspaceSetting.labels.empty": "Noch keine Bezeichnungen. Erstellen Sie eine, um Ihre Agenten zu organisieren.",+ "workspaceSetting.labels.filterEmpty": "Keine Bezeichnungen entsprechen dem Filter",+ "workspaceSetting.labels.filterPlaceholder": "Nach Name filtern...",+ "workspaceSetting.labels.form.color": "Farbe",+ "workspaceSetting.labels.form.createTitle": "Neue Bezeichnung",+ "workspaceSetting.labels.form.description": "Beschreibung",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Optionale Beschreibung",+ "workspaceSetting.labels.form.duplicateName": "Ein Label mit diesem Namen existiert bereits",+ "workspaceSetting.labels.form.editTitle": "Bezeichnung bearbeiten",+ "workspaceSetting.labels.form.name": "Name",+ "workspaceSetting.labels.form.namePlaceholder": "Bezeichnungsname",+ "workspaceSetting.labels.form.restoreTitle": "Umbenennen, um wiederherzustellen",+ "workspaceSetting.labels.loadFailed": "Konnte Labels nicht laden",+ "workspaceSetting.labels.manageBlocked": "Nur Workspace-Administratoren können Bezeichnungen verwalten",+ "workspaceSetting.labels.scope.archived": "Archiviert",+ "workspaceSetting.labels.scope.personal": "Persönlich",+ "workspaceSetting.labels.scope.workspace": "Workspace",+ "workspaceSetting.labels.usage": "{{count}} Agenten","workspaceSetting.storage.comingSoon": "Datenimport und -export auf Arbeitsbereichsebene kommt bald.","workspaceSetting.storage.danger.reset.confirm.content": "Jede Arbeitsbereichseinstellung wird für alle im Arbeitsbereich auf die Standardeinstellungen zurückgesetzt. Agenten, Unterhaltungen und Dateien bleiben unberührt.","workspaceSetting.storage.danger.reset.confirm.ok": "Einstellungen zurücksetzen",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Audit-Protokolle","workspaceSetting.tab.connector": "Konnektoren","workspaceSetting.tab.general": "Allgemein",+ "workspaceSetting.tab.labels": "Bezeichnungen","workspaceSetting.tab.members": "Mitglieder","workspaceSetting.tab.skill": "Fähigkeiten"}diff --git a/locales/de-DE/subscription.json b/locales/de-DE/subscription.jsonindex 2ee105ac2db..08012052df7 100644--- a/locales/de-DE/subscription.json+++ b/locales/de-DE/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Standardmitgliedsbudget","credits.memberBudget.defaultLimitHint": "Mitglieder ohne benutzerdefinierte Regel verwenden dieses Limit in jedem Abrechnungszeitraum.","credits.memberBudget.desc": "Begrenzen Sie, wie viele Arbeitsbereichs-Credits jedes Mitglied im aktuellen Abrechnungszeitraum verwenden kann",+ "credits.memberBudget.details.action": "Details anzeigen",+ "credits.memberBudget.details.title": "Mitgliedsnutzung","credits.memberBudget.effectiveBudget": "Effektives Budget","credits.memberBudget.empty": "Noch keine Mitglieder im Arbeitsbereich","credits.memberBudget.globalBadge": "Global",diff --git a/locales/en-US/chat.json b/locales/en-US/chat.jsonindex edeba85dd46..7ed9010a70b 100644--- a/locales/en-US/chat.json+++ b/locales/en-US/chat.json@@ -884,6 +884,7 @@"sessionGroup.createSuccess": "Created successfully","sessionGroup.creatingAgent": "Creating agent...","sessionGroup.groupName": "Category Name",+ "sessionGroup.hideFromSidebar": "Hide from my sidebar","sessionGroup.inputPlaceholder": "Please enter category name...","sessionGroup.manageCategory": "Manage Category","sessionGroup.moveGroup": "Move to Category",@@ -898,6 +899,7 @@"sessionGroup.renameSuccess": "Renamed successfully","sessionGroup.searchAgents": "Search agents","sessionGroup.selectedAgents": "Selected agents ({{count}})",+ "sessionGroup.showInSidebar": "Show in my sidebar","sessionGroup.sortSuccess": "Reorder successful","sessionGroup.sorting": "Category sorting updating...","sessionGroup.tooLong": "Category name length should be between 1-20",diff --git a/locales/en-US/common.json b/locales/en-US/common.jsonindex cc48d3b5264..6d6f8bfbb18 100644--- a/locales/en-US/common.json+++ b/locales/en-US/common.json@@ -2,22 +2,27 @@"about": "About","addNew": "Add new","advanceSettings": "Advanced Settings",- "agentViewAll.addToSidebar": "Show in sidebar",- "agentViewAll.columns.author": "Author",- "agentViewAll.columns.name": "Name",- "agentViewAll.columns.updatedAt": "Last update time",+ "agentLabel.create": "New label",+ "agentLabel.manage": "Manage labels",+ "agentLabel.menuTitle": "Labels",+ "agentViewAll.addToSidebar": "Show in my sidebar","agentViewAll.empty": "No agents yet","agentViewAll.form.grouping": "Grouping","agentViewAll.form.ordering": "Ordering",- "agentViewAll.form.showSidebarHidden": "Show agents hidden from sidebar",+ "agentViewAll.form.showSidebarHidden": "Show agents hidden from my sidebar","agentViewAll.groupBy.author": "Author",+ "agentViewAll.groupBy.label": "Label",+ "agentViewAll.groupBy.noLabel": "No label","agentViewAll.groupBy.none": "No grouping","agentViewAll.groupBy.unknownAuthor": "Unknown author","agentViewAll.myAgents": "My Agents","agentViewAll.orderBy.author": "Author","agentViewAll.orderBy.title": "Title","agentViewAll.orderBy.updatedAt": "Updated at",- "agentViewAll.removeFromSidebar": "Hide from sidebar",+ "agentViewAll.removeFromSidebar": "Hide from my sidebar",+ "agentViewAll.sidebarSection.collapse": "Fold",+ "agentViewAll.sidebarSection.expand": "Unfold",+ "agentViewAll.sidebarSection.title": "In Sidebar","agentViewAll.title": "Agents","agentViewAll.untitled": "Untitled Agent","agentViewAll.view.card": "Card",diff --git a/locales/en-US/setting.json b/locales/en-US/setting.jsonindex d1ac1aa6adc..4e8d9b72f7a 100644--- a/locales/en-US/setting.json+++ b/locales/en-US/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "credentials, secrets, oauth","settingsSearch.tabKeywords.devices": "devices, sessions, logged in devices","settingsSearch.tabKeywords.hotkey": "hotkey, shortcut, keyboard",+ "settingsSearch.tabKeywords.labels": "labels, tags, grouping","settingsSearch.tabKeywords.memory": "memory, memories, personalization","settingsSearch.tabKeywords.messenger": "messenger, chat platform, bot","settingsSearch.tabKeywords.notification": "notification, email, push, alerts",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Import from a public GitHub repository","tab.importFromUrl": "Import from URL","tab.importFromUrl.desc": "Import via a direct link to SKILL.md",+ "tab.labels": "Labels","tab.llm": "Language Model","tab.manualFill": "Manually Fill In","tab.manualFill.desc": "Configure a custom MCP skill manually",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Admin","workspaceSetting.group.agent": "Agent","workspaceSetting.group.general": "General",+ "workspaceSetting.labels.actions.archive": "Archive",+ "workspaceSetting.labels.actions.create": "New label",+ "workspaceSetting.labels.actions.unarchive": "Restore",+ "workspaceSetting.labels.archive.desc": "This label will no longer be available to apply to agents. Agents with the label already applied will remain unchanged.",+ "workspaceSetting.labels.archive.success": "Label archived",+ "workspaceSetting.labels.archive.title": "Archive \"{{name}}\"?",+ "workspaceSetting.labels.archivedEmpty": "No archived labels",+ "workspaceSetting.labels.columns.created": "Created",+ "workspaceSetting.labels.columns.description": "Description",+ "workspaceSetting.labels.columns.name": "Name",+ "workspaceSetting.labels.columns.usage": "Agents",+ "workspaceSetting.labels.delete.archiveHint": "To prevent future application of this label, archive the label instead.",+ "workspaceSetting.labels.delete.confirmHint": "To confirm, type \"delete\" below:",+ "workspaceSetting.labels.delete.desc": "Deletion cannot be undone.",+ "workspaceSetting.labels.delete.descUsed": "This label will be removed from {{count}} agents. Deletion cannot be undone.",+ "workspaceSetting.labels.delete.success": "Label deleted",+ "workspaceSetting.labels.delete.title": "Delete the label \"{{name}}\"?",+ "workspaceSetting.labels.empty": "No labels yet. Create one to organize your agents.",+ "workspaceSetting.labels.filterEmpty": "No labels match the filter",+ "workspaceSetting.labels.filterPlaceholder": "Filter by name...",+ "workspaceSetting.labels.form.color": "Color",+ "workspaceSetting.labels.form.createTitle": "New label",+ "workspaceSetting.labels.form.description": "Description",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Optional description",+ "workspaceSetting.labels.form.duplicateName": "A label with this name already exists",+ "workspaceSetting.labels.form.editTitle": "Edit label",+ "workspaceSetting.labels.form.name": "Name",+ "workspaceSetting.labels.form.namePlaceholder": "Label name",+ "workspaceSetting.labels.form.restoreTitle": "Rename to restore",+ "workspaceSetting.labels.loadFailed": "Couldn't load labels",+ "workspaceSetting.labels.manageBlocked": "Only workspace admins can manage labels",+ "workspaceSetting.labels.scope.archived": "Archived",+ "workspaceSetting.labels.scope.personal": "Personal",+ "workspaceSetting.labels.scope.workspace": "Workspace",+ "workspaceSetting.labels.usage": "{{count}} agents","workspaceSetting.storage.comingSoon": "Workspace-scoped data import & export is coming soon.","workspaceSetting.storage.danger.reset.confirm.content": "Every workspace setting goes back to its default, for everyone in the workspace. Agents, conversations, and files are not touched.","workspaceSetting.storage.danger.reset.confirm.ok": "Reset Settings",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Audit logs","workspaceSetting.tab.connector": "Connectors","workspaceSetting.tab.general": "General",+ "workspaceSetting.tab.labels": "Labels","workspaceSetting.tab.members": "Members","workspaceSetting.tab.skill": "Skills"}diff --git a/locales/en-US/subscription.json b/locales/en-US/subscription.jsonindex 20a54e80e62..a5ad68bc2e3 100644--- a/locales/en-US/subscription.json+++ b/locales/en-US/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Default member budget","credits.memberBudget.defaultLimitHint": "Members without a custom rule use this limit each billing cycle.","credits.memberBudget.desc": "Limit how many workspace credits each member can use in the current billing cycle",+ "credits.memberBudget.details.action": "View details",+ "credits.memberBudget.details.title": "Member usage","credits.memberBudget.effectiveBudget": "Effective budget","credits.memberBudget.empty": "No workspace members yet","credits.memberBudget.globalBadge": "Global",@@ -151,7 +153,7 @@"credits.memberBudget.status.inherit": "Inherits default","credits.memberBudget.status.unlimited": "Unlimited","credits.memberBudget.target.allMembers": "All members",- "credits.memberBudget.title": "Budget",+ "credits.memberBudget.title": "Member Budget Control","credits.memberBudget.unlimited": "Unlimited","credits.memberBudget.unlimitedMemberHint": "Set an all-members rule first before adding an unlimited override for a single member.","credits.memberBudget.upgradeCta": "View plans",diff --git a/locales/es-ES/chat.json b/locales/es-ES/chat.jsonindex a6b507fcd21..330ee2dba81 100644--- a/locales/es-ES/chat.json+++ b/locales/es-ES/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Creado con éxito","sessionGroup.creatingAgent": "Creando agente...","sessionGroup.groupName": "Nombre del grupo",+ "sessionGroup.hideFromSidebar": "Ocultar de mi barra lateral","sessionGroup.inputPlaceholder": "Introduce el nombre del grupo...","sessionGroup.manageCategory": "Gestionar Categoría","sessionGroup.moveGroup": "Mover al grupo",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Renombrado con éxito","sessionGroup.searchAgents": "Buscar agentes","sessionGroup.selectedAgents": "Agentes seleccionados ({{count}})",+ "sessionGroup.showInSidebar": "Mostrar en mi barra lateral","sessionGroup.sortSuccess": "Reordenado con éxito","sessionGroup.sorting": "Actualizando orden del grupo...","sessionGroup.tooLong": "El nombre del grupo debe tener entre 1 y 20 caracteres",diff --git a/locales/es-ES/common.json b/locales/es-ES/common.jsonindex ac565dabfc8..874dd948274 100644--- a/locales/es-ES/common.json+++ b/locales/es-ES/common.json@@ -2,6 +2,9 @@"about": "Acerca de","addNew": "Agregar nuevo","advanceSettings": "Configuración avanzada",+ "agentLabel.create": "Nueva etiqueta",+ "agentLabel.manage": "Gestionar etiquetas",+ "agentLabel.menuTitle": "Etiquetas","agentViewAll.addToSidebar": "Mostrar en la barra lateral","agentViewAll.columns.author": "Autor","agentViewAll.columns.name": "Nombre",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Ordenación","agentViewAll.form.showSidebarHidden": "Mostrar agentes ocultos de la barra lateral","agentViewAll.groupBy.author": "Autor",+ "agentViewAll.groupBy.label": "Etiqueta",+ "agentViewAll.groupBy.noLabel": "Sin etiqueta","agentViewAll.groupBy.none": "Sin agrupación","agentViewAll.groupBy.unknownAuthor": "Autor desconocido","agentViewAll.myAgents": "Mis Agentes",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Título","agentViewAll.orderBy.updatedAt": "Actualizado en","agentViewAll.removeFromSidebar": "Ocultar de la barra lateral",+ "agentViewAll.sidebarSection.collapse": "Plegar",+ "agentViewAll.sidebarSection.expand": "Desplegar",+ "agentViewAll.sidebarSection.title": "En la barra lateral","agentViewAll.title": "Agentes","agentViewAll.untitled": "Agente sin título","agentViewAll.view.card": "Tarjeta",diff --git a/locales/es-ES/setting.json b/locales/es-ES/setting.jsonindex 39411856c72..b7ab1ea9c7a 100644--- a/locales/es-ES/setting.json+++ b/locales/es-ES/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "credenciales, secretos, oauth","settingsSearch.tabKeywords.devices": "dispositivos, sesiones, dispositivos conectados","settingsSearch.tabKeywords.hotkey": "tecla de acceso rápido, atajo, teclado",+ "settingsSearch.tabKeywords.labels": "etiquetas, etiquetas, agrupación","settingsSearch.tabKeywords.memory": "memoria, recuerdos, personalización","settingsSearch.tabKeywords.messenger": "mensajero, plataforma de chat, bot","settingsSearch.tabKeywords.notification": "notificación, correo electrónico, push, alertas",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Importar desde un repositorio público de GitHub","tab.importFromUrl": "Importar desde URL","tab.importFromUrl.desc": "Importar mediante un enlace directo a SKILL.md",+ "tab.labels": "Etiquetas","tab.llm": "Modelo de Lenguaje","tab.manualFill": "Rellenar Manualmente","tab.manualFill.desc": "Configura manualmente una habilidad MCP personalizada",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Administrador","workspaceSetting.group.agent": "Agente","workspaceSetting.group.general": "General",+ "workspaceSetting.labels.actions.archive": "Archivar",+ "workspaceSetting.labels.actions.create": "Nueva etiqueta",+ "workspaceSetting.labels.actions.unarchive": "Restaurar",+ "workspaceSetting.labels.archive.desc": "Esta etiqueta ya no estará disponible para aplicarse a los agentes. Los agentes que ya tengan aplicada la etiqueta permanecerán sin cambios.",+ "workspaceSetting.labels.archive.success": "Etiqueta archivada",+ "workspaceSetting.labels.archive.title": "¿Archivar \"{{name}}\"?",+ "workspaceSetting.labels.archivedEmpty": "No hay etiquetas archivadas",+ "workspaceSetting.labels.columns.created": "Creado",+ "workspaceSetting.labels.columns.description": "Descripción",+ "workspaceSetting.labels.columns.name": "Nombre",+ "workspaceSetting.labels.columns.usage": "Agentes",+ "workspaceSetting.labels.delete.archiveHint": "Para evitar la aplicación futura de esta etiqueta, archívala en su lugar.",+ "workspaceSetting.labels.delete.confirmHint": "Para confirmar, escribe \"eliminar\" a continuación:",+ "workspaceSetting.labels.delete.desc": "La eliminación no se puede deshacer.",+ "workspaceSetting.labels.delete.descUsed": "Esta etiqueta se eliminará de {{count}} agentes. La eliminación no se puede deshacer.",+ "workspaceSetting.labels.delete.success": "Etiqueta eliminada",+ "workspaceSetting.labels.delete.title": "¿Eliminar la etiqueta \"{{name}}\"?",+ "workspaceSetting.labels.empty": "Aún no hay etiquetas. Crea una para organizar a tus agentes.",+ "workspaceSetting.labels.filterEmpty": "No hay etiquetas que coincidan con el filtro",+ "workspaceSetting.labels.filterPlaceholder": "Filtrar por nombre...",+ "workspaceSetting.labels.form.color": "Color",+ "workspaceSetting.labels.form.createTitle": "Nueva etiqueta",+ "workspaceSetting.labels.form.description": "Descripción",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Descripción opcional",+ "workspaceSetting.labels.form.duplicateName": "Ya existe una etiqueta con este nombre",+ "workspaceSetting.labels.form.editTitle": "Editar etiqueta",+ "workspaceSetting.labels.form.name": "Nombre",+ "workspaceSetting.labels.form.namePlaceholder": "Nombre de la etiqueta",+ "workspaceSetting.labels.form.restoreTitle": "Renombrar para restaurar",+ "workspaceSetting.labels.loadFailed": "No se pudieron cargar las etiquetas",+ "workspaceSetting.labels.manageBlocked": "Solo los administradores del espacio de trabajo pueden gestionar etiquetas",+ "workspaceSetting.labels.scope.archived": "Archivado",+ "workspaceSetting.labels.scope.personal": "Personal",+ "workspaceSetting.labels.scope.workspace": "Espacio de trabajo",+ "workspaceSetting.labels.usage": "{{count}} agentes","workspaceSetting.storage.comingSoon": "La importación y exportación de datos a nivel de espacio de trabajo estará disponible pronto.","workspaceSetting.storage.danger.reset.confirm.content": "Cada configuración del espacio de trabajo volverá a su valor predeterminado para todos en el espacio de trabajo. Los agentes, conversaciones y archivos no se verán afectados.","workspaceSetting.storage.danger.reset.confirm.ok": "Restablecer Configuración",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Registros de auditoría","workspaceSetting.tab.connector": "Conectores","workspaceSetting.tab.general": "General",+ "workspaceSetting.tab.labels": "Etiquetas","workspaceSetting.tab.members": "Miembros","workspaceSetting.tab.skill": "Habilidades"}diff --git a/locales/es-ES/subscription.json b/locales/es-ES/subscription.jsonindex 239825df9ba..0b81d6a2396 100644--- a/locales/es-ES/subscription.json+++ b/locales/es-ES/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Presupuesto predeterminado por miembro","credits.memberBudget.defaultLimitHint": "Los miembros sin una regla personalizada usan este límite en cada ciclo de facturación.","credits.memberBudget.desc": "Limita cuántos créditos del espacio de trabajo puede usar cada miembro en el ciclo de facturación actual",+ "credits.memberBudget.details.action": "Ver detalles",+ "credits.memberBudget.details.title": "Uso del miembro","credits.memberBudget.effectiveBudget": "Presupuesto efectivo","credits.memberBudget.empty": "Aún no hay miembros en el espacio de trabajo","credits.memberBudget.globalBadge": "Global",diff --git a/locales/fa-IR/chat.json b/locales/fa-IR/chat.jsonindex 9c2f4d8d77e..11454528f0a 100644--- a/locales/fa-IR/chat.json+++ b/locales/fa-IR/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "با موفقیت ایجاد شد","sessionGroup.creatingAgent": "در حال ایجاد نماینده...","sessionGroup.groupName": "نام گروه",+ "sessionGroup.hideFromSidebar": "از نوار کناری من مخفی کن","sessionGroup.inputPlaceholder": "لطفاً نام گروه را وارد کنید...","sessionGroup.manageCategory": "مدیریت دستهبندی","sessionGroup.moveGroup": "انتقال به گروه",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "با موفقیت تغییر نام یافت","sessionGroup.searchAgents": "جستجوی نمایندهها","sessionGroup.selectedAgents": "نمایندههای انتخابشده ({{count}})",+ "sessionGroup.showInSidebar": "در نوار کناری من نمایش بده","sessionGroup.sortSuccess": "مرتبسازی با موفقیت انجام شد","sessionGroup.sorting": "در حال بهروزرسانی ترتیب گروه...","sessionGroup.tooLong": "طول نام گروه باید بین ۱ تا ۲۰ کاراکتر باشد",diff --git a/locales/fa-IR/common.json b/locales/fa-IR/common.jsonindex 0a180324112..efbd6883cdd 100644--- a/locales/fa-IR/common.json+++ b/locales/fa-IR/common.json@@ -2,6 +2,9 @@"about": "درباره","addNew": "افزودن جدید","advanceSettings": "تنظیمات پیشرفته",+ "agentLabel.create": "برچسب جدید",+ "agentLabel.manage": "مدیریت برچسبها",+ "agentLabel.menuTitle": "برچسبها","agentViewAll.addToSidebar": "نمایش در نوار کناری","agentViewAll.columns.author": "نویسنده","agentViewAll.columns.name": "نام",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "ترتیبدهی","agentViewAll.form.showSidebarHidden": "نمایش عوامل مخفی شده از نوار کناری","agentViewAll.groupBy.author": "نویسنده",+ "agentViewAll.groupBy.label": "برچسب",+ "agentViewAll.groupBy.noLabel": "بدون برچسب","agentViewAll.groupBy.none": "بدون گروهبندی","agentViewAll.groupBy.unknownAuthor": "نویسنده ناشناس","agentViewAll.myAgents": "عوامل من",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "عنوان","agentViewAll.orderBy.updatedAt": "بهروزرسانی شده در","agentViewAll.removeFromSidebar": "مخفی کردن از نوار کناری",+ "agentViewAll.sidebarSection.collapse": "جمع کردن",+ "agentViewAll.sidebarSection.expand": "باز کردن",+ "agentViewAll.sidebarSection.title": "در نوار کناری","agentViewAll.title": "عوامل","agentViewAll.untitled": "عامل بدون عنوان","agentViewAll.view.card": "کارت",diff --git a/locales/fa-IR/setting.json b/locales/fa-IR/setting.jsonindex 3f672db2ef2..be187e6c1c4 100644--- a/locales/fa-IR/setting.json+++ b/locales/fa-IR/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "اعتبارنامهها، رمزها، OAuth","settingsSearch.tabKeywords.devices": "دستگاهها، جلسات، دستگاههای وارد شده","settingsSearch.tabKeywords.hotkey": "کلید میانبر، میانبر، صفحهکلید",+ "settingsSearch.tabKeywords.labels": "برچسبها، تگها، گروهبندی","settingsSearch.tabKeywords.memory": "حافظه، خاطرات، شخصیسازی","settingsSearch.tabKeywords.messenger": "پیامرسان، پلتفرم چت، ربات","settingsSearch.tabKeywords.notification": "اعلان، ایمیل، پوش، هشدارها",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "وارد کردن از یک مخزن عمومی GitHub","tab.importFromUrl": "وارد کردن از URL","tab.importFromUrl.desc": "وارد کردن از طریق یک لینک مستقیم به SKILL.md",+ "tab.labels": "برچسبها","tab.llm": "مدل زبانی","tab.manualFill": "پر کردن دستی","tab.manualFill.desc": "یک مهارت MCP سفارشی را بهصورت دستی پیکربندی کنید",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "مدیر","workspaceSetting.group.agent": "نماینده","workspaceSetting.group.general": "عمومی",+ "workspaceSetting.labels.actions.archive": "بایگانی",+ "workspaceSetting.labels.actions.create": "برچسب جدید",+ "workspaceSetting.labels.actions.unarchive": "بازیابی",+ "workspaceSetting.labels.archive.desc": "این برچسب دیگر برای اعمال به نمایندگان در دسترس نخواهد بود. نمایندگانی که این برچسب قبلاً به آنها اعمال شده است بدون تغییر باقی خواهند ماند.",+ "workspaceSetting.labels.archive.success": "برچسب بایگانی شد",+ "workspaceSetting.labels.archive.title": "بایگانی \"{{name}}\"؟",+ "workspaceSetting.labels.archivedEmpty": "هیچ برچسب بایگانیشدهای وجود ندارد",+ "workspaceSetting.labels.columns.created": "ایجاد شده",+ "workspaceSetting.labels.columns.description": "توضیحات",+ "workspaceSetting.labels.columns.name": "نام",+ "workspaceSetting.labels.columns.usage": "نمایندگان",+ "workspaceSetting.labels.delete.archiveHint": "برای جلوگیری از استفاده آینده از این برچسب، به جای حذف، آن را بایگانی کنید.",+ "workspaceSetting.labels.delete.confirmHint": "برای تأیید، عبارت \"delete\" را در زیر وارد کنید:",+ "workspaceSetting.labels.delete.desc": "حذف غیرقابل بازگشت است.",+ "workspaceSetting.labels.delete.descUsed": "این برچسب از {{count}} نماینده حذف خواهد شد. حذف غیرقابل بازگشت است.",+ "workspaceSetting.labels.delete.success": "برچسب حذف شد",+ "workspaceSetting.labels.delete.title": "حذف برچسب \"{{name}}\"؟",+ "workspaceSetting.labels.empty": "هنوز هیچ برچسبی وجود ندارد. یکی ایجاد کنید تا نمایندگان خود را سازماندهی کنید.",+ "workspaceSetting.labels.filterEmpty": "هیچ برچسبی با این فیلتر مطابقت ندارد",+ "workspaceSetting.labels.filterPlaceholder": "فیلتر بر اساس نام...",+ "workspaceSetting.labels.form.color": "رنگ",+ "workspaceSetting.labels.form.createTitle": "برچسب جدید",+ "workspaceSetting.labels.form.description": "توضیحات",+ "workspaceSetting.labels.form.descriptionPlaceholder": "توضیحات اختیاری",+ "workspaceSetting.labels.form.duplicateName": "برچسبی با این نام قبلاً وجود دارد",+ "workspaceSetting.labels.form.editTitle": "ویرایش برچسب",+ "workspaceSetting.labels.form.name": "نام",+ "workspaceSetting.labels.form.namePlaceholder": "نام برچسب",+ "workspaceSetting.labels.form.restoreTitle": "برای بازیابی تغییر نام دهید",+ "workspaceSetting.labels.loadFailed": "برچسبها بارگیری نشدند",+ "workspaceSetting.labels.manageBlocked": "فقط مدیران فضای کاری میتوانند برچسبها را مدیریت کنند",+ "workspaceSetting.labels.scope.archived": "بایگانیشده",+ "workspaceSetting.labels.scope.personal": "شخصی",+ "workspaceSetting.labels.scope.workspace": "فضای کاری",+ "workspaceSetting.labels.usage": "{{count}} نماینده","workspaceSetting.storage.comingSoon": "وارد کردن و صادر کردن دادههای فضای کاری به زودی ارائه میشود.","workspaceSetting.storage.danger.reset.confirm.content": "تمام تنظیمات فضای کاری به حالت پیشفرض بازمیگردند، برای همه افراد در فضای کاری. عوامل، مکالمات و فایلها دستنخورده باقی میمانند.","workspaceSetting.storage.danger.reset.confirm.ok": "بازنشانی تنظیمات",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "گزارشهای حسابرسی","workspaceSetting.tab.connector": "اتصالدهندهها","workspaceSetting.tab.general": "عمومی",+ "workspaceSetting.tab.labels": "برچسبها","workspaceSetting.tab.members": "اعضا","workspaceSetting.tab.skill": "مهارتها"}diff --git a/locales/fa-IR/subscription.json b/locales/fa-IR/subscription.jsonindex 17e400bba1c..e72ab6f0f28 100644--- a/locales/fa-IR/subscription.json+++ b/locales/fa-IR/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "بودجه پیشفرض اعضا","credits.memberBudget.defaultLimitHint": "اعضایی که قانون سفارشی ندارند، در هر دوره صورتحساب از این محدودیت استفاده میکنند.","credits.memberBudget.desc": "محدود کردن تعداد اعتبارهای فضای کاری که هر عضو میتواند در دوره صورتحساب فعلی استفاده کند",+ "credits.memberBudget.details.action": "مشاهده جزئیات",+ "credits.memberBudget.details.title": "استفاده اعضا","credits.memberBudget.effectiveBudget": "بودجه مؤثر","credits.memberBudget.empty": "هنوز هیچ عضوی در فضای کاری وجود ندارد","credits.memberBudget.globalBadge": "جهانی",diff --git a/locales/fr-FR/chat.json b/locales/fr-FR/chat.jsonindex 1a294b01ee1..9cd1578042e 100644--- a/locales/fr-FR/chat.json+++ b/locales/fr-FR/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Créé avec succès","sessionGroup.creatingAgent": "Création de l'agent...","sessionGroup.groupName": "Nom du groupe",+ "sessionGroup.hideFromSidebar": "Masquer de ma barre latérale","sessionGroup.inputPlaceholder": "Veuillez entrer un nom de groupe...","sessionGroup.manageCategory": "Gérer la catégorie","sessionGroup.moveGroup": "Déplacer vers le groupe",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Renommé avec succès","sessionGroup.searchAgents": "Rechercher des agents","sessionGroup.selectedAgents": "Agents sélectionnés ({{count}})",+ "sessionGroup.showInSidebar": "Afficher dans ma barre latérale","sessionGroup.sortSuccess": "Réorganisation réussie","sessionGroup.sorting": "Mise à jour du tri des groupes...","sessionGroup.tooLong": "Le nom du groupe doit contenir entre 1 et 20 caractères",diff --git a/locales/fr-FR/common.json b/locales/fr-FR/common.jsonindex 9d4461a9e7f..bfe98d76460 100644--- a/locales/fr-FR/common.json+++ b/locales/fr-FR/common.json@@ -2,6 +2,9 @@"about": "À propos","addNew": "Ajouter nouveau","advanceSettings": "Paramètres avancés",+ "agentLabel.create": "Nouveau label",+ "agentLabel.manage": "Gérer les labels",+ "agentLabel.menuTitle": "Labels","agentViewAll.addToSidebar": "Afficher dans la barre latérale","agentViewAll.columns.author": "Auteur","agentViewAll.columns.name": "Nom",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Ordre","agentViewAll.form.showSidebarHidden": "Afficher les agents masqués de la barre latérale","agentViewAll.groupBy.author": "Auteur",+ "agentViewAll.groupBy.label": "Label",+ "agentViewAll.groupBy.noLabel": "Aucun label","agentViewAll.groupBy.none": "Aucun regroupement","agentViewAll.groupBy.unknownAuthor": "Auteur inconnu","agentViewAll.myAgents": "Mes Agents",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Titre","agentViewAll.orderBy.updatedAt": "Mis à jour le","agentViewAll.removeFromSidebar": "Masquer de la barre latérale",+ "agentViewAll.sidebarSection.collapse": "Replier",+ "agentViewAll.sidebarSection.expand": "Déplier",+ "agentViewAll.sidebarSection.title": "Dans la barre latérale","agentViewAll.title": "Agents","agentViewAll.untitled": "Agent sans titre","agentViewAll.view.card": "Carte",diff --git a/locales/fr-FR/setting.json b/locales/fr-FR/setting.jsonindex 9039c4e7eb6..78d8946472f 100644--- a/locales/fr-FR/setting.json+++ b/locales/fr-FR/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "identifiants, secrets, oauth","settingsSearch.tabKeywords.devices": "appareils, sessions, appareils connectés","settingsSearch.tabKeywords.hotkey": "raccourci clavier, raccourci, clavier",+ "settingsSearch.tabKeywords.labels": "étiquettes, tags, regroupement","settingsSearch.tabKeywords.memory": "mémoire, souvenirs, personnalisation","settingsSearch.tabKeywords.messenger": "messagerie, plateforme de chat, bot","settingsSearch.tabKeywords.notification": "notification, email, push, alertes",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Importer depuis un dépôt GitHub public","tab.importFromUrl": "Importer depuis une URL","tab.importFromUrl.desc": "Importer via un lien direct vers SKILL.md",+ "tab.labels": "Étiquettes","tab.llm": "Modèle de langage","tab.manualFill": "Remplir manuellement","tab.manualFill.desc": "Configurer manuellement une compétence MCP personnalisée",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Administrateur","workspaceSetting.group.agent": "Agent","workspaceSetting.group.general": "Général",+ "workspaceSetting.labels.actions.archive": "Archiver",+ "workspaceSetting.labels.actions.create": "Nouveau label",+ "workspaceSetting.labels.actions.unarchive": "Restaurer",+ "workspaceSetting.labels.archive.desc": "Ce label ne sera plus disponible pour être appliqué aux agents. Les agents auxquels le label est déjà appliqué resteront inchangés.",+ "workspaceSetting.labels.archive.success": "Label archivé",+ "workspaceSetting.labels.archive.title": "Archiver \"{{name}}\" ?",+ "workspaceSetting.labels.archivedEmpty": "Aucun label archivé",+ "workspaceSetting.labels.columns.created": "Créé",+ "workspaceSetting.labels.columns.description": "Description",+ "workspaceSetting.labels.columns.name": "Nom",+ "workspaceSetting.labels.columns.usage": "Agents",+ "workspaceSetting.labels.delete.archiveHint": "Pour empêcher l'application future de ce label, archivez-le plutôt.",+ "workspaceSetting.labels.delete.confirmHint": "Pour confirmer, tapez \"supprimer\" ci-dessous :",+ "workspaceSetting.labels.delete.desc": "La suppression est irréversible.",+ "workspaceSetting.labels.delete.descUsed": "Ce label sera retiré de {{count}} agents. La suppression est irréversible.",+ "workspaceSetting.labels.delete.success": "Label supprimé",+ "workspaceSetting.labels.delete.title": "Supprimer le label \"{{name}}\" ?",+ "workspaceSetting.labels.empty": "Aucun label pour le moment. Créez-en un pour organiser vos agents.",+ "workspaceSetting.labels.filterEmpty": "Aucun label ne correspond au filtre",+ "workspaceSetting.labels.filterPlaceholder": "Filtrer par nom...",+ "workspaceSetting.labels.form.color": "Couleur",+ "workspaceSetting.labels.form.createTitle": "Nouveau label",+ "workspaceSetting.labels.form.description": "Description",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Description facultative",+ "workspaceSetting.labels.form.duplicateName": "Un libellé portant ce nom existe déjà",+ "workspaceSetting.labels.form.editTitle": "Modifier le label",+ "workspaceSetting.labels.form.name": "Nom",+ "workspaceSetting.labels.form.namePlaceholder": "Nom du label",+ "workspaceSetting.labels.form.restoreTitle": "Renommer pour restaurer",+ "workspaceSetting.labels.loadFailed": "Impossible de charger les étiquettes",+ "workspaceSetting.labels.manageBlocked": "Seuls les administrateurs de l'espace de travail peuvent gérer les labels",+ "workspaceSetting.labels.scope.archived": "Archivé",+ "workspaceSetting.labels.scope.personal": "Personnel",+ "workspaceSetting.labels.scope.workspace": "Espace de travail",+ "workspaceSetting.labels.usage": "{{count}} agents","workspaceSetting.storage.comingSoon": "L'importation et l'exportation de données au niveau de l'espace de travail arrivent bientôt.","workspaceSetting.storage.danger.reset.confirm.content": "Tous les paramètres de l'espace de travail reviennent à leurs valeurs par défaut, pour tous les membres de l'espace de travail. Les agents, conversations et fichiers ne sont pas affectés.","workspaceSetting.storage.danger.reset.confirm.ok": "Réinitialiser les Paramètres",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Journaux d'audit","workspaceSetting.tab.connector": "Connecteurs","workspaceSetting.tab.general": "Général",+ "workspaceSetting.tab.labels": "Labels","workspaceSetting.tab.members": "Membres","workspaceSetting.tab.skill": "Compétences"}diff --git a/locales/fr-FR/subscription.json b/locales/fr-FR/subscription.jsonindex be31eb01c55..c384cd6ccba 100644--- a/locales/fr-FR/subscription.json+++ b/locales/fr-FR/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Budget par défaut des membres","credits.memberBudget.defaultLimitHint": "Les membres sans règle personnalisée utilisent cette limite à chaque cycle de facturation.","credits.memberBudget.desc": "Limitez le nombre de crédits d'espace de travail que chaque membre peut utiliser dans le cycle de facturation en cours",+ "credits.memberBudget.details.action": "Voir les détails",+ "credits.memberBudget.details.title": "Utilisation par membre","credits.memberBudget.effectiveBudget": "Budget effectif","credits.memberBudget.empty": "Pas encore de membres dans l'espace de travail","credits.memberBudget.globalBadge": "Global",diff --git a/locales/it-IT/chat.json b/locales/it-IT/chat.jsonindex 0d0c36e7188..220e12ca78a 100644--- a/locales/it-IT/chat.json+++ b/locales/it-IT/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Creato con successo","sessionGroup.creatingAgent": "Creazione agente in corso...","sessionGroup.groupName": "Nome del gruppo",+ "sessionGroup.hideFromSidebar": "Nascondi dalla mia barra laterale","sessionGroup.inputPlaceholder": "Inserisci il nome del gruppo...","sessionGroup.manageCategory": "Gestisci Categoria","sessionGroup.moveGroup": "Sposta nel gruppo",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Rinominato con successo","sessionGroup.searchAgents": "Cerca agenti","sessionGroup.selectedAgents": "Agenti selezionati ({{count}})",+ "sessionGroup.showInSidebar": "Mostra nella mia barra laterale","sessionGroup.sortSuccess": "Riordinamento riuscito","sessionGroup.sorting": "Aggiornamento ordinamento gruppi...","sessionGroup.tooLong": "Il nome del gruppo deve contenere da 1 a 20 caratteri",diff --git a/locales/it-IT/common.json b/locales/it-IT/common.jsonindex c5326cc3e94..3b99c4af4b3 100644--- a/locales/it-IT/common.json+++ b/locales/it-IT/common.json@@ -2,6 +2,9 @@"about": "Informazioni","addNew": "Aggiungi nuovo","advanceSettings": "Impostazioni avanzate",+ "agentLabel.create": "Nuova etichetta",+ "agentLabel.manage": "Gestisci etichette",+ "agentLabel.menuTitle": "Etichette","agentViewAll.addToSidebar": "Mostra nella barra laterale","agentViewAll.columns.author": "Autore","agentViewAll.columns.name": "Nome",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Ordinamento","agentViewAll.form.showSidebarHidden": "Mostra gli agenti nascosti dalla barra laterale","agentViewAll.groupBy.author": "Autore",+ "agentViewAll.groupBy.label": "Etichetta",+ "agentViewAll.groupBy.noLabel": "Nessuna etichetta","agentViewAll.groupBy.none": "Nessun raggruppamento","agentViewAll.groupBy.unknownAuthor": "Autore sconosciuto","agentViewAll.myAgents": "I miei agenti",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Titolo","agentViewAll.orderBy.updatedAt": "Aggiornato il","agentViewAll.removeFromSidebar": "Nascondi dalla barra laterale",+ "agentViewAll.sidebarSection.collapse": "Riduci",+ "agentViewAll.sidebarSection.expand": "Espandi",+ "agentViewAll.sidebarSection.title": "Nella barra laterale","agentViewAll.title": "Agenti","agentViewAll.untitled": "Agente senza titolo","agentViewAll.view.card": "Scheda",diff --git a/locales/it-IT/setting.json b/locales/it-IT/setting.jsonindex 237e3b5122d..e16e8df635d 100644--- a/locales/it-IT/setting.json+++ b/locales/it-IT/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "credenziali, segreti, oauth","settingsSearch.tabKeywords.devices": "dispositivi, sessioni, dispositivi connessi","settingsSearch.tabKeywords.hotkey": "tasti rapidi, scorciatoia, tastiera",+ "settingsSearch.tabKeywords.labels": "etichette, tag, raggruppamento","settingsSearch.tabKeywords.memory": "memoria, ricordi, personalizzazione","settingsSearch.tabKeywords.messenger": "messenger, piattaforma di chat, bot","settingsSearch.tabKeywords.notification": "notifica, email, push, avvisi",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Importa da un repository pubblico su GitHub","tab.importFromUrl": "Importa da URL","tab.importFromUrl.desc": "Importa tramite un link diretto a SKILL.md",+ "tab.labels": "Etichette","tab.llm": "Modello Linguistico","tab.manualFill": "Compila Manualmente","tab.manualFill.desc": "Configura manualmente una skill MCP personalizzata",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Amministratore","workspaceSetting.group.agent": "Agente","workspaceSetting.group.general": "Generale",+ "workspaceSetting.labels.actions.archive": "Archivia",+ "workspaceSetting.labels.actions.create": "Nuova etichetta",+ "workspaceSetting.labels.actions.unarchive": "Ripristina",+ "workspaceSetting.labels.archive.desc": "Questa etichetta non sarà più disponibile per essere applicata agli agenti. Gli agenti a cui è già stata applicata rimarranno invariati.",+ "workspaceSetting.labels.archive.success": "Etichetta archiviata",+ "workspaceSetting.labels.archive.title": "Archivia \"{{name}}\"?",+ "workspaceSetting.labels.archivedEmpty": "Nessuna etichetta archiviata",+ "workspaceSetting.labels.columns.created": "Creata",+ "workspaceSetting.labels.columns.description": "Descrizione",+ "workspaceSetting.labels.columns.name": "Nome",+ "workspaceSetting.labels.columns.usage": "Agenti",+ "workspaceSetting.labels.delete.archiveHint": "Per impedire l'applicazione futura di questa etichetta, archiviala invece.",+ "workspaceSetting.labels.delete.confirmHint": "Per confermare, digita \"elimina\" qui sotto:",+ "workspaceSetting.labels.delete.desc": "L'eliminazione non può essere annullata.",+ "workspaceSetting.labels.delete.descUsed": "Questa etichetta sarà rimossa da {{count}} agenti. L'eliminazione non può essere annullata.",+ "workspaceSetting.labels.delete.success": "Etichetta eliminata",+ "workspaceSetting.labels.delete.title": "Eliminare l'etichetta \"{{name}}\"?",+ "workspaceSetting.labels.empty": "Nessuna etichetta ancora. Creane una per organizzare i tuoi agenti.",+ "workspaceSetting.labels.filterEmpty": "Nessuna etichetta corrisponde al filtro",+ "workspaceSetting.labels.filterPlaceholder": "Filtra per nome...",+ "workspaceSetting.labels.form.color": "Colore",+ "workspaceSetting.labels.form.createTitle": "Nuova etichetta",+ "workspaceSetting.labels.form.description": "Descrizione",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Descrizione facoltativa",+ "workspaceSetting.labels.form.duplicateName": "Esiste già un'etichetta con questo nome",+ "workspaceSetting.labels.form.editTitle": "Modifica etichetta",+ "workspaceSetting.labels.form.name": "Nome",+ "workspaceSetting.labels.form.namePlaceholder": "Nome dell'etichetta",+ "workspaceSetting.labels.form.restoreTitle": "Rinomina per ripristinare",+ "workspaceSetting.labels.loadFailed": "Impossibile caricare le etichette",+ "workspaceSetting.labels.manageBlocked": "Solo gli amministratori dello spazio di lavoro possono gestire le etichette",+ "workspaceSetting.labels.scope.archived": "Archiviato",+ "workspaceSetting.labels.scope.personal": "Personale",+ "workspaceSetting.labels.scope.workspace": "Spazio di lavoro",+ "workspaceSetting.labels.usage": "{{count}} agenti","workspaceSetting.storage.comingSoon": "Importazione ed esportazione dati a livello di workspace in arrivo.","workspaceSetting.storage.danger.reset.confirm.content": "Ogni impostazione dello spazio di lavoro tornerà al valore predefinito, per tutti i membri dello spazio di lavoro. Agenti, conversazioni e file non saranno modificati.","workspaceSetting.storage.danger.reset.confirm.ok": "Ripristina Impostazioni",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Registri di audit","workspaceSetting.tab.connector": "Connettori","workspaceSetting.tab.general": "Generale",+ "workspaceSetting.tab.labels": "Etichette","workspaceSetting.tab.members": "Membri","workspaceSetting.tab.skill": "Competenze"}diff --git a/locales/it-IT/subscription.json b/locales/it-IT/subscription.jsonindex 0a9f707cde3..98c22c50755 100644--- a/locales/it-IT/subscription.json+++ b/locales/it-IT/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Budget predefinito per membro","credits.memberBudget.defaultLimitHint": "I membri senza una regola personalizzata utilizzano questo limite in ogni ciclo di fatturazione.","credits.memberBudget.desc": "Limita quanti crediti del workspace ogni membro può utilizzare nel ciclo di fatturazione corrente",+ "credits.memberBudget.details.action": "Visualizza dettagli",+ "credits.memberBudget.details.title": "Utilizzo del membro","credits.memberBudget.effectiveBudget": "Budget effettivo","credits.memberBudget.empty": "Ancora nessun membro del workspace","credits.memberBudget.globalBadge": "Globale",diff --git a/locales/ja-JP/chat.json b/locales/ja-JP/chat.jsonindex 8b5f4156c1b..877f1d9c41d 100644--- a/locales/ja-JP/chat.json+++ b/locales/ja-JP/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "グループの作成に成功しました","sessionGroup.creatingAgent": "アシスタントを作成中…","sessionGroup.groupName": "グループ名",+ "sessionGroup.hideFromSidebar": "サイドバーから非表示","sessionGroup.inputPlaceholder": "グループ名を入力…","sessionGroup.manageCategory": "カテゴリを管理","sessionGroup.moveGroup": "グループに移動",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "名前の変更に成功しました","sessionGroup.searchAgents": "アシスタントを検索","sessionGroup.selectedAgents": "選択済みアシスタント({{count}})",+ "sessionGroup.showInSidebar": "サイドバーに表示","sessionGroup.sortSuccess": "並び替えが更新されました","sessionGroup.sorting": "並び替えを更新中…","sessionGroup.tooLong": "グループ名は 1~20 文字である必要があります",diff --git a/locales/ja-JP/common.json b/locales/ja-JP/common.jsonindex bed1d168075..3bdd121505a 100644--- a/locales/ja-JP/common.json+++ b/locales/ja-JP/common.json@@ -2,6 +2,9 @@"about": "情報","addNew": "新規追加","advanceSettings": "詳細設定",+ "agentLabel.create": "新しいラベル",+ "agentLabel.manage": "ラベルを管理",+ "agentLabel.menuTitle": "ラベル","agentViewAll.addToSidebar": "サイドバーに表示","agentViewAll.columns.author": "作成者","agentViewAll.columns.name": "名前",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "並び替え","agentViewAll.form.showSidebarHidden": "サイドバーから非表示のエージェントを表示","agentViewAll.groupBy.author": "作成者",+ "agentViewAll.groupBy.label": "ラベル",+ "agentViewAll.groupBy.noLabel": "ラベルなし","agentViewAll.groupBy.none": "グループ化なし","agentViewAll.groupBy.unknownAuthor": "不明な作成者","agentViewAll.myAgents": "私のエージェント",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "タイトル","agentViewAll.orderBy.updatedAt": "更新日時","agentViewAll.removeFromSidebar": "サイドバーから非表示",+ "agentViewAll.sidebarSection.collapse": "折りたたむ",+ "agentViewAll.sidebarSection.expand": "展開する",+ "agentViewAll.sidebarSection.title": "サイドバー内","agentViewAll.title": "エージェント","agentViewAll.untitled": "無題のエージェント","agentViewAll.view.card": "カード",diff --git a/locales/ja-JP/setting.json b/locales/ja-JP/setting.jsonindex 6821de82c2d..419ef94f18d 100644--- a/locales/ja-JP/setting.json+++ b/locales/ja-JP/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "認証情報, シークレット, OAuth","settingsSearch.tabKeywords.devices": "デバイス, セッション, ログイン済みデバイス","settingsSearch.tabKeywords.hotkey": "ホットキー, ショートカット, キーボード",+ "settingsSearch.tabKeywords.labels": "ラベル、タグ、グループ化","settingsSearch.tabKeywords.memory": "メモリー, 記憶, パーソナライズ","settingsSearch.tabKeywords.messenger": "メッセンジャー, チャットプラットフォーム, ボット","settingsSearch.tabKeywords.notification": "通知, メール, プッシュ, アラート",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "公開GitHubリポジトリからインポート","tab.importFromUrl": "URLからインポート","tab.importFromUrl.desc": "SKILL.mdへの直接リンクを介してインポート",+ "tab.labels": "ラベル","tab.llm": "言語モデル","tab.manualFill": "手動入力","tab.manualFill.desc": "カスタムMCPスキルを手動で設定",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "管理","workspaceSetting.group.agent": "エージェント","workspaceSetting.group.general": "一般",+ "workspaceSetting.labels.actions.archive": "アーカイブ",+ "workspaceSetting.labels.actions.create": "新しいラベル",+ "workspaceSetting.labels.actions.unarchive": "復元",+ "workspaceSetting.labels.archive.desc": "このラベルはエージェントに適用できなくなります。すでにこのラベルが適用されているエージェントには変更はありません。",+ "workspaceSetting.labels.archive.success": "ラベルをアーカイブしました",+ "workspaceSetting.labels.archive.title": "「{{name}}」をアーカイブしますか?",+ "workspaceSetting.labels.archivedEmpty": "アーカイブされたラベルはありません",+ "workspaceSetting.labels.columns.created": "作成日",+ "workspaceSetting.labels.columns.description": "説明",+ "workspaceSetting.labels.columns.name": "名前",+ "workspaceSetting.labels.columns.usage": "エージェント",+ "workspaceSetting.labels.delete.archiveHint": "このラベルの今後の適用を防ぐには、代わりにラベルをアーカイブしてください。",+ "workspaceSetting.labels.delete.confirmHint": "確認のため、以下に「delete」と入力してください:",+ "workspaceSetting.labels.delete.desc": "削除は元に戻せません。",+ "workspaceSetting.labels.delete.descUsed": "このラベルは{{count}}人のエージェントから削除されます。削除は元に戻せません。",+ "workspaceSetting.labels.delete.success": "ラベルを削除しました",+ "workspaceSetting.labels.delete.title": "ラベル「{{name}}」を削除しますか?",+ "workspaceSetting.labels.empty": "まだラベルがありません。エージェントを整理するために作成してください。",+ "workspaceSetting.labels.filterEmpty": "フィルターに一致するラベルはありません",+ "workspaceSetting.labels.filterPlaceholder": "名前でフィルタリング...",+ "workspaceSetting.labels.form.color": "色",+ "workspaceSetting.labels.form.createTitle": "新しいラベル",+ "workspaceSetting.labels.form.description": "説明",+ "workspaceSetting.labels.form.descriptionPlaceholder": "説明(任意)",+ "workspaceSetting.labels.form.duplicateName": "この名前のラベルはすでに存在します",+ "workspaceSetting.labels.form.editTitle": "ラベルを編集",+ "workspaceSetting.labels.form.name": "名前",+ "workspaceSetting.labels.form.namePlaceholder": "ラベル名",+ "workspaceSetting.labels.form.restoreTitle": "名前を変更して復元",+ "workspaceSetting.labels.loadFailed": "ラベルを読み込めませんでした",+ "workspaceSetting.labels.manageBlocked": "ワークスペース管理者のみがラベルを管理できます",+ "workspaceSetting.labels.scope.archived": "アーカイブ済み",+ "workspaceSetting.labels.scope.personal": "個人用",+ "workspaceSetting.labels.scope.workspace": "ワークスペース",+ "workspaceSetting.labels.usage": "{{count}}人のエージェント","workspaceSetting.storage.comingSoon": "ワークスペース単位のデータインポートとエクスポートが近日中に利用可能になります。","workspaceSetting.storage.danger.reset.confirm.content": "すべてのワークスペース設定がデフォルトに戻ります。エージェント、会話、ファイルには影響しません。","workspaceSetting.storage.danger.reset.confirm.ok": "設定をリセット",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "監査ログ","workspaceSetting.tab.connector": "コネクタ","workspaceSetting.tab.general": "一般",+ "workspaceSetting.tab.labels": "ラベル","workspaceSetting.tab.members": "メンバー","workspaceSetting.tab.skill": "スキル"}diff --git a/locales/ja-JP/subscription.json b/locales/ja-JP/subscription.jsonindex 9d405341a95..7d2ae7e66fa 100644--- a/locales/ja-JP/subscription.json+++ b/locales/ja-JP/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "デフォルトのメンバー予算","credits.memberBudget.defaultLimitHint": "カスタムルールがないメンバーは、各請求サイクルでこの制限を使用します。","credits.memberBudget.desc": "現在の請求サイクルで各メンバーが使用できるワークスペースクレジットの上限を設定します",+ "credits.memberBudget.details.action": "詳細を表示",+ "credits.memberBudget.details.title": "メンバー使用状況","credits.memberBudget.effectiveBudget": "有効な予算","credits.memberBudget.empty": "まだワークスペースメンバーがいません","credits.memberBudget.globalBadge": "グローバル",diff --git a/locales/ko-KR/chat.json b/locales/ko-KR/chat.jsonindex 9a3e5e0c0a8..5bc547228b8 100644--- a/locales/ko-KR/chat.json+++ b/locales/ko-KR/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "그룹 생성 성공","sessionGroup.creatingAgent": "도우미 생성 중…","sessionGroup.groupName": "그룹 이름",+ "sessionGroup.hideFromSidebar": "사이드바에서 숨기기","sessionGroup.inputPlaceholder": "그룹 이름 입력…","sessionGroup.manageCategory": "카테고리 관리","sessionGroup.moveGroup": "그룹으로 이동",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "이름 변경 성공","sessionGroup.searchAgents": "도우미 검색","sessionGroup.selectedAgents": "선택된 도우미({{count}})",+ "sessionGroup.showInSidebar": "사이드바에 표시","sessionGroup.sortSuccess": "정렬 업데이트 성공","sessionGroup.sorting": "정렬 업데이트 중…","sessionGroup.tooLong": "그룹 이름은 1~20자여야 합니다",diff --git a/locales/ko-KR/common.json b/locales/ko-KR/common.jsonindex afa77ef4a58..862c435ed00 100644--- a/locales/ko-KR/common.json+++ b/locales/ko-KR/common.json@@ -2,6 +2,9 @@"about": "정보","addNew": "새로 추가","advanceSettings": "고급 설정",+ "agentLabel.create": "새 라벨",+ "agentLabel.manage": "라벨 관리",+ "agentLabel.menuTitle": "라벨","agentViewAll.addToSidebar": "사이드바에 표시","agentViewAll.columns.author": "작성자","agentViewAll.columns.name": "이름",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "정렬","agentViewAll.form.showSidebarHidden": "사이드바에서 숨겨진 에이전트 표시","agentViewAll.groupBy.author": "작성자",+ "agentViewAll.groupBy.label": "라벨",+ "agentViewAll.groupBy.noLabel": "라벨 없음","agentViewAll.groupBy.none": "그룹화 없음","agentViewAll.groupBy.unknownAuthor": "알 수 없는 작성자","agentViewAll.myAgents": "내 에이전트",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "제목","agentViewAll.orderBy.updatedAt": "업데이트 시간","agentViewAll.removeFromSidebar": "사이드바에서 숨기기",+ "agentViewAll.sidebarSection.collapse": "접기",+ "agentViewAll.sidebarSection.expand": "펼치기",+ "agentViewAll.sidebarSection.title": "사이드바에서","agentViewAll.title": "에이전트","agentViewAll.untitled": "제목 없는 에이전트","agentViewAll.view.card": "카드",diff --git a/locales/ko-KR/setting.json b/locales/ko-KR/setting.jsonindex df63d59f136..7f1aac2d3c9 100644--- a/locales/ko-KR/setting.json+++ b/locales/ko-KR/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "자격 증명, 비밀, OAuth","settingsSearch.tabKeywords.devices": "기기, 세션, 로그인된 기기","settingsSearch.tabKeywords.hotkey": "핫키, 바로가기, 키보드",+ "settingsSearch.tabKeywords.labels": "레이블, 태그, 그룹화","settingsSearch.tabKeywords.memory": "메모리, 기억, 개인화","settingsSearch.tabKeywords.messenger": "메신저, 채팅 플랫폼, 봇","settingsSearch.tabKeywords.notification": "알림, 이메일, 푸시, 경고",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "공개 GitHub 저장소에서 가져오기","tab.importFromUrl": "URL에서 가져오기","tab.importFromUrl.desc": "SKILL.md의 직접 링크를 통해 가져오기",+ "tab.labels": "레이블","tab.llm": "언어 모델","tab.manualFill": "수동 입력","tab.manualFill.desc": "사용자 정의 MCP 스킬을 수동으로 구성합니다",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "관리자","workspaceSetting.group.agent": "에이전트","workspaceSetting.group.general": "일반",+ "workspaceSetting.labels.actions.archive": "보관",+ "workspaceSetting.labels.actions.create": "새 레이블",+ "workspaceSetting.labels.actions.unarchive": "복원",+ "workspaceSetting.labels.archive.desc": "이 레이블은 더 이상 에이전트에 적용할 수 없습니다. 이미 이 레이블이 적용된 에이전트는 변경되지 않습니다.",+ "workspaceSetting.labels.archive.success": "레이블이 보관되었습니다",+ "workspaceSetting.labels.archive.title": "\"{{name}}\"을(를) 보관하시겠습니까?",+ "workspaceSetting.labels.archivedEmpty": "보관된 레이블이 없습니다",+ "workspaceSetting.labels.columns.created": "생성일",+ "workspaceSetting.labels.columns.description": "설명",+ "workspaceSetting.labels.columns.name": "이름",+ "workspaceSetting.labels.columns.usage": "에이전트",+ "workspaceSetting.labels.delete.archiveHint": "이 레이블의 향후 적용을 방지하려면, 대신 레이블을 보관하세요.",+ "workspaceSetting.labels.delete.confirmHint": "확인을 위해 아래에 \"delete\"를 입력하세요:",+ "workspaceSetting.labels.delete.desc": "삭제는 되돌릴 수 없습니다.",+ "workspaceSetting.labels.delete.descUsed": "이 레이블은 {{count}}명의 에이전트에서 제거됩니다. 삭제는 되돌릴 수 없습니다.",+ "workspaceSetting.labels.delete.success": "레이블이 삭제되었습니다",+ "workspaceSetting.labels.delete.title": "레이블 \"{{name}}\"을(를) 삭제하시겠습니까?",+ "workspaceSetting.labels.empty": "아직 레이블이 없습니다. 에이전트를 정리하려면 새로 생성하세요.",+ "workspaceSetting.labels.filterEmpty": "필터와 일치하는 레이블이 없습니다",+ "workspaceSetting.labels.filterPlaceholder": "이름으로 필터링...",+ "workspaceSetting.labels.form.color": "색상",+ "workspaceSetting.labels.form.createTitle": "새 레이블",+ "workspaceSetting.labels.form.description": "설명",+ "workspaceSetting.labels.form.descriptionPlaceholder": "선택적 설명",+ "workspaceSetting.labels.form.duplicateName": "이 이름의 라벨이 이미 존재합니다",+ "workspaceSetting.labels.form.editTitle": "레이블 편집",+ "workspaceSetting.labels.form.name": "이름",+ "workspaceSetting.labels.form.namePlaceholder": "레이블 이름",+ "workspaceSetting.labels.form.restoreTitle": "복원하려면 이름을 변경하세요",+ "workspaceSetting.labels.loadFailed": "레이블을 불러오지 못했습니다",+ "workspaceSetting.labels.manageBlocked": "워크스페이스 관리자만 레이블을 관리할 수 있습니다",+ "workspaceSetting.labels.scope.archived": "보관됨",+ "workspaceSetting.labels.scope.personal": "개인",+ "workspaceSetting.labels.scope.workspace": "워크스페이스",+ "workspaceSetting.labels.usage": "{{count}}명의 에이전트","workspaceSetting.storage.comingSoon": "워크스페이스 범위의 데이터 가져오기 및 내보내기가 곧 제공됩니다.","workspaceSetting.storage.danger.reset.confirm.content": "모든 워크스페이스 설정이 기본값으로 돌아갑니다. 워크스페이스의 모든 사용자에게 적용됩니다. 에이전트, 대화 및 파일은 영향을 받지 않습니다.","workspaceSetting.storage.danger.reset.confirm.ok": "설정 초기화",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "감사 로그","workspaceSetting.tab.connector": "커넥터","workspaceSetting.tab.general": "일반",+ "workspaceSetting.tab.labels": "레이블","workspaceSetting.tab.members": "멤버","workspaceSetting.tab.skill": "기술"}diff --git a/locales/ko-KR/subscription.json b/locales/ko-KR/subscription.jsonindex fec326f05bf..3c7702f84e2 100644--- a/locales/ko-KR/subscription.json+++ b/locales/ko-KR/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "기본 멤버 예산","credits.memberBudget.defaultLimitHint": "사용자 지정 규칙이 없는 멤버는 각 청구 주기마다 이 한도를 사용합니다.","credits.memberBudget.desc": "현재 청구 주기 동안 각 멤버가 사용할 수 있는 워크스페이스 크레딧을 제한합니다.",+ "credits.memberBudget.details.action": "세부 정보 보기",+ "credits.memberBudget.details.title": "회원 사용량","credits.memberBudget.effectiveBudget": "적용 예산","credits.memberBudget.empty": "아직 워크스페이스 멤버가 없습니다.","credits.memberBudget.globalBadge": "글로벌",diff --git a/locales/nl-NL/chat.json b/locales/nl-NL/chat.jsonindex ddeeb585746..94f3b18a4ee 100644--- a/locales/nl-NL/chat.json+++ b/locales/nl-NL/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Succesvol aangemaakt","sessionGroup.creatingAgent": "Agent aan het aanmaken...","sessionGroup.groupName": "Groepsnaam",+ "sessionGroup.hideFromSidebar": "Verbergen in mijn zijbalk","sessionGroup.inputPlaceholder": "Voer groepsnaam in...","sessionGroup.manageCategory": "Categorie beheren","sessionGroup.moveGroup": "Verplaatsen naar groep",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Succesvol hernoemd","sessionGroup.searchAgents": "Zoek agenten","sessionGroup.selectedAgents": "Geselecteerde agenten ({{count}})",+ "sessionGroup.showInSidebar": "Weergeven in mijn zijbalk","sessionGroup.sortSuccess": "Volgorde succesvol bijgewerkt","sessionGroup.sorting": "Groepsvolgorde wordt bijgewerkt...","sessionGroup.tooLong": "De groepsnaam moet tussen 1 en 20 tekens lang zijn",diff --git a/locales/nl-NL/common.json b/locales/nl-NL/common.jsonindex 41fa7d3f743..6811543d1e5 100644--- a/locales/nl-NL/common.json+++ b/locales/nl-NL/common.json@@ -2,6 +2,9 @@"about": "Over","addNew": "Nieuw toevoegen","advanceSettings": "Geavanceerde instellingen",+ "agentLabel.create": "Nieuw label",+ "agentLabel.manage": "Labels beheren",+ "agentLabel.menuTitle": "Labels","agentViewAll.addToSidebar": "Weergeven in zijbalk","agentViewAll.columns.author": "Auteur","agentViewAll.columns.name": "Naam",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Sorteren","agentViewAll.form.showSidebarHidden": "Toon agents verborgen in zijbalk","agentViewAll.groupBy.author": "Auteur",+ "agentViewAll.groupBy.label": "Label",+ "agentViewAll.groupBy.noLabel": "Geen label","agentViewAll.groupBy.none": "Geen groepering","agentViewAll.groupBy.unknownAuthor": "Onbekende auteur","agentViewAll.myAgents": "Mijn Agents",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Titel","agentViewAll.orderBy.updatedAt": "Bijgewerkt op","agentViewAll.removeFromSidebar": "Verbergen in zijbalk",+ "agentViewAll.sidebarSection.collapse": "Inklappen",+ "agentViewAll.sidebarSection.expand": "Uitklappen",+ "agentViewAll.sidebarSection.title": "In zijbalk","agentViewAll.title": "Agents","agentViewAll.untitled": "Naamloze Agent","agentViewAll.view.card": "Kaart",diff --git a/locales/nl-NL/setting.json b/locales/nl-NL/setting.jsonindex e1452925e9a..b0a4fc7a8b8 100644--- a/locales/nl-NL/setting.json+++ b/locales/nl-NL/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "referenties, geheimen, oauth","settingsSearch.tabKeywords.devices": "apparaten, sessies, ingelogde apparaten","settingsSearch.tabKeywords.hotkey": "sneltoets, snelkoppeling, toetsenbord",+ "settingsSearch.tabKeywords.labels": "labels, tags, groeperen","settingsSearch.tabKeywords.memory": "geheugen, herinneringen, personalisatie","settingsSearch.tabKeywords.messenger": "messenger, chatplatform, bot","settingsSearch.tabKeywords.notification": "melding, e-mail, push, waarschuwingen",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Importeren vanuit een openbare GitHub-repository","tab.importFromUrl": "Importeren via URL","tab.importFromUrl.desc": "Importeren via een directe link naar SKILL.md",+ "tab.labels": "Labels","tab.llm": "Taalmodel","tab.manualFill": "Handmatig Invullen","tab.manualFill.desc": "Handmatig een aangepaste MCP-vaardigheid configureren",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Beheerder","workspaceSetting.group.agent": "Agent","workspaceSetting.group.general": "Algemeen",+ "workspaceSetting.labels.actions.archive": "Archiveren",+ "workspaceSetting.labels.actions.create": "Nieuwe label",+ "workspaceSetting.labels.actions.unarchive": "Herstellen",+ "workspaceSetting.labels.archive.desc": "Deze label zal niet langer beschikbaar zijn om toe te passen op agenten. Agenten met de label die al is toegepast blijven ongewijzigd.",+ "workspaceSetting.labels.archive.success": "Label gearchiveerd",+ "workspaceSetting.labels.archive.title": "Label \"{{name}}\" archiveren?",+ "workspaceSetting.labels.archivedEmpty": "Geen gearchiveerde labels",+ "workspaceSetting.labels.columns.created": "Aangemaakt",+ "workspaceSetting.labels.columns.description": "Beschrijving",+ "workspaceSetting.labels.columns.name": "Naam",+ "workspaceSetting.labels.columns.usage": "Agenten",+ "workspaceSetting.labels.delete.archiveHint": "Om toekomstige toepassing van deze label te voorkomen, archiveer de label in plaats daarvan.",+ "workspaceSetting.labels.delete.confirmHint": "Om te bevestigen, typ hieronder \"verwijderen\":",+ "workspaceSetting.labels.delete.desc": "Verwijderen kan niet ongedaan worden gemaakt.",+ "workspaceSetting.labels.delete.descUsed": "Deze label zal worden verwijderd van {{count}} agenten. Verwijderen kan niet ongedaan worden gemaakt.",+ "workspaceSetting.labels.delete.success": "Label verwijderd",+ "workspaceSetting.labels.delete.title": "Label \"{{name}}\" verwijderen?",+ "workspaceSetting.labels.empty": "Nog geen labels. Maak er een aan om je agenten te organiseren.",+ "workspaceSetting.labels.filterEmpty": "Geen labels komen overeen met de filter",+ "workspaceSetting.labels.filterPlaceholder": "Filter op naam...",+ "workspaceSetting.labels.form.color": "Kleur",+ "workspaceSetting.labels.form.createTitle": "Nieuwe label",+ "workspaceSetting.labels.form.description": "Beschrijving",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Optionele beschrijving",+ "workspaceSetting.labels.form.duplicateName": "Er bestaat al een label met deze naam",+ "workspaceSetting.labels.form.editTitle": "Label bewerken",+ "workspaceSetting.labels.form.name": "Naam",+ "workspaceSetting.labels.form.namePlaceholder": "Labelnaam",+ "workspaceSetting.labels.form.restoreTitle": "Hernoemen om te herstellen",+ "workspaceSetting.labels.loadFailed": "Kon labels niet laden",+ "workspaceSetting.labels.manageBlocked": "Alleen workspace-beheerders kunnen labels beheren",+ "workspaceSetting.labels.scope.archived": "Gearchiveerd",+ "workspaceSetting.labels.scope.personal": "Persoonlijk",+ "workspaceSetting.labels.scope.workspace": "Workspace",+ "workspaceSetting.labels.usage": "{{count}} agenten","workspaceSetting.storage.comingSoon": "Gegevensimport en -export op werkruimte-niveau komt binnenkort.","workspaceSetting.storage.danger.reset.confirm.content": "Elke werkruimte-instelling wordt teruggezet naar de standaardinstellingen, voor iedereen in de werkruimte. Agents, gesprekken en bestanden blijven onaangeroerd.","workspaceSetting.storage.danger.reset.confirm.ok": "Instellingen Resetten",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Auditlogs","workspaceSetting.tab.connector": "Connectors","workspaceSetting.tab.general": "Algemeen",+ "workspaceSetting.tab.labels": "Labels","workspaceSetting.tab.members": "Leden","workspaceSetting.tab.skill": "Vaardigheden"}diff --git a/locales/nl-NL/subscription.json b/locales/nl-NL/subscription.jsonindex c558c8a5984..3b8e49ccfe2 100644--- a/locales/nl-NL/subscription.json+++ b/locales/nl-NL/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Standaard ledenbudget","credits.memberBudget.defaultLimitHint": "Leden zonder een aangepaste regel gebruiken deze limiet per factureringscyclus.","credits.memberBudget.desc": "Beperk hoeveel werkruimtecredits elk lid kan gebruiken in de huidige factureringscyclus",+ "credits.memberBudget.details.action": "Bekijk details",+ "credits.memberBudget.details.title": "Ledengebruik","credits.memberBudget.effectiveBudget": "Effectief budget","credits.memberBudget.empty": "Nog geen werkruimteleden","credits.memberBudget.globalBadge": "Globaal",diff --git a/locales/pl-PL/chat.json b/locales/pl-PL/chat.jsonindex 1d21d183d16..4e2bf48612c 100644--- a/locales/pl-PL/chat.json+++ b/locales/pl-PL/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Utworzono pomyślnie","sessionGroup.creatingAgent": "Tworzenie agenta...","sessionGroup.groupName": "Nazwa grupy",+ "sessionGroup.hideFromSidebar": "Ukryj z mojego paska bocznego","sessionGroup.inputPlaceholder": "Wprowadź nazwę grupy...","sessionGroup.manageCategory": "Zarządzaj kategorią","sessionGroup.moveGroup": "Przenieś do grupy",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Zmieniono nazwę pomyślnie","sessionGroup.searchAgents": "Szukaj agentów","sessionGroup.selectedAgents": "Wybrani agenci ({{count}})",+ "sessionGroup.showInSidebar": "Pokaż na moim pasku bocznym","sessionGroup.sortSuccess": "Pomyślnie zmieniono kolejność","sessionGroup.sorting": "Aktualizowanie kolejności grup...","sessionGroup.tooLong": "Długość nazwy grupy powinna wynosić od 1 do 20 znaków",diff --git a/locales/pl-PL/common.json b/locales/pl-PL/common.jsonindex caab4f82b45..f5ccf299c22 100644--- a/locales/pl-PL/common.json+++ b/locales/pl-PL/common.json@@ -2,6 +2,9 @@"about": "O nas","addNew": "Dodaj nowy","advanceSettings": "Ustawienia zaawansowane",+ "agentLabel.create": "Nowa etykieta",+ "agentLabel.manage": "Zarządzaj etykietami",+ "agentLabel.menuTitle": "Etykiety","agentViewAll.addToSidebar": "Pokaż w pasku bocznym","agentViewAll.columns.author": "Autor","agentViewAll.columns.name": "Nazwa",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Sortowanie","agentViewAll.form.showSidebarHidden": "Pokaż agentów ukrytych w pasku bocznym","agentViewAll.groupBy.author": "Autor",+ "agentViewAll.groupBy.label": "Etykieta",+ "agentViewAll.groupBy.noLabel": "Brak etykiety","agentViewAll.groupBy.none": "Brak grupowania","agentViewAll.groupBy.unknownAuthor": "Nieznany autor","agentViewAll.myAgents": "Moje Agenty",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Tytuł","agentViewAll.orderBy.updatedAt": "Zaktualizowano","agentViewAll.removeFromSidebar": "Ukryj w pasku bocznym",+ "agentViewAll.sidebarSection.collapse": "Zwiń",+ "agentViewAll.sidebarSection.expand": "Rozwiń",+ "agentViewAll.sidebarSection.title": "W pasku bocznym","agentViewAll.title": "Agenty","agentViewAll.untitled": "Agent bez tytułu","agentViewAll.view.card": "Karta",diff --git a/locales/pl-PL/setting.json b/locales/pl-PL/setting.jsonindex 59d8e540675..ae6aff34188 100644--- a/locales/pl-PL/setting.json+++ b/locales/pl-PL/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "poświadczenia, sekrety, oauth","settingsSearch.tabKeywords.devices": "urządzenia, sesje, zalogowane urządzenia","settingsSearch.tabKeywords.hotkey": "skrót klawiszowy, skrót, klawiatura",+ "settingsSearch.tabKeywords.labels": "etykiety, tagi, grupowanie","settingsSearch.tabKeywords.memory": "pamięć, wspomnienia, personalizacja","settingsSearch.tabKeywords.messenger": "messenger, platforma czatu, bot","settingsSearch.tabKeywords.notification": "powiadomienie, e-mail, push, alerty",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Importuj z publicznego repozytorium GitHub","tab.importFromUrl": "Importuj z URL","tab.importFromUrl.desc": "Importuj za pomocą bezpośredniego linku do SKILL.md",+ "tab.labels": "Etykiety","tab.llm": "Model językowy","tab.manualFill": "Wypełnij ręcznie","tab.manualFill.desc": "Ręcznie skonfiguruj niestandardową umiejętność MCP",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Administrator","workspaceSetting.group.agent": "Agent","workspaceSetting.group.general": "Ogólne",+ "workspaceSetting.labels.actions.archive": "Archiwizuj",+ "workspaceSetting.labels.actions.create": "Nowa etykieta",+ "workspaceSetting.labels.actions.unarchive": "Przywróć",+ "workspaceSetting.labels.archive.desc": "Ta etykieta nie będzie już dostępna do przypisywania agentom. Agenci, którym już przypisano tę etykietę, pozostaną bez zmian.",+ "workspaceSetting.labels.archive.success": "Etykieta zarchiwizowana",+ "workspaceSetting.labels.archive.title": "Archiwizować „{{name}}”?",+ "workspaceSetting.labels.archivedEmpty": "Brak zarchiwizowanych etykiet",+ "workspaceSetting.labels.columns.created": "Utworzono",+ "workspaceSetting.labels.columns.description": "Opis",+ "workspaceSetting.labels.columns.name": "Nazwa",+ "workspaceSetting.labels.columns.usage": "Agenci",+ "workspaceSetting.labels.delete.archiveHint": "Aby zapobiec przyszłemu użyciu tej etykiety, zamiast tego ją zarchiwizuj.",+ "workspaceSetting.labels.delete.confirmHint": "Aby potwierdzić, wpisz poniżej „usuń”:",+ "workspaceSetting.labels.delete.desc": "Usunięcie nie może zostać cofnięte.",+ "workspaceSetting.labels.delete.descUsed": "Ta etykieta zostanie usunięta z {{count}} agentów. Usunięcie nie może zostać cofnięte.",+ "workspaceSetting.labels.delete.success": "Etykieta usunięta",+ "workspaceSetting.labels.delete.title": "Usunąć etykietę „{{name}}”?",+ "workspaceSetting.labels.empty": "Brak etykiet. Utwórz jedną, aby zorganizować swoich agentów.",+ "workspaceSetting.labels.filterEmpty": "Brak etykiet pasujących do filtra",+ "workspaceSetting.labels.filterPlaceholder": "Filtruj według nazwy...",+ "workspaceSetting.labels.form.color": "Kolor",+ "workspaceSetting.labels.form.createTitle": "Nowa etykieta",+ "workspaceSetting.labels.form.description": "Opis",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Opcjonalny opis",+ "workspaceSetting.labels.form.duplicateName": "Etykieta o tej nazwie już istnieje",+ "workspaceSetting.labels.form.editTitle": "Edytuj etykietę",+ "workspaceSetting.labels.form.name": "Nazwa",+ "workspaceSetting.labels.form.namePlaceholder": "Nazwa etykiety",+ "workspaceSetting.labels.form.restoreTitle": "Zmień nazwę, aby przywrócić",+ "workspaceSetting.labels.loadFailed": "Nie udało się załadować etykiet",+ "workspaceSetting.labels.manageBlocked": "Tylko administratorzy przestrzeni roboczej mogą zarządzać etykietami",+ "workspaceSetting.labels.scope.archived": "Zarchiwizowane",+ "workspaceSetting.labels.scope.personal": "Osobiste",+ "workspaceSetting.labels.scope.workspace": "Przestrzeń robocza",+ "workspaceSetting.labels.usage": "{{count}} agentów","workspaceSetting.storage.comingSoon": "Import i eksport danych w zakresie środowiska pracy wkrótce dostępne.","workspaceSetting.storage.danger.reset.confirm.content": "Wszystkie ustawienia przestrzeni roboczej zostaną przywrócone do domyślnych dla wszystkich w przestrzeni roboczej. Agenci, rozmowy i pliki pozostaną nienaruszone.","workspaceSetting.storage.danger.reset.confirm.ok": "Zresetuj ustawienia",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Logi audytu","workspaceSetting.tab.connector": "Konektory","workspaceSetting.tab.general": "Ogólne",+ "workspaceSetting.tab.labels": "Etykiety","workspaceSetting.tab.members": "Członkowie","workspaceSetting.tab.skill": "Umiejętności"}diff --git a/locales/pl-PL/subscription.json b/locales/pl-PL/subscription.jsonindex 599c1054c36..f3fe9fb843c 100644--- a/locales/pl-PL/subscription.json+++ b/locales/pl-PL/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Domyślny budżet członka","credits.memberBudget.defaultLimitHint": "Członkowie bez niestandardowej reguły używają tego limitu w każdym cyklu rozliczeniowym.","credits.memberBudget.desc": "Ogranicz liczbę kredytów workspace, które każdy członek może wykorzystać w bieżącym cyklu rozliczeniowym",+ "credits.memberBudget.details.action": "Zobacz szczegóły",+ "credits.memberBudget.details.title": "Wykorzystanie członka","credits.memberBudget.effectiveBudget": "Efektywny budżet","credits.memberBudget.empty": "Brak członków workspace","credits.memberBudget.globalBadge": "Globalny",diff --git a/locales/pt-BR/chat.json b/locales/pt-BR/chat.jsonindex 2c7d0a4f914..4597cc0ab5e 100644--- a/locales/pt-BR/chat.json+++ b/locales/pt-BR/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Criado com sucesso","sessionGroup.creatingAgent": "Criando agente...","sessionGroup.groupName": "Nome do Grupo",+ "sessionGroup.hideFromSidebar": "Ocultar da minha barra lateral","sessionGroup.inputPlaceholder": "Digite o nome do grupo...","sessionGroup.manageCategory": "Gerenciar Categoria","sessionGroup.moveGroup": "Mover para Grupo",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Renomeado com sucesso","sessionGroup.searchAgents": "Buscar agentes","sessionGroup.selectedAgents": "Agentes selecionados ({{count}})",+ "sessionGroup.showInSidebar": "Mostrar na minha barra lateral","sessionGroup.sortSuccess": "Reordenação bem-sucedida","sessionGroup.sorting": "Atualizando ordenação do grupo...","sessionGroup.tooLong": "O nome do grupo deve ter entre 1 e 20 caracteres",diff --git a/locales/pt-BR/common.json b/locales/pt-BR/common.jsonindex 4e6e8704894..aca0093650b 100644--- a/locales/pt-BR/common.json+++ b/locales/pt-BR/common.json@@ -2,6 +2,9 @@"about": "Sobre","addNew": "Adicionar novo","advanceSettings": "Configurações Avançadas",+ "agentLabel.create": "Novo rótulo",+ "agentLabel.manage": "Gerenciar rótulos",+ "agentLabel.menuTitle": "Rótulos","agentViewAll.addToSidebar": "Mostrar na barra lateral","agentViewAll.columns.author": "Autor","agentViewAll.columns.name": "Nome",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Ordenação","agentViewAll.form.showSidebarHidden": "Mostrar agentes ocultos na barra lateral","agentViewAll.groupBy.author": "Autor",+ "agentViewAll.groupBy.label": "Rótulo",+ "agentViewAll.groupBy.noLabel": "Sem rótulo","agentViewAll.groupBy.none": "Sem agrupamento","agentViewAll.groupBy.unknownAuthor": "Autor desconhecido","agentViewAll.myAgents": "Meus Agentes",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Título","agentViewAll.orderBy.updatedAt": "Atualizado em","agentViewAll.removeFromSidebar": "Ocultar da barra lateral",+ "agentViewAll.sidebarSection.collapse": "Recolher",+ "agentViewAll.sidebarSection.expand": "Expandir",+ "agentViewAll.sidebarSection.title": "Na Barra Lateral","agentViewAll.title": "Agentes","agentViewAll.untitled": "Agente sem título","agentViewAll.view.card": "Cartão",diff --git a/locales/pt-BR/setting.json b/locales/pt-BR/setting.jsonindex b8a10966ef8..3574c7f4bc9 100644--- a/locales/pt-BR/setting.json+++ b/locales/pt-BR/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "credenciais, segredos, oauth","settingsSearch.tabKeywords.devices": "dispositivos, sessões, dispositivos conectados","settingsSearch.tabKeywords.hotkey": "atalho, tecla de atalho, teclado",+ "settingsSearch.tabKeywords.labels": "etiquetas, tags, agrupamento","settingsSearch.tabKeywords.memory": "memória, memórias, personalização","settingsSearch.tabKeywords.messenger": "mensageiro, plataforma de chat, bot","settingsSearch.tabKeywords.notification": "notificação, email, push, alertas",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Importar de um repositório público do GitHub","tab.importFromUrl": "Importar de URL","tab.importFromUrl.desc": "Importar via um link direto para SKILL.md",+ "tab.labels": "Etiquetas","tab.llm": "Modelo de Linguagem","tab.manualFill": "Preencher Manualmente","tab.manualFill.desc": "Configurar manualmente uma habilidade MCP personalizada",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Admin","workspaceSetting.group.agent": "Agente","workspaceSetting.group.general": "Geral",+ "workspaceSetting.labels.actions.archive": "Arquivar",+ "workspaceSetting.labels.actions.create": "Nova etiqueta",+ "workspaceSetting.labels.actions.unarchive": "Restaurar",+ "workspaceSetting.labels.archive.desc": "Esta etiqueta não estará mais disponível para ser aplicada aos agentes. Agentes que já possuem a etiqueta aplicada permanecerão inalterados.",+ "workspaceSetting.labels.archive.success": "Etiqueta arquivada",+ "workspaceSetting.labels.archive.title": "Arquivar \"{{name}}\"?",+ "workspaceSetting.labels.archivedEmpty": "Nenhuma etiqueta arquivada",+ "workspaceSetting.labels.columns.created": "Criado",+ "workspaceSetting.labels.columns.description": "Descrição",+ "workspaceSetting.labels.columns.name": "Nome",+ "workspaceSetting.labels.columns.usage": "Agentes",+ "workspaceSetting.labels.delete.archiveHint": "Para evitar a aplicação futura desta etiqueta, arquive-a em vez disso.",+ "workspaceSetting.labels.delete.confirmHint": "Para confirmar, digite \"excluir\" abaixo:",+ "workspaceSetting.labels.delete.desc": "A exclusão não pode ser desfeita.",+ "workspaceSetting.labels.delete.descUsed": "Esta etiqueta será removida de {{count}} agentes. A exclusão não pode ser desfeita.",+ "workspaceSetting.labels.delete.success": "Etiqueta excluída",+ "workspaceSetting.labels.delete.title": "Excluir a etiqueta \"{{name}}\"?",+ "workspaceSetting.labels.empty": "Ainda não há etiquetas. Crie uma para organizar seus agentes.",+ "workspaceSetting.labels.filterEmpty": "Nenhuma etiqueta corresponde ao filtro",+ "workspaceSetting.labels.filterPlaceholder": "Filtrar por nome...",+ "workspaceSetting.labels.form.color": "Cor",+ "workspaceSetting.labels.form.createTitle": "Nova etiqueta",+ "workspaceSetting.labels.form.description": "Descrição",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Descrição opcional",+ "workspaceSetting.labels.form.duplicateName": "Já existe uma etiqueta com este nome",+ "workspaceSetting.labels.form.editTitle": "Editar etiqueta",+ "workspaceSetting.labels.form.name": "Nome",+ "workspaceSetting.labels.form.namePlaceholder": "Nome da etiqueta",+ "workspaceSetting.labels.form.restoreTitle": "Renomear para restaurar",+ "workspaceSetting.labels.loadFailed": "Não foi possível carregar os rótulos",+ "workspaceSetting.labels.manageBlocked": "Somente administradores do workspace podem gerenciar etiquetas",+ "workspaceSetting.labels.scope.archived": "Arquivadas",+ "workspaceSetting.labels.scope.personal": "Pessoal",+ "workspaceSetting.labels.scope.workspace": "Workspace",+ "workspaceSetting.labels.usage": "{{count}} agentes","workspaceSetting.storage.comingSoon": "Importação e exportação de dados no escopo do espaço de trabalho em breve.","workspaceSetting.storage.danger.reset.confirm.content": "Todas as configurações do espaço de trabalho voltarão ao padrão, para todos no espaço de trabalho. Agentes, conversas e arquivos não serão alterados.","workspaceSetting.storage.danger.reset.confirm.ok": "Redefinir Configurações",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Registros de auditoria","workspaceSetting.tab.connector": "Conectores","workspaceSetting.tab.general": "Geral",+ "workspaceSetting.tab.labels": "Etiquetas","workspaceSetting.tab.members": "Membros","workspaceSetting.tab.skill": "Habilidades"}diff --git a/locales/pt-BR/subscription.json b/locales/pt-BR/subscription.jsonindex 6bc095e2e33..0d38faf69bc 100644--- a/locales/pt-BR/subscription.json+++ b/locales/pt-BR/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Orçamento padrão por membro","credits.memberBudget.defaultLimitHint": "Membros sem uma regra personalizada usam este limite a cada ciclo de faturamento.","credits.memberBudget.desc": "Limite quantos créditos do workspace cada membro pode usar no ciclo de faturamento atual",+ "credits.memberBudget.details.action": "Ver detalhes",+ "credits.memberBudget.details.title": "Uso do membro","credits.memberBudget.effectiveBudget": "Orçamento efetivo","credits.memberBudget.empty": "Ainda não há membros no workspace","credits.memberBudget.globalBadge": "Global",diff --git a/locales/ru-RU/chat.json b/locales/ru-RU/chat.jsonindex e49299d2559..0e3b48b8b7d 100644--- a/locales/ru-RU/chat.json+++ b/locales/ru-RU/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Успешно создано","sessionGroup.creatingAgent": "Создание агента...","sessionGroup.groupName": "Название группы",+ "sessionGroup.hideFromSidebar": "Скрыть из моей боковой панели","sessionGroup.inputPlaceholder": "Введите название группы...","sessionGroup.manageCategory": "Управление категорией","sessionGroup.moveGroup": "Переместить в группу",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Переименование успешно","sessionGroup.searchAgents": "Поиск агентов","sessionGroup.selectedAgents": "Выбранные агенты ({{count}})",+ "sessionGroup.showInSidebar": "Показать на моей боковой панели","sessionGroup.sortSuccess": "Сортировка успешна","sessionGroup.sorting": "Обновление порядка групп...","sessionGroup.tooLong": "Длина названия группы должна быть от 1 до 20 символов",diff --git a/locales/ru-RU/common.json b/locales/ru-RU/common.jsonindex 46a99de599c..1f2f98470e1 100644--- a/locales/ru-RU/common.json+++ b/locales/ru-RU/common.json@@ -2,6 +2,9 @@"about": "О проекте","addNew": "Добавить новый","advanceSettings": "Расширенные настройки",+ "agentLabel.create": "Новая метка",+ "agentLabel.manage": "Управление метками",+ "agentLabel.menuTitle": "Метки","agentViewAll.addToSidebar": "Показать в боковой панели","agentViewAll.columns.author": "Автор","agentViewAll.columns.name": "Название",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Сортировка","agentViewAll.form.showSidebarHidden": "Показать агентов, скрытых из боковой панели","agentViewAll.groupBy.author": "Автор",+ "agentViewAll.groupBy.label": "Метка",+ "agentViewAll.groupBy.noLabel": "Без метки","agentViewAll.groupBy.none": "Без группировки","agentViewAll.groupBy.unknownAuthor": "Неизвестный автор","agentViewAll.myAgents": "Мои агенты",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Название","agentViewAll.orderBy.updatedAt": "Обновлено","agentViewAll.removeFromSidebar": "Скрыть из боковой панели",+ "agentViewAll.sidebarSection.collapse": "Свернуть",+ "agentViewAll.sidebarSection.expand": "Развернуть",+ "agentViewAll.sidebarSection.title": "В боковой панели","agentViewAll.title": "Агенты","agentViewAll.untitled": "Безымянный агент","agentViewAll.view.card": "Карточка",diff --git a/locales/ru-RU/setting.json b/locales/ru-RU/setting.jsonindex 7e1918eb319..e3a2068713a 100644--- a/locales/ru-RU/setting.json+++ b/locales/ru-RU/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "учетные данные, секреты, oauth","settingsSearch.tabKeywords.devices": "устройства, сессии, вошедшие устройства","settingsSearch.tabKeywords.hotkey": "горячая клавиша, ярлык, клавиатура",+ "settingsSearch.tabKeywords.labels": "метки, теги, группировка","settingsSearch.tabKeywords.memory": "память, воспоминания, персонализация","settingsSearch.tabKeywords.messenger": "мессенджер, платформа чата, бот","settingsSearch.tabKeywords.notification": "уведомление, email, push, оповещения",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Импорт из публичного репозитория GitHub","tab.importFromUrl": "Импорт из URL","tab.importFromUrl.desc": "Импорт через прямую ссылку на SKILL.md",+ "tab.labels": "Метки","tab.llm": "Языковая модель","tab.manualFill": "Заполнить вручную","tab.manualFill.desc": "Ручная настройка пользовательского навыка MCP",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Администратор","workspaceSetting.group.agent": "Агент","workspaceSetting.group.general": "Общие",+ "workspaceSetting.labels.actions.archive": "Архивировать",+ "workspaceSetting.labels.actions.create": "Новая метка",+ "workspaceSetting.labels.actions.unarchive": "Восстановить",+ "workspaceSetting.labels.archive.desc": "Эта метка больше не будет доступна для применения к агентам. Агенты, к которым уже применена эта метка, останутся без изменений.",+ "workspaceSetting.labels.archive.success": "Метка архивирована",+ "workspaceSetting.labels.archive.title": "Архивировать \"{{name}}\"?",+ "workspaceSetting.labels.archivedEmpty": "Нет архивированных меток",+ "workspaceSetting.labels.columns.created": "Создано",+ "workspaceSetting.labels.columns.description": "Описание",+ "workspaceSetting.labels.columns.name": "Название",+ "workspaceSetting.labels.columns.usage": "Агенты",+ "workspaceSetting.labels.delete.archiveHint": "Чтобы предотвратить дальнейшее применение этой метки, вместо удаления архивируйте её.",+ "workspaceSetting.labels.delete.confirmHint": "Для подтверждения введите \"удалить\" ниже:",+ "workspaceSetting.labels.delete.desc": "Удаление невозможно отменить.",+ "workspaceSetting.labels.delete.descUsed": "Эта метка будет удалена у {{count}} агентов. Удаление невозможно отменить.",+ "workspaceSetting.labels.delete.success": "Метка удалена",+ "workspaceSetting.labels.delete.title": "Удалить метку \"{{name}}\"?",+ "workspaceSetting.labels.empty": "Метки пока отсутствуют. Создайте одну, чтобы организовать ваших агентов.",+ "workspaceSetting.labels.filterEmpty": "Нет меток, соответствующих фильтру",+ "workspaceSetting.labels.filterPlaceholder": "Фильтр по названию...",+ "workspaceSetting.labels.form.color": "Цвет",+ "workspaceSetting.labels.form.createTitle": "Новая метка",+ "workspaceSetting.labels.form.description": "Описание",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Необязательное описание",+ "workspaceSetting.labels.form.duplicateName": "Метка с таким именем уже существует",+ "workspaceSetting.labels.form.editTitle": "Редактировать метку",+ "workspaceSetting.labels.form.name": "Название",+ "workspaceSetting.labels.form.namePlaceholder": "Название метки",+ "workspaceSetting.labels.form.restoreTitle": "Переименуйте для восстановления",+ "workspaceSetting.labels.loadFailed": "Не удалось загрузить метки",+ "workspaceSetting.labels.manageBlocked": "Только администраторы рабочего пространства могут управлять метками",+ "workspaceSetting.labels.scope.archived": "Архивированные",+ "workspaceSetting.labels.scope.personal": "Личное",+ "workspaceSetting.labels.scope.workspace": "Рабочее пространство",+ "workspaceSetting.labels.usage": "{{count}} агентов","workspaceSetting.storage.comingSoon": "Импорт и экспорт данных, связанных с рабочим пространством, скоро появятся.","workspaceSetting.storage.danger.reset.confirm.content": "Все настройки рабочего пространства будут сброшены до значений по умолчанию для всех участников рабочего пространства. Агенты, разговоры и файлы не будут затронуты.","workspaceSetting.storage.danger.reset.confirm.ok": "Сбросить настройки",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Аудит-логи","workspaceSetting.tab.connector": "Коннекторы","workspaceSetting.tab.general": "Общие",+ "workspaceSetting.tab.labels": "Метки","workspaceSetting.tab.members": "Участники","workspaceSetting.tab.skill": "Навыки"}diff --git a/locales/ru-RU/subscription.json b/locales/ru-RU/subscription.jsonindex 0c2759f9998..80d1307ac1e 100644--- a/locales/ru-RU/subscription.json+++ b/locales/ru-RU/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Бюджет участника по умолчанию","credits.memberBudget.defaultLimitHint": "Участники без пользовательского правила используют этот лимит в каждом расчетном цикле.","credits.memberBudget.desc": "Ограничьте количество кредитов рабочего пространства, которые каждый участник может использовать в текущем расчетном цикле",+ "credits.memberBudget.details.action": "Просмотреть детали",+ "credits.memberBudget.details.title": "Использование участника","credits.memberBudget.effectiveBudget": "Фактический бюджет","credits.memberBudget.empty": "Пока нет участников рабочего пространства","credits.memberBudget.globalBadge": "Глобальный",diff --git a/locales/tr-TR/chat.json b/locales/tr-TR/chat.jsonindex 41d6cfb6783..6ce2c644a89 100644--- a/locales/tr-TR/chat.json+++ b/locales/tr-TR/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Başarıyla oluşturuldu","sessionGroup.creatingAgent": "Ajan oluşturuluyor...","sessionGroup.groupName": "Grup Adı",+ "sessionGroup.hideFromSidebar": "Kenar çubuğumdan gizle","sessionGroup.inputPlaceholder": "Lütfen grup adını girin...","sessionGroup.manageCategory": "Kategoriyi Yönet","sessionGroup.moveGroup": "Gruba Taşı",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Başarıyla yeniden adlandırıldı","sessionGroup.searchAgents": "Ajanları ara","sessionGroup.selectedAgents": "Seçilen ajanlar ({{count}})",+ "sessionGroup.showInSidebar": "Kenar çubuğumda göster","sessionGroup.sortSuccess": "Sıralama başarılı","sessionGroup.sorting": "Grup sıralaması güncelleniyor...","sessionGroup.tooLong": "Grup adı 1-20 karakter arasında olmalıdır",diff --git a/locales/tr-TR/common.json b/locales/tr-TR/common.jsonindex 092f059dd97..830a7f7a52b 100644--- a/locales/tr-TR/common.json+++ b/locales/tr-TR/common.json@@ -2,6 +2,9 @@"about": "Hakkında","addNew": "Yeni ekle","advanceSettings": "Gelişmiş Ayarlar",+ "agentLabel.create": "Yeni etiket",+ "agentLabel.manage": "Etiketleri yönet",+ "agentLabel.menuTitle": "Etiketler","agentViewAll.addToSidebar": "Kenar çubuğunda göster","agentViewAll.columns.author": "Yazar","agentViewAll.columns.name": "Ad",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Sıralama","agentViewAll.form.showSidebarHidden": "Kenar çubuğunda gizlenen ajanları göster","agentViewAll.groupBy.author": "Yazar",+ "agentViewAll.groupBy.label": "Etiket",+ "agentViewAll.groupBy.noLabel": "Etiket yok","agentViewAll.groupBy.none": "Gruplama yok","agentViewAll.groupBy.unknownAuthor": "Bilinmeyen yazar","agentViewAll.myAgents": "Ajanlarım",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Başlık","agentViewAll.orderBy.updatedAt": "Güncelleme zamanı","agentViewAll.removeFromSidebar": "Kenar çubuğundan gizle",+ "agentViewAll.sidebarSection.collapse": "Katla",+ "agentViewAll.sidebarSection.expand": "Aç",+ "agentViewAll.sidebarSection.title": "Kenar Çubuğunda","agentViewAll.title": "Ajanlar","agentViewAll.untitled": "Başlıksız Ajan","agentViewAll.view.card": "Kart",diff --git a/locales/tr-TR/setting.json b/locales/tr-TR/setting.jsonindex a3b41f36ec7..fafb20fe6ae 100644--- a/locales/tr-TR/setting.json+++ b/locales/tr-TR/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "kimlik bilgileri, gizli bilgiler, oauth","settingsSearch.tabKeywords.devices": "cihazlar, oturumlar, giriş yapılan cihazlar","settingsSearch.tabKeywords.hotkey": "kısayol tuşu, kısayol, klavye",+ "settingsSearch.tabKeywords.labels": "etiketler, etiketleme, gruplama","settingsSearch.tabKeywords.memory": "hafıza, anılar, kişiselleştirme","settingsSearch.tabKeywords.messenger": "mesajlaşma, sohbet platformu, bot","settingsSearch.tabKeywords.notification": "bildirim, e-posta, anlık bildirim, uyarılar",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Genel bir GitHub deposundan içe aktar","tab.importFromUrl": "URL'den İçe Aktar","tab.importFromUrl.desc": "SKILL.md'ye doğrudan bağlantı aracılığıyla içe aktar",+ "tab.labels": "Etiketler","tab.llm": "Dil Modeli","tab.manualFill": "Manuel Doldur","tab.manualFill.desc": "Özel bir MCP becerisini manuel olarak yapılandırın",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Yönetici","workspaceSetting.group.agent": "Temsilci","workspaceSetting.group.general": "Genel",+ "workspaceSetting.labels.actions.archive": "Arşivle",+ "workspaceSetting.labels.actions.create": "Yeni etiket",+ "workspaceSetting.labels.actions.unarchive": "Geri Yükle",+ "workspaceSetting.labels.archive.desc": "Bu etiket artık ajanlara uygulanabilir olmayacak. Zaten etiketi uygulanmış olan ajanlar değişmeden kalacak.",+ "workspaceSetting.labels.archive.success": "Etiket arşivlendi",+ "workspaceSetting.labels.archive.title": "\"{{name}}\" arşivlensin mi?",+ "workspaceSetting.labels.archivedEmpty": "Arşivlenmiş etiket yok",+ "workspaceSetting.labels.columns.created": "Oluşturulma Tarihi",+ "workspaceSetting.labels.columns.description": "Açıklama",+ "workspaceSetting.labels.columns.name": "Ad",+ "workspaceSetting.labels.columns.usage": "Ajanlar",+ "workspaceSetting.labels.delete.archiveHint": "Bu etiketin gelecekte uygulanmasını önlemek için, etiketi arşivleyin.",+ "workspaceSetting.labels.delete.confirmHint": "Onaylamak için aşağıya \"sil\" yazın:",+ "workspaceSetting.labels.delete.desc": "Silme işlemi geri alınamaz.",+ "workspaceSetting.labels.delete.descUsed": "Bu etiket {{count}} ajanlardan kaldırılacak. Silme işlemi geri alınamaz.",+ "workspaceSetting.labels.delete.success": "Etiket silindi",+ "workspaceSetting.labels.delete.title": "\"{{name}}\" etiketini silmek istiyor musunuz?",+ "workspaceSetting.labels.empty": "Henüz etiket yok. Ajanlarınızı düzenlemek için bir tane oluşturun.",+ "workspaceSetting.labels.filterEmpty": "Filtreye uyan etiket yok",+ "workspaceSetting.labels.filterPlaceholder": "Ada göre filtrele...",+ "workspaceSetting.labels.form.color": "Renk",+ "workspaceSetting.labels.form.createTitle": "Yeni etiket",+ "workspaceSetting.labels.form.description": "Açıklama",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Opsiyonel açıklama",+ "workspaceSetting.labels.form.duplicateName": "Bu isimde bir etiket zaten mevcut",+ "workspaceSetting.labels.form.editTitle": "Etiketi düzenle",+ "workspaceSetting.labels.form.name": "Ad",+ "workspaceSetting.labels.form.namePlaceholder": "Etiket adı",+ "workspaceSetting.labels.form.restoreTitle": "Geri yüklemek için yeniden adlandır",+ "workspaceSetting.labels.loadFailed": "Etiketler yüklenemedi",+ "workspaceSetting.labels.manageBlocked": "Sadece çalışma alanı yöneticileri etiketleri yönetebilir",+ "workspaceSetting.labels.scope.archived": "Arşivlenmiş",+ "workspaceSetting.labels.scope.personal": "Kişisel",+ "workspaceSetting.labels.scope.workspace": "Çalışma Alanı",+ "workspaceSetting.labels.usage": "{{count}} ajan","workspaceSetting.storage.comingSoon": "Çalışma alanı kapsamlı veri içe ve dışa aktarma yakında geliyor.","workspaceSetting.storage.danger.reset.confirm.content": "Her çalışma alanı ayarı, çalışma alanındaki herkes için varsayılana döner. Ajanlar, konuşmalar ve dosyalar etkilenmez.","workspaceSetting.storage.danger.reset.confirm.ok": "Ayarları Sıfırla",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Denetim kayıtları","workspaceSetting.tab.connector": "Bağlayıcılar","workspaceSetting.tab.general": "Genel",+ "workspaceSetting.tab.labels": "Etiketler","workspaceSetting.tab.members": "Üyeler","workspaceSetting.tab.skill": "Beceriler"}diff --git a/locales/tr-TR/subscription.json b/locales/tr-TR/subscription.jsonindex 79d28cc87d7..8064baa1ed3 100644--- a/locales/tr-TR/subscription.json+++ b/locales/tr-TR/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Varsayılan üye bütçesi","credits.memberBudget.defaultLimitHint": "Özel bir kuralı olmayan üyeler, her fatura döneminde bu limiti kullanır.","credits.memberBudget.desc": "Her üyenin mevcut fatura döneminde kullanabileceği çalışma alanı kredilerini sınırlayın",+ "credits.memberBudget.details.action": "Detayları görüntüle",+ "credits.memberBudget.details.title": "Üye kullanımı","credits.memberBudget.effectiveBudget": "Geçerli bütçe","credits.memberBudget.empty": "Henüz çalışma alanı üyesi yok","credits.memberBudget.globalBadge": "Global",diff --git a/locales/vi-VN/chat.json b/locales/vi-VN/chat.jsonindex 45e5ed4fa63..f6bff2d85aa 100644--- a/locales/vi-VN/chat.json+++ b/locales/vi-VN/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "Tạo thành công","sessionGroup.creatingAgent": "Đang tạo tác nhân...","sessionGroup.groupName": "Tên nhóm",+ "sessionGroup.hideFromSidebar": "Ẩn khỏi thanh bên của tôi","sessionGroup.inputPlaceholder": "Vui lòng nhập tên nhóm...","sessionGroup.manageCategory": "Quản lý Danh mục","sessionGroup.moveGroup": "Chuyển đến nhóm",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "Đổi tên thành công","sessionGroup.searchAgents": "Tìm kiếm tác nhân","sessionGroup.selectedAgents": "Tác nhân đã chọn ({{count}})",+ "sessionGroup.showInSidebar": "Hiển thị trong thanh bên của tôi","sessionGroup.sortSuccess": "Sắp xếp lại thành công","sessionGroup.sorting": "Đang cập nhật sắp xếp nhóm...","sessionGroup.tooLong": "Tên nhóm phải từ 1 đến 20 ký tự",diff --git a/locales/vi-VN/common.json b/locales/vi-VN/common.jsonindex 2f9d4272cd8..9268537a18f 100644--- a/locales/vi-VN/common.json+++ b/locales/vi-VN/common.json@@ -2,6 +2,9 @@"about": "Giới thiệu","addNew": "Thêm mới","advanceSettings": "Cài đặt nâng cao",+ "agentLabel.create": "Nhãn mới",+ "agentLabel.manage": "Quản lý nhãn",+ "agentLabel.menuTitle": "Nhãn","agentViewAll.addToSidebar": "Hiển thị trong thanh bên","agentViewAll.columns.author": "Tác giả","agentViewAll.columns.name": "Tên",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "Sắp xếp","agentViewAll.form.showSidebarHidden": "Hiển thị các tác nhân ẩn khỏi thanh bên","agentViewAll.groupBy.author": "Tác giả",+ "agentViewAll.groupBy.label": "Nhãn",+ "agentViewAll.groupBy.noLabel": "Không có nhãn","agentViewAll.groupBy.none": "Không nhóm","agentViewAll.groupBy.unknownAuthor": "Tác giả không xác định","agentViewAll.myAgents": "Tác nhân của tôi",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "Tiêu đề","agentViewAll.orderBy.updatedAt": "Cập nhật lúc","agentViewAll.removeFromSidebar": "Ẩn khỏi thanh bên",+ "agentViewAll.sidebarSection.collapse": "Thu gọn",+ "agentViewAll.sidebarSection.expand": "Mở rộng",+ "agentViewAll.sidebarSection.title": "Trong Thanh bên","agentViewAll.title": "Tác nhân","agentViewAll.untitled": "Tác nhân chưa có tiêu đề","agentViewAll.view.card": "Thẻ",diff --git a/locales/vi-VN/setting.json b/locales/vi-VN/setting.jsonindex 93db6c1a5ca..a7f9f6c36ca 100644--- a/locales/vi-VN/setting.json+++ b/locales/vi-VN/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "thông tin xác thực, bí mật, oauth","settingsSearch.tabKeywords.devices": "thiết bị, phiên, thiết bị đã đăng nhập","settingsSearch.tabKeywords.hotkey": "phím tắt, phím nhanh, bàn phím",+ "settingsSearch.tabKeywords.labels": "nhãn, thẻ, nhóm","settingsSearch.tabKeywords.memory": "bộ nhớ, ký ức, cá nhân hóa","settingsSearch.tabKeywords.messenger": "nhắn tin, nền tảng chat, bot","settingsSearch.tabKeywords.notification": "thông báo, email, đẩy, cảnh báo",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "Nhập từ một kho GitHub công khai","tab.importFromUrl": "Nhập từ URL","tab.importFromUrl.desc": "Nhập qua liên kết trực tiếp đến SKILL.md",+ "tab.labels": "Nhãn","tab.llm": "Mô Hình Ngôn Ngữ","tab.manualFill": "Điền Thủ công","tab.manualFill.desc": "Cấu hình thủ công một kỹ năng MCP tùy chỉnh",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "Quản trị viên","workspaceSetting.group.agent": "Đại lý","workspaceSetting.group.general": "Chung",+ "workspaceSetting.labels.actions.archive": "Lưu trữ",+ "workspaceSetting.labels.actions.create": "Nhãn mới",+ "workspaceSetting.labels.actions.unarchive": "Khôi phục",+ "workspaceSetting.labels.archive.desc": "Nhãn này sẽ không còn khả dụng để áp dụng cho các nhân viên. Các nhân viên đã được áp dụng nhãn này sẽ không bị thay đổi.",+ "workspaceSetting.labels.archive.success": "Nhãn đã được lưu trữ",+ "workspaceSetting.labels.archive.title": "Lưu trữ \"{{name}}\"?",+ "workspaceSetting.labels.archivedEmpty": "Không có nhãn nào đã lưu trữ",+ "workspaceSetting.labels.columns.created": "Ngày tạo",+ "workspaceSetting.labels.columns.description": "Mô tả",+ "workspaceSetting.labels.columns.name": "Tên",+ "workspaceSetting.labels.columns.usage": "Nhân viên",+ "workspaceSetting.labels.delete.archiveHint": "Để ngăn việc áp dụng nhãn này trong tương lai, hãy lưu trữ nhãn thay vì xóa.",+ "workspaceSetting.labels.delete.confirmHint": "Để xác nhận, hãy nhập \"delete\" bên dưới:",+ "workspaceSetting.labels.delete.desc": "Việc xóa không thể hoàn tác.",+ "workspaceSetting.labels.delete.descUsed": "Nhãn này sẽ bị xóa khỏi {{count}} nhân viên. Việc xóa không thể hoàn tác.",+ "workspaceSetting.labels.delete.success": "Nhãn đã được xóa",+ "workspaceSetting.labels.delete.title": "Xóa nhãn \"{{name}}\"?",+ "workspaceSetting.labels.empty": "Chưa có nhãn nào. Tạo một nhãn để tổ chức các nhân viên của bạn.",+ "workspaceSetting.labels.filterEmpty": "Không có nhãn nào khớp với bộ lọc",+ "workspaceSetting.labels.filterPlaceholder": "Lọc theo tên...",+ "workspaceSetting.labels.form.color": "Màu sắc",+ "workspaceSetting.labels.form.createTitle": "Nhãn mới",+ "workspaceSetting.labels.form.description": "Mô tả",+ "workspaceSetting.labels.form.descriptionPlaceholder": "Mô tả tùy chọn",+ "workspaceSetting.labels.form.duplicateName": "Đã tồn tại một nhãn với tên này",+ "workspaceSetting.labels.form.editTitle": "Chỉnh sửa nhãn",+ "workspaceSetting.labels.form.name": "Tên",+ "workspaceSetting.labels.form.namePlaceholder": "Tên nhãn",+ "workspaceSetting.labels.form.restoreTitle": "Đổi tên để khôi phục",+ "workspaceSetting.labels.loadFailed": "Không thể tải nhãn",+ "workspaceSetting.labels.manageBlocked": "Chỉ quản trị viên không gian làm việc mới có thể quản lý nhãn",+ "workspaceSetting.labels.scope.archived": "Đã lưu trữ",+ "workspaceSetting.labels.scope.personal": "Cá nhân",+ "workspaceSetting.labels.scope.workspace": "Không gian làm việc",+ "workspaceSetting.labels.usage": "{{count}} nhân viên","workspaceSetting.storage.comingSoon": "Nhập & xuất dữ liệu theo không gian làm việc sẽ sớm ra mắt.","workspaceSetting.storage.danger.reset.confirm.content": "Mọi cài đặt không gian làm việc sẽ trở về mặc định, cho tất cả mọi người trong không gian làm việc. Các agent, cuộc trò chuyện và tệp tin sẽ không bị ảnh hưởng.","workspaceSetting.storage.danger.reset.confirm.ok": "Đặt lại cài đặt",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "Nhật ký kiểm toán","workspaceSetting.tab.connector": "Trình kết nối","workspaceSetting.tab.general": "Chung",+ "workspaceSetting.tab.labels": "Nhãn","workspaceSetting.tab.members": "Thành viên","workspaceSetting.tab.skill": "Kỹ năng"}diff --git a/locales/vi-VN/subscription.json b/locales/vi-VN/subscription.jsonindex d484b326971..c46759e630a 100644--- a/locales/vi-VN/subscription.json+++ b/locales/vi-VN/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "Ngân sách mặc định cho thành viên","credits.memberBudget.defaultLimitHint": "Các thành viên không có quy tắc tùy chỉnh sẽ sử dụng giới hạn này trong mỗi chu kỳ thanh toán.","credits.memberBudget.desc": "Giới hạn số lượng tín dụng không gian làm việc mà mỗi thành viên có thể sử dụng trong chu kỳ thanh toán hiện tại",+ "credits.memberBudget.details.action": "Xem chi tiết",+ "credits.memberBudget.details.title": "Sử dụng của thành viên","credits.memberBudget.effectiveBudget": "Ngân sách hiệu lực","credits.memberBudget.empty": "Chưa có thành viên trong không gian làm việc","credits.memberBudget.globalBadge": "Toàn cầu",diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.jsonindex 5841df758ff..58f848b1b82 100644--- a/locales/zh-CN/chat.json+++ b/locales/zh-CN/chat.json@@ -884,6 +884,7 @@"sessionGroup.createSuccess": "分类创建成功","sessionGroup.creatingAgent": "正在创建助理…","sessionGroup.groupName": "分类名称",+ "sessionGroup.hideFromSidebar": "在我的侧边栏隐藏","sessionGroup.inputPlaceholder": "请输入分类名称…","sessionGroup.manageCategory": "管理分类","sessionGroup.moveGroup": "移动到分类",@@ -898,6 +899,7 @@"sessionGroup.renameSuccess": "重命名成功","sessionGroup.searchAgents": "搜索助理","sessionGroup.selectedAgents": "已选助理({{count}})",+ "sessionGroup.showInSidebar": "在我的侧边栏显示","sessionGroup.sortSuccess": "排序已更新","sessionGroup.sorting": "正在更新分类排序…","sessionGroup.tooLong": "分类名称长度需为 1–20 个字符",diff --git a/locales/zh-CN/common.json b/locales/zh-CN/common.jsonindex 6e11d095af3..6998e6c0aab 100644--- a/locales/zh-CN/common.json+++ b/locales/zh-CN/common.json@@ -2,22 +2,27 @@"about": "关于","addNew": "新建","advanceSettings": "高级设置",- "agentViewAll.addToSidebar": "在侧边栏显示",- "agentViewAll.columns.author": "作者",- "agentViewAll.columns.name": "名称",- "agentViewAll.columns.updatedAt": "最后更新时间",+ "agentLabel.create": "新建标签",+ "agentLabel.manage": "管理标签",+ "agentLabel.menuTitle": "标签",+ "agentViewAll.addToSidebar": "在我的侧边栏显示","agentViewAll.empty": "暂无助理","agentViewAll.form.grouping": "分组","agentViewAll.form.ordering": "排序",- "agentViewAll.form.showSidebarHidden": "显示侧边栏隐藏的助理",+ "agentViewAll.form.showSidebarHidden": "显示已从我的侧边栏隐藏的助手","agentViewAll.groupBy.author": "作者",+ "agentViewAll.groupBy.label": "标签",+ "agentViewAll.groupBy.noLabel": "无标签","agentViewAll.groupBy.none": "不分组","agentViewAll.groupBy.unknownAuthor": "未知作者","agentViewAll.myAgents": "我的助理","agentViewAll.orderBy.author": "作者","agentViewAll.orderBy.title": "标题","agentViewAll.orderBy.updatedAt": "更新时间",- "agentViewAll.removeFromSidebar": "在侧边栏隐藏",+ "agentViewAll.removeFromSidebar": "在我的侧边栏隐藏",+ "agentViewAll.sidebarSection.collapse": "收起",+ "agentViewAll.sidebarSection.expand": "展开",+ "agentViewAll.sidebarSection.title": "侧边栏展示","agentViewAll.title": "助理","agentViewAll.untitled": "未命名助理","agentViewAll.view.card": "卡片",diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.jsonindex 32e66d7a0bf..0bc9a38e25f 100644--- a/locales/zh-CN/setting.json+++ b/locales/zh-CN/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "凭证,密钥,授权","settingsSearch.tabKeywords.devices": "设备,会话,登录设备","settingsSearch.tabKeywords.hotkey": "快捷键,键盘,热键",+ "settingsSearch.tabKeywords.labels": "标签, 分组, 标记","settingsSearch.tabKeywords.memory": "记忆,个性化","settingsSearch.tabKeywords.messenger": "聊天平台,机器人,消息","settingsSearch.tabKeywords.notification": "通知,推送,邮件提醒",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "从公开的 GitHub 仓库导入","tab.importFromUrl": "从 URL 导入","tab.importFromUrl.desc": "通过 SKILL.md 的直接链接导入",+ "tab.labels": "标签","tab.llm": "语言模型","tab.manualFill": "自行填写内容","tab.manualFill.desc": "手动配置自定义 MCP 技能",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "管理","workspaceSetting.group.agent": "智能体","workspaceSetting.group.general": "通用",+ "workspaceSetting.labels.actions.archive": "归档",+ "workspaceSetting.labels.actions.create": "新建标签",+ "workspaceSetting.labels.actions.unarchive": "恢复",+ "workspaceSetting.labels.archive.desc": "归档后该标签将无法再应用到助理,已应用该标签的助理保持不变。",+ "workspaceSetting.labels.archive.success": "标签已归档",+ "workspaceSetting.labels.archive.title": "归档「{{name}}」?",+ "workspaceSetting.labels.archivedEmpty": "没有已归档的标签",+ "workspaceSetting.labels.columns.created": "创建时间",+ "workspaceSetting.labels.columns.description": "描述",+ "workspaceSetting.labels.columns.name": "名称",+ "workspaceSetting.labels.columns.usage": "助理数",+ "workspaceSetting.labels.delete.archiveHint": "如果只是不想再使用该标签,建议改为归档。",+ "workspaceSetting.labels.delete.confirmHint": "请输入 \"delete\" 以确认删除:",+ "workspaceSetting.labels.delete.desc": "删除后无法恢复。",+ "workspaceSetting.labels.delete.descUsed": "该标签将从 {{count}} 个助理上移除,删除后无法恢复。",+ "workspaceSetting.labels.delete.success": "标签已删除",+ "workspaceSetting.labels.delete.title": "删除标签「{{name}}」?",+ "workspaceSetting.labels.empty": "还没有标签,创建一个来组织你的助理吧。",+ "workspaceSetting.labels.filterEmpty": "没有匹配的标签",+ "workspaceSetting.labels.filterPlaceholder": "按名称筛选...",+ "workspaceSetting.labels.form.color": "颜色",+ "workspaceSetting.labels.form.createTitle": "新建标签",+ "workspaceSetting.labels.form.description": "描述",+ "workspaceSetting.labels.form.descriptionPlaceholder": "可选描述",+ "workspaceSetting.labels.form.duplicateName": "已存在同名标签",+ "workspaceSetting.labels.form.editTitle": "编辑标签",+ "workspaceSetting.labels.form.name": "名称",+ "workspaceSetting.labels.form.namePlaceholder": "标签名称",+ "workspaceSetting.labels.form.restoreTitle": "重命名后恢复",+ "workspaceSetting.labels.loadFailed": "标签加载失败",+ "workspaceSetting.labels.manageBlocked": "仅工作区管理员可以管理标签",+ "workspaceSetting.labels.scope.archived": "已归档",+ "workspaceSetting.labels.scope.personal": "个人",+ "workspaceSetting.labels.scope.workspace": "工作区",+ "workspaceSetting.labels.usage": "{{count}} 个助理","workspaceSetting.storage.comingSoon": "工作区范围的数据导入和导出即将推出。","workspaceSetting.storage.danger.reset.confirm.content": "工作区的所有设置都会恢复为默认值,对工作区中的每个人生效。智能体、会话和文件不受影响。","workspaceSetting.storage.danger.reset.confirm.ok": "重置设置",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "审计日志","workspaceSetting.tab.connector": "连接器","workspaceSetting.tab.general": "通用",+ "workspaceSetting.tab.labels": "标签","workspaceSetting.tab.members": "成员","workspaceSetting.tab.skill": "技能"}diff --git a/locales/zh-CN/subscription.json b/locales/zh-CN/subscription.jsonindex 423233a9f00..664c179ed7e 100644--- a/locales/zh-CN/subscription.json+++ b/locales/zh-CN/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "默认成员预算","credits.memberBudget.defaultLimitHint": "未设置单独规则的成员,每个计费周期适用该上限。","credits.memberBudget.desc": "限制每位成员在当前计费周期内可使用的工作区积分",+ "credits.memberBudget.details.action": "查看详情",+ "credits.memberBudget.details.title": "成员用量详情","credits.memberBudget.effectiveBudget": "生效预算","credits.memberBudget.empty": "暂无工作区成员","credits.memberBudget.globalBadge": "全局生效",@@ -151,7 +153,7 @@"credits.memberBudget.status.inherit": "继承默认","credits.memberBudget.status.unlimited": "不限制","credits.memberBudget.target.allMembers": "所有成员",- "credits.memberBudget.title": "预算",+ "credits.memberBudget.title": "成员预算管控","credits.memberBudget.unlimited": "不限制","credits.memberBudget.unlimitedMemberHint": "请先设置所有成员规则,再为单个成员添加不限制覆盖。","credits.memberBudget.upgradeCta": "查看套餐",diff --git a/locales/zh-TW/chat.json b/locales/zh-TW/chat.jsonindex e5f99f05b3f..1c752c19bf0 100644--- a/locales/zh-TW/chat.json+++ b/locales/zh-TW/chat.json@@ -863,6 +863,7 @@"sessionGroup.createSuccess": "創建成功","sessionGroup.creatingAgent": "助手建立中...","sessionGroup.groupName": "群組名稱",+ "sessionGroup.hideFromSidebar": "從我的側邊欄隱藏","sessionGroup.inputPlaceholder": "請輸入分組名稱...","sessionGroup.manageCategory": "管理類別","sessionGroup.moveGroup": "移動到分組",@@ -877,6 +878,7 @@"sessionGroup.renameSuccess": "重新命名成功","sessionGroup.searchAgents": "搜尋助理","sessionGroup.selectedAgents": "已選助理 ({{count}})",+ "sessionGroup.showInSidebar": "在我的側邊欄顯示","sessionGroup.sortSuccess": "重新排序成功","sessionGroup.sorting": "分組排序更新中...","sessionGroup.tooLong": "分組名稱長度需在 1-20 之內",diff --git a/locales/zh-TW/common.json b/locales/zh-TW/common.jsonindex 7429e3df384..00ad1fe1cea 100644--- a/locales/zh-TW/common.json+++ b/locales/zh-TW/common.json@@ -2,6 +2,9 @@"about": "關於","addNew": "新增","advanceSettings": "進階設定",+ "agentLabel.create": "新增標籤",+ "agentLabel.manage": "管理標籤",+ "agentLabel.menuTitle": "標籤","agentViewAll.addToSidebar": "顯示於側邊欄","agentViewAll.columns.author": "作者","agentViewAll.columns.name": "名稱",@@ -11,6 +14,8 @@"agentViewAll.form.ordering": "排序","agentViewAll.form.showSidebarHidden": "顯示隱藏於側邊欄的代理","agentViewAll.groupBy.author": "作者",+ "agentViewAll.groupBy.label": "標籤",+ "agentViewAll.groupBy.noLabel": "無標籤","agentViewAll.groupBy.none": "無分組","agentViewAll.groupBy.unknownAuthor": "未知作者","agentViewAll.myAgents": "我的代理",@@ -18,6 +23,9 @@"agentViewAll.orderBy.title": "標題","agentViewAll.orderBy.updatedAt": "更新時間","agentViewAll.removeFromSidebar": "從側邊欄隱藏",+ "agentViewAll.sidebarSection.collapse": "摺疊",+ "agentViewAll.sidebarSection.expand": "展開",+ "agentViewAll.sidebarSection.title": "在側邊欄","agentViewAll.title": "代理","agentViewAll.untitled": "未命名代理","agentViewAll.view.card": "卡片",diff --git a/locales/zh-TW/setting.json b/locales/zh-TW/setting.jsonindex 63574528f0b..67743dbd6e5 100644--- a/locales/zh-TW/setting.json+++ b/locales/zh-TW/setting.json@@ -994,6 +994,7 @@"settingsSearch.tabKeywords.creds": "憑證, 密鑰, OAuth","settingsSearch.tabKeywords.devices": "裝置, 工作階段, 登入的裝置","settingsSearch.tabKeywords.hotkey": "快捷鍵, 快捷方式, 鍵盤",+ "settingsSearch.tabKeywords.labels": "標籤、標記、分組","settingsSearch.tabKeywords.memory": "記憶, 記憶體, 個性化","settingsSearch.tabKeywords.messenger": "Messenger, 聊天平台, 機器人","settingsSearch.tabKeywords.notification": "通知, 電子郵件, 推送, 警報",@@ -1196,6 +1197,7 @@"tab.importFromGithub.desc": "從公開的 GitHub 儲存庫匯入","tab.importFromUrl": "從 URL 匯入","tab.importFromUrl.desc": "透過 SKILL.md 的直接連結匯入",+ "tab.labels": "標籤","tab.llm": "語言模型","tab.manualFill": "手動填寫","tab.manualFill.desc": "手動配置自訂 MCP 技能",@@ -2712,6 +2714,41 @@"workspaceSetting.group.admin": "管理","workspaceSetting.group.agent": "智能體","workspaceSetting.group.general": "一般",+ "workspaceSetting.labels.actions.archive": "封存",+ "workspaceSetting.labels.actions.create": "新增標籤",+ "workspaceSetting.labels.actions.unarchive": "還原",+ "workspaceSetting.labels.archive.desc": "此標籤將無法再被套用至代理。已套用此標籤的代理將保持不變。",+ "workspaceSetting.labels.archive.success": "標籤已封存",+ "workspaceSetting.labels.archive.title": "封存「{{name}}」?",+ "workspaceSetting.labels.archivedEmpty": "沒有已封存的標籤",+ "workspaceSetting.labels.columns.created": "建立時間",+ "workspaceSetting.labels.columns.description": "描述",+ "workspaceSetting.labels.columns.name": "名稱",+ "workspaceSetting.labels.columns.usage": "代理",+ "workspaceSetting.labels.delete.archiveHint": "若要防止此標籤未來被套用,請改為封存此標籤。",+ "workspaceSetting.labels.delete.confirmHint": "請輸入「delete」以確認:",+ "workspaceSetting.labels.delete.desc": "刪除後無法復原。",+ "workspaceSetting.labels.delete.descUsed": "此標籤將從 {{count}} 位代理中移除。刪除後無法復原。",+ "workspaceSetting.labels.delete.success": "標籤已刪除",+ "workspaceSetting.labels.delete.title": "刪除標籤「{{name}}」?",+ "workspaceSetting.labels.empty": "尚無標籤。建立一個以組織您的代理。",+ "workspaceSetting.labels.filterEmpty": "沒有符合篩選條件的標籤",+ "workspaceSetting.labels.filterPlaceholder": "按名稱篩選...",+ "workspaceSetting.labels.form.color": "顏色",+ "workspaceSetting.labels.form.createTitle": "新增標籤",+ "workspaceSetting.labels.form.description": "描述",+ "workspaceSetting.labels.form.descriptionPlaceholder": "可選描述",+ "workspaceSetting.labels.form.duplicateName": "已存在相同名稱的標籤",+ "workspaceSetting.labels.form.editTitle": "編輯標籤",+ "workspaceSetting.labels.form.name": "名稱",+ "workspaceSetting.labels.form.namePlaceholder": "標籤名稱",+ "workspaceSetting.labels.form.restoreTitle": "重新命名以恢復",+ "workspaceSetting.labels.loadFailed": "無法載入標籤",+ "workspaceSetting.labels.manageBlocked": "僅工作區管理員可以管理標籤",+ "workspaceSetting.labels.scope.archived": "已封存",+ "workspaceSetting.labels.scope.personal": "個人",+ "workspaceSetting.labels.scope.workspace": "工作區",+ "workspaceSetting.labels.usage": "{{count}} 位代理","workspaceSetting.storage.comingSoon": "工作空間範圍的數據導入與導出即將推出。","workspaceSetting.storage.danger.reset.confirm.content": "每個工作區的設定將恢復為預設值,適用於工作區中的所有人。代理、對話和檔案不會受到影響。","workspaceSetting.storage.danger.reset.confirm.ok": "重置設定",@@ -2722,6 +2759,7 @@"workspaceSetting.tab.auditLog": "稽核記錄","workspaceSetting.tab.connector": "連接器","workspaceSetting.tab.general": "一般",+ "workspaceSetting.tab.labels": "標籤","workspaceSetting.tab.members": "成員","workspaceSetting.tab.skill": "技能"}diff --git a/locales/zh-TW/subscription.json b/locales/zh-TW/subscription.jsonindex 1b2a00ff71d..a821e1c17cf 100644--- a/locales/zh-TW/subscription.json+++ b/locales/zh-TW/subscription.json@@ -137,6 +137,8 @@"credits.memberBudget.defaultLimit": "預設成員預算","credits.memberBudget.defaultLimitHint": "沒有自訂規則的成員每個計費週期都使用此限制。","credits.memberBudget.desc": "限制每位成員在當前計費週期內可使用的工作區點數數量",+ "credits.memberBudget.details.action": "查看詳情",+ "credits.memberBudget.details.title": "會員使用情況","credits.memberBudget.effectiveBudget": "有效預算","credits.memberBudget.empty": "尚無工作區成員","credits.memberBudget.globalBadge": "全域",diff --git a/packages/const/src/rbac.test.ts b/packages/const/src/rbac.test.tsindex 119ca987d7e..106c813708c 100644--- a/packages/const/src/rbac.test.ts+++ b/packages/const/src/rbac.test.ts@@ -26,15 +26,31 @@ describe('workspace built-in roles', () => {'workspace_member:update_role:all','workspace_audit:read:all','api_key:update:all',- 'agent:update:owner',]),);expect(admin).not.toEqual(- expect.arrayContaining([- 'workspace:billing_manage:all',- 'workspace:delete:all',- 'agent:update:all',- ]),+ expect.arrayContaining(['workspace:billing_manage:all', 'workspace:delete:all']),);});++ // Agent curation is an Admin job, so `AGENT_UPDATE:all` is what lets+ // `canPerformResourceAction` bypass a shared Agent's Member Permissions —+ // General Access constrains members and viewers, not the Admin. Destroying+ // or rehoming someone else's Agent stays Owner/creator-only.+ it('lets Admin curate other members Agents without granting destructive rights', () => {+ const admin = WORKSPACE_ROLE_PERMISSIONS[WORKSPACE_SYSTEM_ROLES.ADMIN];++ expect(admin).toContain('agent:update:all');+ expect(admin).not.toContain('agent:update:owner');+ expect(admin).toContain('agent:delete:owner');+ expect(admin).not.toContain('agent:delete:all');+ });++ it('keeps every non-Agent content resource owner-scoped for Admin', () => {+ const admin = WORKSPACE_ROLE_PERMISSIONS[WORKSPACE_SYSTEM_ROLES.ADMIN];++ for (const code of ['document:update:all', 'knowledge_base:update:all', 'file:update:all']) {+ expect(admin).not.toContain(code);+ }+ });});diff --git a/packages/const/src/rbac.ts b/packages/const/src/rbac.tsindex 7f7b0a9625e..bb6f19337f9 100644--- a/packages/const/src/rbac.ts+++ b/packages/const/src/rbac.ts@@ -15,6 +15,15 @@ export const PERMISSION_ACTIONS = {AGENT_UPDATE: 'agent:update',+ // ==================== Agent Label Management ====================+ AGENT_LABEL_CREATE: 'agent_label:create',++ AGENT_LABEL_DELETE: 'agent_label:delete',++ AGENT_LABEL_READ: 'agent_label:read',++ AGENT_LABEL_UPDATE: 'agent_label:update',+// ==================== AI Infrastructure Management ====================AI_MODEL_CREATE: 'ai_model:create',@@ -224,6 +233,20 @@ export const getAllowedScopesForAction = (// workspace_member.role + assigned permissions already pin who can do what.if (resource.startsWith('workspace')) return ['ALL'];+ // Agent labels are a shared registry rather than per-author content: in a+ // workspace every member sees and uses the same label set, and the model+ // scopes reads and writes by `workspace_id` alone. An OWNER grant would+ // therefore be a lie — it reads as "only labels you created" but would in+ // fact authorize mutating every label in the workspace.+ if (resource === 'agent_label') return ['ALL'];++ // Sidebar folders became the same kind of thing: they are the shared+ // skeleton of a workspace sidebar, and `SessionGroupModel.ownership()` now+ // matches every public folder rather than only the caller's. An OWNER grant+ // would read as "only folders you created" while authorizing renames and+ // deletes across every shared Category.+ if (resource === 'session_group') return ['ALL'];+// user resource nuance: create/delete without OWNER; read/update allow OWNERif (resource === 'user') {if (action === 'create' || action === 'delete') return ['ALL'];@@ -312,7 +335,10 @@ const action = (key: keyof typeof PERMISSION_ACTIONS): string => PERMISSION_ACTI* - `workspace_owner` — every workspace-domain permission + every content* permission (`:all`) so they can manage other members' resources too.* - `workspace_admin` — workspace administration without billing, workspace- * deletion, ownership transfer, or write access to other members' content.+ * deletion, or ownership transfer. Holds `AGENT_UPDATE:all` so Agent+ * curation (rename, config, Member Permissions) is not blocked by another+ * member's General Access; every other content resource stays `:owner`, and+ * deleting or rehoming someone else's Agent remains Owner/creator-only.* - `workspace_member` — read workspace + members; create/update/delete their* own content (`:owner`) on every content resource.* - `workspace_viewer` — strict read-only on workspace + members + content.@@ -347,6 +373,10 @@ export const WORKSPACE_ROLE_PERMISSIONS: Record<WorkspaceSystemRoleName, readonl`${action('AGENT_UPDATE')}:all`,`${action('AGENT_DELETE')}:all`,`${action('AGENT_FORK')}:all`,+ `${action('AGENT_LABEL_READ')}:all`,+ `${action('AGENT_LABEL_CREATE')}:all`,+ `${action('AGENT_LABEL_UPDATE')}:all`,+ `${action('AGENT_LABEL_DELETE')}:all`,`${action('SESSION_READ')}:all`,`${action('SESSION_CREATE')}:all`,`${action('SESSION_UPDATE')}:all`,@@ -410,20 +440,29 @@ export const WORKSPACE_ROLE_PERMISSIONS: Record<WorkspaceSystemRoleName, readonl`${action('WORKSPACE_ROLE_CREATE')}:all`,`${action('WORKSPACE_ROLE_UPDATE')}:all`,`${action('WORKSPACE_ROLE_DELETE')}:all`,- // Content — Admin can read shared resources but only write their own+ // Content — Admin curates shared Agents (`AGENT_UPDATE:all` is what lets+ // `canPerformResourceAction` bypass a resource's Member Permissions, so+ // General Access constrains members and viewers, not the Admin who has to+ // keep the workspace's Agent list in order). Destructive / ownership+ // actions stay with the creator or the workspace Owner: AGENT_DELETE and+ // transfer are deliberately still `:owner`-scoped here.`${action('AGENT_READ')}:all`,`${action('AGENT_CREATE')}:owner`,- `${action('AGENT_UPDATE')}:owner`,+ `${action('AGENT_UPDATE')}:all`,`${action('AGENT_DELETE')}:owner`,`${action('AGENT_FORK')}:owner`,+ `${action('AGENT_LABEL_READ')}:all`,+ `${action('AGENT_LABEL_CREATE')}:all`,+ `${action('AGENT_LABEL_UPDATE')}:all`,+ `${action('AGENT_LABEL_DELETE')}:all`,`${action('SESSION_READ')}:all`,`${action('SESSION_CREATE')}:owner`,`${action('SESSION_UPDATE')}:owner`,`${action('SESSION_DELETE')}:owner`,`${action('SESSION_GROUP_READ')}:all`,- `${action('SESSION_GROUP_CREATE')}:owner`,- `${action('SESSION_GROUP_UPDATE')}:owner`,- `${action('SESSION_GROUP_DELETE')}:owner`,+ `${action('SESSION_GROUP_CREATE')}:all`,+ `${action('SESSION_GROUP_UPDATE')}:all`,+ `${action('SESSION_GROUP_DELETE')}:all`,`${action('MESSAGE_READ')}:all`,`${action('MESSAGE_CREATE')}:owner`,`${action('MESSAGE_UPDATE')}:owner`,@@ -473,14 +512,15 @@ export const WORKSPACE_ROLE_PERMISSIONS: Record<WorkspaceSystemRoleName, readonl`${action('AGENT_UPDATE')}:owner`,`${action('AGENT_DELETE')}:owner`,`${action('AGENT_FORK')}:owner`,+ `${action('AGENT_LABEL_READ')}:all`,`${action('SESSION_READ')}:all`,`${action('SESSION_CREATE')}:owner`,`${action('SESSION_UPDATE')}:owner`,`${action('SESSION_DELETE')}:owner`,`${action('SESSION_GROUP_READ')}:all`,- `${action('SESSION_GROUP_CREATE')}:owner`,- `${action('SESSION_GROUP_UPDATE')}:owner`,- `${action('SESSION_GROUP_DELETE')}:owner`,+ `${action('SESSION_GROUP_CREATE')}:all`,+ `${action('SESSION_GROUP_UPDATE')}:all`,+ `${action('SESSION_GROUP_DELETE')}:all`,`${action('MESSAGE_READ')}:all`,`${action('MESSAGE_CREATE')}:owner`,`${action('MESSAGE_UPDATE')}:owner`,@@ -514,6 +554,7 @@ export const WORKSPACE_ROLE_PERMISSIONS: Record<WorkspaceSystemRoleName, readonl`${action('WORKSPACE_READ')}:all`,`${action('WORKSPACE_MEMBER_READ')}:all`,`${action('AGENT_READ')}:all`,+ `${action('AGENT_LABEL_READ')}:all`,`${action('SESSION_READ')}:all`,`${action('SESSION_GROUP_READ')}:all`,`${action('MESSAGE_READ')}:all`,diff --git a/packages/database/src/models/__tests__/agent.test.ts b/packages/database/src/models/__tests__/agent.test.tsindex f67b2841a45..f16c4a0e21c 100644--- a/packages/database/src/models/__tests__/agent.test.ts+++ b/packages/database/src/models/__tests__/agent.test.ts@@ -2489,6 +2489,29 @@ describe('AgentModel', () => {});});+ describe('duplicate visibility', () => {+ it('keeps a private agent private when duplicated', async () => {+ // The column defaults to `public`, so an omitted copy publishes the+ // duplicate of a private agent to the whole workspace — and, now that+ // folder placement is shared, strands it in Ungrouped as well, since a+ // public item resolves only against public folders.+ const [group] = await serverDB+ .insert(sessionGroups)+ .values({ name: 'Private folder', userId, visibility: 'private' })+ .returning();+ const [agent] = await serverDB+ .insert(agents)+ .values({ sessionGroupId: group.id, title: 'Secret', userId, visibility: 'private' })+ .returning();++ const result = await agentModel.duplicate(agent.id);++ const [copy] = await serverDB.select().from(agents).where(eq(agents.id, result!.agentId));+ expect(copy.visibility).toBe('private');+ expect(copy.sessionGroupId).toBe(group.id);+ });+ });+describe('updateSessionGroupId', () => {it('should update agent sessionGroupId', async () => {const [group] = await serverDB@@ -2519,6 +2542,26 @@ describe('AgentModel', () => {expect(result.sessionGroupId).toBeNull();});+ it('should reject a folder the caller cannot see', async () => {+ // The column is workspace-shared, so an unvalidated target corrupts the+ // sidebar for every member: the foreign key accepts another user's+ // folder, and everyone who cannot see it then finds the agent in+ // Ungrouped.+ const [foreignGroup] = await serverDB+ .insert(sessionGroups)+ .values({ userId: userId2, name: 'Someone else' })+ .returning();++ const [agent] = await serverDB.insert(agents).values({ userId, title: 'Agent' }).returning();++ await expect(agentModel.updateSessionGroupId(agent.id, foreignGroup.id)).rejects.toThrow(+ /not found in current scope/,+ );++ const [row] = await serverDB.select().from(agents).where(eq(agents.id, agent.id));+ expect(row.sessionGroupId).toBeNull();+ });+it('should not update agents from other users', async () => {const [agent] = await serverDB.insert(agents)diff --git a/packages/database/src/models/__tests__/agentLabel.test.ts b/packages/database/src/models/__tests__/agentLabel.test.tsnew file mode 100644index 00000000000..9941a02bda9--- /dev/null+++ b/packages/database/src/models/__tests__/agentLabel.test.ts@@ -0,0 +1,243 @@+// @vitest-environment node+import { eq } from 'drizzle-orm';+import { afterEach, beforeEach, describe, expect, it } from 'vitest';++import { getTestDB } from '../../core/getTestDB';+import { agentLabelAssignments, agentLabels, agents, users, workspaces } from '../../schemas';+import type { LobeChatDatabase } from '../../type';+import { AgentLabelModel } from '../agentLabel';++const serverDB: LobeChatDatabase = await getTestDB();++const userId = 'agent-label-test-user';+const otherUserId = 'agent-label-test-user-2';+const workspaceId = 'agent-label-test-ws';++const personalModel = new AgentLabelModel(serverDB, userId);+const workspaceModel = new AgentLabelModel(serverDB, userId, workspaceId);++beforeEach(async () => {+ await serverDB.delete(users);+ await serverDB.delete(workspaces);+ await serverDB.insert(users).values([{ id: userId }, { id: otherUserId }]);+ await serverDB+ .insert(workspaces)+ .values([+ { id: workspaceId, name: 'Test WS', primaryOwnerId: userId, slug: 'agent-label-test-ws' },+ ]);+});++afterEach(async () => {+ await serverDB.delete(agentLabels);+ await serverDB.delete(users);+ await serverDB.delete(workspaces);+});++const createAgent = async (id: string, wsId?: string) => {+ await serverDB.insert(agents).values({ id, userId, workspaceId: wsId ?? null });+};++describe('AgentLabelModel', () => {+ describe('create / query', () => {+ it('should create a personal label with workspace_id NULL', async () => {+ const label = await personalModel.create({ color: '#ff0000', name: 'Bug' });++ expect(label.id).toBeDefined();+ expect(label).toMatchObject({ color: '#ff0000', name: 'Bug', userId, workspaceId: null });+ });++ it('should create a workspace label shared across members', async () => {+ const label = await workspaceModel.create({ name: 'Team Label' });+ expect(label.workspaceId).toBe(workspaceId);++ // another member of the same workspace sees it+ const memberModel = new AgentLabelModel(serverDB, otherUserId, workspaceId);+ const labels = await memberModel.query();+ expect(labels).toHaveLength(1);+ expect(labels[0].name).toBe('Team Label');+ });++ it('should isolate personal labels from workspace labels', async () => {+ await personalModel.create({ name: 'Personal' });+ await workspaceModel.create({ name: 'Workspace' });++ const personal = await personalModel.query();+ const workspace = await workspaceModel.query();++ expect(personal.map((l) => l.name)).toEqual(['Personal']);+ expect(workspace.map((l) => l.name)).toEqual(['Workspace']);+ });++ it('should not leak personal labels between users', async () => {+ await personalModel.create({ name: 'Mine' });++ const otherModel = new AgentLabelModel(serverDB, otherUserId);+ expect(await otherModel.query()).toHaveLength(0);+ });++ it('should include usage count', async () => {+ await createAgent('agt-usage');+ const label = await personalModel.create({ name: 'Used' });+ await personalModel.setAgentLabels('agt-usage', [label.id]);++ const labels = await personalModel.query();+ expect(labels[0].usageCount).toBe(1);+ });+ });++ describe('update / archive', () => {+ it('should update name and color', async () => {+ const label = await workspaceModel.create({ name: 'Old' });+ await workspaceModel.update(label.id, { color: '#00ff00', name: 'New' });++ const updated = await workspaceModel.findById(label.id);+ expect(updated).toMatchObject({ color: '#00ff00', name: 'New' });+ });++ it('should archive and unarchive', async () => {+ const label = await workspaceModel.create({ name: 'Archivable' });+ await workspaceModel.update(label.id, { archived: true });+ expect((await workspaceModel.findById(label.id))?.archived).toBe(true);++ await workspaceModel.update(label.id, { archived: false });+ expect((await workspaceModel.findById(label.id))?.archived).toBe(false);+ });++ it('should not update labels outside the scope', async () => {+ const label = await personalModel.create({ name: 'Personal' });+ await workspaceModel.update(label.id, { name: 'Hacked' });++ expect((await personalModel.findById(label.id))?.name).toBe('Personal');+ });+ });++ describe('delete', () => {+ it('should delete label and cascade assignments', async () => {+ await createAgent('agt-del');+ const label = await personalModel.create({ name: 'Doomed' });+ await personalModel.setAgentLabels('agt-del', [label.id]);++ await personalModel.delete(label.id);++ expect(await personalModel.findById(label.id)).toBeUndefined();+ const assignments = await serverDB+ .select()+ .from(agentLabelAssignments)+ .where(eq(agentLabelAssignments.agentId, 'agt-del'));+ expect(assignments).toHaveLength(0);+ });+ });++ describe('setAgentLabels', () => {+ it('should replace the label set of an agent', async () => {+ await createAgent('agt-set');+ const a = await personalModel.create({ name: 'A' });+ const b = await personalModel.create({ name: 'B' });+ const c = await personalModel.create({ name: 'C' });++ await personalModel.setAgentLabels('agt-set', [a.id, b.id]);+ expect((await personalModel.getAgentLabelIds('agt-set')).toSorted()).toEqual(+ [a.id, b.id].toSorted(),+ );++ await personalModel.setAgentLabels('agt-set', [b.id, c.id]);+ expect((await personalModel.getAgentLabelIds('agt-set')).toSorted()).toEqual(+ [b.id, c.id].toSorted(),+ );++ await personalModel.setAgentLabels('agt-set', []);+ expect(await personalModel.getAgentLabelIds('agt-set')).toEqual([]);+ });++ it('should reject agents outside the scope', async () => {+ await createAgent('agt-scope');+ const label = await workspaceModel.create({ name: 'WS' });++ await expect(workspaceModel.setAgentLabels('agt-scope', [label.id])).rejects.toThrow();+ });++ it('should reject labels outside the scope instead of dropping them', async () => {+ await createAgent('agt-cross');+ const wsLabel = await workspaceModel.create({ name: 'WS Only' });++ await expect(personalModel.setAgentLabels('agt-cross', [wsLabel.id])).rejects.toThrow(+ /not found in current scope/,+ );+ });++ it('should not wipe existing labels when the caller sends a foreign id', async () => {+ // Regression: this is a full replacement, so silently dropping an+ // unresolvable id shrinks the next set and deletes assignments the+ // caller never touched. A client still holding another workspace's+ // registry across a scope switch would erase the agent's labels.+ await createAgent('agt-stale');+ const mine = await personalModel.create({ name: 'Mine' });+ const foreign = await workspaceModel.create({ name: 'Theirs' });++ await personalModel.setAgentLabels('agt-stale', [mine.id]);++ await expect(+ personalModel.setAgentLabels('agt-stale', [mine.id, foreign.id]),+ ).rejects.toThrow();++ expect(await personalModel.getAgentLabelIds('agt-stale')).toEqual([mine.id]);+ });++ it('should not clobber a concurrent editor when toggling one label', async () => {+ // Regression: the menu used to send a full replacement built from its+ // cached assignment set, so a click made against a stale list deleted+ // whatever another editor had added since that list was fetched.+ await createAgent('agt-race');+ const a = await personalModel.create({ name: 'A' });+ const b = await personalModel.create({ name: 'B' });++ // Another editor applies A.+ await personalModel.toggleAgentLabel('agt-race', a.id, true);++ // This client's cache still says "no labels"; it toggles B on.+ await personalModel.toggleAgentLabel('agt-race', b.id, true);++ expect((await personalModel.getAgentLabelIds('agt-race')).toSorted()).toEqual(+ [a.id, b.id].toSorted(),+ );+ });++ it('should be idempotent when toggling the same label on twice', async () => {+ await createAgent('agt-idem');+ const label = await personalModel.create({ name: 'Idem' });++ await personalModel.toggleAgentLabel('agt-idem', label.id, true);+ await personalModel.toggleAgentLabel('agt-idem', label.id, true);++ expect(await personalModel.getAgentLabelIds('agt-idem')).toEqual([label.id]);+ });++ it('should refuse to newly apply an archived label through the toggle', async () => {+ await createAgent('agt-toggle-arch');+ const label = await personalModel.create({ name: 'Retired' });+ await personalModel.update(label.id, { archived: true });++ await expect(+ personalModel.toggleAgentLabel('agt-toggle-arch', label.id, true),+ ).rejects.toThrow(/archived/);+ });++ it('should not newly apply archived labels but keep existing ones', async () => {+ await createAgent('agt-arch');+ const active = await personalModel.create({ name: 'Active' });+ const archived = await personalModel.create({ name: 'Archived' });++ await personalModel.setAgentLabels('agt-arch', [archived.id]);+ await personalModel.update(archived.id, { archived: true });++ // keeping an already-assigned archived label is allowed+ const kept = await personalModel.setAgentLabels('agt-arch', [archived.id, active.id]);+ expect(kept.toSorted()).toEqual([active.id, archived.id].toSorted());++ // newly applying an archived label is filtered out+ await personalModel.setAgentLabels('agt-arch', []);+ const next = await personalModel.setAgentLabels('agt-arch', [archived.id]);+ expect(next).toEqual([]);+ });+ });+});diff --git a/packages/database/src/models/__tests__/sessionGroup.test.ts b/packages/database/src/models/__tests__/sessionGroup.test.tsindex 8540b207619..08079fc087c 100644--- a/packages/database/src/models/__tests__/sessionGroup.test.ts+++ b/packages/database/src/models/__tests__/sessionGroup.test.ts@@ -190,10 +190,10 @@ describe('SessionGroupModel', () => {});describe('ownership visibility filter', () => {- // Folders are a per-member concern in workspace mode: each member sees- // and manages ONLY their own folders regardless of visibility (which- // now merely decides the sidebar section a folder renders in).- it('should scope a member to their own folders only', async () => {+ // Folders are the SHARED skeleton of a workspace sidebar: every member+ // sees and manages every public folder. Only private folders stay+ // scoped to their creator.+ it('should list every public folder plus the caller’s own private ones', async () => {const ownerPrivate = await ownerModel.create({name: 'Owner Private',visibility: 'private',@@ -207,15 +207,14 @@ describe('SessionGroupModel', () => {visibility: 'private',});- const seenByMember = await memberModel.query();- const ids = seenByMember.map((row) => row.id).sort();+ const ids = (await memberModel.query()).map((row) => row.id);expect(ids).toContain(memberPrivate.id);- expect(ids).not.toContain(ownerPublic.id);+ expect(ids).toContain(ownerPublic.id);expect(ids).not.toContain(ownerPrivate.id);});- it('should return undefined when a member reads another member’s folder by id', async () => {+ it('should read another member’s public folder but not their private one', async () => {const ownerPrivate = await ownerModel.create({name: 'Owner Private',visibility: 'private',@@ -226,21 +225,32 @@ describe('SessionGroupModel', () => {});expect(await memberModel.findById(ownerPrivate.id)).toBeUndefined();- expect(await memberModel.findById(ownerPublic.id)).toBeUndefined();+ expect(await memberModel.findById(ownerPublic.id)).toBeDefined();});- it('should not delete another member’s folder even by id', async () => {+ it('should let any member delete a shared folder, but not a private one', async () => {const ownerPublic = await ownerModel.create({name: 'Owner Public',visibility: 'public',});+ const ownerPrivate = await ownerModel.create({+ name: 'Owner Private',+ visibility: 'private',+ });await memberModel.delete(ownerPublic.id);-- const stillThere = await serverDB.query.sessionGroups.findFirst({- where: eq(sessionGroups.id, ownerPublic.id),- });- expect(stillThere).toBeDefined();+ await memberModel.delete(ownerPrivate.id);++ expect(+ await serverDB.query.sessionGroups.findFirst({+ where: eq(sessionGroups.id, ownerPublic.id),+ }),+ ).toBeUndefined();+ expect(+ await serverDB.query.sessionGroups.findFirst({+ where: eq(sessionGroups.id, ownerPrivate.id),+ }),+ ).toBeDefined();});});diff --git a/packages/database/src/models/__tests__/workspaceUserSettings.test.ts b/packages/database/src/models/__tests__/workspaceUserSettings.test.tsindex f250fe3ad18..99ebd9421a7 100644--- a/packages/database/src/models/__tests__/workspaceUserSettings.test.ts+++ b/packages/database/src/models/__tests__/workspaceUserSettings.test.ts@@ -124,18 +124,6 @@ describe('WorkspaceUserSettingsModel', () => {expect(preference.agentModeOverrides).toEqual({ agentX: true, agentY: false });});- it('deep-merges sidebarPinnedOverrides so a single-item patch never drops other items', async () => {- const model = new WorkspaceUserSettingsModel(serverDB, userA, workspaceId);- await model.updatePreference({ sidebarPinnedOverrides: { agentX: true } });-- // A stale/empty local copy patches ONLY groupY — agentX's pin (and an- // explicit unpin=false) must survive the write.- await model.updatePreference({ sidebarPinnedOverrides: { groupY: false } });-- const preference = await model.getPreference();- expect(preference.sidebarPinnedOverrides).toEqual({ agentX: true, groupY: false });- });-it('deep-merges sidebarAgentVisibilityOverrides across single-item patches', async () => {const model = new WorkspaceUserSettingsModel(serverDB, userA, workspaceId);await model.updatePreference({ sidebarAgentVisibilityOverrides: { agentX: true } });@@ -146,33 +134,35 @@ describe('WorkspaceUserSettingsModel', () => {expect(preference.sidebarAgentVisibilityOverrides).toEqual({ agentX: true, agentY: false });});- it('setSidebarGroupAssignment records a create-in-folder placement without dropping siblings', async () => {- const model = new WorkspaceUserSettingsModel(serverDB, userA, workspaceId);- await model.updatePreference({ sidebarGroupAssignments: { agentX: 'folder-1' } });-- // Server-side create-in-folder path (createAgent / createGroup lambdas).- await model.setSidebarGroupAssignment('agentNew', 'folder-2');-- const preference = await model.getPreference();- expect(preference.sidebarGroupAssignments).toEqual({- agentNew: 'folder-2',- agentX: 'folder-1',- });- });-- it('copySidebarGroupAssignment carries the source folder to a duplicate, no-op when unassigned', async () => {+ it.each([+ ['sidebarGroupAssignments', 'folder-1'],+ ['sidebarPinnedOverrides', true],+ ] as const)(+ 'keeps deep-merging the deprecated %s for clients from before the shared sidebar',+ async (key, value) => {+ // The fields are deprecated but still on the API, so a released client+ // can patch a single item. A top-level replace would let one such write+ // shred the rest of that user's map — the very data the deprecation+ // promises to leave intact for a rollback.+ const model = new WorkspaceUserSettingsModel(serverDB, userA, workspaceId);+ await model.updatePreference({ [key]: { itemX: value } } as any);++ await model.updatePreference({ [key]: { itemY: value } } as any);++ const preference = await model.getPreference();+ expect((preference as any)[key]).toEqual({ itemX: value, itemY: value });+ },+ );++ it('replaces sidebarHiddenGroupIds wholesale — the caller always writes the full list', async () => {const model = new WorkspaceUserSettingsModel(serverDB, userA, workspaceId);- await model.updatePreference({ sidebarGroupAssignments: { agentX: 'folder-1' } });+ await model.updatePreference({ sidebarHiddenGroupIds: ['folder-1', 'folder-2'] });- await model.copySidebarGroupAssignment('agentX', 'agentX-copy');- // Source never assigned → no entry is written for the target.- await model.copySidebarGroupAssignment('agentY', 'agentY-copy');+ // Un-hiding folder-1 sends the remaining list, not a delta.+ await model.updatePreference({ sidebarHiddenGroupIds: ['folder-2'] });const preference = await model.getPreference();- expect(preference.sidebarGroupAssignments).toEqual({- 'agentX': 'folder-1',- 'agentX-copy': 'folder-1',- });+ expect(preference.sidebarHiddenGroupIds).toEqual(['folder-2']);});it('deep-merges notification so a single-switch patch never drops other toggles', async () => {diff --git a/packages/database/src/models/agent.ts b/packages/database/src/models/agent.tsindex 0d9ab6a9dc9..bec59d65ace 100644--- a/packages/database/src/models/agent.ts+++ b/packages/database/src/models/agent.ts@@ -30,6 +30,7 @@ import type { AgentItem } from '../schemas';import {agentBotProviders,agentCronJobs,+ agentLabelAssignments,agents,agentsFiles,agentsKnowledgeBases,@@ -103,6 +104,12 @@ const AGENT_BUILDER_PROTECTED_FIELDS = [const IMMUTABLE_AGENT_FIELDS = ['createdAt','id',+ // Folder placement is shared state and has its own validated path+ // (`updateSessionGroupId`), which checks the target is visible in scope and+ // matches the agent's visibility bucket. Riding along in a config patch+ // would skip both, leaving the shared row in a folder the sidebar cannot+ // resolve — it then renders in Ungrouped for every member.+ 'sessionGroupId','slug','userId','virtual',@@ -1017,7 +1024,7 @@ export class AgentModel {*/publishToWorkspace = async (agentId: string) => {const agent = await this.db.query.agents.findFirst({- columns: { agencyConfig: true, workspaceId: true },+ columns: { agencyConfig: true, sessionGroupId: true, workspaceId: true },where: and(eq(agents.id, agentId),this.ownership(),@@ -1035,9 +1042,24 @@ export class AgentModel {// when workspace members cannot resolve it.await this.assertFixedExecutionTarget(agent.workspaceId, agent.agencyConfig);+ // Rehome exactly as `setVisibility` does: a folder cannot mix+ // visibilities, so publishing out of a private Category releases the+ // folder. Left in place the agent would be public while its folder is not,+ // and the sidebar would show it in Ungrouped rather than where it was+ // published from.+ const clearGroup = agent.sessionGroupId+ ? await this.getAssignableSessionGroupVisibility(agent.sessionGroupId)+ .then((visibility) => visibility !== 'public')+ .catch(() => true)+ : false;+const [result] = await this.db.update(agents)- .set({ updatedAt: new Date(), visibility: 'public' })+ .set({+ updatedAt: new Date(),+ visibility: 'public',+ ...(clearGroup ? { sessionGroupId: null } : {}),+ }).where(and(eq(agents.id, agentId),@@ -1281,7 +1303,76 @@ export class AgentModel {/*** Update the sessionGroupId for an agent*/+ /**+ * A move target must be a folder the caller can actually see, and a *public*+ * agent may only sit in a *public* folder — otherwise the agent stays+ * visible to the workspace while its folder does not, and everyone else+ * silently finds it in Ungrouped. Private agents are only visible to their+ * owner, so any folder that owner can see is fine.+ */+ /**+ * Resolve a folder the caller may put an item in, returning its visibility.+ * Shared by the move guard and the create path — both need the same+ * "visible in scope" check, and create additionally derives the new agent's+ * visibility from the result.+ */+ getAssignableSessionGroupVisibility = async (+ sessionGroupId: string,+ ): Promise<'private' | 'public'> => {+ const [group] = await this.db+ .select({ visibility: sessionGroups.visibility })+ .from(sessionGroups)+ .where(+ and(+ eq(sessionGroups.id, sessionGroupId),+ buildWorkspaceWhere(+ { userId: this.userId, workspaceId: this.workspaceId },+ {+ userId: sessionGroups.userId,+ visibility: sessionGroups.visibility,+ workspaceId: sessionGroups.workspaceId,+ },+ ),+ ),+ )+ .limit(1);++ if (!group) throw new Error(`Session group ${sessionGroupId} not found in current scope`);++ return group.visibility as 'private' | 'public';+ };++ private assertSessionGroupAssignable = async (agentId: string, sessionGroupId: string) => {+ const groupVisibility = await this.getAssignableSessionGroupVisibility(sessionGroupId);+ const group = { visibility: groupVisibility };++ if (!this.workspaceId) return;++ const [agent] = await this.db+ .select({ visibility: agents.visibility })+ .from(agents)+ .where(and(eq(agents.id, agentId), this.ownership()))+ .limit(1);++ // Buckets must match exactly, not merely "public agent needs a public+ // folder". `processAgentList` resolves a private item's folder only against+ // the private folder set and a public item's only against the public one,+ // so a mismatch in either direction renders as Ungrouped rather than in+ // the folder the user picked.+ if (agent && agent.visibility !== group.visibility)+ throw new Error(+ `A ${agent.visibility} agent cannot be moved into a ${group.visibility} folder`,+ );+ };+updateSessionGroupId = async (agentId: string, sessionGroupId: string | null) => {+ // The column is workspace-shared, so an unvalidated target corrupts the+ // sidebar for everyone, not just the caller. The foreign key only proves+ // the folder exists: another workspace's folder, or another member's+ // private one, passes it happily and then renders as Ungrouped for every+ // member who cannot see it.+ if (sessionGroupId) await this.assertSessionGroupAssignable(agentId, sessionGroupId);+const result = await this.db.update(agents).set({ sessionGroupId, updatedAt: new Date() })@@ -1324,8 +1415,13 @@ export class AgentModel {plugins: sourceAgent.plugins,provider: sourceAgent.provider,- // Session group+ // Session group. Visibility has to travel with it: the column+ // defaults to `public`, and now that folder placement is shared and+ // authoritative, a private agent duplicated into its private folder+ // would be published to the workspace and still render in Ungrouped,+ // since a public item resolves only against public folders.sessionGroupId: sourceAgent.sessionGroupId,+ visibility: sourceAgent.visibility,systemRole: sourceAgent.systemRole,tags: sourceAgent.tags,@@ -1706,6 +1802,11 @@ export class AgentModel {agencyConfig: targetWorkspaceId? (resolvedAgencyConfigs.get(agent.id) ?? null): (agent.agencyConfig ?? null),+ // Pins are shared state now, exactly like the folder above: a pin+ // the previous owner set for themselves would arrive as a pin for+ // every member of the target workspace. Both belong to the source+ // scope and are dropped with it.+ pinned: false,sessionGroupId: null,slug: resolvedSlugs.get(agent.id) ?? agent.slug,// A scope transfer does not make the agent's content newer. Keep the@@ -1737,6 +1838,17 @@ export class AgentModel {.set(ownershipUpdate).where(inArray(agentsToSessions.agentId, agentIds));+ // 5b. Drop label assignments. Unlike sessions, these cannot travel: a+ // label belongs to the source registry, and the target scope has its own+ // (or none). Re-homing them would need a name-matched label in the+ // target, which is a merge decision, not a transfer one. Leaving them+ // instead would keep inflating the source label's usage count and make+ // the labels reappear if the agent ever moves back — same reasoning as+ // the device bindings stripped above.+ await trx+ .delete(agentLabelAssignments)+ .where(inArray(agentLabelAssignments.agentId, agentIds));+// 6. Update topics (linked via sessionId or agentId)const topicCondition =sessionIds.length > 0diff --git a/packages/database/src/models/agentLabel.ts b/packages/database/src/models/agentLabel.tsnew file mode 100644index 00000000000..829ba66f4a9--- /dev/null+++ b/packages/database/src/models/agentLabel.ts@@ -0,0 +1,258 @@+import { and, asc, count, eq, inArray, not } from 'drizzle-orm';++import type { AgentLabelItem } from '../schemas';+import { agentLabelAssignments, agentLabels, agents } from '../schemas';+import type { LobeChatDatabase } from '../type';+import { buildWorkspacePayload, buildWorkspaceWhere } from '../utils/workspace';++export interface AgentLabelWithUsage extends AgentLabelItem {+ usageCount: number;+}++export class AgentLabelModel {+ private userId: string;+ private db: LobeChatDatabase;+ private workspaceId?: string;++ constructor(db: LobeChatDatabase, userId: string, workspaceId?: string) {+ this.userId = userId;+ this.db = db;+ this.workspaceId = workspaceId;+ }++ // Labels are a workspace-level registry: every member sees and shares the+ // same label set (no per-member visibility). Personal mode falls back to+ // `user_id = ? AND workspace_id IS NULL`.+ private ownership = () =>+ buildWorkspaceWhere(+ { userId: this.userId, workspaceId: this.workspaceId },+ { userId: agentLabels.userId, workspaceId: agentLabels.workspaceId },+ );++ private assignmentOwnership = () =>+ buildWorkspaceWhere(+ { userId: this.userId, workspaceId: this.workspaceId },+ { userId: agentLabelAssignments.userId, workspaceId: agentLabelAssignments.workspaceId },+ );++ private agentOwnership = () =>+ buildWorkspaceWhere(+ { userId: this.userId, workspaceId: this.workspaceId },+ { userId: agents.userId, workspaceId: agents.workspaceId, visibility: agents.visibility },+ );++ query = async (): Promise<AgentLabelWithUsage[]> => {+ const rows = await this.db+ .select({+ accessedAt: agentLabels.accessedAt,+ archived: agentLabels.archived,+ color: agentLabels.color,+ createdAt: agentLabels.createdAt,+ description: agentLabels.description,+ id: agentLabels.id,+ name: agentLabels.name,+ updatedAt: agentLabels.updatedAt,+ usageCount: count(agents.id),+ userId: agentLabels.userId,+ workspaceId: agentLabels.workspaceId,+ })+ .from(agentLabels)+ // The usage total must only count agents the caller can actually see.+ // Counting assignment rows alone would report how many of a teammate's+ // private agents carry a shared label — a number the agents list itself+ // never reveals. Joining through `agents` under the same visibility+ // predicate keeps the count consistent with what the list shows.+ .leftJoin(agentLabelAssignments, eq(agentLabelAssignments.labelId, agentLabels.id))+ .leftJoin(+ agents,+ and(+ eq(agents.id, agentLabelAssignments.agentId),+ not(eq(agents.virtual, true)),+ this.agentOwnership(),+ ),+ )+ .where(this.ownership())+ .groupBy(agentLabels.id)+ .orderBy(asc(agentLabels.name));++ return rows;+ };++ findById = async (id: string) => {+ const [result] = await this.db+ .select()+ .from(agentLabels)+ .where(and(eq(agentLabels.id, id), this.ownership()))+ .limit(1);++ return result;+ };++ create = async (params: { color?: string; description?: string; name: string }) => {+ const [result] = await this.db+ .insert(agentLabels)+ .values(buildWorkspacePayload({ userId: this.userId, workspaceId: this.workspaceId }, params))+ .returning();++ return result;+ };++ update = async (+ id: string,+ value: Partial<Pick<AgentLabelItem, 'archived' | 'color' | 'description' | 'name'>>,+ ) => {+ return this.db+ .update(agentLabels)+ .set({ ...value, updatedAt: new Date() })+ .where(and(eq(agentLabels.id, id), this.ownership()));+ };++ delete = async (id: string) => {+ return this.db.delete(agentLabels).where(and(eq(agentLabels.id, id), this.ownership()));+ };++ /**+ * Label ids currently assigned to an agent (scope-checked on the junction).+ */+ getAgentLabelIds = async (agentId: string): Promise<string[]> => {+ const rows = await this.db+ .select({ labelId: agentLabelAssignments.labelId })+ .from(agentLabelAssignments)+ .where(and(eq(agentLabelAssignments.agentId, agentId), this.assignmentOwnership()));++ return rows.map((row) => row.labelId);+ };++ /**+ * Apply or remove a single label. Preferred over `setAgentLabels` wherever+ * the caller expresses one toggle: a full replacement built from a client's+ * cached assignment set silently drops whatever another editor added since+ * that cache was filled. Mirrors the add/remove pairs used for the other+ * many-to-many memberships (knowledge-base files, chat-group agents).+ */+ toggleAgentLabel = async (agentId: string, labelId: string, assigned: boolean) => {+ await this.assertAgentInScope(agentId);++ if (!assigned) {+ await this.db+ .delete(agentLabelAssignments)+ .where(+ and(+ eq(agentLabelAssignments.agentId, agentId),+ eq(agentLabelAssignments.labelId, labelId),+ this.assignmentOwnership(),+ ),+ );++ return this.getAgentLabelIds(agentId);+ }++ const [label] = await this.db+ .select({ archived: agentLabels.archived, id: agentLabels.id })+ .from(agentLabels)+ .where(and(eq(agentLabels.id, labelId), this.ownership()))+ .limit(1);++ if (!label) throw new Error(`Agent label not found in current scope: ${labelId}`);+ // Archived labels are retired: existing assignments survive, new ones are+ // refused rather than silently ignored, matching `setAgentLabels`.+ if (label.archived) throw new Error(`Agent label is archived: ${labelId}`);++ await this.db+ .insert(agentLabelAssignments)+ .values(+ buildWorkspacePayload(+ { userId: this.userId, workspaceId: this.workspaceId },+ { agentId, labelId },+ ),+ )+ .onConflictDoNothing();++ return this.getAgentLabelIds(agentId);+ };++ private assertAgentInScope = async (agentId: string) => {+ const [agent] = await this.db+ .select({ id: agents.id })+ .from(agents)+ .where(+ and(+ eq(agents.id, agentId),+ // Virtual agents — chat-group supervisors and synthetic members — are+ // filtered out of the agents list entirely, so a label on one could+ // never be seen while still inflating that label's usage count.+ not(eq(agents.virtual, true)),+ this.agentOwnership(),+ ),+ )+ .limit(1);++ if (!agent) throw new Error(`Agent ${agentId} not found in current scope`);+ };++ /**+ * Replace the full label set of an agent. Only labels that exist in the+ * current scope can be applied; archived labels stay applied if already+ * assigned but cannot be newly added.+ */+ setAgentLabels = async (agentId: string, labelIds: string[]) => {+ // The agent itself must be visible in the current scope.+ await this.assertAgentInScope(agentId);++ const currentIds = new Set(await this.getAgentLabelIds(agentId));++ const scopedLabels =+ labelIds.length > 0+ ? await this.db+ .select({ archived: agentLabels.archived, id: agentLabels.id })+ .from(agentLabels)+ .where(and(inArray(agentLabels.id, labelIds), this.ownership()))+ : [];++ // Silently dropping ids the caller cannot see would turn a partial+ // mismatch into a destructive write: this is a full replacement, so an+ // unresolvable id shrinks `nextIds` and deletes assignments the caller+ // never meant to touch. A client holding another scope's registry (mid+ // workspace switch) would wipe the agent's labels. Fail loudly instead.+ const scopedIds = new Set(scopedLabels.map((label) => label.id));+ const unknownIds = labelIds.filter((id) => !scopedIds.has(id));+ if (unknownIds.length > 0)+ throw new Error(`Agent labels not found in current scope: ${unknownIds.join(', ')}`);++ const nextIds = scopedLabels+ .filter((label) => !label.archived || currentIds.has(label.id))+ .map((label) => label.id);++ const toRemove = [...currentIds].filter((id) => !nextIds.includes(id));+ const toAdd = nextIds.filter((id) => !currentIds.has(id));++ await this.db.transaction(async (tx) => {+ if (toRemove.length > 0) {+ await tx+ .delete(agentLabelAssignments)+ .where(+ and(+ eq(agentLabelAssignments.agentId, agentId),+ inArray(agentLabelAssignments.labelId, toRemove),+ this.assignmentOwnership(),+ ),+ );+ }++ if (toAdd.length > 0) {+ await tx+ .insert(agentLabelAssignments)+ .values(+ toAdd.map((labelId) =>+ buildWorkspacePayload(+ { userId: this.userId, workspaceId: this.workspaceId },+ { agentId, labelId },+ ),+ ),+ );+ }+ });++ return nextIds;+ };+}diff --git a/packages/database/src/models/chatGroup.ts b/packages/database/src/models/chatGroup.tsindex f4fe6e6c90e..afbd728c501 100644--- a/packages/database/src/models/chatGroup.ts+++ b/packages/database/src/models/chatGroup.ts@@ -220,10 +220,66 @@ export class ChatGroupModel {// ******* Update Methods ******* //+ /**+ * A move target must be a folder the caller can see, and a workspace-public+ * group may only sit in a public folder. `chat_groups.groupId` is read by+ * every member's sidebar now, and the foreign key only proves the folder+ * exists — another workspace's folder, or another member's private one,+ * satisfies it and then renders as Ungrouped for everyone who cannot see it.+ * Mirrors `AgentModel.assertSessionGroupAssignable`.+ */+ private async assertFolderAssignable(id: string, groupId: string) {+ const [folder] = await this.db+ .select({ visibility: sessionGroups.visibility })+ .from(sessionGroups)+ .where(+ and(+ eq(sessionGroups.id, groupId),+ buildWorkspaceWhere(+ { userId: this.userId, workspaceId: this.workspaceId },+ {+ userId: sessionGroups.userId,+ visibility: sessionGroups.visibility,+ workspaceId: sessionGroups.workspaceId,+ },+ ),+ ),+ )+ .limit(1);++ if (!folder) throw new Error(`Session group ${groupId} not found in current scope`);++ if (!this.workspaceId) return;++ const [group] = await this.db+ .select({ visibility: chatGroups.visibility })+ .from(chatGroups)+ .where(and(eq(chatGroups.id, id), this.ownership()))+ .limit(1);++ // Same exact-match rule as agents: the render path resolves a private+ // item's folder only against private folders and a public item's only+ // against public ones, so either mismatch lands it in Ungrouped.+ if (group && group.visibility !== folder.visibility)+ throw new Error(+ `A ${group.visibility} chat group cannot be moved into a ${folder.visibility} folder`,+ );+ }+async update(id: string, value: Partial<ChatGroupItem>): Promise<ChatGroupItem> {+ if (value.groupId) await this.assertFolderAssignable(id, value.groupId);++ // Scope columns never travel through the generic update. The router hands+ // this a partial insert schema, so without stripping them a member could+ // re-scope another member's group now that the ownership predicate spans+ // every visible workspace row. Ignored rather than rejected so a client+ // that sends an extra field still gets its real edit applied. Publishing+ // has its own path and writes `visibility` directly.+ const { userId: _userId, visibility: _visibility, workspaceId: _workspaceId, ...safe } = value;+const [result] = await this.db.update(chatGroups)- .set(value)+ .set(safe).where(and(eq(chatGroups.id, id), this.ownership())).returning();@@ -240,9 +296,26 @@ export class ChatGroupModel {* `private`. Restricted to the creator's own still-private group.*/async publishToWorkspace(id: string): Promise<ChatGroupItem> {+ // Rehome exactly as `setVisibility` does. A folder cannot mix+ // visibilities, so publishing out of a private Category has to release the+ // folder too — left in place, the group would be public while its folder+ // is not, and the sidebar would show it in Ungrouped rather than where the+ // user published it from.+ const [current] = await this.db+ .select({ folderVisibility: sessionGroups.visibility })+ .from(chatGroups)+ .leftJoin(sessionGroups, eq(chatGroups.groupId, sessionGroups.id))+ .where(and(eq(chatGroups.id, id), this.ownership()))+ .limit(1);+ const clearFolder = current?.folderVisibility != null && current.folderVisibility !== 'public';+const [result] = await this.db.update(chatGroups)- .set({ updatedAt: new Date(), visibility: 'public' })+ .set({+ updatedAt: new Date(),+ visibility: 'public',+ ...(clearFolder ? { groupId: null } : {}),+ }).where(and(eq(chatGroups.id, id),@@ -593,6 +666,12 @@ export class ChatGroupModel {and(eq(chatGroupsAgents.chatGroupId, groupId),eq(agents.visibility, 'private'),+ // The synthetic supervisor mirrors the group's own visibility, so a+ // private group always owns one private agent. Counting it makes the+ // publish guard unsatisfiable — every private group would look like+ // it still holds private members and could never be shared. Only+ // real members can block a publish.+ ne(chatGroupsAgents.role, 'supervisor'),this.agentsOwnership(),),);diff --git a/packages/database/src/models/sessionGroup.ts b/packages/database/src/models/sessionGroup.tsindex 678fab970d6..c4b1eff5ba1 100644--- a/packages/database/src/models/sessionGroup.ts+++ b/packages/database/src/models/sessionGroup.ts@@ -1,7 +1,7 @@-import { and, asc, desc, eq } from 'drizzle-orm';+import { and, asc, count, desc, eq } from 'drizzle-orm';import type { SessionGroupItem } from '../schemas';-import { sessionGroups } from '../schemas';+import { agents, chatGroups, sessionGroups } from '../schemas';import type { LobeChatDatabase } from '../type';import { idGenerator } from '../utils/idGenerator';import { buildWorkspacePayload, buildWorkspaceWhere } from '../utils/workspace';@@ -17,13 +17,15 @@ export class SessionGroupModel {this.workspaceId = workspaceId;}- // Sidebar folders are a per-member concern: in workspace mode every member- // sees and manages ONLY their own folders (visibility still decides which- // sidebar section a folder renders in). This deliberately diverges from the- // shared "public rows + own private rows" predicate other resources use —- // one member's folder edits must never reshape another member's sidebar.- private ownership = () => {- const shared = buildWorkspaceWhere(+ // Sidebar folders are the SHARED skeleton of a workspace sidebar: every+ // member sees and manages the same public folders (creating, renaming,+ // reordering and deleting them), exactly like any other workspace-public+ // resource. Private folders stay constrained to their creator by the+ // standard visibility predicate. Members who don't want a folder in their+ // own sidebar hide it through `sidebarHiddenGroupIds` — a personal+ // preference that never touches these rows.+ private ownership = () =>+ buildWorkspaceWhere({ userId: this.userId, workspaceId: this.workspaceId },{userId: sessionGroups.userId,@@ -31,9 +33,6 @@ export class SessionGroupModel {visibility: sessionGroups.visibility,},);- if (!this.workspaceId) return shared;- return and(shared, eq(sessionGroups.userId, this.userId))!;- };create = async (params: { name: string; sort?: number; visibility?: 'private' | 'public' }) => {const [result] = await this.db@@ -70,7 +69,14 @@ export class SessionGroupModel {});};- update = async (id: string, value: Partial<SessionGroupItem>) => {+ /**+ * Rename / reorder only. The scope columns (`userId`, `workspaceId`,+ * `visibility`) are deliberately not accepted: the ownership predicate now+ * matches every public folder in the workspace, so allowing them here would+ * let any member re-scope another member's Category. Publishing has its own+ * one-way path.+ */+ update = async (id: string, value: Partial<Pick<SessionGroupItem, 'name' | 'sort'>>) => {return this.db.update(sessionGroups).set({ ...value, updatedAt: new Date() })@@ -84,6 +90,28 @@ export class SessionGroupModel {* it as a container for their bookmarks.*/publishToWorkspace = async (id: string) => {+ // A folder cannot mix visibilities: the sidebar resolves a public item's+ // folder only against public folders and a private item's only against+ // private ones. Publishing a folder that still holds private items would+ // therefore silently evict the owner's own contents to Private → Ungrouped+ // while every other member received an empty shared folder. Promoting the+ // children instead would publish private work nobody asked to share, so+ // this refuses and leaves the choice with the user.+ const [{ privateChildren }] = await this.db+ .select({ privateChildren: count() })+ .from(agents)+ .where(and(eq(agents.sessionGroupId, id), eq(agents.visibility, 'private')));++ const [{ privateGroups }] = await this.db+ .select({ privateGroups: count() })+ .from(chatGroups)+ .where(and(eq(chatGroups.groupId, id), eq(chatGroups.visibility, 'private')));++ if (privateChildren > 0 || privateGroups > 0)+ throw new Error(+ 'Move or publish the private items inside this folder before sharing it with the workspace',+ );+return this.db.update(sessionGroups).set({ updatedAt: new Date(), visibility: 'public' })diff --git a/packages/database/src/models/workspaceUserSettings.ts b/packages/database/src/models/workspaceUserSettings.tsindex 7bb50c74399..795fefd50fc 100644--- a/packages/database/src/models/workspaceUserSettings.ts+++ b/packages/database/src/models/workspaceUserSettings.ts@@ -55,29 +55,6 @@ export class WorkspaceUserSettingsModel {return row?.preference ?? {};};- /**- * Record the caller's per-member folder assignment for a sidebar item.- * Creation flows call this when an item is created inside a folder in- * workspace mode: the shared `sessionGroupId` / `chat_groups.groupId`- * columns are ignored there, so without this entry a create-in-folder- * would land the new item in the ungrouped list.- */- setSidebarGroupAssignment = async (itemId: string, folderId: string | null) => {- await this.updatePreference({ sidebarGroupAssignments: { [itemId]: folderId } });- };-- /**- * Copy the caller's folder assignment from a source item to its duplicate,- * so duplicating an item that sits in "my" folder keeps the copy there.- * No-op when the caller never assigned the source item.- */- copySidebarGroupAssignment = async (sourceItemId: string, targetItemId: string) => {- const preference = await this.getPreference();- const assignment = preference.sidebarGroupAssignments?.[sourceItemId];- if (assignment === undefined) return;- await this.updatePreference({ sidebarGroupAssignments: { [targetItemId]: assignment } });- };-/*** Merge `patch` on top of the caller's current preference and persist the* result via UPSERT. The merge is done at the application layer (read →@@ -127,14 +104,6 @@ export class WorkspaceUserSettingsModel {},}: {}),- ...(patch.sidebarGroupAssignments- ? {- sidebarGroupAssignments: {- ...current.sidebarGroupAssignments,- ...patch.sidebarGroupAssignments,- },- }- : {}),...(patch.sidebarAgentVisibilityOverrides? {sidebarAgentVisibilityOverrides: {@@ -143,6 +112,20 @@ export class WorkspaceUserSettingsModel {},}: {}),+ // Deprecated, but still merged: the fields stay on the API, so a client+ // from before the shared-sidebar change can still patch a single item.+ // A top-level replace would let one such write shred the rest of that+ // user's saved map — which is exactly the data the deprecation promises+ // to leave intact for a rollback. Drop these two once the fields leave+ // `WorkspaceUserPreference`.+ ...(patch.sidebarGroupAssignments+ ? {+ sidebarGroupAssignments: {+ ...current.sidebarGroupAssignments,+ ...patch.sidebarGroupAssignments,+ },+ }+ : {}),...(patch.sidebarPinnedOverrides? {sidebarPinnedOverrides: {diff --git a/packages/database/src/repositories/agentGroup/index.ts b/packages/database/src/repositories/agentGroup/index.tsindex 2f33c694c59..3459822d911 100644--- a/packages/database/src/repositories/agentGroup/index.ts+++ b/packages/database/src/repositories/agentGroup/index.ts@@ -16,11 +16,13 @@ import type {NewChatGroupAgent,} from '../../schemas';import {+ agentLabelAssignments,agents,chatGroups,chatGroupsAgents,messagePlugins,messages,+ sessionGroups,threads,topics,} from '../../schemas';@@ -428,15 +430,61 @@ export class AgentGroupRepository {* @param supervisorConfig - Optional configuration for the supervisor agent* @returns Created group, agents, and supervisor agent ID*/+ /**+ * Resolve a folder the caller may put a group in, returning its visibility.+ * Mirrors `AgentModel.getAssignableSessionGroupVisibility` — the foreign key+ * only proves the folder exists, which is the wrong question once the column+ * is read by every member's sidebar.+ */+ async getAssignableFolderVisibility(folderId: string): Promise<'private' | 'public'> {+ const [folder] = await this.db+ .select({ visibility: sessionGroups.visibility })+ .from(sessionGroups)+ .where(+ and(+ eq(sessionGroups.id, folderId),+ buildWorkspaceWhere(+ { userId: this.userId, workspaceId: this.workspaceId },+ {+ userId: sessionGroups.userId,+ visibility: sessionGroups.visibility,+ workspaceId: sessionGroups.workspaceId,+ },+ ),+ ),+ )+ .limit(1);++ if (!folder) throw new Error(`Session group ${folderId} not found in current scope`);++ return folder.visibility as 'private' | 'public';+ }+async createGroupWithSupervisor(groupParams: Omit<NewChatGroup, 'userId'>,agentMembers: string[] = [],supervisorConfig?: SupervisorAgentConfig,): Promise<CreateGroupWithSupervisorResult> {+ // Creating inside a Category has to land in that Category. The sidebar+ // resolves a public group's folder only against public folders (and a+ // private group's only against private ones), so a default-public group+ // created in a private Category renders in Ungrouped — for its creator as+ // well. The folder therefore decides the new group's visibility, and an+ // explicit value that contradicts it is refused rather than overridden.+ // Same rule and same reasoning as agent creation.+ const folderVisibility = groupParams.groupId+ ? await this.getAssignableFolderVisibility(groupParams.groupId)+ : undefined;++ if (folderVisibility && groupParams.visibility && groupParams.visibility !== folderVisibility)+ throw new Error(+ `A ${groupParams.visibility} chat group cannot be created in a ${folderVisibility} folder`,+ );+// Mirror the group's visibility onto the synthetic supervisor agent so// workspace members don't see a stray supervisor when the parent group is// private. Defaults to 'public' to match the column default.- const groupVisibility = groupParams.visibility ?? 'public';+ const groupVisibility = groupParams.visibility ?? folderVisibility ?? 'public';// 1. Create supervisor agent (virtual agent)const [supervisorAgent] = await this.db@@ -467,7 +515,12 @@ export class AgentGroupRepository {// 2. Create the groupconst [group] = await this.db.insert(chatGroups)- .values({ ...groupParams, userId: this.userId, workspaceId: this.workspaceId ?? null })+ .values({+ ...groupParams,+ userId: this.userId,+ visibility: groupVisibility,+ workspaceId: this.workspaceId ?? null,+ }).returning();// 3. Add supervisor agent to group with role 'supervisor'@@ -669,6 +722,15 @@ export class AgentGroupRepository {content: sourceGroup.content,description: sourceGroup.description,editorData: sourceGroup.editorData,+ // Sidebar folder placement is shared state, so the copy lands next to+ // its source (matching AgentModel.duplicate's `sessionGroupId`).+ groupId: sourceGroup.groupId,+ // Visibility travels with the folder, and must: the column defaults+ // to `public`, so duplicating a private group would otherwise publish+ // the copy to the workspace *and* strand it — the sidebar resolves a+ // public item's folder only against public folders, so the copy would+ // land in Ungrouped rather than beside its source.+ visibility: sourceGroup.visibility,pinned: sourceGroup.pinned,title: newTitle || (sourceGroup.title ? `${sourceGroup.title} (Copy)` : 'Copy'),userId: this.userId,@@ -692,6 +754,10 @@ export class AgentGroupRepository {title: supervisorAgent?.title || 'Supervisor',userId: this.userId,virtual: true,+ // Synthetic agents stay in lockstep with their group, the same way+ // creation and `setVisibility` keep them. Left to the column default+ // they would be workspace-visible while the group stays private.+ visibility: sourceGroup.visibility,workspaceId: this.workspaceId ?? null,}).returning();@@ -721,6 +787,7 @@ export class AgentGroupRepository {// User & virtual flaguserId: this.userId,virtual: true,+ visibility: sourceGroup.visibility,workspaceId: this.workspaceId ?? null,}));@@ -856,7 +923,19 @@ export class AgentGroupRepository {await trx.update(chatGroups)- .set({ ...ownershipUpdate, ...visibilityUpdate, updatedAt: new Date() })+ // Folders stay in the source scope, exactly as `transferAgents` does+ // for `sessionGroupId`: carrying the id across would point the moved+ // group at a folder the target workspace cannot resolve, dropping it+ // into Ungrouped for every member there.+ .set({+ ...ownershipUpdate,+ ...visibilityUpdate,+ groupId: null,+ // Same reasoning as the folder: a pin is the previous owner's own+ // sidebar choice and would otherwise arrive as a workspace-wide pin.+ pinned: false,+ updatedAt: new Date(),+ }).where(eq(chatGroups.id, groupId));await trx@@ -876,8 +955,25 @@ export class AgentGroupRepository {await trx.update(agents)- .set({ ...ownershipUpdate, ...visibilityUpdate, updatedAt: new Date() })+ .set({+ ...ownershipUpdate,+ ...visibilityUpdate,+ // Folders and pins belong to the source scope — same rule the+ // group row and `AgentModel.transferAgents` follow.+ pinned: false,+ sessionGroupId: null,+ updatedAt: new Date(),+ }).where(inArray(agents.id, agentIds));++ // This path moves member agents itself instead of going through+ // `AgentModel.transferAgents`, so it has to repeat that method's+ // cleanup: a label belongs to the source registry and cannot travel.+ // Left behind, the rows keep inflating the source label's usage count+ // and reappear if the agent ever comes back.+ await trx+ .delete(agentLabelAssignments)+ .where(inArray(agentLabelAssignments.agentId, agentIds));}await trxdiff --git a/packages/database/src/repositories/agentMigration/index.ts b/packages/database/src/repositories/agentMigration/index.tsindex aed41e67339..fe2882a33d2 100644--- a/packages/database/src/repositories/agentMigration/index.ts+++ b/packages/database/src/repositories/agentMigration/index.ts@@ -176,6 +176,15 @@ export class AgentMigrationRepo {* It copies the session's groupId to the agent's sessionGroupId*/migrateSessionGroupId = async () => {+ // Personal scope only. `sessions` are per-user rows and the join below does+ // not filter by the caller, so inside a workspace this would copy some+ // member's legacy per-session folder into the *shared*+ // `agents.sessionGroupId` — arbitrarily, since which session wins depends+ // on the join, and permanently, since the column is now what every+ // member's sidebar reads. Workspace agents keep whatever the shared column+ // already says; there is no legacy shared value to recover.+ if (this.workspaceId) return;+// Find all agents that need migration:// - Agent's sessionGroupId is NULL// - Agent's associated session has a groupIddiff --git a/packages/database/src/repositories/home/__tests__/pinnedOverrides.test.ts b/packages/database/src/repositories/home/__tests__/pinnedOverrides.test.tsdeleted file mode 100644index 928f9bfdc28..00000000000--- a/packages/database/src/repositories/home/__tests__/pinnedOverrides.test.ts+++ /dev/null@@ -1,106 +0,0 @@-// Regression: pinning is FULLY per-member in workspace mode. Only the-// caller's `sidebarPinnedOverrides` entries pin items — the shared-// `agents.pinned` / `chat_groups.pinned` columns are ignored entirely (no-// fallback), so neither another member's legacy pin nor a transferred-in-// agent's personal-mode pin can surface in anyone's sidebar.-import { afterEach, beforeEach, describe, expect, it } from 'vitest';--import { getTestDB } from '../../../core/getTestDB';-import { AgentModel } from '../../../models/agent';-import { WorkspaceUserSettingsModel } from '../../../models/workspaceUserSettings';-import * as Schema from '../../../schemas';-import { HomeRepository } from '../index';--const clientDB = await getTestDB();--const memberA = 'u-member-a';-const memberB = 'u-member-b';-const ws = 'ws-pin-override';--beforeEach(async () => {- await clientDB.delete(Schema.users);- await clientDB.delete(Schema.workspaces);- await clientDB.insert(Schema.users).values([{ id: memberA }, { id: memberB }]);- await clientDB.insert(Schema.workspaces).values({- id: ws,- name: 'WS',- primaryOwnerId: memberA,- slug: ws,- });-});--afterEach(async () => {- await clientDB.delete(Schema.users);- await clientDB.delete(Schema.workspaces);-});--describe('workspace per-member pins (no shared-column fallback)', () => {- it("member's pin floats the item into their own pinned bucket only", async () => {- const agentModel = new AgentModel(clientDB, memberA, ws);- const agent = await agentModel.create({- systemRole: '',- title: 'Shared Agent',- visibility: 'public',- } as any);-- await new WorkspaceUserSettingsModel(clientDB, memberA, ws).updatePreference({- sidebarPinnedOverrides: { [agent.id]: true },- });-- const forA = await new HomeRepository(clientDB, memberA, ws).getSidebarAgentList();- expect(forA.pinned.map((a) => a.id)).toContain(agent.id);-- // Member B never pinned it — unpinned for them, regardless of A's action.- const forB = await new HomeRepository(clientDB, memberB, ws).getSidebarAgentList();- expect(forB.pinned.map((a) => a.id)).not.toContain(agent.id);- expect(forB.ungrouped.map((a) => a.id)).toContain(agent.id);- });-- it('ignores the shared pinned column for every member (legacy / transferred-in pins)', async () => {- const agentModel = new AgentModel(clientDB, memberA, ws);- const agent = await agentModel.create({- systemRole: '',- title: 'Legacy Pinned Agent',- visibility: 'public',- } as any);- // Shared-column pin: pre-per-member legacy state, or a personal-mode pin- // carried along by transferAgents (ownership update keeps `pinned`).- await agentModel.update(agent.id, { pinned: true });-- for (const member of [memberA, memberB]) {- const view = await new HomeRepository(clientDB, member, ws).getSidebarAgentList();- expect(view.pinned.map((a) => a.id)).not.toContain(agent.id);- expect(view.ungrouped.map((a) => a.id)).toContain(agent.id);- }- });-- it("member's explicit unpin entry keeps the item unpinned for them", async () => {- const agentModel = new AgentModel(clientDB, memberA, ws);- const agent = await agentModel.create({- systemRole: '',- title: 'Toggled Agent',- visibility: 'public',- } as any);-- const settings = new WorkspaceUserSettingsModel(clientDB, memberA, ws);- await settings.updatePreference({ sidebarPinnedOverrides: { [agent.id]: true } });- await settings.updatePreference({ sidebarPinnedOverrides: { [agent.id]: false } });-- const forA = await new HomeRepository(clientDB, memberA, ws).getSidebarAgentList();- expect(forA.pinned.map((a) => a.id)).not.toContain(agent.id);- expect(forA.ungrouped.map((a) => a.id)).toContain(agent.id);- });-- it('personal mode keeps reading the shared column', async () => {- const agentModel = new AgentModel(clientDB, memberA);- const agent = await agentModel.create({- systemRole: '',- title: 'Personal Agent',- visibility: 'private',- } as any);- await agentModel.update(agent.id, { pinned: true });-- const result = await new HomeRepository(clientDB, memberA).getSidebarAgentList();- expect(result.pinned.map((a) => a.id)).toContain(agent.id);- });-});diff --git a/packages/database/src/repositories/home/__tests__/privatePinned.test.ts b/packages/database/src/repositories/home/__tests__/privatePinned.test.tsindex cbff2040b51..1d01638964b 100644--- a/packages/database/src/repositories/home/__tests__/privatePinned.test.ts+++ b/packages/database/src/repositories/home/__tests__/privatePinned.test.ts@@ -6,7 +6,6 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest';import { getTestDB } from '../../../core/getTestDB';import { AgentModel } from '../../../models/agent';-import { WorkspaceUserSettingsModel } from '../../../models/workspaceUserSettings';import * as Schema from '../../../schemas';import { HomeRepository } from '../index';@@ -41,11 +40,7 @@ describe('workspace private pinned bucket', () => {title: 'Private Agent',visibility: 'private',} as any);- // Workspace pins live in the caller's per-member preference, not the- // shared `agents.pinned` column.- await new WorkspaceUserSettingsModel(clientDB, creator, ws).updatePreference({- sidebarPinnedOverrides: { [agent.id]: true },- });+ await agentModel.update(agent.id, { pinned: true });const result = await new HomeRepository(clientDB, creator, ws).getSidebarAgentList();@@ -62,9 +57,7 @@ describe('workspace private pinned bucket', () => {title: 'Public Agent',visibility: 'public',} as any);- await new WorkspaceUserSettingsModel(clientDB, creator, ws).updatePreference({- sidebarPinnedOverrides: { [agent.id]: true },- });+ await agentModel.update(agent.id, { pinned: true });const result = await new HomeRepository(clientDB, creator, ws).getSidebarAgentList();diff --git a/packages/database/src/repositories/home/__tests__/sharedSidebar.test.ts b/packages/database/src/repositories/home/__tests__/sharedSidebar.test.tsnew file mode 100644index 00000000000..12f916a674f--- /dev/null+++ b/packages/database/src/repositories/home/__tests__/sharedSidebar.test.ts@@ -0,0 +1,99 @@+// Regression: the workspace sidebar skeleton is SHARED. Folders (Categories),+// their order, folder membership and pinning all live on the shared columns,+// so every member sees the same structure. The only per-member layer left is+// show/hide, which is applied client-side and never reaches this repository.+import { afterEach, beforeEach, describe, expect, it } from 'vitest';++import { getTestDB } from '../../../core/getTestDB';+import { AgentModel } from '../../../models/agent';+import { SessionGroupModel } from '../../../models/sessionGroup';+import * as Schema from '../../../schemas';+import { HomeRepository } from '../index';++const clientDB = await getTestDB();++const memberA = 'u-member-a';+const memberB = 'u-member-b';+const ws = 'ws-shared-sidebar';++beforeEach(async () => {+ await clientDB.delete(Schema.users);+ await clientDB.delete(Schema.workspaces);+ await clientDB.insert(Schema.users).values([{ id: memberA }, { id: memberB }]);+ await clientDB.insert(Schema.workspaces).values({+ id: ws,+ name: 'WS',+ primaryOwnerId: memberA,+ slug: ws,+ });+});++afterEach(async () => {+ await clientDB.delete(Schema.users);+ await clientDB.delete(Schema.workspaces);+});++describe('shared workspace sidebar skeleton', () => {+ it('pins from the shared column surface for every member', async () => {+ const agentModel = new AgentModel(clientDB, memberA, ws);+ const agent = await agentModel.create({+ systemRole: '',+ title: 'Shared Agent',+ visibility: 'public',+ } as any);+ await agentModel.update(agent.id, { pinned: true });++ for (const member of [memberA, memberB]) {+ const view = await new HomeRepository(clientDB, member, ws).getSidebarAgentList();+ expect(view.pinned.map((a) => a.id)).toContain(agent.id);+ expect(view.ungrouped.map((a) => a.id)).not.toContain(agent.id);+ }+ });++ it("lists another member's public folder, with the same shared membership", async () => {+ const folder = await new SessionGroupModel(clientDB, memberA, ws).create({ name: 'Marketing' });+ const agentModel = new AgentModel(clientDB, memberA, ws);+ const agent = await agentModel.create({+ systemRole: '',+ title: 'Campaign Agent',+ visibility: 'public',+ } as any);+ await agentModel.updateSessionGroupId(agent.id, folder.id);++ // Member B never created the folder, never moved the agent into it.+ const forB = await new HomeRepository(clientDB, memberB, ws).getSidebarAgentList();+ const groupForB = forB.groups.find((g) => g.id === folder.id);++ expect(groupForB).toBeDefined();+ expect(groupForB!.name).toBe('Marketing');+ expect(groupForB!.items.map((i) => i.id)).toContain(agent.id);+ expect(forB.ungrouped.map((i) => i.id)).not.toContain(agent.id);+ });++ it("keeps another member's private folder out of the list", async () => {+ const folder = await new SessionGroupModel(clientDB, memberA, ws).create({+ name: 'A only',+ visibility: 'private',+ });++ const forA = await new HomeRepository(clientDB, memberA, ws).getSidebarAgentList();+ expect(forA.privateGroups.map((g) => g.id)).toContain(folder.id);++ const forB = await new HomeRepository(clientDB, memberB, ws).getSidebarAgentList();+ expect(forB.groups.map((g) => g.id)).not.toContain(folder.id);+ expect(forB.privateGroups.map((g) => g.id)).not.toContain(folder.id);+ });++ it('personal mode keeps reading the shared columns', async () => {+ const agentModel = new AgentModel(clientDB, memberA);+ const agent = await agentModel.create({+ systemRole: '',+ title: 'Personal Agent',+ visibility: 'private',+ } as any);+ await agentModel.update(agent.id, { pinned: true });++ const result = await new HomeRepository(clientDB, memberA).getSidebarAgentList();+ expect(result.pinned.map((a) => a.id)).toContain(agent.id);+ });+});diff --git a/packages/database/src/repositories/home/index.ts b/packages/database/src/repositories/home/index.tsindex 1eeb1ff0339..8150459b853 100644--- a/packages/database/src/repositories/home/index.ts+++ b/packages/database/src/repositories/home/index.ts@@ -1,20 +1,22 @@import {type SidebarAgentItem,+ type SidebarAgentLabel,type SidebarAgentListResponse,type SidebarGroup,} from '@lobechat/types';import { cleanObject } from '@lobechat/utils';-import { and, count, desc, eq, inArray, isNull, not, or, sql } from 'drizzle-orm';+import { and, asc, count, desc, eq, inArray, isNull, not, or, sql } from 'drizzle-orm';import { ChatGroupModel } from '../../models/chatGroup';import {+ agentLabelAssignments,+ agentLabels,agents,agentsToSessions,chatGroups,sessionGroups,sessions,topics,- workspaceUserSettings,} from '../../schemas';import { type LobeChatDatabase } from '../../type';import { sanitizeBm25Query } from '../../utils/bm25';@@ -61,8 +63,15 @@ export class HomeRepository {/*** Get sidebar agent list with pinned, grouped, and ungrouped items+ *+ * @param includeLabels - whether the caller holds `agent_label:read`. The+ * router decides; defaulting to `true` keeps personal mode and every+ * existing caller unchanged, since that grant only exists in a workspace.*/- async getSidebarAgentList(): Promise<SidebarAgentListResponse> {+ async getSidebarAgentList(+ includeLabels = true,+ includeGroups = true,+ ): Promise<SidebarAgentListResponse> {// 1. Query all agents (non-virtual) with their session info (if exists).// `visibility` is selected so we can later bucket public vs. the// current user's private rows; the WHERE already hides other members'@@ -133,36 +142,39 @@ export class HomeRepository {// loaded topics for.const { agentUnread, groupUnread } = await this.getUnreadCounts();- // 3. Query sessionGroups (user-defined folders). Folders are a per-member- // concern in workspace mode: only the caller's own folders render —- // another member's folder must never shape this caller's sidebar. Items- // whose groupId points at a folder invisible to the caller fall back to- // the ungrouped list in processAgentList.- const folderWhere = buildWorkspaceWhere(this.scope, {- userId: sessionGroups.userId,- workspaceId: sessionGroups.workspaceId,- visibility: sessionGroups.visibility,- });- const groupList = await this.db- .select({- id: sessionGroups.id,- name: sessionGroups.name,- sort: sessionGroups.sort,- userId: sessionGroups.userId,- visibility: sessionGroups.visibility,- })- .from(sessionGroups)- .where(- this.workspaceId ? and(folderWhere, eq(sessionGroups.userId, this.userId)) : folderWhere,- )- .orderBy(sessionGroups.sort);-- // 3.5 Per-member folder assignments + pins: workspace members organize- // shared items without touching the shared `agents.sessionGroupId` /- // `pinned` columns (one member's drag or pin must not reshape another- // member's sidebar). These entries are the sole source in workspace mode- // — see processAgentList for the no-fallback rule.- const { assignmentOverrides, pinnedOverrides } = await this.getSidebarPreferenceOverrides();+ // 2.3 Labels applied to agents — one scope-wide query, attached per item+ // in processAgentList so the list can render tags / group by label.+ //+ // Skipped when the caller lacks the label read grant: the registry is+ // gated on `agent_label:read`, and this payload carries the same label+ // names and colors, so returning it anyway would just be a second way in.+ const agentLabelsMap = includeLabels ? await this.getAgentLabelsMap() : new Map();++ // 3. Query sessionGroups (user-defined folders). Folders are the shared+ // skeleton of a workspace sidebar: every member sees the same public+ // folders, in the same shared order. Private folders stay scoped to their+ // creator through the standard visibility predicate. Items whose groupId+ // points at a folder invisible to the caller fall back to the ungrouped+ // list in processAgentList.+ const groupList = !includeGroups+ ? []+ : await this.db+ .select({+ id: sessionGroups.id,+ name: sessionGroups.name,+ sort: sessionGroups.sort,+ userId: sessionGroups.userId,+ visibility: sessionGroups.visibility,+ })+ .from(sessionGroups)+ .where(+ buildWorkspaceWhere(this.scope, {+ userId: sessionGroups.userId,+ workspaceId: sessionGroups.workspaceId,+ visibility: sessionGroups.visibility,+ }),+ )+ .orderBy(sessionGroups.sort);// 4. Process and categorizereturn this.processAgentList(@@ -172,11 +184,42 @@ export class HomeRepository {memberAvatarsMap,agentUnread,groupUnread,- assignmentOverrides,- pinnedOverrides,+ agentLabelsMap,);}+ /**+ * Labels applied to agents in the current scope, keyed by agent id. The+ * junction rows carry the same workspace scoping as the label registry, so+ * one predicate covers both personal and workspace mode.+ */+ private async getAgentLabelsMap(): Promise<Map<string, SidebarAgentLabel[]>> {+ const rows = await this.db+ .select({+ agentId: agentLabelAssignments.agentId,+ color: agentLabels.color,+ id: agentLabels.id,+ name: agentLabels.name,+ })+ .from(agentLabelAssignments)+ .innerJoin(agentLabels, eq(agentLabelAssignments.labelId, agentLabels.id))+ .where(+ buildWorkspaceWhere(this.scope, {+ userId: agentLabelAssignments.userId,+ workspaceId: agentLabelAssignments.workspaceId,+ }),+ )+ .orderBy(asc(agentLabels.name));++ const map = new Map<string, SidebarAgentLabel[]>();+ for (const { agentId, ...label } of rows) {+ const existing = map.get(agentId) || [];+ existing.push(label);+ map.set(agentId, existing);+ }+ return map;+ }+/*** Count topics with an unread completed generation, grouped by agent and by* group. Returns plain maps keyed by agentId / groupId.@@ -267,20 +310,13 @@ export class HomeRepository {memberAvatarsMap: Map<string, Array<{ avatar: string; background?: string }>>,agentUnread: Map<string, number> = new Map(),groupUnread: Map<string, number> = new Map(),- assignmentOverrides: Record<string, string | null> = {},- pinnedOverrides: Record<string, boolean> = {},+ agentLabelsMap: Map<string, SidebarAgentLabel[]> = new Map(),): SidebarAgentListResponse {- // Sidebar organization (folder + pin) is FULLY per-member in workspace- // mode: only the caller's own workspace_user_settings entries apply — the- // shared `sessionGroupId` / `pinned` columns are ignored entirely (no- // fallback), so nothing another member did (or a transferred-in agent's- // personal-mode state) can shape this caller's sidebar. Personal mode- // keeps reading the shared columns — single-user data, nothing to leak.- const perMember = Boolean(this.workspaceId);- const effectiveGroupId = (itemId: string, sharedGroupId: string | null): string | null =>- perMember ? (assignmentOverrides[itemId] ?? null) : sharedGroupId;- const effectivePinned = (itemId: string, sharedPinned: boolean): boolean =>- perMember ? (pinnedOverrides[itemId] ?? false) : sharedPinned;+ // Sidebar organization (folder membership + pin) is SHARED in workspace+ // mode: it reads the same `sessionGroupId` / `pinned` columns as personal+ // mode, so one member's grouping and pinning is what every member sees.+ // The only per-member layer left is show/hide, applied client-side from+ // `sidebarAgentVisibilityOverrides` / `sidebarHiddenGroupIds`.// Convert to unified format// For pinned status: agents.pinned takes priority, fallback to sessions.pinned for backward compatibility// For groupId: agents.sessionGroupId takes priority, fallback to sessions.groupId for backward compatibility@@ -301,11 +337,22 @@ export class HomeRepository {avatar: meta.avatar,backgroundColor: a.backgroundColor,description: a.description,- groupId: effectiveGroupId(a.id, a.agentSessionGroupId ?? a.sessionGroupId),+ // Legacy fallback, personal scope only. `sessions` are per-user rows+ // and this join does not filter by the caller, so in a workspace the+ // fallback would hand one member's old per-session folder to every+ // member — arbitrarily, since which session wins depends on the join.+ // That was harmless while folders were per-member; now that the+ // sidebar is shared it would publish one person's legacy state.+ groupId: this.workspaceId+ ? a.agentSessionGroupId+ : (a.agentSessionGroupId ?? a.sessionGroupId),heterogeneousType: a.agencyConfig?.heterogeneousProvider?.type ?? null,id: a.id,isPrivate: visibility === 'private',- pinned: effectivePinned(a.id, a.pinned ?? a.sessionPinned ?? false),+ labels: agentLabelsMap.get(a.id),+ // Same personal-only reasoning as `groupId`: `sessions.pinned` is one+ // member's legacy pin, and pins are shared again.+ pinned: this.workspaceId ? (a.pinned ?? false) : (a.pinned ?? a.sessionPinned ?? false),sessionId: a.sessionId,slug: a.slug,title: meta.title,@@ -325,10 +372,10 @@ export class HomeRepository {backgroundColor: g.backgroundColor,description: g.description,groupAvatar: g.avatar,- groupId: effectiveGroupId(g.id, g.groupId),+ groupId: g.groupId,id: g.id,isPrivate: visibility === 'private',- pinned: effectivePinned(g.id, g.pinned ?? false),+ pinned: g.pinned ?? false,sessionId: null,title: g.title,type: 'group' as const,@@ -408,31 +455,6 @@ export class HomeRepository {return { groups, pinned, privateGroups, privatePinned, privateUngrouped, ungrouped };}- /**- * Per-member sidebar state from workspace_user_settings. Folder assignment- * and pinning are fully per-member in workspace mode — these entries are- * the only source of truth; the shared `sessionGroupId` / `pinned` columns- * are ignored (no fallback), so no other member's action leaks into the- * caller's sidebar.- */- private async getSidebarPreferenceOverrides(): Promise<{- assignmentOverrides: Record<string, string | null>;- pinnedOverrides: Record<string, boolean>;- }> {- if (!this.workspaceId) return { assignmentOverrides: {}, pinnedOverrides: {} };-- const settings = await this.db.query.workspaceUserSettings.findFirst({- where: and(- eq(workspaceUserSettings.workspaceId, this.workspaceId),- eq(workspaceUserSettings.userId, this.userId),- ),- });- return {- assignmentOverrides: settings?.preference?.sidebarGroupAssignments ?? {},- pinnedOverrides: settings?.preference?.sidebarPinnedOverrides ?? {},- };- }-/*** Search agents and chat groups by keyword* Searches in title and description fields@@ -443,8 +465,7 @@ export class HomeRepository {const bm25Query = sanitizeBm25Query(keyword);// Run agent and chat group searches in parallel- const [{ pinnedOverrides }, agentResults, chatGroupResults] = await Promise.all([- this.getSidebarPreferenceOverrides(),+ const [agentResults, chatGroupResults] = await Promise.all([// 1. Search agents by title or description (BM25)this.db.select({@@ -514,9 +535,9 @@ export class HomeRepository {backgroundColor: a.backgroundColor,description: a.description,id: a.id,- pinned: this.workspaceId- ? (pinnedOverrides[a.id] ?? false)- : (a.pinned ?? a.sessionPinned ?? false),+ // Same personal-only reasoning as `groupId`: `sessions.pinned` is one+ // member's legacy pin, and pins are shared again.+ pinned: this.workspaceId ? (a.pinned ?? false) : (a.pinned ?? a.sessionPinned ?? false),sessionId: a.sessionId,title: meta.title,type: 'agent' as const,@@ -533,7 +554,7 @@ export class HomeRepository {backgroundColor: g.backgroundColor,description: g.description,id: g.id,- pinned: this.workspaceId ? (pinnedOverrides[g.id] ?? false) : (g.pinned ?? false),+ pinned: g.pinned ?? false,title: g.title,type: 'group' as const,updatedAt: g.updatedAt,diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.tsindex 376cd9a0054..0bced053843 100644--- a/packages/locales/src/default/chat.ts+++ b/packages/locales/src/default/chat.ts@@ -1037,6 +1037,7 @@ export default {'sessionGroup.createSuccess': 'Created successfully','sessionGroup.creatingAgent': 'Creating agent...','sessionGroup.groupName': 'Category Name',+ 'sessionGroup.hideFromSidebar': 'Hide from my sidebar','sessionGroup.inputPlaceholder': 'Please enter category name...','sessionGroup.moveGroup': 'Move to Category','sessionGroup.newGroup': 'New Category',@@ -1051,6 +1052,7 @@ export default {'sessionGroup.renameSuccess': 'Renamed successfully','sessionGroup.searchAgents': 'Search agents','sessionGroup.selectedAgents': 'Selected agents ({{count}})',+ 'sessionGroup.showInSidebar': 'Show in my sidebar','sessionGroup.sortSuccess': 'Reorder successful','sessionGroup.sorting': 'Category sorting updating...','sessionGroup.tooLong': 'Category name length should be between 1-20',diff --git a/packages/locales/src/default/common.ts b/packages/locales/src/default/common.tsindex 582bde852fd..0c64c431be7 100644--- a/packages/locales/src/default/common.ts+++ b/packages/locales/src/default/common.ts@@ -7,22 +7,27 @@ export default {'alert.cloud.descOnMobile':'All registered users get {{credit}} free credits per month—no setup needed.','alert.cloud.title': '{{name}} beta is live',- 'agentViewAll.addToSidebar': 'Show in sidebar',- 'agentViewAll.columns.author': 'Author',- 'agentViewAll.columns.name': 'Name',- 'agentViewAll.columns.updatedAt': 'Last update time',+ 'agentViewAll.addToSidebar': 'Show in my sidebar','agentViewAll.empty': 'No agents yet','agentViewAll.form.grouping': 'Grouping','agentViewAll.form.ordering': 'Ordering',- 'agentViewAll.form.showSidebarHidden': 'Show agents hidden from sidebar',+ 'agentViewAll.form.showSidebarHidden': 'Show agents hidden from my sidebar',+ 'agentLabel.create': 'New label',+ 'agentLabel.manage': 'Manage labels',+ 'agentLabel.menuTitle': 'Labels','agentViewAll.groupBy.author': 'Author',+ 'agentViewAll.groupBy.label': 'Label',+ 'agentViewAll.groupBy.noLabel': 'No label','agentViewAll.groupBy.none': 'No grouping','agentViewAll.groupBy.unknownAuthor': 'Unknown author','agentViewAll.myAgents': 'My Agents','agentViewAll.orderBy.author': 'Author','agentViewAll.orderBy.title': 'Title','agentViewAll.orderBy.updatedAt': 'Updated at',- 'agentViewAll.removeFromSidebar': 'Hide from sidebar',+ 'agentViewAll.removeFromSidebar': 'Hide from my sidebar',+ 'agentViewAll.sidebarSection.collapse': 'Fold',+ 'agentViewAll.sidebarSection.expand': 'Unfold',+ 'agentViewAll.sidebarSection.title': 'In Sidebar','agentViewAll.title': 'Agents','agentViewAll.untitled': 'Untitled Agent','agentViewAll.view.card': 'Card',diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.tsindex 1881a78a6e9..5488023d948 100644--- a/packages/locales/src/default/setting.ts+++ b/packages/locales/src/default/setting.ts@@ -1044,6 +1044,7 @@ export default {'settingsSearch.tabKeywords.creds': 'credentials, secrets, oauth','settingsSearch.tabKeywords.devices': 'devices, sessions, logged in devices','settingsSearch.tabKeywords.hotkey': 'hotkey, shortcut, keyboard',+ 'settingsSearch.tabKeywords.labels': 'labels, tags, grouping','settingsSearch.tabKeywords.memory': 'memory, memories, personalization','settingsSearch.tabKeywords.messenger': 'messenger, chat platform, bot','settingsSearch.tabKeywords.notification': 'notification, email, push, alerts',@@ -1390,6 +1391,7 @@ When I am ___, I need ___'tab.importFromGithub.desc': 'Import from a public GitHub repository','tab.importFromUrl': 'Import from URL','tab.importFromUrl.desc': 'Import via a direct link to SKILL.md',+ 'tab.labels': 'Labels','tab.llm': 'Language Model','tab.manualFill': 'Manually Fill In','tab.manualFill.desc': 'Configure a custom MCP skill manually',@@ -2954,8 +2956,47 @@ When I am ___, I need ___'workspaceSetting.group.admin': 'Admin','workspaceSetting.group.agent': 'Agent','workspaceSetting.group.general': 'General',+ 'workspaceSetting.labels.actions.archive': 'Archive',+ 'workspaceSetting.labels.actions.create': 'New label',+ 'workspaceSetting.labels.actions.unarchive': 'Restore',+ 'workspaceSetting.labels.archive.desc':+ 'This label will no longer be available to apply to agents. Agents with the label already applied will remain unchanged.',+ 'workspaceSetting.labels.archive.success': 'Label archived',+ 'workspaceSetting.labels.archive.title': 'Archive "{{name}}"?',+ 'workspaceSetting.labels.archivedEmpty': 'No archived labels',+ 'workspaceSetting.labels.columns.created': 'Created',+ 'workspaceSetting.labels.columns.description': 'Description',+ 'workspaceSetting.labels.columns.name': 'Name',+ 'workspaceSetting.labels.columns.usage': 'Agents',+ 'workspaceSetting.labels.delete.archiveHint':+ 'To prevent future application of this label, archive the label instead.',+ 'workspaceSetting.labels.delete.confirmHint': 'To confirm, type "delete" below:',+ 'workspaceSetting.labels.delete.desc': 'Deletion cannot be undone.',+ 'workspaceSetting.labels.delete.descUsed':+ 'This label will be removed from {{count}} agents. Deletion cannot be undone.',+ 'workspaceSetting.labels.delete.success': 'Label deleted',+ 'workspaceSetting.labels.delete.title': 'Delete the label "{{name}}"?',+ 'workspaceSetting.labels.empty': 'No labels yet. Create one to organize your agents.',+ 'workspaceSetting.labels.filterEmpty': 'No labels match the filter',+ 'workspaceSetting.labels.filterPlaceholder': 'Filter by name...',+ 'workspaceSetting.labels.loadFailed': "Couldn't load labels",+ 'workspaceSetting.labels.form.color': 'Color',+ 'workspaceSetting.labels.form.createTitle': 'New label',+ 'workspaceSetting.labels.form.description': 'Description',+ 'workspaceSetting.labels.form.descriptionPlaceholder': 'Optional description',+ 'workspaceSetting.labels.form.duplicateName': 'A label with this name already exists',+ 'workspaceSetting.labels.form.editTitle': 'Edit label',+ 'workspaceSetting.labels.form.restoreTitle': 'Rename to restore',+ 'workspaceSetting.labels.form.name': 'Name',+ 'workspaceSetting.labels.form.namePlaceholder': 'Label name',+ 'workspaceSetting.labels.manageBlocked': 'Only workspace admins can manage labels',+ 'workspaceSetting.labels.scope.archived': 'Archived',+ 'workspaceSetting.labels.scope.personal': 'Personal',+ 'workspaceSetting.labels.scope.workspace': 'Workspace',+ 'workspaceSetting.labels.usage': '{{count}} agents','workspaceSetting.tab.auditLog': 'Audit logs','workspaceSetting.tab.general': 'General',+ 'workspaceSetting.tab.labels': 'Labels','workspaceSetting.tab.members': 'Members','workspaceSetting.storage.comingSoon': 'Workspace-scoped data import & export is coming soon.','workspaceSetting.storage.danger.reset.confirm.content':diff --git a/packages/locales/src/default/subscription.ts b/packages/locales/src/default/subscription.tsindex 96d0f237d28..af8d832d27f 100644--- a/packages/locales/src/default/subscription.ts+++ b/packages/locales/src/default/subscription.ts@@ -183,6 +183,8 @@ export default {'Members without a custom rule use this limit each billing cycle.','credits.memberBudget.desc':'Limit how many workspace credits each member can use in the current billing cycle',+ 'credits.memberBudget.details.action': 'View details',+ 'credits.memberBudget.details.title': 'Member usage','credits.memberBudget.effectiveBudget': 'Effective budget','credits.memberBudget.empty': 'No workspace members yet','credits.memberBudget.globalBadge': 'Global',@@ -199,7 +201,7 @@ export default {'credits.memberBudget.status.inherit': 'Inherits default','credits.memberBudget.status.unlimited': 'Unlimited','credits.memberBudget.target.allMembers': 'All members',- 'credits.memberBudget.title': 'Budget',+ 'credits.memberBudget.title': 'Member Budget Control','credits.memberBudget.unlimited': 'Unlimited','credits.memberBudget.upgradeCta': 'View plans','credits.memberBudget.userPanel.exhaustedDesc':diff --git a/packages/types/src/home.ts b/packages/types/src/home.tsindex 88e54e465cd..47f8e7e0968 100644--- a/packages/types/src/home.ts+++ b/packages/types/src/home.ts@@ -18,6 +18,28 @@ export interface GroupMemberAvatar {background?: string;}+/**+ * Label applied to a sidebar agent. Mirrors the `agent_labels` registry+ * (workspace-shared, or personal when outside a workspace).+ */+export interface SidebarAgentLabel {+ color?: string | null;+ id: string;+ name: string;+}++/**+ * Full agent-label registry entry, as returned by the label management API.+ * Extends the lightweight {@link SidebarAgentLabel} with management fields.+ */+export interface AgentLabelListItem extends SidebarAgentLabel {+ archived: boolean;+ createdAt: Date;+ description?: string | null;+ /** Number of agents currently carrying this label. */+ usageCount: number;+}+/*** Sidebar agent item - represents an agent or chat group in the sidebar*/@@ -47,6 +69,11 @@ export interface SidebarAgentItem {*/heterogeneousType?: string | null;id: string;+ /**+ * Labels applied to the agent (absent for chat groups and unlabeled+ * agents). Used by the agents list to render label tags and group by label.+ */+ labels?: SidebarAgentLabel[];pinned: boolean;sessionId?: string | null;/**diff --git a/packages/types/src/user/preference.test.ts b/packages/types/src/user/preference.test.tsnew file mode 100644index 00000000000..c1b377acbd6--- /dev/null+++ b/packages/types/src/user/preference.test.ts@@ -0,0 +1,20 @@+import { describe, expect, it } from 'vitest';++import { UserPreferenceSchema } from './preference';++describe('UserPreferenceSchema', () => {+ // `user.updatePreference` validates its input with this schema, and zod+ // strips unknown keys rather than rejecting them. A field that exists on the+ // TypeScript interface but is missing here therefore fails silently: the+ // client patches its store optimistically, the write "succeeds", and the+ // value is gone on the next load. Both sidebar preferences are asserted so+ // the pair cannot drift apart again.+ it.each([['sidebarHiddenAgentIds'], ['sidebarHiddenGroupIds']])(+ 'preserves %s instead of stripping it',+ (key) => {+ const parsed = UserPreferenceSchema.parse({ telemetry: null, [key]: ['id-1', 'id-2'] });++ expect(parsed).toMatchObject({ [key]: ['id-1', 'id-2'] });+ },+ );+});diff --git a/packages/types/src/user/preference.ts b/packages/types/src/user/preference.tsindex 057b47fca6c..f738c7309a1 100644--- a/packages/types/src/user/preference.ts+++ b/packages/types/src/user/preference.ts@@ -80,19 +80,18 @@ export interface WorkspaceUserPreference {sidebar?: SidebarLayoutPreference;/*** Explicit per-member sidebar membership for workspace Agents / chat groups- * (itemId -> visible). When absent, Agents created by the caller are shown- * and Agents created by another member are hidden; chat groups and builtin- * Agents keep their existing visible default. An explicit entry always wins- * over that ownership-based default and the legacy hidden-id list.+ * (itemId -> visible). The workspace sidebar is a shared structure, so every+ * item a member can see is listed by default; an entry here is that member's+ * personal opt-out (`false`) or an explicit re-show of something the legacy+ * hidden-id list removed. An explicit entry always wins over that list.*/sidebarAgentVisibilityOverrides?: Record<string /* itemId */, boolean>;/**- * Per-member folder assignment for sidebar items (agentId/chatGroupId →- * sessionGroupId). Folders are per-member in workspace mode, so moving a- * shared item into "my" folder must not rewrite the shared- * `agents.sessionGroupId` column (which would regroup every member's- * sidebar). This map is the sole source in workspace mode — items absent- * here sit in the default (ungrouped) list; the shared column is ignored.+ * Per-member folder assignment for sidebar items.+ *+ * @deprecated Folder membership is workspace-shared again — it lives on the+ * `agents.sessionGroupId` / `chat_groups.groupId` columns. Existing keys+ * are ignored; nothing reads or writes this map.*/sidebarGroupAssignments?: Record<string /* itemId */, string | null>;/**@@ -103,12 +102,18 @@ export interface WorkspaceUserPreference {*/sidebarHiddenAgentIds?: string[];/**- * Per-member pins for sidebar items (agentId/chatGroupId → pinned).- * Pinning is fully per-member in workspace mode: this map is the sole- * source — the shared `agents.pinned` / `chat_groups.pinned` columns are- * ignored (a transferred-in agent's personal pin, or a pin made before- * this preference existed, must not surface for anyone). Items absent- * here are unpinned.+ * Sidebar folders (Categories) the caller removed from their own sidebar in+ * this workspace. Folders themselves are shared, so this is the personal+ * mask over them: absent id = shown. Hiding a folder hides the whole+ * section, its items included — they stay reachable from the agents list.+ */+ sidebarHiddenGroupIds?: string[];+ /**+ * Per-member pins for sidebar items.+ *+ * @deprecated Pinning is workspace-shared again — it lives on the+ * `agents.pinned` / `chat_groups.pinned` columns. Existing keys are+ * ignored; nothing reads or writes this map.*/sidebarPinnedOverrides?: Record<string /* itemId */, boolean>;}@@ -231,6 +236,12 @@ export interface UserPreference {* removed from the personal sidebar via the View All page.*/sidebarHiddenAgentIds?: string[];+ /**+ * Personal-mode counterpart of+ * {@link WorkspaceUserPreference.sidebarHiddenGroupIds}: folders+ * (Categories) hidden from the personal sidebar via Category Management.+ */+ sidebarHiddenGroupIds?: string[];/*** @deprecated Use settings.general.telemetry instead*/@@ -305,6 +316,7 @@ export const UserPreferenceSchema = zlab: UserLabSchema.optional(),lastWorkspaceId: z.string().nullish(),sidebarHiddenAgentIds: z.array(z.string()).optional(),+ sidebarHiddenGroupIds: z.array(z.string()).optional(),terminalFontFamily: z.string().optional(),telemetry: z.boolean().nullable(),topicGroupMode: z.enum(['byTime', 'byProject', 'flat', 'byStatus']).optional(),diff --git a/src/components/ImperativeModal/index.test.tsx b/src/components/ImperativeModal/index.test.tsxnew file mode 100644index 00000000000..9945327d0d8--- /dev/null+++ b/src/components/ImperativeModal/index.test.tsx@@ -0,0 +1,82 @@+import { Input, MotionProvider } from '@lobehub/ui';+import { ModalHost } from '@lobehub/ui/base-ui';+import { render, screen } from '@testing-library/react';+import { motion } from 'motion/react';+import { useState } from 'react';+import { describe, expect, it } from 'vitest';++import ImperativeModal from '.';++/** A modal whose input is controlled by state living in the CALLER's tree. */+const Harness = () => {+ const [value, setValue] = useState('');+ return (+ <MotionProvider motion={motion}>+ <ImperativeModal destroyOnHidden open title={'title'}>+ <Input+ autoFocus+ data-testid={'field'}+ value={value}+ onChange={(e) => setValue(e.target.value)}+ />+ </ImperativeModal>+ <ModalHost />+ </MotionProvider>+ );+};++const valueDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')!;+const nativeGet = valueDescriptor.get!;+const nativeSet = valueDescriptor.set!;++/** Records every write that actually changes the node's value. */+const recordValueWrites = (node: HTMLInputElement) => {+ const writes: { from: string; to: string }[] = [];+ Object.defineProperty(node, 'value', {+ configurable: true,+ get: () => nativeGet.call(node),+ set: (next: string) => {+ const from = nativeGet.call(node);+ if (from !== next) writes.push({ from, to: next });+ nativeSet.call(node, next);+ },+ });+ return writes;+};++/** Feeds `node` one composing keystroke, the way a browser IME does. */+const composeStep = async (node: HTMLInputElement, text: string) => {+ nativeSet.call(node, text);+ node.dispatchEvent(new InputEvent('input', { bubbles: true, data: text, isComposing: true }));+ await new Promise((resolve) => setTimeout(resolve, 0));+};++describe('ImperativeModal', () => {+ it('renders children inside the modal and keeps autofocus', async () => {+ render(<Harness />);++ const field = (await screen.findByTestId('field')) as HTMLInputElement;+ await new Promise((resolve) => setTimeout(resolve, 20));++ expect(field.closest('[role="dialog"]')).not.toBeNull();+ expect(document.activeElement).toBe(field);+ });++ it('never writes back to a controlled input while an IME composition is active', async () => {+ // Regression: modal content used to be handed to the base-ui modal host,+ // a separate React tree that only saw caller state one commit later. React+ // then restored the stale value onto the input at the end of every event,+ // which aborts the composition session and makes CJK input impossible.+ render(<Harness />);++ const field = (await screen.findByTestId('field')) as HTMLInputElement;+ const writes = recordValueWrites(field);++ field.focus();+ field.dispatchEvent(new CompositionEvent('compositionstart', { bubbles: true }));+ for (const step of ['l', 'la', 'lal', 'lala']) await composeStep(field, step);++ expect(writes).toEqual([]);+ expect(field.value).toBe('lala');+ });+});diff --git a/src/components/ImperativeModal/index.tsx b/src/components/ImperativeModal/index.tsxindex 01213467ce8..d53038c5983 100644--- a/src/components/ImperativeModal/index.tsx+++ b/src/components/ImperativeModal/index.tsx@@ -7,7 +7,8 @@ import {ModalFooter,type ModalInstance,} from '@lobehub/ui/base-ui';-import { type CSSProperties, type ReactNode, useEffect, useMemo, useRef } from 'react';+import { type CSSProperties, type ReactNode, useEffect, useMemo, useRef, useState } from 'react';+import { createPortal } from 'react-dom';import { useTranslation } from 'react-i18next';interface LegacyModalButtonProps {@@ -98,6 +99,20 @@ const ImperativeModal = ({const { t } = useTranslation('common');const modalRef = useRef<ModalInstance>(undefined);const canRenderContent = open || !destroyOnHidden;++ // `createModal` renders into its own host tree, so handing `children` over as+ // modal content would put them in a tree that only learns about caller state+ // one commit late (the update below runs in an effect). React then restores+ // the stale value onto controlled inputs at the end of each event, which+ // aborts IME composition — CJK input becomes impossible. Instead the modal+ // tree renders a stable empty slot and the children are portaled into it from+ // THIS tree, so their state and their inputs commit together (this also+ // matches how the antd modals behaved before the base-ui migration).+ const [contentHost, setContentHost] = useState<HTMLElement | null>(null);+ const contentSlot = useMemo(+ () => <div ref={setContentHost} style={{ display: 'contents' }} />,+ [],+ );const modalFooter = useMemo(() => {if (footer === null) return null;if (footer !== undefined) return footer;@@ -144,7 +159,7 @@ const ImperativeModal = ({const modalProps = {...rest,classNames: normalizeClassNames(className, classNames),- content: canRenderContent ? children : null,+ content: canRenderContent ? contentSlot : null,footer: modalFooter,loading,onOpenChange: (nextOpen: boolean) => {@@ -165,7 +180,7 @@ const ImperativeModal = ({}, [afterOpenChange,canRenderContent,- children,+ contentSlot,className,classNames,loading,@@ -183,7 +198,9 @@ const ImperativeModal = ({};}, []);- return null;+ if (!contentHost || !canRenderContent) return null;++ return createPortal(children, contentHost);};ImperativeModal.displayName = 'ImperativeModal';diff --git a/src/features/AgentViewAll/AgentCard.tsx b/src/features/AgentViewAll/AgentCard.tsxindex b5e699c94a4..d139675b49c 100644--- a/src/features/AgentViewAll/AgentCard.tsx+++ b/src/features/AgentViewAll/AgentCard.tsx@@ -2,9 +2,17 @@import { AGENT_CHAT_URL, DEFAULT_AVATAR, GROUP_CHAT_URL } from '@lobechat/const';import { type SidebarAgentItem } from '@lobechat/types';-import { Avatar, Block, Flexbox, Text } from '@lobehub/ui';+import {+ Avatar,+ Block,+ ContextMenuTrigger,+ Flexbox,+ type MenuProps,+ Text,+ Tooltip,+} from '@lobehub/ui';import { createStaticStyles, responsive } from 'antd-style';-import { memo, useState } from 'react';+import { memo, useCallback, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';import WorkspaceLink from '@/features/Workspace/WorkspaceLink';@@ -12,6 +20,7 @@ import WorkspaceLink from '@/features/Workspace/WorkspaceLink';import AgentAvatar from './AgentAvatar';import { type AgentRowAuthor, formatUpdatedAt } from './AgentRow';import ItemActions from './ItemActions';+import LabelTags from './LabelTags';// Card layout mirrors the agent channel platform cards// (src/routes/(main)/agent/channel/list.tsx): icon + title + trailing state on@@ -90,70 +99,90 @@ const AgentCard = memo<AgentCardProps>(const { description, id, title, type, updatedAt } = item;const [anchor, setAnchor] = useState<HTMLElement | null>(null);+ // Right-click support — same bridge as AgentRow: the hook-bearing menu+ // mounts on the card's pointer-enter and hands its items back via ref.+ const [menuActivated, setMenuActivated] = useState(false);+ const activateMenu = useCallback(() => setMenuActivated(true), []);+ const menuItemsRef = useRef<(() => MenuProps['items']) | null>(null);+ const handleMenuReady = useCallback((getItems: () => MenuProps['items']) => {+ menuItemsRef.current = getItems;+ }, []);+ const getContextMenuItems = useCallback(() => menuItemsRef.current?.() ?? [], []);+return (- <WorkspaceLink- aria-label={title || undefined}- className={cardStyles.link}- ref={setAnchor}- to={type === 'group' ? GROUP_CHAT_URL(id) : AGENT_CHAT_URL(id, false)}- >- <Block clickable className={cardStyles.card} height={'100%'} variant={'outlined'}>- <Flexbox horizontal align={'center'} gap={8} style={{ minWidth: 0 }}>- <AgentAvatar item={item} size={24} />- <Text ellipsis style={{ flex: 1, minWidth: 0 }} weight={600}>- {title || t('agentViewAll.untitled')}+ <ContextMenuTrigger items={getContextMenuItems}>+ <WorkspaceLink+ aria-label={title || undefined}+ className={cardStyles.link}+ ref={setAnchor}+ to={type === 'group' ? GROUP_CHAT_URL(id) : AGENT_CHAT_URL(id, false)}+ onPointerEnter={activateMenu}+ >+ <Block clickable className={cardStyles.card} height={'100%'} variant={'outlined'}>+ <Flexbox horizontal align={'center'} gap={8} style={{ minWidth: 0 }}>+ <AgentAvatar item={item} size={24} />+ <Text ellipsis style={{ flex: 1, minWidth: 0 }} weight={600}>+ {title || t('agentViewAll.untitled')}+ </Text>+ <Flexbox+ flex={'none'}+ onClick={(e) => {+ // Keep the menu from following the card link.+ e.preventDefault();+ e.stopPropagation();+ }}+ >+ {/* Headless: the card's context menu is the only actions entry+ (the sidebar toggle folds into it via includeSidebarToggle). */}+ <ItemActions+ hideTrigger+ includeSidebarToggle+ anchor={anchor}+ forceActivated={menuActivated}+ item={item}+ sidebarHidden={sidebarHidden}+ onMenuReady={handleMenuReady}+ onToggleSidebar={onToggleSidebar}+ />+ </Flexbox>+ </Flexbox>+ <Text className={cardStyles.description} fontSize={12} type={'secondary'}>+ {description}</Text>+ {item.labels?.length ? (+ <Flexbox horizontal align={'center'} gap={6} wrap={'wrap'}>+ <LabelTags labels={item.labels} />+ </Flexbox>+ ) : null}<Flexbox- flex={'none'}- onClick={(e) => {- // Keep the menu from following the card link.- e.preventDefault();- e.stopPropagation();- }}+ horizontal+ align={'center'}+ gap={8}+ justify={'space-between'}+ style={{ marginBlockStart: 'auto' }}>- <ItemActions- includeSidebarToggle- anchor={anchor}- item={item}- sidebarHidden={sidebarHidden}- onToggleSidebar={onToggleSidebar}- />- </Flexbox>- </Flexbox>- <Text className={cardStyles.description} fontSize={12} type={'secondary'}>- {description}- </Text>- <Flexbox- horizontal- align={'center'}- gap={8}- justify={'space-between'}- style={{ marginBlockStart: 'auto' }}- >- {showAuthor ? (- <Flexbox horizontal align={'center'} gap={6} style={{ minWidth: 0 }}>- {author ? (- <>- <Avatar avatar={author.avatar || DEFAULT_AVATAR} size={18} />- <Text ellipsis fontSize={12} type={'secondary'}>- {author.name}+ {showAuthor ? (+ <Flexbox horizontal align={'center'} gap={6} style={{ minWidth: 0 }}>+ {author ? (+ <Tooltip title={author.name}>+ <Avatar avatar={author.avatar || DEFAULT_AVATAR} size={18} />+ </Tooltip>+ ) : (+ <Text fontSize={12} type={'secondary'}>+ –</Text>- </>- ) : (- <Text fontSize={12} type={'secondary'}>- –- </Text>- )}- </Flexbox>- ) : (- <div />- )}- <Text className={cardStyles.updatedAt} fontSize={12}>- {updatedAt ? formatUpdatedAt(updatedAt) : '–'}- </Text>- </Flexbox>- </Block>- </WorkspaceLink>+ )}+ </Flexbox>+ ) : (+ <div />+ )}+ <Text className={cardStyles.updatedAt} fontSize={12}>+ {updatedAt ? formatUpdatedAt(updatedAt) : '–'}+ </Text>+ </Flexbox>+ </Block>+ </WorkspaceLink>+ </ContextMenuTrigger>);},);diff --git a/src/features/AgentViewAll/AgentRow.tsx b/src/features/AgentViewAll/AgentRow.tsxindex c47f8909c33..ea43946a3c5 100644--- a/src/features/AgentViewAll/AgentRow.tsx+++ b/src/features/AgentViewAll/AgentRow.tsx@@ -2,27 +2,34 @@import { AGENT_CHAT_URL, DEFAULT_AVATAR, GROUP_CHAT_URL } from '@lobechat/const';import { type SidebarAgentItem } from '@lobechat/types';-import { ActionIcon, Avatar, Flexbox, Text } from '@lobehub/ui';+import {+ ActionIcon,+ Avatar,+ ContextMenuTrigger,+ Flexbox,+ type MenuProps,+ Text,+ Tooltip,+} from '@lobehub/ui';import { createStaticStyles, cssVar } from 'antd-style';import dayjs from 'dayjs';import { EyeIcon, EyeOffIcon } from 'lucide-react';-import { memo, type MouseEvent, useCallback, useState } from 'react';+import { memo, type MouseEvent, useCallback, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';import WorkspaceLink from '@/features/Workspace/WorkspaceLink';import AgentAvatar from './AgentAvatar';import ItemActions from './ItemActions';+import LabelTags from './LabelTags';-/** Shared column widths so the table header and rows stay aligned. */-export const AUTHOR_COL_WIDTH = 180;-export const TIME_COL_WIDTH = 130;-export const ACTION_COL_WIDTH = 88;+/** Fixed action-column width (sidebar-eye toggle only) so rows stay aligned. */+export const ACTION_COL_WIDTH = 40;++/** Author avatar slot — reserved even when the author is unknown. */+const AUTHOR_COL_WIDTH = 20;const styles = createStaticStyles(({ css, cssVar }) => ({- description: css`- max-width: min(720px, 100%);- `,// The link spans the name column (not the whole row) — a management list// is for scanning and acting, and a full-row link turns clicks on the// author / timestamp / action columns into a navigation. The name column@@ -53,9 +60,20 @@ const styles = createStaticStyles(({ css, cssVar }) => ({background: ${cssVar.colorFillTertiary};}`,+ /**+ * Reserved width, right-aligned: "3 天前" and "2026-07-22" differ by ~30px,+ * and a content-sized column puts the author avatar and the label pills at a+ * different x on every row. `min-width` (not `width`) so an unusually long+ * relative string — en's "a few seconds ago" — grows instead of truncating.+ */updatedAt: css`flex: none;++ min-width: 88px;+color: ${cssVar.colorTextQuaternary};+ text-align: end;+ white-space: nowrap;`,}));@@ -89,9 +107,20 @@ interface AgentRowProps {const AgentRow = memo<AgentRowProps>(({ author, item, onToggleSidebar, showAuthor, sidebarHidden }) => {const { t } = useTranslation('common');- const { description, id, title, type, updatedAt } = item;+ const { id, title, type, updatedAt } = item;const [anchor, setAnchor] = useState<HTMLElement | null>(null);+ // Right-click support (Task-List-style): the hook-bearing menu mounts on+ // the ROW's pointer-enter (which always precedes a right-click) and hands+ // its filtered items back via ref for the ContextMenuTrigger.+ const [menuActivated, setMenuActivated] = useState(false);+ const activateMenu = useCallback(() => setMenuActivated(true), []);+ const menuItemsRef = useRef<(() => MenuProps['items']) | null>(null);+ const handleMenuReady = useCallback((getItems: () => MenuProps['items']) => {+ menuItemsRef.current = getItems;+ }, []);+ const getContextMenuItems = useCallback(() => menuItemsRef.current?.() ?? [], []);+const handleToggleSidebar = useCallback((e: MouseEvent) => {e.stopPropagation();@@ -101,73 +130,99 @@ const AgentRow = memo<AgentRowProps>();return (- <Flexbox horizontal align={'center'} className={styles.row} gap={12} ref={setAnchor}>- <WorkspaceLink- aria-label={title || undefined}- className={styles.identity}- to={type === 'group' ? GROUP_CHAT_URL(id) : AGENT_CHAT_URL(id, false)}+ <ContextMenuTrigger items={getContextMenuItems}>+ <Flexbox+ horizontal+ align={'center'}+ className={styles.row}+ gap={12}+ ref={setAnchor}+ onPointerEnter={activateMenu}>- <AgentAvatar item={item} size={36} />- <Flexbox flex={1} gap={2} style={{ minWidth: 0 }}>- <Text ellipsis className={'agent-row-title'} weight={500}>- {title || t('agentViewAll.untitled')}- </Text>- {description && (- <Text ellipsis className={styles.description} fontSize={12} type={'secondary'}>- {description}+ <WorkspaceLink+ aria-label={title || undefined}+ className={styles.identity}+ to={type === 'group' ? GROUP_CHAT_URL(id) : AGENT_CHAT_URL(id, false)}+ >+ <AgentAvatar item={item} size={28} />+ <Flexbox flex={1} style={{ minWidth: 0 }}>+ {/* Single-line row (Linear-style density) — the description only+ renders in card mode, where there is room to browse. */}+ <Text ellipsis className={'agent-row-title'} weight={500}>+ {title || t('agentViewAll.untitled')}</Text>+ </Flexbox>+ </WorkspaceLink>+ {/* Trailing cluster (Task-list-style): label pills + author avatar ++ update time as one tight right-aligned group. */}+ <Flexbox+ horizontal+ align={'center'}+ flex={'none'}+ gap={8}+ justify={'flex-end'}+ style={{ maxWidth: 420, overflow: 'hidden' }}+ >+ <LabelTags labels={item.labels} />+ {showAuthor && (+ // The slot is reserved even without an author, so an unknown+ // author doesn't shift the row's label pills sideways.+ <Flexbox flex={'none'} style={{ width: AUTHOR_COL_WIDTH }}>+ {author && (+ <Tooltip title={author.name}>+ <Avatar avatar={author.avatar || DEFAULT_AVATAR} size={AUTHOR_COL_WIDTH} />+ </Tooltip>+ )}+ </Flexbox>)}+ <Text+ className={styles.updatedAt}+ fontSize={12}+ title={updatedAt ? dayjs(updatedAt).format('YYYY-MM-DD HH:mm') : undefined}+ >+ {updatedAt ? formatUpdatedAt(updatedAt) : '–'}+ </Text></Flexbox>- </WorkspaceLink>- {showAuthor && (<Flexboxhorizontalalign={'center'}flex={'none'}- gap={6}- style={{ width: AUTHOR_COL_WIDTH }}+ gap={4}+ style={{ width: ACTION_COL_WIDTH }}>- {author ? (- <>- <Avatar avatar={author.avatar || DEFAULT_AVATAR} size={20} />- <Text ellipsis fontSize={12} type={'secondary'}>- {author.name}- </Text>- </>- ) : (- <Text fontSize={12} type={'secondary'}>- –- </Text>+ {onToggleSidebar && (+ <ActionIcon+ color={cssVar.colorTextSecondary}+ icon={sidebarHidden ? EyeOffIcon : EyeIcon}+ size={'small'}+ // Hidden agents read as faded, mirroring the customize-sidebar+ // modal's 0.5-opacity treatment of hidden rows.+ style={{ opacity: sidebarHidden ? 0.5 : undefined }}+ title={+ sidebarHidden+ ? t('agentViewAll.addToSidebar')+ : t('agentViewAll.removeFromSidebar')+ }+ onClick={handleToggleSidebar}+ />)}- </Flexbox>- )}- <Text className={styles.updatedAt} fontSize={12} style={{ width: TIME_COL_WIDTH }}>- {updatedAt ? formatUpdatedAt(updatedAt) : '–'}- </Text>- <Flexbox- horizontal- align={'center'}- flex={'none'}- gap={4}- style={{ width: ACTION_COL_WIDTH }}- >- {onToggleSidebar && (- <ActionIcon- color={cssVar.colorTextSecondary}- icon={sidebarHidden ? EyeOffIcon : EyeIcon}- size={'small'}- // Hidden agents read as faded, mirroring the customize-sidebar- // modal's 0.5-opacity treatment of hidden rows.- style={{ opacity: sidebarHidden ? 0.5 : undefined }}- title={- sidebarHidden ? t('agentViewAll.addToSidebar') : t('agentViewAll.removeFromSidebar')- }- onClick={handleToggleSidebar}+ {/* Headless: the row's context menu is the only actions entry. It+ carries the sidebar toggle too — the eye icon above is a fast+ single-click path, but right-click is where users look for the+ row's actions, and the toggle went missing there. */}+ <ItemActions+ hideTrigger+ anchor={anchor}+ forceActivated={menuActivated}+ includeSidebarToggle={Boolean(onToggleSidebar)}+ item={item}+ sidebarHidden={sidebarHidden}+ onMenuReady={handleMenuReady}+ onToggleSidebar={onToggleSidebar}/>- )}- <ItemActions anchor={anchor} item={item} />+ </Flexbox></Flexbox>- </Flexbox>+ </ContextMenuTrigger>);},);diff --git a/src/features/AgentViewAll/AgentViewAllPage.tsx b/src/features/AgentViewAll/AgentViewAllPage.tsxindex 5316c869559..9cab5d026bd 100644--- a/src/features/AgentViewAll/AgentViewAllPage.tsx+++ b/src/features/AgentViewAll/AgentViewAllPage.tsx@@ -1,11 +1,13 @@'use client';+import { DEFAULT_AVATAR } from '@lobechat/const';import { type SidebarAgentItem } from '@lobechat/types';-import { Center, Empty, Flexbox, Icon, SearchBar, Text, Tooltip } from '@lobehub/ui';-import { Button, DropdownMenu, Segmented } from '@lobehub/ui/base-ui';+import { Avatar, Center, Empty, Flexbox, Icon, SearchBar, Text, Tooltip } from '@lobehub/ui';+import { Button, DropdownMenu, Segmented, toast } from '@lobehub/ui/base-ui';+import { createStaticStyles, cssVar, cx } from 'antd-style';import dayjs from 'dayjs';import isEqual from 'fast-deep-equal';-import { ChevronDownIcon, PlusIcon } from 'lucide-react';+import { ChevronDownIcon, ChevronRightIcon, PlusIcon } from 'lucide-react';import { memo, useCallback, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';import { useSearchParams } from 'react-router';@@ -15,8 +17,10 @@ import { useWorkspaceMembers } from '@/business/client/hooks/useWorkspaceMembersimport NavHeader from '@/features/NavHeader';import SkeletonList from '@/features/NavPanel/components/SkeletonList';import WideScreenContainer from '@/features/WideScreenContainer';+import { useFetchAgentLabels } from '@/hooks/useFetchAgentLabels';import { useFetchAgentList } from '@/hooks/useFetchAgentList';import { usePermission } from '@/hooks/usePermission';+import { useKeepSidebarGroupsListed } from '@/routes/(main)/home/_layout/Body/Agent/List/useAgentList';import { AgentModalProvider } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';import { useSidebarItemVisibility } from '@/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility';import { useCreateMenuItems } from '@/routes/(main)/home/_layout/hooks';@@ -31,11 +35,109 @@ import AgentRow, { type AgentRowAuthor } from './AgentRow';import { flattenAgentBuckets } from './flattenBuckets';import ListConfig from './ListConfig';import { type AgentListViewOptions, normalizeAgentListViewOptions } from './listViewOptions';-import TableHeader from './TableHeader';+import SidebarAgentsSection from './SidebarAgentsSection';type SegmentValue = 'private' | 'workspace';type ViewMode = 'card' | 'list';+interface GroupHeaderProps {+ /** Author avatar for author-grouping headers (Linear-style). */+ avatar?: string | null;+ collapsed: boolean;+ color?: string | null;+ count: number;+ /** Position in the group list — drives the alternating bar tint. */+ index: number;+ label: string;+ onToggle: () => void;+}++// Linear-style group header: a full-width subtle bar with chevron ++// identity (color dot / avatar) + name + count.+const groupHeaderStyles = createStaticStyles(({ css, cssVar }) => ({+ bar: css`+ cursor: pointer;+ user-select: none;++ width: 100%;+ padding-block: 8px;+ padding-inline: 12px;+ border-radius: ${cssVar.borderRadiusLG};++ transition: background 0.15s;+ `,+ // Alternating tints (mirrors Linear's group striping).+ barEven: css`+ background: ${cssVar.colorFillQuaternary};++ &:hover {+ background: ${cssVar.colorFillTertiary};+ }+ `,+ barOdd: css`+ background: ${cssVar.colorFillTertiary};++ &:hover {+ background: ${cssVar.colorFillSecondary};+ }+ `,+}));++const GroupHeader = memo<GroupHeaderProps>(+ ({ avatar, collapsed, color, count, index, label, onToggle }) => (+ <Flexbox+ horizontal+ align={'center'}+ gap={8}+ className={cx(+ groupHeaderStyles.bar,+ index % 2 === 0 ? groupHeaderStyles.barEven : groupHeaderStyles.barOdd,+ )}+ onClick={onToggle}+ >+ <Icon+ color={cssVar.colorTextSecondary}+ icon={collapsed ? ChevronRightIcon : ChevronDownIcon}+ size={14}+ />+ {avatar ? (+ <Avatar avatar={avatar} size={20} />+ ) : color ? (+ <span+ style={{+ background: color,+ borderRadius: '50%',+ display: 'inline-block',+ height: 9,+ width: 9,+ }}+ />+ ) : null}+ <Text fontSize={13} weight={500}>+ {label}+ </Text>+ <Text fontSize={12} type={'secondary'}>+ {count}+ </Text>+ </Flexbox>+ ),+);++GroupHeader.displayName = 'AgentViewAllGroupHeader';++// Bucket tab label: name plus how many agents the tab would list, in the same+// muted-count style the group headers use.+const SegmentLabel = memo<{ count: number; label: string }>(({ count, label }) => (+ <Flexbox horizontal align={'center'} gap={6}>+ {label}+ <Text fontSize={12} type={'secondary'}>+ {count}+ </Text>+ </Flexbox>+));++SegmentLabel.displayName = 'AgentViewAllSegmentLabel';+const AgentViewAllPage = memo(() => {const { t } = useTranslation('common');const activeWorkspaceId = useActiveWorkspaceId();@@ -80,6 +182,7 @@ const AgentViewAllPage = memo(() => {// The sidebar usually owns these fetches, but this page must survive a// direct deep link — SWR dedupes when both are mounted.useFetchAgentList();+ useFetchAgentLabels();const useFetchWorkspaceUserPreference = useUserStore((s) => s.useFetchWorkspaceUserPreference);useFetchWorkspaceUserPreference();@@ -95,6 +198,7 @@ const AgentViewAllPage = memo(() => {);const { isSidebarItemVisible, setSidebarItemVisible } = useSidebarItemVisibility();+ const keepGroups = useKeepSidebarGroupsListed();const workspaceItems = useMemo(() => flattenAgentBuckets(pinnedAgents, agentGroups, ungroupedAgents),@@ -107,6 +211,40 @@ const AgentViewAllPage = memo(() => {const items = activeWorkspaceId && segment === 'private' ? privateItems : workspaceItems;+ // "In sidebar" overview data: everything visible in the sidebar across BOTH+ // the workspace and private buckets — the block answers "what's in my+ // sidebar right now", so it ignores the tab and the search keyword (it+ // hides entirely while searching to keep results scannable).+ const sidebarItems = useMemo(() => {+ // Rebuilt from folder-filtered buckets rather than reusing the page's+ // flattened lists: hiding a Category removes its whole section from the+ // sidebar, so its agents are not "in sidebar" either. The page's own list+ // deliberately keeps showing them — hiding is a sidebar-only preference.+ const inSidebar = [+ ...flattenAgentBuckets(pinnedAgents, keepGroups(agentGroups), ungroupedAgents),+ ...flattenAgentBuckets(+ privatePinnedAgents,+ keepGroups(privateAgentGroups),+ privateUngroupedAgents,+ ),+ ];+ const seen = new Set<string>();+ return inSidebar.filter((item) => {+ if (seen.has(item.id) || !isSidebarItemVisible(item)) return false;+ seen.add(item.id);+ return true;+ });+ }, [+ agentGroups,+ isSidebarItemVisible,+ keepGroups,+ pinnedAgents,+ privateAgentGroups,+ privatePinnedAgents,+ privateUngroupedAgents,+ ungroupedAgents,+ ]);+// Author info (column, grouping, sorting) only means something on the// workspace tab — every private item is the viewer's own.const showAuthor = !!activeWorkspaceId && segment !== 'private';@@ -131,7 +269,24 @@ const AgentViewAllPage = memo(() => {// author controls are hidden) — coerce back to visible defaults instead of// sorting by an invisible key with a select value that has no option.const { orderDirection, showSidebarHidden } = viewOptions;- const groupBy = showAuthor ? viewOptions.groupBy : 'none';++ // Tab counts describe how big each bucket is, so they follow the persisted+ // hidden-agent setting (what the tab would list) but ignore the keyword —+ // searching narrows the list below, it doesn't shrink the buckets.+ const bucketCounts = useMemo(() => {+ const count = (list: SidebarAgentItem[]) =>+ showSidebarHidden ? list.length : list.filter(isSidebarItemVisible).length;+ return { private: count(privateItems), workspace: count(workspaceItems) };+ }, [workspaceItems, privateItems, showSidebarHidden, isSidebarItemVisible]);++ // Label grouping works on every tab (labels exist in personal mode too);+ // author grouping only makes sense where the author column shows.+ const groupBy =+ showAuthor || viewOptions.groupBy === 'label'+ ? viewOptions.groupBy+ : viewOptions.groupBy === 'author'+ ? 'none'+ : viewOptions.groupBy;const orderBy =!showAuthor && viewOptions.orderBy === 'author' ? 'updatedAt' : viewOptions.orderBy;const effectiveViewOptions = useMemo(@@ -177,28 +332,102 @@ const AgentViewAllPage = memo(() => {// already sorted, so buckets keep the in-group order; groups themselves// read alphabetically.const groupedItems = useMemo(() => {- if (!activeWorkspaceId || groupBy !== 'author' || segment === 'private') return null;- const buckets = new Map<string, SidebarAgentItem[]>();- for (const item of filteredItems) {- const key = item.userId ?? '';- const bucket = buckets.get(key);- if (bucket) bucket.push(item);- else buckets.set(key, [item]);+ if (groupBy === 'author') {+ if (!activeWorkspaceId || segment === 'private') return null;+ const buckets = new Map<string, SidebarAgentItem[]>();+ for (const item of filteredItems) {+ const key = item.userId ?? '';+ const bucket = buckets.get(key);+ if (bucket) bucket.push(item);+ else buckets.set(key, [item]);+ }+ const groups = [...buckets.entries()].map(([userId, groupItems]) => ({+ // Same fallback as the row avatars — a member without a profile+ // avatar still gets the default one instead of a bare name.+ avatar: (userId && authorByUserId.get(userId)?.avatar) || DEFAULT_AVATAR,+ color: undefined as string | null | undefined,+ items: groupItems,+ key: `author:${userId || 'unknown'}`,+ label:+ (userId && authorByUserId.get(userId)?.name) || t('agentViewAll.groupBy.unknownAuthor'),+ }));+ return groups.sort((a, b) => a.label.localeCompare(b.label));+ }++ if (groupBy === 'label') {+ // Label sections: an agent carrying several labels appears once per+ // label (mirrors Linear); unlabeled items collect in a trailing bucket.+ const buckets = new Map<+ string,+ { color?: string | null; items: SidebarAgentItem[]; label: string }+ >();+ const unlabeled: SidebarAgentItem[] = [];+ for (const item of filteredItems) {+ const itemLabels = item.labels ?? [];+ if (itemLabels.length === 0) {+ unlabeled.push(item);+ continue;+ }+ for (const label of itemLabels) {+ const bucket = buckets.get(label.id);+ if (bucket) bucket.items.push(item);+ else buckets.set(label.id, { color: label.color, items: [item], label: label.name });+ }+ }+ const groups = [...buckets.entries()]+ .map(([labelId, bucket]) => ({+ avatar: null as string | null,+ color: bucket.color,+ items: bucket.items,+ key: `label:${labelId}`,+ label: bucket.label,+ }))+ .sort((a, b) => a.label.localeCompare(b.label));+ if (unlabeled.length > 0)+ groups.push({+ avatar: null,+ color: undefined,+ items: unlabeled,+ key: 'label:none',+ label: t('agentViewAll.groupBy.noLabel'),+ });+ return groups;}- const groups = [...buckets.entries()].map(([userId, groupItems]) => ({- items: groupItems,- key: userId || 'unknown',- label:- (userId && authorByUserId.get(userId)?.name) || t('agentViewAll.groupBy.unknownAuthor'),- }));- return groups.sort((a, b) => a.label.localeCompare(b.label));++ return null;}, [activeWorkspaceId, groupBy, segment, filteredItems, authorByUserId, t]);+ // Group collapse state — groups default to COLLAPSED (mirrors Linear), so+ // the EXPANDED keys are what persists (systemStatus): a reload keeps opened+ // groups open, and newly appearing groups start collapsed.+ const expandedGroupKeys = useGlobalStore(+ systemStatusSelectors.agentListExpandedGroupKeys,+ isEqual,+ );+ const expandedGroupSet = useMemo(() => new Set(expandedGroupKeys), [expandedGroupKeys]);+ const toggleGroupCollapsed = useCallback(+ (key: string) => {+ const next = expandedGroupSet.has(key)+ ? expandedGroupKeys.filter((item) => item !== key)+ : [...expandedGroupKeys, key];+ updateSystemStatus({ agentListExpandedGroupKeys: next }, 'toggleAgentListGroupExpanded');+ },+ [expandedGroupKeys, expandedGroupSet, updateSystemStatus],+ );+const handleToggleSidebar = useCallback(- (item: SidebarAgentItem) => {- void setSidebarItemVisible(item.id, !isSidebarItemVisible(item));+ async (item: SidebarAgentItem) => {+ try {+ await setSidebarItemVisible(item.id, !isSidebarItemVisible(item));+ } catch (error) {+ // Personal mode writes the preference optimistically and never rolls+ // back, workspace mode rolls back silently — either way the row's+ // state stops matching what was saved, so say so.+ console.error('Failed to toggle Agent sidebar visibility:', error);+ toast.error(t('operationFailed'));+ }},- [isSidebarItemVisible, setSidebarItemVisible],+ [isSidebarItemVisible, setSidebarItemVisible, t],);const renderCard = useCallback(@@ -286,6 +515,9 @@ const AgentViewAllPage = memo(() => {}/><WideScreenContainer gap={16} paddingBlock={16} wrapperStyle={{ flex: 1, overflowY: 'auto' }}>+ {isInit && !keyword.trim() && sidebarItems.length > 0 && (+ <SidebarAgentsSection items={sidebarItems} onToggleSidebar={handleToggleSidebar} />+ )}<Flexbox horizontal align={'center'} gap={12} justify={'space-between'}>{/* The workspace/private split only exists inside a workspace;personal mode leads with the search box instead. */}@@ -293,8 +525,24 @@ const AgentViewAllPage = memo(() => {<Segmentedvalue={segment}options={[- { label: t('navPanel.publicAgents'), value: 'workspace' },- { label: t('navPanel.privateAgents'), value: 'private' },+ {+ label: (+ <SegmentLabel+ count={bucketCounts.workspace}+ label={t('navPanel.publicAgents')}+ />+ ),+ value: 'workspace',+ },+ {+ label: (+ <SegmentLabel+ count={bucketCounts.private}+ label={t('navPanel.privateAgents')}+ />+ ),+ value: 'private',+ },]}onChange={(value) => handleSegmentChange(value as SegmentValue)}/>@@ -344,47 +592,52 @@ const AgentViewAllPage = memo(() => {</Center>) : viewMode === 'card' ? (groupedItems ? (- <Flexbox gap={24}>- {groupedItems.map((group) => (- <Flexbox gap={12} key={group.key}>- <Flexbox horizontal align={'center'} gap={6}>- <Text fontSize={13} weight={500}>- {group.label}- </Text>- <Text fontSize={12} type={'secondary'}>- {group.items.length}- </Text>+ <Flexbox gap={8}>+ {groupedItems.map((group, index) => {+ const collapsed = !expandedGroupSet.has(group.key);+ return (+ <Flexbox gap={12} key={group.key}>+ <GroupHeader+ avatar={group.avatar}+ collapsed={collapsed}+ color={group.color}+ count={group.items.length}+ index={index}+ label={group.label}+ onToggle={() => toggleGroupCollapsed(group.key)}+ />+ {!collapsed && (+ <div className={cardStyles.grid}>{group.items.map(renderCard)}</div>+ )}</Flexbox>- <div className={cardStyles.grid}>{group.items.map(renderCard)}</div>- </Flexbox>- ))}+ );+ })}</Flexbox>) : (<div className={cardStyles.grid}>{filteredItems.map(renderCard)}</div>)) : (- <Flexbox gap={2}>- <TableHeader showAuthor={showAuthor} />+ // Grouped list shares the card branch's wrapper rhythm (outer gap 8,+ // bare GroupHeader) so toggling the view mode doesn't shift the bars.+ <Flexbox gap={groupedItems ? 8 : 2}>{groupedItems- ? groupedItems.map((group) => (- <Flexbox gap={2} key={group.key}>- <Flexbox- horizontal- align={'center'}- gap={6}- paddingBlock={8}- paddingInline={12}- >- <Text fontSize={13} weight={500}>- {group.label}- </Text>- <Text fontSize={12} type={'secondary'}>- {group.items.length}- </Text>+ ? groupedItems.map((group, index) => {+ const collapsed = !expandedGroupSet.has(group.key);+ return (+ <Flexbox gap={2} key={group.key}>+ <GroupHeader+ avatar={group.avatar}+ collapsed={collapsed}+ color={group.color}+ count={group.items.length}+ index={index}+ label={group.label}+ onToggle={() => toggleGroupCollapsed(group.key)}+ />+ {!collapsed && group.items.map(renderRow)}</Flexbox>- {group.items.map(renderRow)}- </Flexbox>- ))+ );+ }): filteredItems.map(renderRow)}</Flexbox>)}diff --git a/src/features/AgentViewAll/ItemActions.tsx b/src/features/AgentViewAll/ItemActions.tsxindex cb042ace059..d6fbc687080 100644--- a/src/features/AgentViewAll/ItemActions.tsx+++ b/src/features/AgentViewAll/ItemActions.tsx@@ -36,11 +36,30 @@ interface ItemActionsProps {/** Element the rename EditingPopover anchors to (the card / row root). */anchor: HTMLElement | null;/**- * Merge the sidebar show/hide toggle in as the first menu item (card mode).- * List mode keeps the standalone eye icon next to this menu instead.+ * Activate the real (hook-bearing) menu from outside — the row/card sets+ * this on its own pointer-enter so a right-click anywhere on it has the+ * menu ready, not just after hovering the "…" trigger.+ */+ forceActivated?: boolean;+ /**+ * Headless mode: mount the menu machinery (for the right-click trigger via+ * `onMenuReady`) without rendering the "…" button — the context menu is the+ * only entry.+ */+ hideTrigger?: boolean;+ /**+ * Merge the sidebar show/hide toggle in as the first menu item. Every+ * surface that can toggle sets it: cards have no other affordance, and rows+ * carry the standalone eye icon as a shortcut but still need the action+ * where users look for a row's actions — its right-click menu.*/includeSidebarToggle?: boolean;item: SidebarAgentItem;+ /**+ * Hands the filtered menu-items getter back to the row/card, which feeds it+ * to its ContextMenuTrigger so right-click shows the same menu as "…".+ */+ onMenuReady?: (getItems: () => MenuProps['items']) => void;onToggleSidebar?: (item: SidebarAgentItem) => void;sidebarHidden?: boolean;}@@ -51,7 +70,15 @@ interface ActionsDropdownProps extends Omit<ItemActionsProps, 'anchor'> {/** Shared "…" trigger: adapts a sidebar item menu for the flat view-all list. */const ActionsDropdown = memo<ActionsDropdownProps>(- ({ getMenuItems, includeSidebarToggle, item, onToggleSidebar, sidebarHidden }) => {+ ({+ getMenuItems,+ hideTrigger,+ includeSidebarToggle,+ item,+ onMenuReady,+ onToggleSidebar,+ sidebarHidden,+ }) => {const { t } = useTranslation('common');const items = useMemo(@@ -84,6 +111,13 @@ const ActionsDropdown = memo<ActionsDropdownProps>([getMenuItems, includeSidebarToggle, item, onToggleSidebar, sidebarHidden, t],);+ // Expose the same filtered items to the row/card's right-click trigger.+ useEffect(() => {+ onMenuReady?.(items);+ }, [items, onMenuReady]);++ if (hideTrigger) return null;+return (<DropdownMenu items={items}><ActionIcon icon={EllipsisIcon} size={'small'} />@@ -117,6 +151,8 @@ const AgentItemActions = memo<ItemActionsProps>(({ anchor, item, ...rest }) => {backgroundColor: backgroundColor || undefined,group: undefined,id,+ labels: item.labels,+ labelsEnabled: true,openCreateGroupModal: handleOpenCreateGroupModal,pinned: pinned ?? false,slug,@@ -168,15 +204,16 @@ GroupItemActions.displayName = 'GroupItemActions';* so the real menu is mounted by the time it is needed.*/const ItemActions = memo<ItemActionsProps>((props) => {- const [activated, setActivated] = useState(false);+ const [selfActivated, setSelfActivated] = useState(false);+ const activated = selfActivated || props.forceActivated;const containerRef = useRef<HTMLSpanElement>(null);const refocusPending = useRef(false);- const activate = useCallback(() => setActivated(true), []);+ const activate = useCallback(() => setSelfActivated(true), []);const activateFromFocus = useCallback(() => {// Swapping the focused placeholder subtree drops keyboard focus — note// it so the effect below can move focus onto the real trigger.refocusPending.current = true;- setActivated(true);+ setSelfActivated(true);}, []);useEffect(() => {@@ -193,7 +230,7 @@ const ItemActions = memo<ItemActionsProps>((props) => {) : (<AgentItemActions {...props} />)- ) : (+ ) : props.hideTrigger ? null : (<span onFocus={activateFromFocus} onPointerEnter={activate}><ActionIcon icon={EllipsisIcon} size={'small'} /></span>diff --git a/src/features/AgentViewAll/LabelTags.tsx b/src/features/AgentViewAll/LabelTags.tsxnew file mode 100644index 00000000000..362b6fab81b--- /dev/null+++ b/src/features/AgentViewAll/LabelTags.tsx@@ -0,0 +1,55 @@+'use client';++import { type SidebarAgentLabel } from '@lobechat/types';+import { createStaticStyles } from 'antd-style';+import { memo } from 'react';++const styles = createStaticStyles(({ css, cssVar }) => ({+ dot: css`+ flex: none;++ width: 7px;+ height: 7px;+ border-radius: 50%;++ background: ${cssVar.colorFill};+ `,+ tag: css`+ display: inline-flex;+ gap: 5px;+ align-items: center;++ max-width: 140px;+ padding-block: 1px;+ padding-inline: 8px;+ border: 1px solid ${cssVar.colorBorderSecondary};+ border-radius: 999px;++ font-size: 11px;+ color: ${cssVar.colorTextSecondary};+ white-space: nowrap;+ `,+}));++/** Pill-style label tags (color dot + name), shared by list rows and cards. */+const LabelTags = memo<{ labels?: SidebarAgentLabel[] }>(({ labels }) => {+ if (!labels?.length) return null;++ return (+ <>+ {labels.map((label) => (+ <span className={styles.tag} key={label.id}>+ <span+ className={styles.dot}+ style={label.color ? { background: label.color } : undefined}+ />+ {label.name}+ </span>+ ))}+ </>+ );+});++LabelTags.displayName = 'AgentLabelTags';++export default LabelTags;diff --git a/src/features/AgentViewAll/ListConfig.tsx b/src/features/AgentViewAll/ListConfig.tsxindex f7338f8c0e6..2e0ca16ce77 100644--- a/src/features/AgentViewAll/ListConfig.tsx+++ b/src/features/AgentViewAll/ListConfig.tsx@@ -48,9 +48,12 @@ const ListConfig = memo<ListConfigProps>(const groupingOptions = useMemo<Array<{ label: string; value: AgentGroupBy }>>(() => [{ label: t('agentViewAll.groupBy.none'), value: 'none' },- { label: t('agentViewAll.groupBy.author'), value: 'author' },+ ...(showAuthor+ ? [{ label: t('agentViewAll.groupBy.author'), value: 'author' as const }]+ : []),+ { label: t('agentViewAll.groupBy.label'), value: 'label' },],- [t],+ [showAuthor, t],);const orderOptions = useMemo<Array<{ label: string; value: AgentOrderBy }>>(() => [@@ -64,24 +67,20 @@ const ListConfig = memo<ListConfigProps>();const formItems: FormItemProps[] = [- ...(showAuthor- ? [- {- children: (- <Select- options={groupingOptions}- size={'small'}- style={{ width: 150 }}- value={options.groupBy}- onChange={(value: AgentGroupBy) => {- setOptions((prev) => ({ ...prev, groupBy: value }));- }}- />- ),- label: t('agentViewAll.form.grouping'),- } satisfies FormItemProps,- ]- : []),+ {+ children: (+ <Select+ options={groupingOptions}+ size={'small'}+ style={{ width: 150 }}+ value={options.groupBy}+ onChange={(value: AgentGroupBy) => {+ setOptions((prev) => ({ ...prev, groupBy: value }));+ }}+ />+ ),+ label: t('agentViewAll.form.grouping'),+ },{children: (<Flexbox horizontal align={'center'} gap={8}>diff --git a/src/features/AgentViewAll/SidebarAgentsSection.tsx b/src/features/AgentViewAll/SidebarAgentsSection.tsxnew file mode 100644index 00000000000..0e31917cbb5--- /dev/null+++ b/src/features/AgentViewAll/SidebarAgentsSection.tsx@@ -0,0 +1,221 @@+'use client';++import { AGENT_CHAT_URL, GROUP_CHAT_URL } from '@lobechat/const';+import { type SidebarAgentItem } from '@lobechat/types';+import { Block, ContextMenuTrigger, Flexbox, Icon, type MenuProps, Text } from '@lobehub/ui';+import { createStaticStyles, cssVar, responsive } from 'antd-style';+import { ChevronDownIcon, ChevronUpIcon } from 'lucide-react';+import { memo, useCallback, useRef, useState } from 'react';+import { useTranslation } from 'react-i18next';++import WorkspaceLink from '@/features/Workspace/WorkspaceLink';+import { useGlobalStore } from '@/store/global';+import { systemStatusSelectors } from '@/store/global/selectors';++import AgentAvatar from './AgentAvatar';+import ItemActions from './ItemActions';++// "In sidebar" overview: a collapsible card grid pinned above the main list+// so the user can see at a glance which agents currently show in the sidebar+// (mirrors the enabled-providers block on the provider settings page).+const styles = createStaticStyles(({ css, cssVar }) => ({+ /* The headless ItemActions still renders an empty span; keeping it out of+ the flex flow stops it from claiming a `gap` and shifting the centering. */+ actions: css`+ position: absolute;+ inset-block-start: 0;+ inset-inline-end: 0;+ `,+ card: css`+ position: relative;++ display: flex;+ flex-direction: column;+ gap: 6px;+ align-items: stretch;+ justify-content: center;++ /* Uniform height across the grid; a card without a description centers its+ title instead of leaving a hole where the description would be. */+ min-height: 72px;+ padding-block: 10px;+ padding-inline: 12px;++ transition:+ transform 0.18s,+ box-shadow 0.18s,+ border-color 0.18s;++ &:hover {+ transform: translateY(-1px);+ box-shadow: 0 4px 12px rgb(0 0 0 / 6%);+ }+ `,+ container: css`+ padding: 12px;+ border-radius: ${cssVar.borderRadiusLG};+ background: ${cssVar.colorFillQuaternary};+ `,+ description: css`+ overflow: hidden;+ display: -webkit-box;+ -webkit-box-orient: vertical;+ -webkit-line-clamp: 1;++ line-height: 1.5;+ `,+ grid: css`+ display: grid;+ grid-template-columns: repeat(3, minmax(0, 1fr));+ gap: 12px;++ width: 100%;+ min-width: 0;++ ${responsive.md} {+ grid-template-columns: repeat(2, minmax(0, 1fr));+ }++ ${responsive.sm} {+ grid-template-columns: minmax(0, 1fr);+ }+ `,+ header: css`+ cursor: pointer;+ user-select: none;+ `,+ link: css`+ display: block;+ min-width: 0;+ color: inherit;+ `,+}));++interface SidebarMiniCardProps {+ item: SidebarAgentItem;+ onToggleSidebar?: (item: SidebarAgentItem) => void;+}++// Deliberately minimal (avatar + name + description only) — the block answers+// "what's in my sidebar", so the full card's labels/author/date are noise here.+// Actions live entirely in the right-click menu (same as rows/cards).+const SidebarMiniCard = memo<SidebarMiniCardProps>(({ item, onToggleSidebar }) => {+ const { t } = useTranslation('common');+ const { description, id, title, type } = item;+ const [anchor, setAnchor] = useState<HTMLElement | null>(null);++ const [menuActivated, setMenuActivated] = useState(false);+ const activateMenu = useCallback(() => setMenuActivated(true), []);+ const menuItemsRef = useRef<(() => MenuProps['items']) | null>(null);+ const handleMenuReady = useCallback((getItems: () => MenuProps['items']) => {+ menuItemsRef.current = getItems;+ }, []);+ const getContextMenuItems = useCallback(() => menuItemsRef.current?.() ?? [], []);++ return (+ <ContextMenuTrigger items={getContextMenuItems}>+ {/* Single child: the trigger wraps exactly one element, and the grid+ treats it as one cell. The headless ItemActions lives INSIDE it —+ rendering it as a sibling would add a phantom grid item. */}+ <WorkspaceLink+ aria-label={title || undefined}+ className={styles.link}+ ref={setAnchor}+ to={type === 'group' ? GROUP_CHAT_URL(id) : AGENT_CHAT_URL(id, false)}+ onPointerEnter={activateMenu}+ >+ <Block clickable className={styles.card} height={'100%'} variant={'outlined'}>+ <Flexbox horizontal align={'center'} gap={8} style={{ minWidth: 0 }}>+ <AgentAvatar item={item} size={24} />+ <Text ellipsis style={{ flex: 1, minWidth: 0 }} weight={600}>+ {title || t('agentViewAll.untitled')}+ </Text>+ </Flexbox>+ {description ? (+ <Text className={styles.description} fontSize={12} type={'secondary'}>+ {description}+ </Text>+ ) : null}+ <span className={styles.actions}>+ <ItemActions+ hideTrigger+ includeSidebarToggle+ anchor={anchor}+ forceActivated={menuActivated}+ item={item}+ sidebarHidden={false}+ onMenuReady={handleMenuReady}+ onToggleSidebar={onToggleSidebar}+ />+ </span>+ </Block>+ </WorkspaceLink>+ </ContextMenuTrigger>+ );+});++SidebarMiniCard.displayName = 'SidebarMiniCard';++interface SidebarAgentsSectionProps {+ items: SidebarAgentItem[];+ onToggleSidebar?: (item: SidebarAgentItem) => void;+}++const SidebarAgentsSection = memo<SidebarAgentsSectionProps>(({ items, onToggleSidebar }) => {+ const { t } = useTranslation('common');+ const collapsed = useGlobalStore(systemStatusSelectors.agentListSidebarSectionCollapsed);+ const updateSystemStatus = useGlobalStore((s) => s.updateSystemStatus);+ const toggle = useCallback(+ () =>+ updateSystemStatus(+ { agentListSidebarSectionCollapsed: !collapsed },+ 'toggleAgentListSidebarSection',+ ),+ [collapsed, updateSystemStatus],+ );++ return (+ <Flexbox className={styles.container} gap={12}>+ <Flexbox+ horizontal+ align={'center'}+ className={styles.header}+ gap={8}+ justify={'space-between'}+ onClick={toggle}+ >+ <Flexbox horizontal align={'center'} gap={8}>+ <Text fontSize={13} weight={500}>+ {t('agentViewAll.sidebarSection.title')}+ </Text>+ <Text fontSize={12} type={'secondary'}>+ {items.length}+ </Text>+ </Flexbox>+ <Flexbox horizontal align={'center'} gap={4}>+ <Text fontSize={12} type={'secondary'}>+ {collapsed+ ? t('agentViewAll.sidebarSection.expand')+ : t('agentViewAll.sidebarSection.collapse')}+ </Text>+ <Icon+ color={cssVar.colorTextSecondary}+ icon={collapsed ? ChevronDownIcon : ChevronUpIcon}+ size={14}+ />+ </Flexbox>+ </Flexbox>+ {!collapsed && (+ <div className={styles.grid}>+ {items.map((item) => (+ <SidebarMiniCard item={item} key={item.id} onToggleSidebar={onToggleSidebar} />+ ))}+ </div>+ )}+ </Flexbox>+ );+});++SidebarAgentsSection.displayName = 'SidebarAgentsSection';++export default SidebarAgentsSection;diff --git a/src/features/AgentViewAll/TableHeader.tsx b/src/features/AgentViewAll/TableHeader.tsxdeleted file mode 100644index ee04db376e9..00000000000--- a/src/features/AgentViewAll/TableHeader.tsx+++ /dev/null@@ -1,54 +0,0 @@-'use client';--import { Flexbox, Text } from '@lobehub/ui';-import { createStaticStyles } from 'antd-style';-import { memo } from 'react';-import { useTranslation } from 'react-i18next';--import { ACTION_COL_WIDTH, AUTHOR_COL_WIDTH, TIME_COL_WIDTH } from './AgentRow';--const styles = createStaticStyles(({ css, cssVar }) => ({- header: css`- padding-block: 4px;- padding-inline: 12px;- border-block-end: 1px solid ${cssVar.colorBorderSecondary};- `,-}));--interface TableHeaderProps {- showAuthor?: boolean;-}--// Plain column labels — ordering lives in the display-config popover, so the-// header carries no sort affordance.-const TableHeader = memo<TableHeaderProps>(({ showAuthor }) => {- const { t } = useTranslation('common');-- return (- <Flexbox horizontal align={'center'} className={styles.header} gap={12}>- <Flexbox flex={1}>- <Text fontSize={12} type={'secondary'}>- {t('agentViewAll.columns.name')}- </Text>- </Flexbox>- {showAuthor && (- <Flexbox flex={'none'} style={{ width: AUTHOR_COL_WIDTH }}>- <Text fontSize={12} type={'secondary'}>- {t('agentViewAll.columns.author')}- </Text>- </Flexbox>- )}- <Flexbox flex={'none'} style={{ width: TIME_COL_WIDTH }}>- <Text fontSize={12} type={'secondary'}>- {t('agentViewAll.columns.updatedAt')}- </Text>- </Flexbox>- {/* Action column keeps its width but shows no label. */}- <div style={{ flex: 'none', width: ACTION_COL_WIDTH }} />- </Flexbox>- );-});--TableHeader.displayName = 'AgentViewAllTableHeader';--export default TableHeader;diff --git a/src/features/AgentViewAll/listViewOptions.ts b/src/features/AgentViewAll/listViewOptions.tsindex 8befd0bdbf6..8212b562fed 100644--- a/src/features/AgentViewAll/listViewOptions.ts+++ b/src/features/AgentViewAll/listViewOptions.ts@@ -1,4 +1,4 @@-export type AgentGroupBy = 'author' | 'none';+export type AgentGroupBy = 'author' | 'label' | 'none';export type AgentOrderBy = 'author' | 'title' | 'updatedAt';export type AgentOrderDirection = 'asc' | 'desc';@@ -17,7 +17,7 @@ export const DEFAULT_AGENT_LIST_VIEW_OPTIONS: AgentListViewOptions = {showSidebarHidden: true,};-const AGENT_GROUP_BY_SET = new Set<AgentGroupBy>(['author', 'none']);+const AGENT_GROUP_BY_SET = new Set<AgentGroupBy>(['author', 'label', 'none']);const AGENT_ORDER_BY_SET = new Set<AgentOrderBy>(['author', 'title', 'updatedAt']);const AGENT_ORDER_DIRECTION_SET = new Set<AgentOrderDirection>(['asc', 'desc']);diff --git a/src/features/CommandMenu/SearchResults.tsx b/src/features/CommandMenu/SearchResults.tsxindex 8f6f28f3bc0..04083525f69 100644--- a/src/features/CommandMenu/SearchResults.tsx+++ b/src/features/CommandMenu/SearchResults.tsx@@ -35,6 +35,7 @@ import { markdownToTxt } from '@/utils/markdownToTxt';import { CommandItem } from './components';import { styles } from './styles';+import { shouldShowMarketplaceFallback } from './utils/marketplaceFallback';import { type ValidSearchType } from './utils/queryParser';interface SearchResultsProps {@@ -605,10 +606,14 @@ const SearchResults = memo<SearchResultsProps>(</Command.Group>)}- {/* The aggregate search is DB-only, so marketplace hits never appear- above; keep permanent typed-search entries as the visible route into- marketplace discovery. */}- {!typeFilter && (+ {/* Marketplace typed-search entries as the no-result fallback; see+ shouldShowMarketplaceFallback for the rationale. */}+ {shouldShowMarketplaceFallback({+ hasLocalTopicResults,+ hasResults,+ isLoading,+ typeFilter,+ }) && (<Command.Group forceMount>{renderSearchMore('mcp', mcpResults.length)}{renderSearchMore('plugin', pluginResults.length)}diff --git a/src/features/CommandMenu/index.tsx b/src/features/CommandMenu/index.tsxindex 4f5ee42266f..0544a86a099 100644--- a/src/features/CommandMenu/index.tsx+++ b/src/features/CommandMenu/index.tsx@@ -133,8 +133,9 @@ const CommandMenuContent = memo<CommandMenuContentProps>(({ isClosing, onClose }<Command.List ref={listRef}>{/* Hide cmdk's Empty when we have search results or are loading them,since force-mounted items aren't counted by cmdk's internal filter.- The unfiltered search view also always renders the permanent- marketplace entries, so it is never truly empty. */}+ The unfiltered search view also renders the marketplace fallback+ entries whenever the search settles with no results, so it is+ never truly empty. */}{!(hasSearch &&(searchResults.length > 0 ||diff --git a/src/features/CommandMenu/utils/marketplaceFallback.test.ts b/src/features/CommandMenu/utils/marketplaceFallback.test.tsnew file mode 100644index 00000000000..003700f0f60--- /dev/null+++ b/src/features/CommandMenu/utils/marketplaceFallback.test.ts@@ -0,0 +1,32 @@+import { describe, expect, it } from 'vitest';++import { shouldShowMarketplaceFallback } from './marketplaceFallback';++const base = {+ hasLocalTopicResults: false,+ hasResults: false,+ isLoading: false,+ typeFilter: undefined,+};++describe('shouldShowMarketplaceFallback', () => {+ it('should show once the search settles with no results', () => {+ expect(shouldShowMarketplaceFallback(base)).toBe(true);+ });++ it('should hide when the search has results', () => {+ expect(shouldShowMarketplaceFallback({ ...base, hasResults: true })).toBe(false);+ });++ it('should hide when local generation topics match', () => {+ expect(shouldShowMarketplaceFallback({ ...base, hasLocalTopicResults: true })).toBe(false);+ });++ it('should hide while the search is still loading', () => {+ expect(shouldShowMarketplaceFallback({ ...base, isLoading: true })).toBe(false);+ });++ it('should hide when a type filter is active', () => {+ expect(shouldShowMarketplaceFallback({ ...base, typeFilter: 'mcp' })).toBe(false);+ });+});diff --git a/src/features/CommandMenu/utils/marketplaceFallback.ts b/src/features/CommandMenu/utils/marketplaceFallback.tsnew file mode 100644index 00000000000..ef29129f70f--- /dev/null+++ b/src/features/CommandMenu/utils/marketplaceFallback.ts@@ -0,0 +1,21 @@+interface MarketplaceFallbackState {+ hasLocalTopicResults: boolean;+ hasResults: boolean;+ isLoading: boolean;+ typeFilter: string | undefined;+}++/**+ * The aggregate search is DB-only, so marketplace hits never appear in its+ * results; the typed-search entries (MCP / plugin / community agent) are the+ * fallback route into marketplace discovery. Only surface them once the+ * aggregate search has settled with no results — they must not crowd out+ * real matches or the loading skeleton.+ */+export const shouldShowMarketplaceFallback = ({+ hasLocalTopicResults,+ hasResults,+ isLoading,+ typeFilter,+}: MarketplaceFallbackState): boolean =>+ !typeFilter && !hasResults && !hasLocalTopicResults && !isLoading;diff --git a/src/features/Home/AgentSelect/useHomeAgentRows.test.ts b/src/features/Home/AgentSelect/useHomeAgentRows.test.tsindex 36d4398f888..05a74cb9aba 100644--- a/src/features/Home/AgentSelect/useHomeAgentRows.test.ts+++ b/src/features/Home/AgentSelect/useHomeAgentRows.test.ts@@ -22,6 +22,7 @@ const mocks = vi.hoisted(() => ({ungroupedAgents: [] as any[],},sidebarHiddenAgentIds: [] as string[],+ sidebarHiddenGroupIds: [] as string[],sidebarVisibilityOverrides: {} as Record<string, boolean>,}));@@ -55,7 +56,10 @@ vi.mock('@/store/home', () => ({vi.mock('@/store/user', () => ({useUserStore: (selector: (state: unknown) => unknown) =>selector({- preference: { sidebarHiddenAgentIds: mocks.sidebarHiddenAgentIds },+ preference: {+ sidebarHiddenAgentIds: mocks.sidebarHiddenAgentIds,+ sidebarHiddenGroupIds: mocks.sidebarHiddenGroupIds,+ },updatePreference: vi.fn(),updateWorkspaceUserPreference: vi.fn(),userId: mocks.currentUserId,@@ -64,8 +68,12 @@ vi.mock('@/store/user', () => ({vi.mock('@/store/user/selectors', () => ({workspaceUserSettingsSelectors: {+ // `useKeepSidebarGroupsListed` reaches through to the group-visibility+ // hook, which now gates writes on the loaded preference workspace.+ preferenceWorkspaceId: () => mocks.activeWorkspaceId ?? null,sidebarAgentVisibilityOverrides: () => mocks.sidebarVisibilityOverrides,sidebarHiddenAgentIds: () => mocks.sidebarHiddenAgentIds,+ sidebarHiddenGroupIds: () => mocks.sidebarHiddenGroupIds,},userProfileSelectors: { userId: (state: { userId: string }) => state.userId },}));@@ -93,6 +101,7 @@ describe('useHomeAgentRows', () => {mocks.activeWorkspaceId = undefined;mocks.currentUserId = 'member-1';mocks.sidebarHiddenAgentIds = [];+ mocks.sidebarHiddenGroupIds = [];mocks.sidebarVisibilityOverrides = {};mocks.agentState.agentMap = { agt_inbox: { title: 'Lobe AI' } };mocks.homeState.agentGroups = [];@@ -137,7 +146,7 @@ describe('useHomeAgentRows', () => {expect(ids(result.current.workspaceRows)).toEqual(['agt_inbox', 'agt_a']);});- it('hides another member Agent by default and shows it after an explicit override', () => {+ it("lists another member's Agent by default and hides it after an explicit override", () => {mocks.activeWorkspaceId = 'ws_1';mocks.homeState.ungroupedAgents = [agent('agt_own', 'Own'),@@ -146,12 +155,25 @@ describe('useHomeAgentRows', () => {const { rerender, result } = renderHook(() => useHomeAgentRows());- expect(ids(result.current.workspaceRows)).toEqual(['agt_inbox', 'agt_own']);+ expect(ids(result.current.workspaceRows)).toEqual(['agt_inbox', 'agt_own', 'agt_shared']);- mocks.sidebarVisibilityOverrides = { agt_shared: true };+ mocks.sidebarVisibilityOverrides = { agt_shared: false };rerender();- expect(ids(result.current.workspaceRows)).toEqual(['agt_inbox', 'agt_own', 'agt_shared']);+ expect(ids(result.current.workspaceRows)).toEqual(['agt_inbox', 'agt_own']);+ });++ it('drops the agents inside a Category the caller hid', () => {+ mocks.activeWorkspaceId = 'ws_1';+ mocks.homeState.agentGroups = [+ { id: 'grp_shown', items: [agent('agt_shown', 'Shown')], name: 'Shown' },+ { id: 'grp_hidden', items: [agent('agt_in_hidden', 'In hidden')], name: 'Hidden' },+ ];+ mocks.sidebarHiddenGroupIds = ['grp_hidden'];++ const { result } = renderHook(() => useHomeAgentRows());++ expect(ids(result.current.workspaceRows)).toEqual(['agt_inbox', 'agt_shown']);});it('keeps a single flat bucket in personal mode', () => {diff --git a/src/features/Home/AgentSelect/useHomeAgentRows.ts b/src/features/Home/AgentSelect/useHomeAgentRows.tsindex 004e3aa40c4..e13fb84b275 100644--- a/src/features/Home/AgentSelect/useHomeAgentRows.ts+++ b/src/features/Home/AgentSelect/useHomeAgentRows.ts@@ -7,7 +7,10 @@ import { useTranslation } from 'react-i18next';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import { DEFAULT_INBOX_AVATAR } from '@/const/meta';-import { useKeepSidebarListed } from '@/routes/(main)/home/_layout/Body/Agent/List/useAgentList';+import {+ useKeepSidebarGroupsListed,+ useKeepSidebarListed,+} from '@/routes/(main)/home/_layout/Body/Agent/List/useAgentList';import { useAgentStore } from '@/store/agent';import { agentSelectors, builtinAgentSelectors } from '@/store/agent/selectors';import { useHomeStore } from '@/store/home';@@ -54,10 +57,11 @@ export const useHomeAgentRows = (): HomeAgentRows => {const activeWorkspaceId = useActiveWorkspaceId();- // Drop the caller's "removed from my sidebar" items, exactly like the sidebar- // lists and the agent-detail switcher do — a hidden agent must not resurface- // in the home switcher.+ // Drop the caller's "removed from my sidebar" items and folders, exactly like+ // the sidebar lists and the agent-detail switcher do — a hidden agent (or an+ // agent inside a hidden Category) must not resurface in the home switcher.const keep = useKeepSidebarListed();+ const keepGroups = useKeepSidebarGroupsListed();return useMemo(() => {const seen = new Set<string>();@@ -87,7 +91,7 @@ export const useHomeAgentRows = (): HomeAgentRows => {const privateRows = collect([privatePinnedAgents,- privateAgentGroups.flatMap((group) => group.items),+ keepGroups(privateAgentGroups).flatMap((group) => group.items),privateUngroupedAgents,]);@@ -104,7 +108,11 @@ export const useHomeAgentRows = (): HomeAgentRows => {});}workspaceRows.push(- ...collect([pinnedAgents, agentGroups.flatMap((group) => group.items), ungroupedAgents]),+ ...collect([+ pinnedAgents,+ keepGroups(agentGroups).flatMap((group) => group.items),+ ungroupedAgents,+ ]),);return {@@ -121,6 +129,7 @@ export const useHomeAgentRows = (): HomeAgentRows => {inboxAgentId,inboxMeta,keep,+ keepGroups,pinnedAgents,privateAgentGroups,privatePinnedAgents,diff --git a/src/features/SettingsSearch/items.ts b/src/features/SettingsSearch/items.tsindex 9b35a761473..fea15b686c1 100644--- a/src/features/SettingsSearch/items.ts+++ b/src/features/SettingsSearch/items.ts@@ -50,6 +50,7 @@ export const TAB_SEARCH_EN_KEYWORDS: Partial<Record<SettingsTabs, string[]>> = {[SettingsTabs.About]: ['about', 'version', 'changelog', 'feedback', 'help'],[SettingsTabs.Advanced]: ['advanced', 'developer', 'diagnostics'],[SettingsTabs.APIKey]: ['api key', 'apikey', 'token', 'secret'],+ [SettingsTabs.Labels]: ['label', 'labels', 'tag', 'tags', 'group', 'grouping'],[SettingsTabs.Appearance]: ['appearance','theme',@@ -140,6 +141,7 @@ export const TAB_SEARCH_KEYWORDS_KEYS: Partial<Record<SettingsTabs, string>> = {[SettingsTabs.Credits]: 'settingsSearch.tabKeywords.credits',[SettingsTabs.Creds]: 'settingsSearch.tabKeywords.creds',[SettingsTabs.Devices]: 'settingsSearch.tabKeywords.devices',+ [SettingsTabs.Labels]: 'settingsSearch.tabKeywords.labels',[SettingsTabs.Hotkey]: 'settingsSearch.tabKeywords.hotkey',[SettingsTabs.Memory]: 'settingsSearch.tabKeywords.memory',[SettingsTabs.Messenger]: 'settingsSearch.tabKeywords.messenger',diff --git a/src/features/Workspace/__tests__/workspaceAwarePath.test.ts b/src/features/Workspace/__tests__/workspaceAwarePath.test.tsindex 1ff32a85e23..e214ebf6856 100644--- a/src/features/Workspace/__tests__/workspaceAwarePath.test.ts+++ b/src/features/Workspace/__tests__/workspaceAwarePath.test.ts@@ -84,6 +84,7 @@ describe('buildWorkspaceAwarePath', () => {expect(buildWorkspaceAwarePath('/settings/skill', 'acme')).toBe('/acme/settings/skill');expect(buildWorkspaceAwarePath('/settings/connector', 'acme')).toBe('/acme/settings/connector');expect(buildWorkspaceAwarePath('/settings/devices', 'acme')).toBe('/acme/settings/devices');+ expect(buildWorkspaceAwarePath('/settings/labels', 'acme')).toBe('/acme/settings/labels');expect(buildWorkspaceAwarePath('/settings/audit-log', 'acme')).toBe('/acme/settings/audit-log');expect(buildWorkspaceAwarePath('/settings/storage', 'acme')).toBe('/acme/settings/storage');expect(buildWorkspaceAwarePath('/settings/credential', 'acme')).toBe(diff --git a/src/features/Workspace/workspaceAwarePath.ts b/src/features/Workspace/workspaceAwarePath.tsindex 0f01004420f..822a566205b 100644--- a/src/features/Workspace/workspaceAwarePath.ts+++ b/src/features/Workspace/workspaceAwarePath.ts@@ -42,6 +42,7 @@ export const WORKSPACE_SETTINGS_TABS: ReadonlySet<string> = new Set(['credits','devices','general',+ 'labels','members','notification','oauth-apps',diff --git a/src/features/WorkspaceSetting/Labels/DeleteLabelModal.tsx b/src/features/WorkspaceSetting/Labels/DeleteLabelModal.tsxnew file mode 100644index 00000000000..0425e5b3a53--- /dev/null+++ b/src/features/WorkspaceSetting/Labels/DeleteLabelModal.tsx@@ -0,0 +1,117 @@+import { type AgentLabelListItem } from '@lobechat/types';+import { type ModalProps } from '@lobehub/ui';+import { Flexbox, Input, stopPropagation, Text } from '@lobehub/ui';+import { Button, toast } from '@lobehub/ui/base-ui';+import { memo, useEffect, useState } from 'react';+import { useTranslation } from 'react-i18next';++import ImperativeModal from '@/components/ImperativeModal';+import { useHomeStore } from '@/store/home';++/** The word the user must type to arm the Delete button (mirrors Linear). */+const DELETE_CONFIRM_WORD = 'delete';++interface DeleteLabelModalProps extends Pick<ModalProps, 'open'> {+ label?: AgentLabelListItem;+ onClose: () => void;+}++/**+ * Destructive-delete confirm: deleting removes the label from every agent and+ * cannot be undone, so the modal requires typing `delete` and offers Archive+ * as the reversible alternative (mirrors the Linear flow in the issue spec).+ */+const DeleteLabelModal = memo<DeleteLabelModalProps>(({ label, open, onClose }) => {+ const { t } = useTranslation(['setting', 'common']);+ const [removeAgentLabel, updateAgentLabel] = useHomeStore((s) => [+ s.removeAgentLabel,+ s.updateAgentLabel,+ ]);++ const [confirmText, setConfirmText] = useState('');+ const [loading, setLoading] = useState(false);+ const [archiving, setArchiving] = useState(false);++ useEffect(() => {+ if (open) setConfirmText('');+ }, [open]);++ if (!label) return null;++ const armed = confirmText.trim().toLowerCase() === DELETE_CONFIRM_WORD;++ const handleDelete = async () => {+ if (!armed) return;+ setLoading(true);+ try {+ await removeAgentLabel(label.id);+ toast.success(t('workspaceSetting.labels.delete.success'));+ onClose();+ } catch (error) {+ console.error('Failed to delete label:', error);+ toast.error(t('operationFailed', { ns: 'common' }));+ } finally {+ setLoading(false);+ }+ };++ const handleArchive = async () => {+ setArchiving(true);+ try {+ await updateAgentLabel(label.id, { archived: true });+ toast.success(t('workspaceSetting.labels.archive.success'));+ onClose();+ } catch (error) {+ console.error('Failed to archive label:', error);+ toast.error(t('operationFailed', { ns: 'common' }));+ } finally {+ setArchiving(false);+ }+ };++ return (+ <div onClick={stopPropagation}>+ <ImperativeModal+ destroyOnHidden+ open={open}+ title={t('workspaceSetting.labels.delete.title', { name: label.name })}+ width={460}+ footer={+ <Flexbox horizontal align={'center'} gap={8} justify={'space-between'} width={'100%'}>+ <Button loading={archiving} onClick={handleArchive}>+ {t('workspaceSetting.labels.actions.archive')}+ </Button>+ <Flexbox horizontal gap={8}>+ <Button onClick={onClose}>{t('cancel', { ns: 'common' })}</Button>+ <Button danger disabled={!armed} loading={loading} onClick={handleDelete}>+ {t('delete', { ns: 'common' })}+ </Button>+ </Flexbox>+ </Flexbox>+ }+ onCancel={onClose}+ >+ <Flexbox gap={12} paddingBlock={8}>+ <Text>+ {label.usageCount > 0+ ? t('workspaceSetting.labels.delete.descUsed', { count: label.usageCount })+ : t('workspaceSetting.labels.delete.desc')}+ </Text>+ <Text type={'secondary'}>{t('workspaceSetting.labels.delete.archiveHint')}</Text>+ <Text>{t('workspaceSetting.labels.delete.confirmHint')}</Text>+ <Input+ autoFocus+ placeholder={DELETE_CONFIRM_WORD}+ value={confirmText}+ onChange={(e) => setConfirmText(e.target.value)}+ onPressEnter={handleDelete}+ />+ </Flexbox>+ </ImperativeModal>+ </div>+ );+});++DeleteLabelModal.displayName = 'DeleteLabelModal';++export default DeleteLabelModal;diff --git a/src/features/WorkspaceSetting/Labels/LabelFormModal.tsx b/src/features/WorkspaceSetting/Labels/LabelFormModal.tsxnew file mode 100644index 00000000000..d5a13434db5--- /dev/null+++ b/src/features/WorkspaceSetting/Labels/LabelFormModal.tsx@@ -0,0 +1,181 @@+import { type AgentLabelListItem } from '@lobechat/types';+import { type ModalProps } from '@lobehub/ui';+import { Flexbox, Input, stopPropagation } from '@lobehub/ui';+import { toast } from '@lobehub/ui/base-ui';+import { createStaticStyles, cx } from 'antd-style';+import { memo, useEffect, useState } from 'react';+import { useTranslation } from 'react-i18next';++import ImperativeModal from '@/components/ImperativeModal';+import { useHomeStore } from '@/store/home';++import { DEFAULT_LABEL_COLOR, isValidLabelColor, LABEL_COLOR_PRESETS } from './constants';+import { isDuplicateLabelNameError } from './errors';++const styles = createStaticStyles(({ css, cssVar }) => ({+ swatch: css`+ cursor: pointer;++ width: 20px;+ height: 20px;+ border: 2px solid transparent;+ border-radius: 50%;++ transition: transform 0.1s;++ &:hover {+ transform: scale(1.15);+ }+ `,+ swatchActive: css`+ border-color: ${cssVar.colorText};+ `,+}));++interface LabelFormModalProps extends Pick<ModalProps, 'open' | 'onCancel'> {+ /** Present when editing; absent when creating. */+ /**+ * When creating from an agent's Labels submenu, apply the new label to that+ * agent right away — creating "for" an agent and then having to reopen the+ * picker would be surprising.+ */+ assignTo?: { agentId: string; currentLabelIds: string[] };+ label?: AgentLabelListItem;+ /**+ * Opened from a failed restore: the label is archived and its old name is+ * taken, so saving must also flip `archived` back off — otherwise the user+ * renames it and still has to find the restore action again.+ */+ restoreOnSave?: boolean;+}++const LabelFormModal = memo<LabelFormModalProps>(+ ({ assignTo, label, open, onCancel, restoreOnSave }) => {+ const { t } = useTranslation(['setting', 'common']);+ const [createAgentLabel, toggleAgentLabel, updateAgentLabel] = useHomeStore((s) => [+ s.createAgentLabel,+ s.toggleAgentLabel,+ s.updateAgentLabel,+ ]);++ const [name, setName] = useState('');+ const [description, setDescription] = useState('');+ const [color, setColor] = useState<string>(DEFAULT_LABEL_COLOR);+ const [loading, setLoading] = useState(false);++ // Reset per open so the form reflects the target label (or a blank create).+ useEffect(() => {+ if (!open) return;+ setName(label?.name ?? '');+ setDescription(label?.description ?? '');+ setColor(label?.color ?? DEFAULT_LABEL_COLOR);+ }, [open, label]);++ return (+ <div onClick={stopPropagation}>+ <ImperativeModal+ destroyOnHidden+ okButtonProps={{ disabled: !name.trim() || !isValidLabelColor(color), loading }}+ open={open}+ width={420}+ title={+ restoreOnSave+ ? t('workspaceSetting.labels.form.restoreTitle')+ : label+ ? t('workspaceSetting.labels.form.editTitle')+ : t('workspaceSetting.labels.form.createTitle')+ }+ onCancel={onCancel}+ onOk={async (e) => {+ const trimmed = name.trim();+ if (!trimmed) return;++ setLoading(true);+ try {+ if (label) {+ await updateAgentLabel(label.id, {+ ...(restoreOnSave ? { archived: false } : {}),+ color,+ description: description.trim() || null,+ name: trimmed,+ });+ } else {+ const id = await createAgentLabel({+ color,+ description: description.trim() || undefined,+ name: trimmed,+ });+ if (assignTo && id) {+ // Delta, not `[...currentLabelIds, id]`: those ids were+ // captured when the modal opened, so replaying them as a full+ // set would delete anything another editor applied while the+ // user was typing.+ await toggleAgentLabel(assignTo.agentId, id, true);+ }+ }+ onCancel?.(e as any);+ } catch (error) {+ // Keep the modal open on a name clash — the user's next move is to+ // edit the name they already typed, not to start over.+ if (isDuplicateLabelNameError(error)) {+ toast.error(t('workspaceSetting.labels.form.duplicateName'));+ return;+ }+ console.error('Failed to save label:', error);+ toast.error(t('operationFailed', { ns: 'common' }));+ } finally {+ setLoading(false);+ }+ }}+ >+ <Flexbox gap={16} paddingBlock={8}>+ <Flexbox gap={8}>+ <span>{t('workspaceSetting.labels.form.name')}</span>+ <Input+ autoFocus+ maxLength={40}+ placeholder={t('workspaceSetting.labels.form.namePlaceholder')}+ value={name}+ onChange={(e) => setName(e.target.value)}+ />+ </Flexbox>+ <Flexbox gap={8}>+ <span>{t('workspaceSetting.labels.form.description')}</span>+ <Input+ maxLength={200}+ placeholder={t('workspaceSetting.labels.form.descriptionPlaceholder')}+ value={description}+ onChange={(e) => setDescription(e.target.value)}+ />+ </Flexbox>+ <Flexbox gap={8}>+ <span>{t('workspaceSetting.labels.form.color')}</span>+ <Flexbox horizontal align={'center'} gap={8} wrap={'wrap'}>+ {LABEL_COLOR_PRESETS.map((preset) => (+ <span+ aria-label={preset}+ className={cx(styles.swatch, color === preset && styles.swatchActive)}+ key={preset}+ role={'button'}+ style={{ background: preset }}+ onClick={() => setColor(preset)}+ />+ ))}+ <Input+ placeholder={'#RRGGBB'}+ style={{ width: 100 }}+ value={color}+ onChange={(e) => setColor(e.target.value)}+ />+ </Flexbox>+ </Flexbox>+ </Flexbox>+ </ImperativeModal>+ </div>+ );+ },+);++LabelFormModal.displayName = 'LabelFormModal';++export default LabelFormModal;diff --git a/src/features/WorkspaceSetting/Labels/constants.ts b/src/features/WorkspaceSetting/Labels/constants.tsnew file mode 100644index 00000000000..17bacef7096--- /dev/null+++ b/src/features/WorkspaceSetting/Labels/constants.ts@@ -0,0 +1,27 @@+/**+ * Preset label colors (Linear-inspired palette). Custom values are still+ * allowed through the form's free color input.+ */+export const LABEL_COLOR_PRESETS = [+ '#95999F', // gray+ '#4EA7FC', // blue+ '#26B5CE', // teal+ '#4CB782', // green+ '#F2C94C', // yellow+ '#F2994A', // orange+ '#F1573D', // red+ '#EB5A95', // pink+ '#B36BD4', // purple+ '#6771C5', // indigo+] as const;++export const DEFAULT_LABEL_COLOR = LABEL_COLOR_PRESETS[0];++/**+ * Mirrors the server's `hexColor` check. The value lands in an inline+ * `background`, so anything else is a CSS injection point — the server is the+ * gate, this only keeps the free-form input from submitting a value that is+ * bound to be rejected.+ */+export const isValidLabelColor = (value: string): boolean =>+ /^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(value);diff --git a/src/features/WorkspaceSetting/Labels/errors.ts b/src/features/WorkspaceSetting/Labels/errors.tsnew file mode 100644index 00000000000..168772c5bba--- /dev/null+++ b/src/features/WorkspaceSetting/Labels/errors.ts@@ -0,0 +1,8 @@+/**+ * Active label names are unique per scope (partial unique indexes that skip+ * archived rows), so the server answers a collision with CONFLICT /+ * `DUPLICATE_LABEL_NAME`. It reaches three flows: creating a label, renaming+ * one, and un-archiving one whose name has since been taken.+ */+export const isDuplicateLabelNameError = (error: any): boolean =>+ error?.data?.code === 'CONFLICT' || error?.message === 'DUPLICATE_LABEL_NAME';diff --git a/src/features/WorkspaceSetting/Labels/index.tsx b/src/features/WorkspaceSetting/Labels/index.tsxnew file mode 100644index 00000000000..603a09d7315--- /dev/null+++ b/src/features/WorkspaceSetting/Labels/index.tsx@@ -0,0 +1,384 @@+'use client';++import { type AgentLabelListItem } from '@lobechat/types';+import { ActionIcon, Empty, Flexbox, Icon, SearchBar, Text, Tooltip } from '@lobehub/ui';+import { Button, confirmModal, DropdownMenu, toast } from '@lobehub/ui/base-ui';+import { createStaticStyles } from 'antd-style';+import dayjs from 'dayjs';+import isEqual from 'fast-deep-equal';+import {+ ArchiveIcon,+ ArchiveRestoreIcon,+ CheckIcon,+ EllipsisIcon,+ ListFilterIcon,+ PencilIcon,+ PlusIcon,+ Trash2Icon,+} from 'lucide-react';+import { memo, useMemo, useState } from 'react';+import { useTranslation } from 'react-i18next';++import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';+import SkeletonList from '@/features/NavPanel/components/SkeletonList';+import { useFetchAgentLabels } from '@/hooks/useFetchAgentLabels';+import { usePermission } from '@/hooks/usePermission';+import { useHomeStore } from '@/store/home';+import { agentLabelSelectors } from '@/store/home/selectors';++import DeleteLabelModal from './DeleteLabelModal';+import { isDuplicateLabelNameError } from './errors';+import LabelFormModal from './LabelFormModal';++const styles = createStaticStyles(({ css, cssVar }) => ({+ dot: css`+ flex: none;++ width: 10px;+ height: 10px;+ border-radius: 50%;++ background: ${cssVar.colorFill};+ `,+ row: css`+ padding-block: 10px;+ padding-inline: 12px;+ border-radius: ${cssVar.borderRadius};++ &:hover {+ background: ${cssVar.colorFillTertiary};+ }+ `,+}));++interface LabelRowProps {+ canManage: boolean;+ label: AgentLabelListItem;+ manageBlockedReason?: string;+ onDelete: (label: AgentLabelListItem) => void;+ onEdit: (label: AgentLabelListItem) => void;+ /** Restoring hit an active label with the same name — offer rename-and-restore. */+ onRestoreConflict: (label: AgentLabelListItem) => void;+}++/** Shared column widths so the header and rows stay aligned. */+const NAME_COL_WIDTH = 200;+const USAGE_COL_WIDTH = 88;+const CREATED_COL_WIDTH = 96;+const ACTION_COL_WIDTH = 32;++const LabelRow = memo<LabelRowProps>(+ ({ canManage, label, manageBlockedReason, onDelete, onEdit, onRestoreConflict }) => {+ const { t } = useTranslation(['setting', 'common']);+ const updateAgentLabel = useHomeStore((s) => s.updateAgentLabel);++ const toggleArchive = () => {+ if (label.archived) {+ // Unarchive is non-destructive — no confirm needed.+ updateAgentLabel(label.id, { archived: false }).catch((error) => {+ // The name freed up by archiving may have been taken since. Archived+ // labels have no Edit action, so without this the label would be+ // stuck: hand the user a rename-and-restore form instead of a+ // dead-end "operation failed".+ if (isDuplicateLabelNameError(error)) {+ onRestoreConflict(label);+ return;+ }+ toast.error(t('operationFailed', { ns: 'common' }));+ });+ return;+ }+ confirmModal({+ cancelText: t('cancel', { ns: 'common' }),+ content: t('workspaceSetting.labels.archive.desc'),+ okText: t('workspaceSetting.labels.actions.archive'),+ onOk: async () => {+ try {+ await updateAgentLabel(label.id, { archived: true });+ toast.success(t('workspaceSetting.labels.archive.success'));+ } catch (error) {+ console.error('Failed to archive label:', error);+ toast.error(t('operationFailed', { ns: 'common' }));+ }+ },+ title: t('workspaceSetting.labels.archive.title', { name: label.name }),+ });+ };++ // Archived labels are frozen: restore or delete only (mirrors Linear) —+ // editing would suggest they're still in active use.+ const menuItems = [+ ...(label.archived+ ? []+ : [+ {+ icon: <Icon icon={PencilIcon} />,+ key: 'edit',+ label: t('edit', { ns: 'common' }),+ onClick: () => onEdit(label),+ },+ ]),+ {+ icon: <Icon icon={label.archived ? ArchiveRestoreIcon : ArchiveIcon} />,+ key: 'archive',+ label: label.archived+ ? t('workspaceSetting.labels.actions.unarchive')+ : t('workspaceSetting.labels.actions.archive'),+ onClick: toggleArchive,+ },+ { type: 'divider' as const },+ {+ danger: true,+ icon: <Icon icon={Trash2Icon} />,+ key: 'delete',+ label: t('delete', { ns: 'common' }),+ onClick: () => onDelete(label),+ },+ ];++ const actions = canManage ? (+ <DropdownMenu items={menuItems}>+ <ActionIcon icon={EllipsisIcon} size={'small'} />+ </DropdownMenu>+ ) : (+ <Tooltip title={manageBlockedReason ?? t('workspaceSetting.labels.manageBlocked')}>+ <ActionIcon disabled icon={EllipsisIcon} size={'small'} />+ </Tooltip>+ );++ return (+ <Flexbox horizontal align={'center'} className={styles.row} gap={12}>+ <Flexbox+ horizontal+ align={'center'}+ flex={'none'}+ gap={12}+ style={{ width: NAME_COL_WIDTH }}+ >+ <span+ className={styles.dot}+ style={label.color ? { background: label.color } : undefined}+ />+ <Text ellipsis weight={500}>+ {label.name}+ </Text>+ </Flexbox>+ <Flexbox flex={1} style={{ minWidth: 0 }}>+ {label.description ? (+ <Text ellipsis fontSize={12} type={'secondary'}>+ {label.description}+ </Text>+ ) : null}+ </Flexbox>+ <Text+ fontSize={12}+ style={{ flex: 'none', textAlign: 'end', width: USAGE_COL_WIDTH }}+ type={'secondary'}+ >+ {t('workspaceSetting.labels.usage', { count: label.usageCount })}+ </Text>+ <Text+ fontSize={12}+ style={{ flex: 'none', textAlign: 'end', width: CREATED_COL_WIDTH }}+ type={'secondary'}+ >+ {dayjs(label.createdAt).format('YYYY-MM-DD')}+ </Text>+ <Flexbox align={'center'} flex={'none'} style={{ width: ACTION_COL_WIDTH }}>+ {actions}+ </Flexbox>+ </Flexbox>+ );+ },+);++LabelRow.displayName = 'WorkspaceLabelRow';++/** Column header row, aligned with LabelRow via the shared widths. */+const LabelTableHeader = memo(() => {+ const { t } = useTranslation('setting');++ return (+ <Flexbox horizontal align={'center'} gap={12} paddingInline={12} style={{ paddingBlock: 4 }}>+ <Text fontSize={12} style={{ flex: 'none', width: NAME_COL_WIDTH }} type={'secondary'}>+ {t('workspaceSetting.labels.columns.name')}+ </Text>+ <Text ellipsis fontSize={12} style={{ flex: 1, minWidth: 0 }} type={'secondary'}>+ {t('workspaceSetting.labels.columns.description')}+ </Text>+ <Text+ fontSize={12}+ style={{ flex: 'none', textAlign: 'end', width: USAGE_COL_WIDTH }}+ type={'secondary'}+ >+ {t('workspaceSetting.labels.columns.usage')}+ </Text>+ <Text+ fontSize={12}+ style={{ flex: 'none', textAlign: 'end', width: CREATED_COL_WIDTH }}+ type={'secondary'}+ >+ {t('workspaceSetting.labels.columns.created')}+ </Text>+ <span style={{ flex: 'none', width: ACTION_COL_WIDTH }} />+ </Flexbox>+ );+});++LabelTableHeader.displayName = 'WorkspaceLabelTableHeader';++/**+ * Workspace Settings → Labels — the agent-label registry management page:+ * create / edit (name, description, color), archive / unarchive, and+ * type-to-confirm delete with an archive escape hatch.+ */+const WorkspaceLabelsContent = memo(() => {+ const { t } = useTranslation(['setting', 'common']);+ const { error, isLoading, mutate } = useFetchAgentLabels();++ const isInit = useHomeStore(agentLabelSelectors.isLabelsInit);+ const allLabels = useHomeStore(agentLabelSelectors.allLabels, isEqual);++ // Inside a workspace, label management shares the workspace-settings gate:+ // admin/owner only, with buttons visible but disabled for members+ // (consistent with the rest of the settings surface). In personal mode the+ // registry belongs to the single user who owns it, so there is nobody to+ // gate against — `manage_settings` is a workspace-role signal and would+ // wrongly lock a personal user out of their own labels.+ const activeWorkspaceId = useActiveWorkspaceId();+ const { allowed: workspaceCanManage, reason: workspaceBlockedReason } =+ usePermission('manage_settings');+ const canManage = activeWorkspaceId ? workspaceCanManage : true;+ const manageBlockedReason = activeWorkspaceId ? workspaceBlockedReason : undefined;++ const [keyword, setKeyword] = useState('');+ // Linear-style scope filter: the default "workspace" scope lists active+ // labels; "archived" surfaces archived ones so they can be restored.+ const [scope, setScope] = useState<'archived' | 'workspace'>('workspace');+ const [formModal, setFormModal] = useState<{+ label?: AgentLabelListItem;+ open: boolean;+ restoreOnSave?: boolean;+ }>({+ open: false,+ });+ const [deleteTarget, setDeleteTarget] = useState<AgentLabelListItem | undefined>();++ const visibleLabels = useMemo(() => {+ const query = keyword.trim().toLowerCase();+ const matched = query+ ? allLabels.filter((label) => label.name.toLowerCase().includes(query))+ : allLabels;+ return matched.filter((label) => (scope === 'archived' ? label.archived : !label.archived));+ }, [allLabels, keyword, scope]);++ const renderRow = (label: AgentLabelListItem) => (+ <LabelRow+ canManage={canManage}+ key={label.id}+ label={label}+ manageBlockedReason={manageBlockedReason}+ onDelete={setDeleteTarget}+ onEdit={(target) => setFormModal({ label: target, open: true })}+ onRestoreConflict={(target) =>+ setFormModal({ label: target, open: true, restoreOnSave: true })+ }+ />+ );++ const newLabelButton = (+ <Button+ disabled={!canManage}+ icon={PlusIcon}+ type={'primary'}+ onClick={() => setFormModal({ open: true })}+ >+ {t('workspaceSetting.labels.actions.create')}+ </Button>+ );++ // The active-labels scope is named after where the registry lives, so it+ // reads "Workspace" for a team and "Personal" for a single user.+ const activeScopeLabel = t(+ activeWorkspaceId+ ? 'workspaceSetting.labels.scope.workspace'+ : 'workspaceSetting.labels.scope.personal',+ );+ const scopeLabel = (value: 'archived' | 'workspace') =>+ value === 'archived' ? t('workspaceSetting.labels.scope.archived') : activeScopeLabel;++ const scopeMenuItems = (['workspace', 'archived'] as const).map((value) => ({+ icon: value === scope ? <Icon icon={CheckIcon} /> : undefined,+ key: value,+ label: scopeLabel(value),+ onClick: () => setScope(value),+ }));++ return (+ <Flexbox gap={16}>+ <Flexbox horizontal align={'center'} gap={12} justify={'space-between'}>+ <Flexbox horizontal align={'center'} gap={8}>+ <SearchBar+ allowClear+ placeholder={t('workspaceSetting.labels.filterPlaceholder')}+ style={{ maxWidth: 240 }}+ value={keyword}+ onChange={(e) => setKeyword(e.target.value)}+ />+ <DropdownMenu items={scopeMenuItems}>+ <Button icon={ListFilterIcon}>{scopeLabel(scope)}</Button>+ </DropdownMenu>+ </Flexbox>+ {canManage ? (+ newLabelButton+ ) : (+ <Tooltip title={manageBlockedReason ?? t('workspaceSetting.labels.manageBlocked')}>+ {newLabelButton}+ </Tooltip>+ )}+ </Flexbox>+ {!isInit && isLoading ? (+ <SkeletonList rows={4} />+ ) : error && !isInit ? (+ // A failed load must not read as "you have no labels" — the two look+ // identical here and lead the user to create duplicates of labels that+ // already exist.+ <Flexbox align={'center'} gap={12} paddingBlock={40}>+ <Empty description={t('workspaceSetting.labels.loadFailed')} />+ <Button onClick={() => mutate()}>{t('retry', { ns: 'common' })}</Button>+ </Flexbox>+ ) : visibleLabels.length === 0 ? (+ <Empty+ style={{ paddingBlock: 40 }}+ description={+ keyword.trim()+ ? t('workspaceSetting.labels.filterEmpty')+ : scope === 'archived'+ ? t('workspaceSetting.labels.archivedEmpty')+ : t('workspaceSetting.labels.empty')+ }+ />+ ) : (+ <Flexbox gap={2}>+ <LabelTableHeader />+ {visibleLabels.map(renderRow)}+ </Flexbox>+ )}+ <LabelFormModal+ label={formModal.label}+ open={formModal.open}+ restoreOnSave={formModal.restoreOnSave}+ onCancel={() => setFormModal({ open: false })}+ />+ <DeleteLabelModal+ label={deleteTarget}+ open={!!deleteTarget}+ onClose={() => setDeleteTarget(undefined)}+ />+ </Flexbox>+ );+});++WorkspaceLabelsContent.displayName = 'WorkspaceLabelsContent';++export default WorkspaceLabelsContent;diff --git a/src/features/WorkspaceSetting/Layout.tsx b/src/features/WorkspaceSetting/Layout.tsxindex 13d511a21cd..d45a5703ef5 100644--- a/src/features/WorkspaceSetting/Layout.tsx+++ b/src/features/WorkspaceSetting/Layout.tsx@@ -19,6 +19,7 @@ const COMPACT_HEADER_TABS = new Set<string>([WorkspaceSettingsTabs.Credits,WorkspaceSettingsTabs.Devices,WorkspaceSettingsTabs.General,+ WorkspaceSettingsTabs.Labels,WorkspaceSettingsTabs.Members,WorkspaceSettingsTabs.Plans,WorkspaceSettingsTabs.ServiceModel,diff --git a/src/features/WorkspaceSetting/hooks/useCategory.tsx b/src/features/WorkspaceSetting/hooks/useCategory.tsxindex fccd4c6044f..81c20aab006 100644--- a/src/features/WorkspaceSetting/hooks/useCategory.tsx+++ b/src/features/WorkspaceSetting/hooks/useCategory.tsx@@ -16,6 +16,7 @@ import {MonitorSmartphoneIcon,ScrollText,Sparkles,+ TagIcon,Users,} from 'lucide-react';import { useMemo } from 'react';@@ -145,6 +146,13 @@ export const useWorkspaceSettingCategory = (): WorkspaceSettingCategoryGroup[] =key: WorkspaceSettingsTabs.Skill,label: t('workspaceSetting.tab.skill'),},+ // Label registry is readable by everyone; the page itself keeps+ // management actions behind the admin gate (disabled, not hidden).+ {+ icon: TagIcon,+ key: WorkspaceSettingsTabs.Labels,+ label: t('workspaceSetting.tab.labels'),+ },{icon: Blocks,key: WorkspaceSettingsTabs.Connector,diff --git a/src/hooks/useFetchAgentLabels.ts b/src/hooks/useFetchAgentLabels.tsnew file mode 100644index 00000000000..7f080162246--- /dev/null+++ b/src/hooks/useFetchAgentLabels.ts@@ -0,0 +1,20 @@+import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';+import { useHomeStore } from '@/store/home';+import { useUserStore } from '@/store/user';+import { authSelectors } from '@/store/user/slices/auth/selectors';++/**+ * Hook to fetch the agent label registry into the home store. Mounted by+ * every surface that renders labels (sidebar list, view-all page, settings) —+ * SWR dedupes concurrent mounts.+ *+ * Scoped by workspace: the registries are disjoint, so a switch must refetch+ * rather than reuse the previous scope's cache.+ */+export const useFetchAgentLabels = () => {+ const isLogin = useUserStore(authSelectors.isLogin);+ const workspaceId = useActiveWorkspaceId();+ const useFetchAgentLabelsHook = useHomeStore((s) => s.useFetchAgentLabels);++ return useFetchAgentLabelsHook(isLogin, workspaceId);+};diff --git a/src/libs/swr/keys.ts b/src/libs/swr/keys.tsindex 79c3a4f5c20..3222bfeb105 100644--- a/src/libs/swr/keys.ts+++ b/src/libs/swr/keys.ts@@ -177,6 +177,20 @@ export const agentKeys = {list: def('agent:list', (isLogin: boolean) => ['agent:list', isLogin]),};+// ---- agent labels -------------------------------------------------------+export const agentLabelKeys = {+ /**+ * Agent label registry (workspace-shared, or personal). Keyed by workspace:+ * the registries are disjoint per scope, so a shared key would serve the+ * previous workspace's labels across a switch.+ */+ list: def('agentLabel:list', (isLogin: boolean, workspaceId: string | null | undefined) => [+ 'agentLabel:list',+ isLogin,+ workspaceId ?? null,+ ]),+};+// ---- agent builder (opening-suggestion chips) ---------------------------// Kept off `CACHE_TIERS` on purpose — these are ephemeral LLM-generated chips.// `contextSummary` is intentionally NOT part of the key so config autosaves for@@ -1110,6 +1124,7 @@ export const swrKeys = {agentDocument: agentDocumentSWRKeys,agentHome: agentHomeKeys,agentKnowledge: agentKnowledgeKeys,+ agentLabel: agentLabelKeys,agentProfile: agentProfileKeys,agentSignal: agentSignalKeys,aiModel: aiModelKeys,diff --git a/src/routes/(main)/[workspaceSlug]/settings/labels/index.tsx b/src/routes/(main)/[workspaceSlug]/settings/labels/index.tsxnew file mode 100644index 00000000000..286b38a37ef--- /dev/null+++ b/src/routes/(main)/[workspaceSlug]/settings/labels/index.tsx@@ -0,0 +1,9 @@+'use client';++import WorkspaceLabelsContent from '@/features/WorkspaceSetting/Labels';++const WorkspaceLabelsSetting = () => <WorkspaceLabelsContent />;++WorkspaceLabelsSetting.displayName = 'WorkspaceLabelsSetting';++export default WorkspaceLabelsSetting;diff --git a/src/routes/(main)/agent/profile/features/Header/index.tsx b/src/routes/(main)/agent/profile/features/Header/index.tsxindex cb96aec8c58..b6a70b121d9 100644--- a/src/routes/(main)/agent/profile/features/Header/index.tsx+++ b/src/routes/(main)/agent/profile/features/Header/index.tsx@@ -247,10 +247,16 @@ const Header = memo(() => {},showPermissionPageEntry? {+ // Same gate the page itself applies (ResourceConfigAccessGate):+ // without edit-level access it redirects straight back with a+ // toast, so an enabled entry here is a click into a dead end.+ // Disabled, not hidden — the member can still see the action exists.+ disabled: !canEditResource,icon: <Icon icon={UsersIcon} />,key: 'permission',label: t('permission.page.entry', { ns: 'setting' }),onClick: () => {+ if (!canEditResource) return;if (activeAgentId) navigate(`/agent/${activeAgentId}/permission`);},}diff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.test.tsx b/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.test.tsxindex ece02cda2af..8bb2b96e906 100644--- a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.test.tsx+++ b/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.test.tsx@@ -16,6 +16,7 @@ const mocks = vi.hoisted(() => ({pinAgent: vi.fn(),refreshAgentList: vi.fn(),removeAgent: vi.fn(),+ toggleAgentLabel: vi.fn(),updateAgentGroup: vi.fn(),},navigate: vi.fn(),@@ -84,6 +85,10 @@ vi.mock('@/hooks/useResourceManageable', () => ({vi.mock('@/services/agent', () => ({ agentService: {} }));+vi.mock('@/routes/(main)/home/_layout/Body/Agent/ModalProvider', () => ({+ useOptionalAgentModal: () => null,+}));+vi.mock('@/store/global', () => ({useGlobalStore: (selector: (state: { openAgentInNewWindow: typeof vi.fn }) => unknown) =>selector({ openAgentInNewWindow: mocks.openAgentInNewWindow }),@@ -94,6 +99,9 @@ vi.mock('@/store/home', () => ({}));vi.mock('@/store/home/selectors', () => ({+ agentLabelSelectors: {+ allLabels: () => [],+ },homeAgentListSelectors: {agentGroups: () => [],privateAgentGroups: () => [],@@ -158,6 +166,69 @@ describe('useAgentDropdownMenu', () => {]);});+ it('shows the Labels submenu only where it is enabled (the agents list page)', () => {+ const { result } = renderHook(() =>+ useAgentDropdownMenu({+ anchor: null,+ group: undefined,+ id: 'agent-1',+ labelsEnabled: true,+ openCreateGroupModal: vi.fn(),+ pinned: false,+ title: 'Public Agent',+ userId: 'creator-1',+ visibility: 'public',+ }),+ );++ expect(getMenuKeys(result.current())).toContain('labels');+ });++ it('offers the Labels submenu on an agent the member cannot configure', () => {+ // Labelling is list organization, not configuration: a member with+ // view-only access to a teammate's public agent may still tag it, and the+ // server agrees (role scope only, no per-resource check).+ mocks.canEditResource = false;++ const { result } = renderHook(() =>+ useAgentDropdownMenu({+ anchor: null,+ group: undefined,+ id: 'agent-1',+ labelsEnabled: true,+ openCreateGroupModal: vi.fn(),+ pinned: false,+ title: 'Public Agent',+ userId: 'creator-1',+ visibility: 'public',+ }),+ );++ expect(getMenuKeys(result.current())).toContain('labels');+ });++ it('hides the Labels submenu from a viewer', () => {+ // The viewer role holds no `agent:update` grant, so the server refuses —+ // this is the line labelling still respects.+ mocks.canEdit = false;++ const { result } = renderHook(() =>+ useAgentDropdownMenu({+ anchor: null,+ group: undefined,+ id: 'agent-1',+ labelsEnabled: true,+ openCreateGroupModal: vi.fn(),+ pinned: false,+ title: 'Public Agent',+ userId: 'creator-1',+ visibility: 'public',+ }),+ );++ expect(getMenuKeys(result.current())).not.toContain('labels');+ });+it('keeps write actions hidden from a Workspace viewer', () => {mocks.canCreate = false;mocks.canEdit = false;diff --git a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx b/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsxindex c0bdb496882..52308b2f868 100644--- a/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx+++ b/src/routes/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx@@ -1,5 +1,9 @@import { BUILTIN_AGENT_SLUGS } from '@lobechat/builtin-agents';-import { SessionDefaultGroup, type SidebarVisibility } from '@lobechat/types';+import {+ SessionDefaultGroup,+ type SidebarAgentLabel,+ type SidebarVisibility,+} from '@lobechat/types';import { type MenuProps } from '@lobehub/ui';import { Icon } from '@lobehub/ui';import { confirmModal, toast } from '@lobehub/ui/base-ui';@@ -15,6 +19,8 @@ import {PictureInPicture2Icon,Pin,PinOff,+ Settings2Icon,+ TagIcon,Trash,UsersIcon,} from 'lucide-react';@@ -29,10 +35,11 @@ import VisibilityConfirmContent from '@/features/VisibilityConfirmContent';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { usePermission } from '@/hooks/usePermission';import { useResourceManageable } from '@/hooks/useResourceManageable';+import { useOptionalAgentModal } from '@/routes/(main)/home/_layout/Body/Agent/ModalProvider';import { agentService } from '@/services/agent';import { useGlobalStore } from '@/store/global';import { useHomeStore } from '@/store/home';-import { homeAgentListSelectors } from '@/store/home/selectors';+import { agentLabelSelectors, homeAgentListSelectors } from '@/store/home/selectors';import { useUserStore } from '@/store/user';import { userProfileSelectors } from '@/store/user/selectors';import { isForbiddenError, isOwnerOnlyForbiddenError } from '@/utils/forbiddenError';@@ -49,6 +56,14 @@ interface UseAgentDropdownMenuParams {backgroundColor?: string;group: string | undefined;id: string;+ /** Labels currently applied to the agent (from the sidebar list payload). */+ labels?: SidebarAgentLabel[];+ /**+ * Show the Labels submenu. Off by default: the sidebar renders no label+ * badges, so tagging there has no visible feedback — the submenu only+ * surfaces on the agents list page (ItemActions), where labels render.+ */+ labelsEnabled?: boolean;openCreateGroupModal: () => void;pinned: boolean;slug?: string | null;@@ -63,6 +78,8 @@ export const useAgentDropdownMenu = ({backgroundColor,group,id,+ labels,+ labelsEnabled,openCreateGroupModal,pinned,slug,@@ -85,12 +102,20 @@ export const useAgentDropdownMenu = ({isEqual,);const refreshAgentList = useHomeStore((s) => s.refreshAgentList);- const [pinAgent, duplicateAgent, updateAgentGroup, removeAgent] = useHomeStore((s) => [- s.pinAgent,- s.duplicateAgent,- s.updateAgentGroup,- s.removeAgent,- ]);+ const [pinAgent, duplicateAgent, updateAgentGroup, removeAgent, toggleAgentLabel] = useHomeStore(+ (s) => [s.pinAgent, s.duplicateAgent, s.updateAgentGroup, s.removeAgent, s.toggleAgentLabel],+ );++ // Label picker: the shared registry (archived labels only stay listed while+ // still applied to this agent, so they can be unchecked but not re-added).+ const registryLabels = useHomeStore(agentLabelSelectors.allLabels, isEqual);+ const agentModal = useOptionalAgentModal();+ const openCreateLabelModal = agentModal?.openCreateLabelModal;+ const assignedLabelIds = useMemo(() => new Set((labels ?? []).map((l) => l.id)), [labels]);+ const pickerLabels = useMemo(+ () => registryLabels.filter((label) => !label.archived || assignedLabelIds.has(label.id)),+ [registryLabels, assignedLabelIds],+ );// Visibility actions are only meaningful inside a workspace: in personal// mode every row is implicitly owner-private. "Publish to Workspace"@@ -117,6 +142,12 @@ export const useAgentDropdownMenu = ({// organization (pin/group) and duplication remain available to members.const { allowed: canEdit } = usePermission('edit_own_content');const { allowed: canCreate } = usePermission('create_content');+ // Label CRUD is admin-gated inside a workspace; personal mode has no such+ // gate, since the registry belongs to the single user who owns it and both+ // scopes now have a management page at `/settings/labels`.+ const { allowed: canManageLabels } = usePermission('manage_settings');+ const canCreateLabel =+ Boolean(openCreateLabelModal) && (activeWorkspaceId ? canManageLabels : true);const { canEditResource, isAccessResolved } = useResourceAccess('agent', id);const canConfigure = canEdit && isAccessResolved && canEditResource;@@ -257,6 +288,116 @@ export const useAgentDropdownMenu = ({},]: []),+ // Labels work in both scopes: workspace mode uses the shared+ // workspace registry, personal mode a personal one. Clicking an entry+ // toggles that label on the agent.+ //+ // Gated on `canEdit`, matching the server: labelling is list+ // organization, so any member may tag any agent they can see. Using+ // the per-resource `canConfigure` here would hide the submenu on most+ // of a workspace's agents — the shared list a member most wants to+ // organize.+ ...(canEdit && labelsEnabled+ ? [+ {+ children: [+ // Keep `label` a plain string so the menu stays eligible for+ // the native desktop context menu (canGoNative). The icon+ // slot stacks a fixed-width check area + the color dot, so+ // an applied label keeps its color (mirrors Linear).+ ...pickerLabels.map((label) => ({+ icon: (+ <span+ style={{+ alignItems: 'center',+ display: 'inline-flex',+ flex: 'none',+ gap: 6,+ }}+ >+ <span+ style={{+ display: 'inline-flex',+ justifyContent: 'center',+ width: 14,+ }}+ >+ {assignedLabelIds.has(label.id) ? <Icon icon={Check} size={14} /> : null}+ </span>+ <span+ style={{+ background: label.color || 'currentColor',+ borderRadius: '50%',+ display: 'inline-block',+ flex: 'none',+ height: 8,+ opacity: label.color ? 1 : 0.35,+ width: 8,+ }}+ />+ </span>+ ),+ key: `label-${label.id}`,+ label: label.name,+ onClick: async ({ domEvent }: any) => {+ domEvent?.stopPropagation();+ // Delta, not a full replacement: `assignedLabelIds` is+ // only as fresh as the last list fetch, so sending the+ // whole set would drop a label another editor (or+ // another tab) added since.+ try {+ await toggleAgentLabel(id, label.id, !assignedLabelIds.has(label.id));+ } catch (error) {+ console.error('Failed to update agent labels:', error);+ toast.error(t('operationFailed', { ns: 'common' }));+ }+ },+ sfSymbol: assignedLabelIds.has(label.id) ? 'checkmark' : undefined,+ })),+ ...(pickerLabels.length > 0 ? [{ type: 'divider' as const }] : []),+ // In-place creation: creating a label from the picker and+ // then having to reopen it would be surprising, so the+ // submenu carries its own "New label" entry.+ ...(canCreateLabel+ ? [+ {+ icon: <Icon icon={LucidePlus} />,+ key: 'createLabel',+ label: t('agentLabel.create', { ns: 'common' }),+ onClick: ({ domEvent }: any) => {+ domEvent?.stopPropagation();+ // Creating from an agent's submenu applies the new+ // label to that agent right away.+ openCreateLabelModal?.({+ agentId: id,+ currentLabelIds: [...assignedLabelIds],+ });+ },+ sfSymbol: 'plus',+ },+ ]+ : []),+ // `/settings/labels` resolves in both scopes: the workspace+ // settings tree and the personal one both render the same+ // page, which reads the active workspace itself.+ {+ icon: <Icon icon={Settings2Icon} />,+ key: 'manageLabels',+ label: t('agentLabel.manage', { ns: 'common' }),+ onClick: ({ domEvent }: any) => {+ domEvent?.stopPropagation();+ navigate('/settings/labels');+ },+ sfSymbol: 'gearshape',+ },+ ],+ icon: <Icon icon={TagIcon} />,+ key: 'labels',+ label: t('agentLabel.menuTitle', { ns: 'common' }),+ sfSymbol: 'tag',+ },+ ]+ : []),...(canConfigure && transferMenuItems?.length ? transferMenuItems : []),...(canConfigure? [@@ -411,6 +552,12 @@ export const useAgentDropdownMenu = ({duplicateAgent,updateAgentGroup,removeAgent,+ toggleAgentLabel,+ pickerLabels,+ assignedLabelIds,+ canCreateLabel,+ labelsEnabled,+ openCreateLabelModal,openAgentInNewWindow,sessionCustomGroups,group,diff --git a/src/routes/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.tsx b/src/routes/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.tsxindex 23a497df860..d300066607b 100644--- a/src/routes/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.tsx+++ b/src/routes/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.tsx@@ -3,7 +3,7 @@ import { type SidebarVisibility } from '@lobechat/types';import { type MenuProps } from '@lobehub/ui';import { Icon } from '@lobehub/ui';import { confirmModal, toast } from '@lobehub/ui/base-ui';-import { GlobeIcon } from 'lucide-react';+import { EyeOffIcon, GlobeIcon } from 'lucide-react';import { useMemo } from 'react';import { useTranslation } from 'react-i18next';@@ -13,6 +13,7 @@ import { lambdaClient } from '@/libs/trpc/client';import { useHomeStore } from '@/store/home';import { useCreateMenuItems, useSessionGroupMenuItems } from '../../../../hooks';+import { useSidebarGroupVisibility } from '../../useSidebarGroupVisibility';interface GroupDropdownMenuProps {anchor: HTMLElement | null;@@ -54,12 +55,37 @@ export const useGroupDropdownMenu = ({const isPrivate = visibility === 'private';const showPublishAction = Boolean(activeWorkspaceId && id && isCustomGroup) && isPrivate;+ // Hiding is the caller's own view of a shared folder, so it needs no edit+ // permission. Getting it back goes through Category Management, which stays+ // reachable from the default list's header menu.+ const { setSidebarGroupVisible } = useSidebarGroupVisibility();+return useMemo(() => {const createAgentItem = createAgentMenuItem({ groupId: id, isPinned, visibility });const createGroupChatItem = createGroupChatMenuItem({ groupId: id, visibility });const configItem = configGroupMenuItem(openConfigGroupModal);const renameItem = id && name ? renameGroupMenuItem(id, name, anchor) : null;const deleteItem = id ? deleteGroupMenuItem(id) : null;+ const hideItem = id+ ? {+ icon: <Icon icon={EyeOffIcon} />,+ key: 'hideFromSidebar',+ label: t('sessionGroup.hideFromSidebar', { ns: 'chat' }),+ onClick: async (info: any) => {+ info.domEvent?.stopPropagation();+ try {+ await setSidebarGroupVisible(id, false);+ } catch (error) {+ // Workspace mode rolls back, personal mode can keep an unsaved+ // optimistic value — either way the folder looks hidden when it+ // is not, so say so.+ console.error('Failed to hide folder from sidebar:', error);+ toast.error(t('operationFailed', { ns: 'common' }));+ }+ },+ sfSymbol: 'eye.slash' as SFSymbol,+ }+ : null;const publishItem = showPublishAction? {disabled: !canEdit,@@ -117,6 +143,7 @@ export const useGroupDropdownMenu = ({? [renameItem,configItem,+ hideItem,...(publishItem ? [{ type: 'divider' as const }, publishItem] : []),{ type: 'divider' as const },deleteItem,@@ -136,6 +163,7 @@ export const useGroupDropdownMenu = ({renameGroupMenuItem,deleteGroupMenuItem,openConfigGroupModal,+ setSidebarGroupVisible,showPublishAction,canEdit,refreshAgentList,diff --git a/src/routes/(main)/home/_layout/Body/Agent/List/useAgentList.tsx b/src/routes/(main)/home/_layout/Body/Agent/List/useAgentList.tsxindex ffd4b6f0522..f222304323e 100644--- a/src/routes/(main)/home/_layout/Body/Agent/List/useAgentList.tsx+++ b/src/routes/(main)/home/_layout/Body/Agent/List/useAgentList.tsx@@ -8,14 +8,16 @@ import { systemStatusSelectors } from '@/store/global/selectors';import { useHomeStore } from '@/store/home';import { homeAgentListSelectors } from '@/store/home/selectors';+import { useSidebarGroupVisibility } from '../useSidebarGroupVisibility';import { useSidebarItemVisibility } from '../useSidebarItemVisibility';/**- * Filter predicate over the caller's effective sidebar membership. Workspace- * mode combines ownership defaults, legacy hidden ids, and explicit per-item- * overrides; personal mode reads `users.preference`. Applied at render on- * every sidebar-scoped surface (section lists AND the overflow drawer), not- * in the home store, so `/agents` can still list every available item.+ * Filter predicate over the caller's effective sidebar membership: legacy+ * hidden ids plus explicit per-item overrides, read from+ * `workspace_user_settings` in workspace mode and `users.preference`+ * otherwise. Applied at render on every sidebar-scoped surface (section lists+ * AND the overflow drawer), not in the home store, so `/agents` can still list+ * every available item.*/export const useKeepSidebarListed = () => {const { isSidebarItemVisible } = useSidebarItemVisibility();@@ -28,6 +30,22 @@ export const useKeepSidebarListed = () => {);};+/**+ * Companion predicate for folders: drops the whole section (items included)+ * when the caller hid that Category. The folder itself stays shared — this is+ * only the caller's own view of it.+ */+export const useKeepSidebarGroupsListed = () => {+ const { isSidebarGroupVisible } = useSidebarGroupVisibility();++ return useMemo(+ () =>+ <T extends { id: string }>(groups: T[]) =>+ groups.filter((group) => isSidebarGroupVisible(group.id)),+ [isSidebarGroupVisible],+ );+};+// SWR subscription is owned by the caller of AgentListContent (Body/Agent// accordion, or the standalone SwitchPanel). Subscribing here would re-fetch// on every accordion expand and flash spinners across the sidebar.@@ -42,16 +60,17 @@ export const useAgentList = (limitDefault = true) => {isEqual,);const keep = useKeepSidebarListed();+ const keepGroups = useKeepSidebarGroupsListed();return useMemo(() => {const filteredUngrouped = keep(ungroupedAgents);return {- customList: agentGroups.map((group) => ({ ...group, items: keep(group.items) })),+ customList: keepGroups(agentGroups).map((group) => ({ ...group, items: keep(group.items) })),// Filter BEFORE the page-size cut so an unpin doesn't shrink the page.defaultList: limitDefault ? filteredUngrouped.slice(0, agentPageSize) : filteredUngrouped,pinnedList: keep(pinnedAgents),- privateGroupList: privateAgentGroups.map((group) => ({+ privateGroupList: keepGroups(privateAgentGroups).map((group) => ({...group,items: keep(group.items),})),@@ -61,6 +80,7 @@ export const useAgentList = (limitDefault = true) => {agentGroups,agentPageSize,keep,+ keepGroups,limitDefault,pinnedAgents,ungroupedAgents,diff --git a/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsx b/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsxindex b0b8b90c452..669b243e5ad 100644--- a/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsx+++ b/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsx@@ -15,6 +15,7 @@ import {import EditingPopover from '@/features/EditingPopover';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';+import LabelFormModal from '@/features/WorkspaceSetting/Labels/LabelFormModal';import { useAgentStore } from '@/store/agent';import { builtinAgentSelectors } from '@/store/agent/selectors';import { useGlobalStore } from '@/store/global';@@ -61,6 +62,12 @@ interface AgentModalContextValue {closeMemberSelectionModal: () => void;openConfigGroupModal: (scope?: 'private' | 'public') => void;openCreateGroupModal: (sessionId?: string, visibility?: 'private' | 'public') => void;+ /**+ * Create an agent label from anywhere in the list (e.g. the Labels+ * submenu). When `assignTo` is given, the new label is applied to that+ * agent right after creation.+ */+ openCreateLabelModal: (assignTo?: { agentId: string; currentLabelIds: string[] }) => void;openCreateModal: (type: 'agent' | 'group', options?: OpenCreateModalOptions) => void;openGroupWizardModal: (callbacks: GroupWizardCallbacks) => void;openMemberSelectionModal: (callbacks: MemberSelectionCallbacks) => void;@@ -188,6 +195,12 @@ export const AgentModalProvider = memo<AgentModalProviderProps>(({ children }) =const [memberSelectionCallbacks, setMemberSelectionCallbacks] =useState<MemberSelectionCallbacks>({});+ // Create-label modal state+ const [createLabelModalOpen, setCreateLabelModalOpen] = useState(false);+ const [createLabelAssignTo, setCreateLabelAssignTo] = useState<+ { agentId: string; currentLabelIds: string[] } | undefined+ >(undefined);+// CreateAgentModal stateconst [createModalOpen, setCreateModalOpen] = useState(false);const [createModalType, setCreateModalType] = useState<'agent' | 'group'>('agent');@@ -218,6 +231,10 @@ export const AgentModalProvider = memo<AgentModalProviderProps>(({ children }) =setCreateGroupVisibility(visibility);setCreateGroupModalOpen(true);},+ openCreateLabelModal: (assignTo?: { agentId: string; currentLabelIds: string[] }) => {+ setCreateLabelAssignTo(assignTo);+ setCreateLabelModalOpen(true);+ },openCreateModal: (type: 'agent' | 'group', options?: OpenCreateModalOptions) => {setCreateModalType(type);setCreateModalGroupId(options?.groupId);@@ -253,6 +270,13 @@ export const AgentModalProvider = memo<AgentModalProviderProps>(({ children }) ={children}{/* All modals rendered at top level */}+ {createLabelModalOpen && (+ <LabelFormModal+ open+ assignTo={createLabelAssignTo}+ onCancel={() => setCreateLabelModalOpen(false)}+ />+ )}{createGroupModalOpen && (<CreateGroupModalid={createGroupSessionId}diff --git a/src/routes/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsx b/src/routes/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsxindex 6f04769da5d..c36fd1cfc29 100644--- a/src/routes/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsx+++ b/src/routes/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsx@@ -1,19 +1,26 @@import { ActionIcon, EditableText, SortableList } from '@lobehub/ui';import { confirmModal, toast } from '@lobehub/ui/base-ui';import { createStaticStyles } from 'antd-style';-import { PencilLine, Trash } from 'lucide-react';+import { Eye, EyeOff, PencilLine, Trash } from 'lucide-react';import { memo, useState } from 'react';import { useTranslation } from 'react-i18next';import { useHomeStore } from '@/store/home';import type { SessionGroupItemBase } from '@/types/session';+import { useSidebarGroupVisibility } from '../../useSidebarGroupVisibility';+const styles = createStaticStyles(({ css }) => ({content: css`position: relative;overflow: hidden;flex: 1;`,+ // Hidden folders stay in place (they're still shared, and still ordered) but+ // read as inactive, so the row itself answers "is this in my sidebar?".+ hiddenTitle: css`+ opacity: 0.45;+ `,title: css`flex: 1;height: 28px;@@ -31,13 +38,30 @@ const GroupItem = memo<GroupItemProps>(({ id, name, disabled }) => {const [editing, setEditing] = useState(false);const [updateGroupName, removeGroup] = useHomeStore((s) => [s.updateGroupName, s.removeGroup]);+ const { isSidebarGroupVisible, setSidebarGroupVisible } = useSidebarGroupVisibility();+ const visible = isSidebarGroupVisible(id);return (<>{!disabled && <SortableList.DragHandle />}{!editing ? (<>- <span className={styles.title}>{name}</span>+ <span className={`${styles.title} ${visible ? '' : styles.hiddenTitle}`}>{name}</span>+ {/* Visibility is the caller's own view of a shared folder, so it is+ deliberately NOT gated on `disabled` (the edit permission). */}+ <ActionIcon+ icon={visible ? Eye : EyeOff}+ size={'small'}+ title={t(visible ? 'sessionGroup.hideFromSidebar' : 'sessionGroup.showInSidebar')}+ onClick={async () => {+ try {+ await setSidebarGroupVisible(id, !visible);+ } catch (error) {+ console.error('Failed to toggle folder sidebar visibility:', error);+ toast.error(t('operationFailed', { ns: 'common' }));+ }+ }}+ /><ActionIcondisabled={disabled}icon={PencilLine}diff --git a/src/routes/(main)/home/_layout/Body/Agent/index.tsx b/src/routes/(main)/home/_layout/Body/Agent/index.tsxindex eafd8cc9489..feb36c0bb70 100644--- a/src/routes/(main)/home/_layout/Body/Agent/index.tsx+++ b/src/routes/(main)/home/_layout/Body/Agent/index.tsx@@ -9,6 +9,7 @@ import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceimport NeuralNetworkLoading from '@/components/NeuralNetworkLoading';import SkeletonList from '@/features/NavPanel/components/SkeletonList';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';+import { useFetchAgentLabels } from '@/hooks/useFetchAgentLabels';import { useFetchAgentList } from '@/hooks/useFetchAgentList';import { useCreateMenuItems } from '../../hooks';@@ -24,6 +25,8 @@ interface AgentProps {const Agent = memo<AgentProps>(({ itemKey }) => {const { t } = useTranslation('common');const { isRevalidating } = useFetchAgentList();+ // Keep the label registry warm so the per-item "Labels" submenu opens populated.+ useFetchAgentLabels();// In workspace mode the section pairs with the "Private" bucket, so the// public/shared agents are labeled "Public" to make the contrast obvious.// Personal mode has no such duality — keep the existing "Agents" label.diff --git a/src/routes/(main)/home/_layout/Body/Agent/useSidebarGroupVisibility.test.ts b/src/routes/(main)/home/_layout/Body/Agent/useSidebarGroupVisibility.test.tsnew file mode 100644index 00000000000..1032ccad42b--- /dev/null+++ b/src/routes/(main)/home/_layout/Body/Agent/useSidebarGroupVisibility.test.ts@@ -0,0 +1,112 @@+/**+ * @vitest-environment happy-dom+ */+import { act, renderHook } from '@testing-library/react';+import { beforeEach, describe, expect, it, vi } from 'vitest';++import { useSidebarGroupVisibility } from './useSidebarGroupVisibility';++const mocks = vi.hoisted(() => ({+ activeWorkspaceId: undefined as string | undefined,+ personalHiddenGroupIds: [] as string[],+ preferenceWorkspaceId: null as string | null,+ updatePreference: vi.fn(),+ updateWorkspaceUserPreference: vi.fn(),+ workspaceHiddenGroupIds: [] as string[],+}));++vi.mock('@/business/client/hooks/useActiveWorkspaceId', () => ({+ useActiveWorkspaceId: () => mocks.activeWorkspaceId,+}));++vi.mock('@/store/user', () => ({+ useUserStore: (selector: (state: unknown) => unknown) =>+ selector({+ preference: { sidebarHiddenGroupIds: mocks.personalHiddenGroupIds },+ updatePreference: mocks.updatePreference,+ updateWorkspaceUserPreference: mocks.updateWorkspaceUserPreference,+ }),+}));++vi.mock('@/store/user/selectors', () => ({+ workspaceUserSettingsSelectors: {+ preferenceWorkspaceId: () => mocks.preferenceWorkspaceId,+ sidebarHiddenGroupIds: () => mocks.workspaceHiddenGroupIds,+ },+}));++describe('useSidebarGroupVisibility', () => {+ beforeEach(() => {+ mocks.activeWorkspaceId = undefined;+ mocks.personalHiddenGroupIds = [];+ mocks.workspaceHiddenGroupIds = [];+ // Default to "this workspace's row has loaded" so the existing cases+ // exercise the normal path; the gate has its own case below.+ mocks.preferenceWorkspaceId = 'ws_1';+ mocks.updatePreference.mockClear();+ mocks.updateWorkspaceUserPreference.mockClear();+ });++ it('treats a Category as visible unless the caller hid it', () => {+ mocks.activeWorkspaceId = 'ws_1';+ mocks.workspaceHiddenGroupIds = ['grp_hidden'];++ const { result } = renderHook(() => useSidebarGroupVisibility());++ expect(result.current.isSidebarGroupVisible('grp_other_member')).toBe(true);+ expect(result.current.isSidebarGroupVisible('grp_hidden')).toBe(false);+ });++ it('writes the workspace preference bucket in workspace mode', async () => {+ mocks.activeWorkspaceId = 'ws_1';+ mocks.workspaceHiddenGroupIds = ['grp_a'];++ const { result } = renderHook(() => useSidebarGroupVisibility());+ await act(async () => {+ await result.current.setSidebarGroupVisible('grp_b', false);+ });++ expect(mocks.updateWorkspaceUserPreference).toHaveBeenCalledWith({+ sidebarHiddenGroupIds: ['grp_a', 'grp_b'],+ });+ expect(mocks.updatePreference).not.toHaveBeenCalled();+ });++ it('writes the personal preference bucket outside a workspace', async () => {+ mocks.personalHiddenGroupIds = ['grp_a', 'grp_b'];++ const { result } = renderHook(() => useSidebarGroupVisibility());+ await act(async () => {+ await result.current.setSidebarGroupVisible('grp_a', true);+ });++ expect(mocks.updatePreference).toHaveBeenCalledWith({ sidebarHiddenGroupIds: ['grp_b'] });+ expect(mocks.updateWorkspaceUserPreference).not.toHaveBeenCalled();+ });++ it('skips the write when the list is already in the requested shape', async () => {+ mocks.activeWorkspaceId = 'ws_1';+ mocks.workspaceHiddenGroupIds = ['grp_a'];++ const { result } = renderHook(() => useSidebarGroupVisibility());+ await act(async () => {+ await result.current.setSidebarGroupVisible('grp_a', false);+ });++ expect(mocks.updateWorkspaceUserPreference).not.toHaveBeenCalled();+ });++ it("refuses to write before this workspace's preference row has loaded", async () => {+ // The write replaces the whole array, so persisting one built from an+ // empty or previous-workspace value would drop every Category the caller+ // hid earlier. Failing is recoverable; a silent overwrite is not.+ mocks.activeWorkspaceId = 'ws_2';+ mocks.preferenceWorkspaceId = 'ws_1';+ mocks.workspaceHiddenGroupIds = [];++ const { result } = renderHook(() => useSidebarGroupVisibility());++ await expect(result.current.setSidebarGroupVisible('grp_1', false)).rejects.toThrow();+ expect(mocks.updateWorkspaceUserPreference).not.toHaveBeenCalled();+ });+});diff --git a/src/routes/(main)/home/_layout/Body/Agent/useSidebarGroupVisibility.ts b/src/routes/(main)/home/_layout/Body/Agent/useSidebarGroupVisibility.tsnew file mode 100644index 00000000000..da13017ced0--- /dev/null+++ b/src/routes/(main)/home/_layout/Body/Agent/useSidebarGroupVisibility.ts@@ -0,0 +1,81 @@+'use client';++import isEqual from 'fast-deep-equal';+import { useCallback, useMemo } from 'react';++import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';+import { useUserStore } from '@/store/user';+import { workspaceUserSettingsSelectors } from '@/store/user/selectors';++/**+ * Personal mask over the shared folder (Category) list.+ *+ * Folders themselves — which ones exist, their order, and which Agents sit in+ * them — are workspace-shared. What each member controls is whether a folder+ * shows up in *their* sidebar. Hiding one hides the whole section, its items+ * included; they stay reachable from the agents list and search.+ *+ * Unlike {@link useSidebarItemVisibility} there is no ownership default and no+ * legacy override map to reconcile, so a plain hidden-id list is enough — and+ * it reads the same way in personal mode (`users.preference`) and workspace+ * mode (`workspace_user_settings.preference`).+ */+export const useSidebarGroupVisibility = () => {+ const activeWorkspaceId = useActiveWorkspaceId();+ const hiddenGroupIds = useUserStore(+ (s) =>+ activeWorkspaceId+ ? workspaceUserSettingsSelectors.sidebarHiddenGroupIds(s)+ : (s.preference.sidebarHiddenGroupIds ?? []),+ isEqual,+ );+ const preferenceWorkspaceId = useUserStore(workspaceUserSettingsSelectors.preferenceWorkspaceId);+ const updatePreference = useUserStore((s) => s.updatePreference);+ const updateWorkspaceUserPreference = useUserStore((s) => s.updateWorkspaceUserPreference);++ const hiddenGroupIdSet = useMemo(() => new Set(hiddenGroupIds), [hiddenGroupIds]);++ const isSidebarGroupVisible = useCallback(+ (groupId: string) => !hiddenGroupIdSet.has(groupId),+ [hiddenGroupIdSet],+ );++ const setSidebarGroupVisible = useCallback(+ async (groupId: string, visible: boolean) => {+ const nextHiddenGroupIds = visible+ ? hiddenGroupIds.filter((id) => id !== groupId)+ : hiddenGroupIds.includes(groupId)+ ? hiddenGroupIds+ : [...hiddenGroupIds, groupId];++ // Nothing to persist when the list is already in the requested shape —+ // avoids a write (and a re-render round trip) on repeated toggles.+ if (nextHiddenGroupIds === hiddenGroupIds) return;++ if (activeWorkspaceId) {+ // The write sends the whole list, and the server replaces arrays+ // rather than merging them — correct, since the caller owns the list.+ // But that only holds once the caller actually *has* it: toggling+ // before this workspace's preference row has loaded would persist a+ // list built from an empty or previous-workspace value, dropping every+ // Category hidden earlier. Refuse rather than write a guess; the+ // callers surface it, and the window is a single fetch wide.+ if (preferenceWorkspaceId !== activeWorkspaceId)+ throw new Error('Workspace sidebar preference has not loaded yet');++ await updateWorkspaceUserPreference({ sidebarHiddenGroupIds: nextHiddenGroupIds });+ return;+ }+ await updatePreference({ sidebarHiddenGroupIds: nextHiddenGroupIds });+ },+ [+ activeWorkspaceId,+ hiddenGroupIds,+ preferenceWorkspaceId,+ updatePreference,+ updateWorkspaceUserPreference,+ ],+ );++ return { isSidebarGroupVisible, setSidebarGroupVisible };+};diff --git a/src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.test.ts b/src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.test.tsindex 8b80da81d62..66833e5c248 100644--- a/src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.test.ts+++ b/src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.test.ts@@ -3,65 +3,51 @@ import { describe, expect, it } from 'vitest';import { resolveSidebarItemVisibility } from './useSidebarItemVisibility';const options = (overrides: Partial<Parameters<typeof resolveSidebarItemVisibility>[1]> = {}) => ({- currentUserId: 'member-1',hiddenItemIds: new Set<string>(),- isWorkspaceMode: true,visibilityOverrides: {},...overrides,});describe('resolveSidebarItemVisibility', () => {- it('shows own Agents and hides Agents created by another workspace member by default', () => {+ // Regression: shared Agents created by another member used to default to+ // hidden, which left a new workspace member staring at an empty sidebar and+ // made the list impossible to curate collectively.+ it('shows every item by default, whoever created it', () => {expect(resolveSidebarItemVisibility({ id: 'own', type: 'agent', userId: 'member-1' }, options()),).toBe(true);expect(resolveSidebarItemVisibility({ id: 'shared', type: 'agent', userId: 'member-2' }, options()),- ).toBe(false);- });-- it('keeps builtin Agents and chat groups visible by default', () => {- expect(- resolveSidebarItemVisibility(- { id: 'builtin', slug: 'agent-builder', type: 'agent', userId: 'member-2' },- options(),- ),).toBe(true);expect(resolveSidebarItemVisibility({ id: 'group', type: 'group', userId: 'member-2' }, options()),).toBe(true);});- it('lets an explicit per-member override win over ownership and legacy hidden ids', () => {+ it('hides items the caller opted out of, via override or the legacy hidden-id list', () => {expect(resolveSidebarItemVisibility({ id: 'shared', type: 'agent', userId: 'member-2' },- options({- hiddenItemIds: new Set(['shared']),- visibilityOverrides: { shared: true },- }),+ options({ visibilityOverrides: { shared: false } }),),- ).toBe(true);+ ).toBe(false);expect(resolveSidebarItemVisibility(- { id: 'own', type: 'agent', userId: 'member-1' },- options({ visibilityOverrides: { own: false } }),+ { id: 'legacy', type: 'agent', userId: 'member-1' },+ options({ hiddenItemIds: new Set(['legacy']) }),),).toBe(false);});- it('preserves personal-mode visibility and the legacy hidden-id preference', () => {+ it('lets an explicit override win over the legacy hidden-id list', () => {expect(resolveSidebarItemVisibility(- { id: 'personal', type: 'agent', userId: 'member-2' },- options({ isWorkspaceMode: false }),+ { id: 'shared', type: 'agent', userId: 'member-2' },+ options({+ hiddenItemIds: new Set(['shared']),+ visibilityOverrides: { shared: true },+ }),),).toBe(true);- expect(- resolveSidebarItemVisibility(- { id: 'personal', type: 'agent', userId: 'member-1' },- options({ hiddenItemIds: new Set(['personal']), isWorkspaceMode: false }),- ),- ).toBe(false);});});diff --git a/src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.ts b/src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.tsindex 83dd7847d0a..ebc4d4dca39 100644--- a/src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.ts+++ b/src/routes/(main)/home/_layout/Body/Agent/useSidebarItemVisibility.ts@@ -1,46 +1,36 @@'use client';-import { BUILTIN_AGENT_SLUGS } from '@lobechat/builtin-agents';import type { SidebarAgentItem } from '@lobechat/types';import isEqual from 'fast-deep-equal';import { useCallback, useMemo } from 'react';import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import { useUserStore } from '@/store/user';-import { userProfileSelectors, workspaceUserSettingsSelectors } from '@/store/user/selectors';+import { workspaceUserSettingsSelectors } from '@/store/user/selectors';-const BUILTIN_SLUGS = new Set<string>(Object.values(BUILTIN_AGENT_SLUGS));const EMPTY_VISIBILITY_OVERRIDES: Record<string, boolean> = {};type SidebarVisibilityItem = Pick<SidebarAgentItem, 'id' | 'slug' | 'type' | 'userId'>;interface ResolveSidebarItemVisibilityOptions {- currentUserId?: string;hiddenItemIds: ReadonlySet<string>;- isWorkspaceMode: boolean;visibilityOverrides: Readonly<Record<string, boolean>>;}+/**+ * The workspace sidebar is a shared structure: everything the caller can see+ * is listed by default, regardless of who created it. Hiding is the caller's+ * own opt-out, recorded either as an explicit override or in the legacy+ * hidden-id list.+ */export const resolveSidebarItemVisibility = (item: SidebarVisibilityItem,- {- currentUserId,- hiddenItemIds,- isWorkspaceMode,- visibilityOverrides,- }: ResolveSidebarItemVisibilityOptions,+ { hiddenItemIds, visibilityOverrides }: ResolveSidebarItemVisibilityOptions,) => {const override = visibilityOverrides[item.id];if (override !== undefined) return override;- if (hiddenItemIds.has(item.id)) return false;-- if (!isWorkspaceMode || item.type !== 'agent') return true;- if (item.slug && BUILTIN_SLUGS.has(item.slug)) return true;- // Keep the pre-profile frame stable while the current user is loading.- // Once resolved, shared Agents created by another member default hidden.- if (!currentUserId) return true;- return item.userId === currentUserId;+ return !hiddenItemIds.has(item.id);};/**@@ -50,7 +40,6 @@ export const resolveSidebarItemVisibility = (*/export const useSidebarItemVisibility = () => {const activeWorkspaceId = useActiveWorkspaceId();- const currentUserId = useUserStore(userProfileSelectors.userId);const hiddenItemIds = useUserStore((s) =>activeWorkspaceId@@ -72,12 +61,10 @@ export const useSidebarItemVisibility = () => {const isSidebarItemVisible = useCallback((item: SidebarVisibilityItem) =>resolveSidebarItemVisibility(item, {- currentUserId,hiddenItemIds: hiddenItemIdSet,- isWorkspaceMode: Boolean(activeWorkspaceId),visibilityOverrides,}),- [activeWorkspaceId, currentUserId, hiddenItemIdSet, visibilityOverrides],+ [hiddenItemIdSet, visibilityOverrides],);const setSidebarItemVisible = useCallback(diff --git a/src/routes/(main)/home/_layout/Body/Private/List.tsx b/src/routes/(main)/home/_layout/Body/Private/List.tsxindex 0d2c92faec1..29ef158e014 100644--- a/src/routes/(main)/home/_layout/Body/Private/List.tsx+++ b/src/routes/(main)/home/_layout/Body/Private/List.tsx@@ -17,7 +17,7 @@ import { homeAgentListSelectors } from '@/store/home/selectors';import CreateAgentButton from '../Agent/CreateAgentButton';import Group from '../Agent/List/Group';import SessionList from '../Agent/List/List';-import { useKeepSidebarListed } from '../Agent/List/useAgentList';+import { useKeepSidebarGroupsListed, useKeepSidebarListed } from '../Agent/List/useAgentList';interface PrivateListProps {hideCreateButton?: boolean;@@ -37,13 +37,20 @@ const PrivateList = memo<PrivateListProps>(({ hideCreateButton, onMoreClick }) =const rawPrivateUngrouped = useHomeStore(homeAgentListSelectors.privateUngroupedAgents, isEqual);const navigate = useWorkspaceAwareNavigate();const keep = useKeepSidebarListed();+ const keepGroups = useKeepSidebarGroupsListed();if (!isInit) return <SkeletonList rows={2} />;// Drop the caller's sidebar-hidden items BEFORE the page-size cut so a// removal doesn't shrink the visible page below `privateAgentPageSize`.const privatePinned = keep(rawPrivatePinned);- const privateGroups = rawPrivateGroups.map((group) => ({ ...group, items: keep(group.items) }));+ // Hidden Categories drop out here too, the same way the public list does —+ // otherwise hiding one from Category Management saves the preference and+ // changes nothing on screen.+ const privateGroups = keepGroups(rawPrivateGroups).map((group) => ({+ ...group,+ items: keep(group.items),+ }));const filteredUngrouped = keep(rawPrivateUngrouped);const privateUngrouped = filteredUngrouped.slice(0, privateAgentPageSize);diff --git a/src/routes/(main)/home/_layout/hooks/useSessionGroupMenuItems.tsx b/src/routes/(main)/home/_layout/hooks/useSessionGroupMenuItems.tsxindex b7e3ec596e4..72316fbeb52 100644--- a/src/routes/(main)/home/_layout/hooks/useSessionGroupMenuItems.tsx+++ b/src/routes/(main)/home/_layout/hooks/useSessionGroupMenuItems.tsx@@ -60,26 +60,29 @@ export const useSessionGroupMenuItems = () => {);/**- * Config group menu item+ * Config group menu item.+ *+ * Deliberately NOT edit-gated: Category Management is also where a member+ * shows a Category back in their own sidebar, and that show/hide layer is+ * personal. The editing controls inside the modal carry their own+ * `canEdit` gate, so opening it grants nothing.*/const configGroupMenuItem = useCallback((onOpenConfig: () => void): MenuItem => {const iconElement = <Icon icon={FolderCogIcon} />;return {- disabled: !canEdit,icon: iconElement,key: 'config',label: t('sessionGroup.config'),sfSymbol: 'folder.badge.gearshape',onClick: (info: any) => {info.domEvent?.stopPropagation();- if (!canEdit) return;onOpenConfig();},};},- [canEdit, t],+ [t],);/**diff --git a/src/routes/(main)/settings/features/SettingsContent.tsx b/src/routes/(main)/settings/features/SettingsContent.tsxindex 786daf3659c..1bf8013f634 100644--- a/src/routes/(main)/settings/features/SettingsContent.tsx+++ b/src/routes/(main)/settings/features/SettingsContent.tsx@@ -30,6 +30,7 @@ const COMPACT_HEADER_TABS = [SettingsTabs.Credits,SettingsTabs.Devices,SettingsTabs.Hotkey,+ SettingsTabs.Labels,SettingsTabs.Labs,SettingsTabs.Memory,SettingsTabs.Messenger,@@ -60,6 +61,7 @@ const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {[SettingsTabs.Credits]: t('subscription:tab.credits'),[SettingsTabs.Devices]: t('setting:devices.title'),[SettingsTabs.Hotkey]: t('setting:tab.hotkey'),+ [SettingsTabs.Labels]: t('setting:tab.labels'),// Labs has no `setting:tab.*` entry — the nav label comes from the labs namespace.[SettingsTabs.Labs]: t('labs:title'),[SettingsTabs.Memory]: t('setting:tab.memory'),diff --git a/src/routes/(main)/settings/features/componentMap.desktop.ts b/src/routes/(main)/settings/features/componentMap.desktop.tsindex fdc21d1ebaa..7b73f44517a 100644--- a/src/routes/(main)/settings/features/componentMap.desktop.ts+++ b/src/routes/(main)/settings/features/componentMap.desktop.ts@@ -14,6 +14,7 @@ import Connector from '../connector';import Creds from '../creds';import Devices from '../devices';import Hotkey from '../hotkey';+import Labels from '../labels';import Labs from '../labs';import Memory from '../memory';import Messenger from '../messenger';@@ -43,6 +44,7 @@ export const componentMap = {[SettingsTabs.SystemTools]: SystemTools,[SettingsTabs.Storage]: Storage,[SettingsTabs.Devices]: Devices,+ [SettingsTabs.Labels]: Labels,// Profile related tabs[SettingsTabs.Profile]: Profile,[SettingsTabs.Stats]: Stats,diff --git a/src/routes/(main)/settings/features/componentMap.ts b/src/routes/(main)/settings/features/componentMap.tsindex b4e98c892db..529a7946b87 100644--- a/src/routes/(main)/settings/features/componentMap.ts+++ b/src/routes/(main)/settings/features/componentMap.ts@@ -52,6 +52,9 @@ export const componentMap = {[SettingsTabs.Devices]: dynamic(() => import('../devices'), {loading: loading('Settings > Devices'),}),+ [SettingsTabs.Labels]: dynamic(() => import('../labels'), {+ loading: loading('Settings > Labels'),+ }),// Profile related tabs[SettingsTabs.Profile]: dynamic(() => import('../profile'), {loading: loading('Settings > Profile'),diff --git a/src/routes/(main)/settings/hooks/useCategory.tsx b/src/routes/(main)/settings/hooks/useCategory.tsxindex 47d5eab3499..e7bcc5ca020 100644--- a/src/routes/(main)/settings/hooks/useCategory.tsx+++ b/src/routes/(main)/settings/hooks/useCategory.tsx@@ -24,6 +24,7 @@ import {MonitorSmartphoneIcon,PaletteIcon,Sparkles,+ TagIcon,TerminalSquare,} from 'lucide-react';import { useMemo } from 'react';@@ -168,6 +169,11 @@ export const useCategory = () => {key: SettingsTabs.Skill,label: t('tab.skill'),},+ {+ icon: TagIcon,+ key: SettingsTabs.Labels,+ label: t('tab.labels'),+ },{icon: Blocks,key: SettingsTabs.Connector,diff --git a/src/routes/(main)/settings/labels/index.tsx b/src/routes/(main)/settings/labels/index.tsxnew file mode 100644index 00000000000..328c4248db7--- /dev/null+++ b/src/routes/(main)/settings/labels/index.tsx@@ -0,0 +1,14 @@+'use client';++import LabelsContent from '@/features/WorkspaceSetting/Labels';++/**+ * Personal label registry. The same surface serves both scopes — it reads the+ * active workspace itself and falls back to the user's own labels+ * (`workspace_id IS NULL`) when there is none.+ */+const LabelsSetting = () => <LabelsContent />;++LabelsSetting.displayName = 'LabelsSetting';++export default LabelsSetting;diff --git a/src/routes/(mobile)/me/settings/features/useCategory.tsx b/src/routes/(mobile)/me/settings/features/useCategory.tsxindex 19a612d080a..4a37e20fb37 100644--- a/src/routes/(mobile)/me/settings/features/useCategory.tsx+++ b/src/routes/(mobile)/me/settings/features/useCategory.tsx@@ -16,6 +16,7 @@ import {Map,PaletteIcon,Sparkles,+ TagIcon,UserCircle,} from 'lucide-react';import { useMemo } from 'react';@@ -115,6 +116,7 @@ export const useCategory = (): CategoryGroup[] => {label: t('setting:tab.serviceModel'),}),makeItem({ icon: SkillsIcon, key: SettingsTabs.Skill, label: t('setting:tab.skill') }),+ makeItem({ icon: TagIcon, key: SettingsTabs.Labels, label: t('setting:tab.labels') }),makeItem({ icon: Blocks, key: SettingsTabs.Connector, label: t('setting:tab.connector') }),makeItem({ icon: BrainCircuit, key: SettingsTabs.Memory, label: t('setting:tab.memory') }),makeItem({ icon: KeyRound, key: SettingsTabs.Creds, label: t('setting:tab.creds') }),diff --git a/src/services/agentLabel/index.ts b/src/services/agentLabel/index.tsnew file mode 100644index 00000000000..5a296bca223--- /dev/null+++ b/src/services/agentLabel/index.ts@@ -0,0 +1,51 @@+import type { AgentLabelListItem } from '@lobechat/types';++import { lambdaClient } from '@/libs/trpc/client';++export class AgentLabelService {+ getLabels = (): Promise<AgentLabelListItem[]> => {+ return lambdaClient.agentLabel.getLabels.query();+ };++ createLabel = (params: {+ color?: string;+ description?: string;+ name: string;+ }): Promise<string | undefined> => {+ return lambdaClient.agentLabel.createLabel.mutate(params);+ };++ updateLabel = (+ id: string,+ value: {+ archived?: boolean;+ color?: string | null;+ description?: string | null;+ name?: string;+ },+ ): Promise<void> => {+ return lambdaClient.agentLabel.updateLabel.mutate({ id, value }) as any;+ };++ removeLabel = (id: string): Promise<void> => {+ return lambdaClient.agentLabel.removeLabel.mutate({ id }) as any;+ };++ /**+ * Replace the full label set of an agent. Returns the effective label ids+ * after scope/archive filtering on the server.+ */+ setAgentLabels = (agentId: string, labelIds: string[]): Promise<string[]> => {+ return lambdaClient.agentLabel.setAgentLabels.mutate({ agentId, labelIds });+ };++ /**+ * Apply or remove one label. Use this for toggles — a full replacement built+ * from a cached assignment set drops whatever another editor added since.+ */+ toggleAgentLabel = (agentId: string, labelId: string, assigned: boolean): Promise<string[]> => {+ return lambdaClient.agentLabel.toggleAgentLabel.mutate({ agentId, assigned, labelId });+ };+}++export const agentLabelService = new AgentLabelService();diff --git a/src/services/session/index.ts b/src/services/session/index.tsindex 8b17fe0e735..b832a51701a 100644--- a/src/services/session/index.ts+++ b/src/services/session/index.ts@@ -115,7 +115,8 @@ export class SessionService {return lambdaClient.sessionGroup.removeSessionGroup.mutate({ id, removeChildren });};- updateSessionGroup = (id: string, value: Partial<SessionGroupItem>) => {+ /** Rename / reorder only — scope fields are rejected server-side. */+ updateSessionGroup = (id: string, value: Partial<Pick<SessionGroupItem, 'name' | 'sort'>>) => {return lambdaClient.sessionGroup.updateSessionGroup.mutate({ id, value });};diff --git a/src/spa/router/desktopRouter.shared.tsx b/src/spa/router/desktopRouter.shared.tsxindex 046c2d9effd..7e7f6d17bba 100644--- a/src/spa/router/desktopRouter.shared.tsx+++ b/src/spa/router/desktopRouter.shared.tsx@@ -1041,6 +1041,13 @@ const createMainAreaChildrenDefinition = (options: MainAreaRouteOptions = {}): R),path: 'audit-log',},+ {+ element: dynamicElement(+ () => import('@/routes/(main)/[workspaceSlug]/settings/labels'),+ 'Desktop > Workspace > Settings > Labels',+ ),+ path: 'labels',+ },{element: dynamicElement(() => import('@/routes/(main)/[workspaceSlug]/settings/storage'),diff --git a/src/spa/router/mobileRouter.config.tsx b/src/spa/router/mobileRouter.config.tsxindex fdc2ca2112c..78880ce28e5 100644--- a/src/spa/router/mobileRouter.config.tsx+++ b/src/spa/router/mobileRouter.config.tsx@@ -472,6 +472,13 @@ export const mobileRoutes: RouteObject[] = [),path: 'notification',},+ {+ element: dynamicElement(+ () => import('@/routes/(main)/[workspaceSlug]/settings/labels'),+ 'Mobile > Workspace > Settings > Labels',+ ),+ path: 'labels',+ },{element: dynamicElement(() => import('@/routes/(main)/[workspaceSlug]/settings/plans'),diff --git a/src/store/global/initialState.ts b/src/store/global/initialState.tsindex 9e9895550f7..2498dce550b 100644--- a/src/store/global/initialState.ts+++ b/src/store/global/initialState.ts@@ -76,6 +76,7 @@ export enum SettingsTabs {Hotkey = 'hotkey',/** @deprecated Use ServiceModel instead */Image = 'image',+ Labels = 'labels',Labs = 'labs',LLM = 'llm',Memory = 'memory',@@ -144,6 +145,17 @@ export interface SystemStatus {* Agent Builder panel width*/agentBuilderPanelWidth?: number;+ /**+ * Expanded group keys of the agent view-all page. Expanded (not collapsed)+ * keys are persisted because groups default to COLLAPSED (mirrors Linear) —+ * newly appearing groups start collapsed until explicitly opened.+ */+ agentListExpandedGroupKeys?: string[];+ /**+ * Whether the "in sidebar" overview section of the agent view-all page is+ * collapsed. Defaults to expanded so the section is discoverable.+ */+ agentListSidebarSectionCollapsed?: boolean;/*** View mode of the agent view-all page (card grid vs table list)*/@@ -152,7 +164,7 @@ export interface SystemStatus {* Display options of the agent view-all page (grouping / ordering / hidden-agent visibility)*/agentListViewOptions?: {- groupBy: 'author' | 'none';+ groupBy: 'author' | 'label' | 'none';orderBy: 'author' | 'title' | 'updatedAt';orderDirection: 'asc' | 'desc';showSidebarHidden: boolean;@@ -470,6 +482,8 @@ export interface GlobalState {export const INITIAL_STATUS = {agentBuilderPanelWidth: 360,+ agentListExpandedGroupKeys: [] as string[],+ agentListSidebarSectionCollapsed: false,agentListViewMode: 'list' as const,agentListViewOptions: {groupBy: 'none' as const,diff --git a/src/store/global/selectors/systemStatus.ts b/src/store/global/selectors/systemStatus.tsindex df4bcb97113..dc9ebb919d1 100644--- a/src/store/global/selectors/systemStatus.ts+++ b/src/store/global/selectors/systemStatus.ts@@ -402,6 +402,9 @@ const groupAgentBuilderPanelWidth = (s: GlobalState) => s.status.groupAgentBuildconst imagePanelWidth = (s: GlobalState) => s.status.imagePanelWidth;const agentListViewMode = (s: GlobalState) => s.status.agentListViewMode || 'list';const agentListViewOptions = (s: GlobalState) => s.status.agentListViewOptions;+const agentListExpandedGroupKeys = (s: GlobalState) => s.status.agentListExpandedGroupKeys ?? [];+const agentListSidebarSectionCollapsed = (s: GlobalState) =>+ s.status.agentListSidebarSectionCollapsed ?? false;const imageTopicViewMode = (s: GlobalState) => s.status.imageTopicViewMode || 'grid';const imageTopicPanelWidth = (s: GlobalState) => s.status.imageTopicPanelWidth;const verifyReportPanelWidth = (s: GlobalState) => s.status.verifyReportPanelWidth || 300;@@ -446,6 +449,8 @@ const homeSelectedAgentId = (s: GlobalState) => s.status.homeSelectedAgentId;export const systemStatusSelectors = {agentBuilderPanelWidth,+ agentListExpandedGroupKeys,+ agentListSidebarSectionCollapsed,agentListViewMode,agentListViewOptions,agentPageSize,diff --git a/src/store/home/initialState.ts b/src/store/home/initialState.tsindex dc34ef7980b..43e8284cf9b 100644--- a/src/store/home/initialState.ts+++ b/src/store/home/initialState.ts@@ -2,17 +2,20 @@ import { type AgentListState } from './slices/agentList/initialState';import { initialAgentListState } from './slices/agentList/initialState';import { type HomeInputState } from './slices/homeInput/initialState';import { initialHomeInputState } from './slices/homeInput/initialState';+import { type LabelState } from './slices/label/initialState';+import { initialLabelState } from './slices/label/initialState';import { type RecentState } from './slices/recent/initialState';import { initialRecentState } from './slices/recent/initialState';import { type SidebarUIState } from './slices/sidebarUI/initialState';import { initialSidebarUIState } from './slices/sidebarUI/initialState';export interface HomeStoreState- extends AgentListState, RecentState, HomeInputState, SidebarUIState {}+ extends AgentListState, RecentState, HomeInputState, LabelState, SidebarUIState {}export const initialState: HomeStoreState = {...initialAgentListState,...initialRecentState,...initialHomeInputState,+ ...initialLabelState,...initialSidebarUIState,};diff --git a/src/store/home/selectors.ts b/src/store/home/selectors.tsindex 62b5f0b04a4..0e2669553ab 100644--- a/src/store/home/selectors.ts+++ b/src/store/home/selectors.ts@@ -1,2 +1,3 @@export * from './slices/agentList/selectors';+export * from './slices/label/selectors';export * from './slices/recent/selectors';diff --git a/src/store/home/slices/label/action.ts b/src/store/home/slices/label/action.tsnew file mode 100644index 00000000000..89aeb2f05c5--- /dev/null+++ b/src/store/home/slices/label/action.ts@@ -0,0 +1,192 @@+import {+ type AgentLabelListItem,+ type SidebarAgentItem,+ type SidebarAgentLabel,+ type SidebarGroup,+} from '@lobechat/types';+import isEqual from 'fast-deep-equal';+import { useEffect } from 'react';+import { type SWRResponse } from 'swr';++import { mutate, useClientDataSWR } from '@/libs/swr';+import { agentLabelKeys } from '@/libs/swr/keys';+import { agentLabelService } from '@/services/agentLabel';+import { type HomeStore } from '@/store/home/store';+import { type StoreSetter } from '@/store/types';+import { setNamespace } from '@/utils/storeDebug';++const n = setNamespace('label');++type Setter = StoreSetter<HomeStore>;+export const createLabelSlice = (set: Setter, get: () => HomeStore, _api?: unknown) =>+ new LabelActionImpl(set, get, _api);++export class LabelActionImpl {+ readonly #get: () => HomeStore;+ readonly #set: Setter;++ constructor(set: Setter, get: () => HomeStore, _api?: unknown) {+ void _api;+ this.#set = set;+ this.#get = get;+ }++ createAgentLabel = async (params: {+ color?: string;+ description?: string;+ name: string;+ }): Promise<string | undefined> => {+ const id = await agentLabelService.createLabel(params);+ await this.refreshAgentLabels();+ return id;+ };++ refreshAgentLabels = async (): Promise<void> => {+ // Revalidate the key for the scope the registry was loaded for, not a+ // hardcoded one — the key carries the workspace, so mutating inside a+ // workspace must not refresh the personal list instead.+ await mutate(agentLabelKeys.list(true, this.#get().agentLabelsWorkspaceId));+ };++ removeAgentLabel = async (id: string): Promise<void> => {+ await agentLabelService.removeLabel(id);+ // deleting a label also drops its assignments, so the agent list changes too+ await Promise.all([this.refreshAgentLabels(), this.#get().refreshAgentList()]);+ };++ /**+ * Toggle one label on an agent. Optimistically patches the same way+ * `setAgentLabels` does, but the server call carries only the delta so a+ * concurrent editor's assignment survives.+ */+ toggleAgentLabel = async (agentId: string, labelId: string, assigned: boolean): Promise<void> => {+ const state = this.#get();+ const current = new Set(+ [...state.agentGroups.flatMap((g) => g.items), ...state.pinnedAgents]+ .concat(state.ungroupedAgents, state.privatePinnedAgents, state.privateUngroupedAgents)+ .concat(state.privateAgentGroups.flatMap((g) => g.items))+ .find((item) => item.id === agentId && item.type === 'agent')+ ?.labels?.map((label) => label.id) ?? [],+ );++ if (assigned) current.add(labelId);+ else current.delete(labelId);++ this.#patchAgentLabels(agentId, [...current]);++ try {+ await agentLabelService.toggleAgentLabel(agentId, labelId, assigned);+ } catch (error) {+ await this.#get().refreshAgentList();+ throw error;+ }++ await Promise.all([this.refreshAgentLabels(), this.#get().refreshAgentList()]);+ };++ /**+ * Optimistic: patch the agent's labels in every list bucket immediately —+ * waiting for the mutation + full list refetch reads as lag. Name-sorted to+ * match the server's ordering, so the refresh doesn't reshuffle.+ */+ #patchAgentLabels = (agentId: string, labelIds: string[]) => {+ const state = this.#get();+ const nextLabels: SidebarAgentLabel[] = state.agentLabels+ .filter((label) => labelIds.includes(label.id))+ .map(({ color, id, name }) => ({ color, id, name }))+ .sort((a, b) => a.name.localeCompare(b.name));++ const patchItems = (items: SidebarAgentItem[]) =>+ items.map((item) =>+ item.id === agentId && item.type === 'agent' ? { ...item, labels: nextLabels } : item,+ );+ const patchGroups = (groups: SidebarGroup[]) =>+ groups.map((group) => ({ ...group, items: patchItems(group.items) }));++ this.#set(+ {+ agentGroups: patchGroups(state.agentGroups),+ pinnedAgents: patchItems(state.pinnedAgents),+ privateAgentGroups: patchGroups(state.privateAgentGroups),+ privatePinnedAgents: patchItems(state.privatePinnedAgents),+ privateUngroupedAgents: patchItems(state.privateUngroupedAgents),+ ungroupedAgents: patchItems(state.ungroupedAgents),+ },+ false,+ n('patchAgentLabels/optimistic'),+ );+ };++ setAgentLabels = async (agentId: string, labelIds: string[]): Promise<void> => {+ this.#patchAgentLabels(agentId, labelIds);++ try {+ await agentLabelService.setAgentLabels(agentId, labelIds);+ } catch (error) {+ // Roll back to server truth on failure.+ await this.#get().refreshAgentList();+ throw error;+ }++ await Promise.all([this.refreshAgentLabels(), this.#get().refreshAgentList()]);+ };++ updateAgentLabel = async (+ id: string,+ value: {+ archived?: boolean;+ color?: string | null;+ description?: string | null;+ name?: string;+ },+ ): Promise<void> => {+ await agentLabelService.updateLabel(id, value);+ // name/color render on agent rows — keep the list in sync+ await Promise.all([this.refreshAgentLabels(), this.#get().refreshAgentList()]);+ };++ useFetchAgentLabels = (+ isLogin: boolean | undefined,+ workspaceId: string | null | undefined,+ ): SWRResponse<AgentLabelListItem[]> => {+ const scopeId = workspaceId ?? null;++ // Changing the SWR key refetches, but the store keeps serving the previous+ // scope's registry until that request lands. Drop it immediately instead:+ // an empty picker is a moment of missing UI, while a picker holding+ // foreign label ids is a destructive write waiting to happen.+ useEffect(() => {+ if (this.#get().agentLabelsWorkspaceId === scopeId) return;++ this.#set(+ { agentLabels: [], agentLabelsWorkspaceId: scopeId, isAgentLabelsInit: false },+ false,+ n('useFetchAgentLabels/scopeChanged'),+ );+ }, [scopeId]);++ return useClientDataSWR<AgentLabelListItem[]>(+ isLogin === true ? agentLabelKeys.list(isLogin, scopeId) : null,+ () => agentLabelService.getLabels(),+ {+ onSuccess: (data) => {+ const state = this.#get();+ if (+ state.isAgentLabelsInit &&+ state.agentLabelsWorkspaceId === scopeId &&+ isEqual(state.agentLabels, data)+ )+ return;++ this.#set(+ { agentLabels: data, agentLabelsWorkspaceId: scopeId, isAgentLabelsInit: true },+ false,+ n('useFetchAgentLabels/onSuccess'),+ );+ },+ },+ );+ };+}++export type LabelAction = Pick<LabelActionImpl, keyof LabelActionImpl>;diff --git a/src/store/home/slices/label/initialState.ts b/src/store/home/slices/label/initialState.tsnew file mode 100644index 00000000000..b87eb6d055f--- /dev/null+++ b/src/store/home/slices/label/initialState.ts@@ -0,0 +1,28 @@+import { type AgentLabelListItem } from '@lobechat/types';++export interface LabelState {+ /**+ * Agent label registry for the current scope (workspace-shared, or+ * personal outside a workspace). Includes archived labels — consumers+ * filter as needed.+ */+ agentLabels: AgentLabelListItem[];+ /**+ * Workspace the loaded registry belongs to (`null` for personal scope).+ * Registries are disjoint per scope, so anything loaded for another+ * workspace must count as not-yet-loaded rather than as stale-but-usable:+ * applying a label id from the wrong scope is a destructive write, not a+ * cosmetic glitch.+ */+ agentLabelsWorkspaceId: string | null;+ /**+ * Whether the label list has been initialized+ */+ isAgentLabelsInit: boolean;+}++export const initialLabelState: LabelState = {+ agentLabels: [],+ agentLabelsWorkspaceId: null,+ isAgentLabelsInit: false,+};diff --git a/src/store/home/slices/label/selectors.ts b/src/store/home/slices/label/selectors.tsnew file mode 100644index 00000000000..eb43125db33--- /dev/null+++ b/src/store/home/slices/label/selectors.ts@@ -0,0 +1,27 @@+import { type AgentLabelListItem } from '@lobechat/types';++import { type HomeStoreState } from '@/store/home/initialState';++const allLabels = (s: HomeStoreState): AgentLabelListItem[] => s.agentLabels;++/** Labels that can still be applied — archived ones are picker-hidden. */+const activeLabels = (s: HomeStoreState): AgentLabelListItem[] =>+ s.agentLabels.filter((label) => !label.archived);++const archivedLabels = (s: HomeStoreState): AgentLabelListItem[] =>+ s.agentLabels.filter((label) => label.archived);++const getLabelById =+ (id: string) =>+ (s: HomeStoreState): AgentLabelListItem | undefined =>+ s.agentLabels.find((label) => label.id === id);++const isLabelsInit = (s: HomeStoreState): boolean => s.isAgentLabelsInit;++export const agentLabelSelectors = {+ activeLabels,+ allLabels,+ archivedLabels,+ getLabelById,+ isLabelsInit,+};diff --git a/src/store/home/slices/sidebarUI/action.test.ts b/src/store/home/slices/sidebarUI/action.test.tsindex e7a1b1cad4a..3ec091cf149 100644--- a/src/store/home/slices/sidebarUI/action.test.ts+++ b/src/store/home/slices/sidebarUI/action.test.ts@@ -125,15 +125,15 @@ describe('createSidebarUISlice', () => {});describe('pin in workspace mode', () => {- // Regression: pinning used to write the shared `agents.pinned` /- // `chat_groups.pinned` columns in workspace mode, reordering every- // member's sidebar. It must go to the caller's per-member preference.- it('should write agent pin to per-member preference, not the shared column', async () => {+ // Regression: pinning is part of the SHARED sidebar arrangement. It briefly+ // wrote a per-member preference instead, which split the sidebar into two+ // mental models; it must go back to the shared column in both scopes.+ it('should write agent pin to the shared column, not a per-member preference', async () => {vi.mocked(getActiveWorkspaceId).mockReturnValue('ws-1');- const spyOnPreference = vi- .spyOn(useUserStore.getState(), 'updateWorkspaceUserPreference')+ const spyOnPreference = vi.spyOn(useUserStore.getState(), 'updateWorkspaceUserPreference');+ const spyOnShared = vi+ .spyOn(agentService, 'updateAgentPinned').mockResolvedValueOnce(undefined as any);- const spyOnShared = vi.spyOn(agentService, 'updateAgentPinned');const spyOnRefresh = vi.spyOn(useHomeStore.getState(), 'refreshAgentList');const { result } = renderHook(() => useHomeStore());@@ -142,19 +142,17 @@ describe('createSidebarUISlice', () => {await result.current.pinAgent('agent-123', true);});- expect(spyOnPreference).toHaveBeenCalledWith({- sidebarPinnedOverrides: { 'agent-123': true },- });- expect(spyOnShared).not.toHaveBeenCalled();+ expect(spyOnShared).toHaveBeenCalledWith('agent-123', true);+ expect(spyOnPreference).not.toHaveBeenCalled();expect(spyOnRefresh).toHaveBeenCalled();});- it('should write group pin to per-member preference, not the shared column', async () => {+ it('should write group pin to the shared column, not a per-member preference', async () => {vi.mocked(getActiveWorkspaceId).mockReturnValue('ws-1');- const spyOnPreference = vi- .spyOn(useUserStore.getState(), 'updateWorkspaceUserPreference')+ const spyOnPreference = vi.spyOn(useUserStore.getState(), 'updateWorkspaceUserPreference');+ const spyOnShared = vi+ .spyOn(chatGroupService, 'updateGroup').mockResolvedValueOnce(undefined as any);- const spyOnShared = vi.spyOn(chatGroupService, 'updateGroup');const spyOnRefresh = vi.spyOn(useHomeStore.getState(), 'refreshAgentList');const { result } = renderHook(() => useHomeStore());@@ -163,10 +161,8 @@ describe('createSidebarUISlice', () => {await result.current.pinAgentGroup('group-123', false);});- expect(spyOnPreference).toHaveBeenCalledWith({- sidebarPinnedOverrides: { 'group-123': false },- });- expect(spyOnShared).not.toHaveBeenCalled();+ expect(spyOnShared).toHaveBeenCalledWith('group-123', { pinned: false });+ expect(spyOnPreference).not.toHaveBeenCalled();expect(spyOnRefresh).toHaveBeenCalled();});});@@ -302,6 +298,24 @@ describe('createSidebarUISlice', () => {expect(homeService.updateAgentSessionGroupId).toHaveBeenCalledWith(mockAgentId, null);});++ // Regression: folder membership is shared. It briefly wrote a per-member+ // assignment map in workspace mode, so one member's tidy-up was invisible+ // to everyone else.+ it('should write the shared column in workspace mode too', async () => {+ vi.mocked(getActiveWorkspaceId).mockReturnValue('ws-1');+ const spyOnPreference = vi.spyOn(useUserStore.getState(), 'updateWorkspaceUserPreference');+ vi.spyOn(homeService, 'updateAgentSessionGroupId').mockResolvedValueOnce(undefined as any);++ const { result } = renderHook(() => useHomeStore());++ await act(async () => {+ await result.current.updateAgentGroup('agent-123', 'group-456');+ });++ expect(homeService.updateAgentSessionGroupId).toHaveBeenCalledWith('agent-123', 'group-456');+ expect(spyOnPreference).not.toHaveBeenCalled();+ });});// ========== Group Operations ==========diff --git a/src/store/home/slices/sidebarUI/action.ts b/src/store/home/slices/sidebarUI/action.tsindex d69fe8da9d3..aefb3360c63 100644--- a/src/store/home/slices/sidebarUI/action.ts+++ b/src/store/home/slices/sidebarUI/action.ts@@ -1,7 +1,6 @@import { toast } from '@lobehub/ui/base-ui';import { t } from 'i18next';-import { getActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import { agentService } from '@/services/agent';import { chatGroupService } from '@/services/chatGroup';import { homeService } from '@/services/home';@@ -69,41 +68,20 @@ export class SidebarUIActionImpl {agentStore.setActiveAgentId(result.supervisorAgentId);};+ // Pinning is part of the SHARED sidebar arrangement in workspace mode — it+ // writes the same `agents.pinned` / `chat_groups.pinned` columns as personal+ // mode, so every member sees the same pinned section. A member who doesn't+ // want an item in their own sidebar hides it instead (personal layer).pinAgent = async (agentId: string, pinned: boolean): Promise<void> => {- await this.#persistPinned(agentId, pinned, () =>- agentService.updateAgentPinned(agentId, pinned),- );+ await agentService.updateAgentPinned(agentId, pinned);await this.#get().refreshAgentList();};pinAgentGroup = async (groupId: string, pinned: boolean): Promise<void> => {- await this.#persistPinned(groupId, pinned, () =>- chatGroupService.updateGroup(groupId, { pinned }),- );+ await chatGroupService.updateGroup(groupId, { pinned });await this.#get().refreshAgentList();};- // Pinning is fully per-member in workspace mode: record it in the caller's- // workspace_user_settings instead of the shared `agents.pinned` /- // `chat_groups.pinned` columns, so one member's pin never reorders another- // member's sidebar. The shared columns are ignored entirely when reading- // workspace lists (no fallback).- #persistPinned = async (- itemId: string,- pinned: boolean,- persistShared: () => Promise<unknown>,- ): Promise<void> => {- const workspaceId = getActiveWorkspaceId();- if (workspaceId) {- const { getUserStoreState } = await import('@/store/user');- await getUserStoreState().updateWorkspaceUserPreference({- sidebarPinnedOverrides: { [itemId]: pinned },- });- } else {- await persistShared();- }- };-removeAgent = async (agentId: string): Promise<void> => {await agentService.removeAgent(agentId);await this.#get().refreshAgentList();@@ -130,21 +108,12 @@ export class SidebarUIActionImpl {await this.#get().refreshAgentList();};+ // Folder membership is shared: moving an item writes the shared+ // `agents.sessionGroupId` column in both scopes, so the workspace sidebar+ // stays one collectively-curated structure.updateAgentGroup = async (agentId: string, groupId: string | null): Promise<void> => {const normalized = groupId === 'default' ? null : groupId;- const workspaceId = getActiveWorkspaceId();- if (workspaceId) {- // Folders are per-member in workspace mode: record the assignment in the- // caller's workspace_user_settings instead of the shared- // `agents.sessionGroupId` column, so one member's move never regroups- // another member's sidebar.- const { getUserStoreState } = await import('@/store/user');- await getUserStoreState().updateWorkspaceUserPreference({- sidebarGroupAssignments: { [agentId]: normalized },- });- } else {- await homeService.updateAgentSessionGroupId(agentId, normalized);- }+ await homeService.updateAgentSessionGroupId(agentId, normalized);await this.#get().refreshAgentList();};diff --git a/src/store/home/store.ts b/src/store/home/store.tsindex d09e5415b97..72050c3de90 100644--- a/src/store/home/store.ts+++ b/src/store/home/store.ts@@ -17,6 +17,8 @@ import { type GroupAction } from './slices/group/action';import { createGroupSlice } from './slices/group/action';import { type HomeInputAction } from './slices/homeInput/action';import { createHomeInputSlice } from './slices/homeInput/action';+import { type LabelAction } from './slices/label/action';+import { createLabelSlice } from './slices/label/action';import { type RecentAction } from './slices/recent/action';import { createRecentSlice } from './slices/recent/action';import { type SidebarUIAction } from './slices/sidebarUI/action';@@ -30,6 +32,7 @@ export interface HomeStoreGroupAction,RecentAction,HomeInputAction,+ LabelAction,SidebarUIAction,ResetableStore,HomeStoreState {}@@ -38,6 +41,7 @@ type HomeStoreAction = AgentListAction &GroupAction &RecentAction &HomeInputAction &+ LabelAction &SidebarUIAction &ResetableStore;@@ -54,6 +58,7 @@ const createStore: StateCreator<HomeStore, [['zustand/devtools', never]]> = (createGroupSlice(...parameters),createRecentSlice(...parameters),createHomeInputSlice(...parameters),+ createLabelSlice(...parameters),createSidebarUISlice(...parameters),new HomeStoreResetAction(...parameters),]),diff --git a/src/store/user/slices/workspaceUserSettings/action.ts b/src/store/user/slices/workspaceUserSettings/action.tsindex 2269674c656..a711636d39b 100644--- a/src/store/user/slices/workspaceUserSettings/action.ts+++ b/src/store/user/slices/workspaceUserSettings/action.ts@@ -112,14 +112,6 @@ export class WorkspaceUserSettingsActionImpl {...(patch.notification? { notification: mergeNotificationSettings(previous.notification, patch.notification) }: {}),- ...(patch.sidebarGroupAssignments- ? {- sidebarGroupAssignments: {- ...previous.sidebarGroupAssignments,- ...patch.sidebarGroupAssignments,- },- }- : {}),...(patch.sidebarAgentVisibilityOverrides? {sidebarAgentVisibilityOverrides: {@@ -128,14 +120,6 @@ export class WorkspaceUserSettingsActionImpl {},}: {}),- ...(patch.sidebarPinnedOverrides- ? {- sidebarPinnedOverrides: {- ...previous.sidebarPinnedOverrides,- ...patch.sidebarPinnedOverrides,- },- }- : {}),};const workspaceId = getActiveWorkspaceId();const swrKey = workspaceId ? [WORKSPACE_USER_SETTINGS_SWR_KEY, workspaceId] : null;diff --git a/src/store/user/slices/workspaceUserSettings/selectors.ts b/src/store/user/slices/workspaceUserSettings/selectors.tsindex 67ff798dce8..04011df9e8a 100644--- a/src/store/user/slices/workspaceUserSettings/selectors.ts+++ b/src/store/user/slices/workspaceUserSettings/selectors.ts@@ -34,6 +34,13 @@ const sidebarAgentVisibilityOverrides = (s: UserStore): Record<string, boolean>const sidebarHiddenAgentIds = (s: UserStore): string[] =>s.workspaceUserPreference.sidebarHiddenAgentIds ?? EMPTY_HIDDEN;+/**+ * Folders (Categories) the caller hid from their sidebar in the active+ * workspace. The folders themselves stay shared — this is the personal mask.+ */+const sidebarHiddenGroupIds = (s: UserStore): string[] =>+ s.workspaceUserPreference.sidebarHiddenGroupIds ?? EMPTY_HIDDEN;+/** Whether the caller removed this item from their sidebar (default is listed). */const isAgentHiddenFromSidebar =(agentId: string) =>@@ -53,5 +60,6 @@ export const workspaceUserSettingsSelectors = {preferenceWorkspaceId,sidebarAgentVisibilityOverrides,sidebarHiddenAgentIds,+ sidebarHiddenGroupIds,sidebarLayout,};diff --git a/src/types/workspaceSettings.ts b/src/types/workspaceSettings.tsindex 81225ec1dfc..b95e6f14dd8 100644--- a/src/types/workspaceSettings.ts+++ b/src/types/workspaceSettings.ts@@ -15,6 +15,7 @@ export enum WorkspaceSettingsTabs {Creds = 'credential',Devices = 'devices',General = 'general',+ Labels = 'labels',Members = 'members',Notification = 'notification',OAuthApps = 'oauth-apps',