mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-27 21:33:41 +02:00
* refactor(ui): unify collection page patterns * refactor(agents): redesign agent detail workbench (#5263) * refactor(agents): redesign agent detail workbench * refactor(agents): refine capability and settings surfaces * refactor(agents): rebuild general settings form * refactor(agents): refine overview and settings * refactor(agents): redesign custom args editor * docs(ui): record consistency audit
51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
"use client";
|
|
|
|
import type { Agent, MemberWithUser } from "@multica/core/types";
|
|
import {
|
|
SettingsCard,
|
|
SettingsSection,
|
|
} from "../../settings/components/settings-layout";
|
|
import { useT } from "../../i18n";
|
|
import { AccessPicker } from "./inspector/access-picker";
|
|
|
|
export function AgentAccessSettings({
|
|
agent,
|
|
members,
|
|
currentUserId,
|
|
onDirtyChange,
|
|
onUpdate,
|
|
}: {
|
|
agent: Agent;
|
|
members: MemberWithUser[];
|
|
currentUserId: string | null;
|
|
onDirtyChange?: (dirty: boolean) => void;
|
|
onUpdate: (id: string, data: Record<string, unknown>) => Promise<void>;
|
|
}) {
|
|
const { t } = useT("agents");
|
|
|
|
return (
|
|
<SettingsSection
|
|
title={t(($) => $.access.section_title)}
|
|
description={t(($) => $.inspector.section_access_hint)}
|
|
>
|
|
<SettingsCard>
|
|
<AccessPicker
|
|
permissionMode={agent.permission_mode}
|
|
invocationTargets={agent.invocation_targets}
|
|
visibility={agent.visibility}
|
|
members={members}
|
|
ownerId={agent.owner_id}
|
|
canEdit={
|
|
currentUserId !== null && agent.owner_id === currentUserId
|
|
}
|
|
hasComposioAllowlist={
|
|
(agent.composio_toolkit_allowlist ?? []).length > 0
|
|
}
|
|
onDirtyChange={onDirtyChange}
|
|
onChange={(next) => onUpdate(agent.id, next)}
|
|
/>
|
|
</SettingsCard>
|
|
</SettingsSection>
|
|
);
|
|
}
|