mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 11:20:37 +09:00
feat: add ReportsToPicker for agent management
- Introduced ReportsToPicker component in AgentConfigForm and NewAgent pages to allow selection of an agent's manager. - Updated organizational structure documentation to reflect the ability to change an agent's manager post-creation. - Enhanced error handling in ConfigurationTab to provide user feedback on save failures.
This commit is contained in:
parent
dfdd3784b9
commit
61f53b6471
5 changed files with 134 additions and 56 deletions
|
|
@ -44,6 +44,7 @@ import { ClaudeLocalAdvancedFields } from "../adapters/claude-local/config-field
|
|||
import { MarkdownEditor } from "./MarkdownEditor";
|
||||
import { ChoosePathButton } from "./PathInstructionsModal";
|
||||
import { OpenCodeLogoIcon } from "./OpenCodeLogoIcon";
|
||||
import { ReportsToPicker } from "./ReportsToPicker";
|
||||
|
||||
/* ---- Create mode values ---- */
|
||||
|
||||
|
|
@ -301,6 +302,12 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
|||
});
|
||||
const models = fetchedModels ?? externalModels ?? [];
|
||||
|
||||
const { data: companyAgents = [] } = useQuery({
|
||||
queryKey: selectedCompanyId ? queryKeys.agents.list(selectedCompanyId) : ["agents", "none", "list"],
|
||||
queryFn: () => agentsApi.list(selectedCompanyId!),
|
||||
enabled: Boolean(!isCreate && selectedCompanyId),
|
||||
});
|
||||
|
||||
/** Props passed to adapter-specific config field components */
|
||||
const adapterFieldProps = {
|
||||
mode,
|
||||
|
|
@ -447,6 +454,15 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
|||
placeholder="e.g. VP of Engineering"
|
||||
/>
|
||||
</Field>
|
||||
<Field label="Reports to" hint={help.reportsTo}>
|
||||
<ReportsToPicker
|
||||
agents={companyAgents}
|
||||
value={eff("identity", "reportsTo", props.agent.reportsTo ?? null)}
|
||||
onChange={(id) => mark("identity", "reportsTo", id)}
|
||||
excludeAgentIds={[props.agent.id]}
|
||||
chooseLabel="Choose manager…"
|
||||
/>
|
||||
</Field>
|
||||
<Field label="Capabilities" hint={help.capabilities}>
|
||||
<MarkdownEditor
|
||||
value={eff("identity", "capabilities", props.agent.capabilities ?? "")}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue