refactor: Fine-tune sidebar interaction and refine company suite configuration
This commit is contained in:
@@ -206,6 +206,29 @@ export async function handleChatMessage(provider: SidebarChatProvider, data: any
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case 'setCompanyAgentDisplay': {
|
||||
// 이름/역할/이모지/색상 override. 페이로드는 setCompanyAgentPrompt와
|
||||
// 동일한 패턴 — null이면 전체 reset, 각 필드 빈 문자열이면 그 필드만 reset.
|
||||
const { setAgentDisplayOverride } = await import('../features/company');
|
||||
const agentId = typeof data.agentId === 'string' ? data.agentId : '';
|
||||
if (!agentId) return true;
|
||||
const v = data.override;
|
||||
const override = v === null
|
||||
? null
|
||||
: {
|
||||
name: typeof v?.name === 'string' ? v.name : undefined,
|
||||
role: typeof v?.role === 'string' ? v.role : undefined,
|
||||
emoji: typeof v?.emoji === 'string' ? v.emoji : undefined,
|
||||
color: typeof v?.color === 'string' ? v.color : undefined,
|
||||
};
|
||||
const result = await setAgentDisplayOverride(provider._context, agentId, override);
|
||||
provider._view?.webview.postMessage({
|
||||
type: 'setCompanyAgentDisplayResult',
|
||||
value: result.ok ? { ok: true, agentId } : { ok: false, reason: result.reason },
|
||||
});
|
||||
if (result.ok) await provider._sendCompanyAgents();
|
||||
return true;
|
||||
}
|
||||
case 'setCompanyAgentRoleCategory': {
|
||||
// Override an agent's 직군. Empty / null payload value reverts to
|
||||
// the def's own roleCategory. CEO is rejected by the backend.
|
||||
|
||||
Reference in New Issue
Block a user