agnets done
This commit is contained in:
@@ -14,6 +14,7 @@ import { agentTemplate } from '@/lib/agents/customAgents';
|
||||
import { agentFieldsFromSource, applyAgentFields } from '@/lib/agents/agentFields';
|
||||
import { validateAgentSource } from '@/lib/agents/registry';
|
||||
import { AgentConfigure } from '@/components/agents/AgentConfigure';
|
||||
import { useToolCatalogue } from '@/lib/agents/agentStore';
|
||||
import { AgentSkillWorkspace } from '@/components/agents/skills/AgentSkillWorkspace';
|
||||
import { AgentTestPanel } from '@/components/agents/AgentTestPanel';
|
||||
import { AgentInsightsPanel } from '@/components/agents/AgentInsightsPanel';
|
||||
@@ -81,6 +82,10 @@ export default function AdminAgentDetail() {
|
||||
agents, saving, isShipped, isOverridden, sourceFor, save, publish,
|
||||
} = useAgents();
|
||||
|
||||
/* The tools this deployment registers. Fetched once and cached: the set
|
||||
changes when the backend is deployed, not while a form is open. */
|
||||
const { data: toolCatalogue = [] } = useToolCatalogue();
|
||||
|
||||
const creating = !id;
|
||||
|
||||
/* The definition this screen started from: a stored or shipped one, or a
|
||||
@@ -421,6 +426,14 @@ export default function AdminAgentDetail() {
|
||||
onChange={onChange}
|
||||
onOpenSkills={() => setView('skills')}
|
||||
scopeLocked={shipped}
|
||||
/* The same write path the catalog uses. Configure now lists skills
|
||||
beside every other capability, and both screens agree about when
|
||||
one takes effect. */
|
||||
onToggleSkill={onToggleSkill}
|
||||
pendingSkill={pendingSkill}
|
||||
/* What this agent may actually call. Served by the backend, so the
|
||||
options are the tools that exist rather than a copy kept here. */
|
||||
toolCatalogue={toolCatalogue}
|
||||
/>
|
||||
)}
|
||||
{view === 'skills' && (
|
||||
|
||||
@@ -140,9 +140,14 @@ export default function AdminTalentPool() {
|
||||
...s,
|
||||
count: s.members.length,
|
||||
available: s.members.filter((p) => (p.availability || []).length > 0).length,
|
||||
avgExperience: s.members.length
|
||||
? Math.round(s.members.reduce((sum, p) => sum + (p.experience_years || 0), 0) / s.members.length)
|
||||
: 0,
|
||||
avgExperience: (() => {
|
||||
/* 0 years is "not stated", not "first year" — the cards that show it
|
||||
gate on experience_years > 0, so the average is over the same set. */
|
||||
const stated = s.members.filter((p) => (p.experience_years || 0) > 0);
|
||||
return stated.length
|
||||
? Math.round(stated.reduce((sum, p) => sum + p.experience_years, 0) / stated.length)
|
||||
: 0;
|
||||
})(),
|
||||
}));
|
||||
}, [profiles]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user