refactor(authz): move to domain-based authz and flatten routes

This commit is contained in:
yiling
2026-05-25 23:51:37 +08:00
parent 35fd5c78ce
commit 9f9549255d
61 changed files with 1646 additions and 1147 deletions
@@ -82,8 +82,8 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
const deleteAgentMutation = useMutation({
mutationFn: async (agentId: string) => {
const res = await client.api.teams[':teamId'].agents[':agentId'].$delete({
param: { teamId, agentId },
const res = await client.api.agents[':agentId'].$delete({
param: { agentId },
})
if (!res.ok) throw new Error('failed to delete agent')
},
@@ -112,8 +112,8 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
soul?: string
skills?: string[]
}) => {
const res = await client.api.teams[':teamId'].agents[':agentId'].$put({
param: { teamId: params.teamId, agentId: params.agentId },
const res = await client.api.agents[':agentId'].$put({
param: { agentId: params.agentId },
json: {
name: params.name,
type: params.type,