feat(03-02): add agent-centric skill toggles in AgentEditor for D-04 dual access
- Import SkillAgentToggles and Zustand skill state into AgentEditor - Add lazy skill loading for navigation paths that bypass Skills section - Render Skills section with agent-centric toggle mode between heartbeat and save
This commit is contained in:
1 parent
e71d2e5529
commit
2ade6c0cbc
1 file changed
+19
@@ -3,7 +3,9 @@ import { Pencil, Trash } from "@phosphor-icons/react";
|
|||||||
import type { AgentRecord, ConnectorRecord, WorkspaceRecord } from "@shared/types";
|
import type { AgentRecord, ConnectorRecord, WorkspaceRecord } from "@shared/types";
|
||||||
import { getConnectorExecutionReadinessIssue, isConnectorExecutionReady } from "@shared/connector-policy";
|
import { getConnectorExecutionReadinessIssue, isConnectorExecutionReady } from "@shared/connector-policy";
|
||||||
import { unwrap } from "../../lib/desktop";
|
import { unwrap } from "../../lib/desktop";
|
||||||
|
import { useAppStore } from "../../state/store";
|
||||||
import { ActionButton, Input, Select, TextArea } from "../ui";
|
import { ActionButton, Input, Select, TextArea } from "../ui";
|
||||||
|
import { SkillAgentToggles } from "../skills/SkillAgentToggles";
|
||||||
import { ConfirmDelete, HeartbeatSection } from "./helpers";
|
import { ConfirmDelete, HeartbeatSection } from "./helpers";
|
||||||
|
|
||||||
export function AgentEditor({
|
export function AgentEditor({
|
||||||
@@ -74,6 +76,17 @@ export function AgentEditor({
|
|||||||
}
|
}
|
||||||
}, [connectorId, agent.connectorId]);
|
}, [connectorId, agent.connectorId]);
|
||||||
|
|
||||||
|
const skills = useAppStore((s) => s.skills);
|
||||||
|
const setSkills = useAppStore((s) => s.setSkills);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (skills.length === 0 && companyId) {
|
||||||
|
window.agentCompany.listSkills(companyId).then((result) => {
|
||||||
|
if (result.ok) setSkills(result.data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [companyId, skills.length, setSkills]);
|
||||||
|
|
||||||
const managerCandidates = agents.filter((a) => a.id !== agent.id);
|
const managerCandidates = agents.filter((a) => a.id !== agent.id);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -162,6 +175,12 @@ export function AgentEditor({
|
|||||||
|
|
||||||
<HeartbeatSection agent={agent} companyId={companyId} pendingApproval={pendingApproval} persistedConnectorIssue={persistedConnectorIssue} onSaved={onSaved} />
|
<HeartbeatSection agent={agent} companyId={companyId} pendingApproval={pendingApproval} persistedConnectorIssue={persistedConnectorIssue} onSaved={onSaved} />
|
||||||
|
|
||||||
|
{/* Skills section (D-04 dual access) */}
|
||||||
|
<div className="mt-6 border-t border-[color:var(--line)] pt-4">
|
||||||
|
<h3 className="text-[13px] font-semibold uppercase tracking-[0.08em] text-[color:var(--accent-text)] mb-3">Skills</h3>
|
||||||
|
<SkillAgentToggles mode="agent" companyId={companyId} agentId={agent.id} skills={skills} />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<ActionButton
|
<ActionButton
|
||||||
label="Save changes"
|
label="Save changes"
|
||||||
|
|||||||
Reference in new issue
Block a user