Release v2.1.8: Company Agent roster overhaul and UI polish
This commit is contained in:
+24
-2
@@ -1582,10 +1582,20 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
const globalWeight = cfg.knowledgeMixSecondBrainWeight ?? 50;
|
||||
// Built-ins first (insertion order from agents.ts), then user-added
|
||||
// customs in their own order. `custom: true` lets the UI render a
|
||||
// delete button only for user-added entries.
|
||||
const builtinIds = COMPANY_AGENT_ORDER.filter((id) => !!COMPANY_AGENTS[id]);
|
||||
// delete button differently for user-added entries.
|
||||
const hiddenSet = new Set(state.hiddenBuiltinIds ?? []);
|
||||
const builtinIds = COMPANY_AGENT_ORDER.filter((id) => !!COMPANY_AGENTS[id] && !hiddenSet.has(id));
|
||||
const customIds = state.customAgents ? Object.keys(state.customAgents) : [];
|
||||
const orderedIds = [...builtinIds, ...customIds];
|
||||
// 파이프라인에서 사용 중인 에이전트 id별로 사용처(파이프라인 이름) 목록을 미리 계산.
|
||||
// 카드의 삭제 버튼 비활성화 + tooltip에 사용 중인 파이프라인 이름을 노출하는 데 사용.
|
||||
const pipelineUsage: Record<string, string[]> = {};
|
||||
for (const p of Object.values(state.pipelines ?? {})) {
|
||||
for (const s of p.stages) {
|
||||
if (!s.agentId) continue;
|
||||
(pipelineUsage[s.agentId] = pipelineUsage[s.agentId] ?? []).push(p.name || p.id);
|
||||
}
|
||||
}
|
||||
const renderEntry = (id: string) => {
|
||||
const builtin = COMPANY_AGENTS[id];
|
||||
const custom = state.customAgents?.[id];
|
||||
@@ -1635,15 +1645,27 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
|
||||
roleCategoryOverridden: !!roleOverride && roleOverride !== baseDef.roleCategory,
|
||||
knowledgeMixOverride: hasKmOverride ? kmOverride : null,
|
||||
effectiveKnowledgeMixWeight: hasKmOverride ? kmOverride : globalWeight,
|
||||
// 파이프라인 사용 현황. 비어 있으면 삭제 가능, 한 개라도 있으면 UI에서
|
||||
// 삭제 버튼을 disabled로 처리하고 tooltip에 사용 중인 파이프라인을 노출.
|
||||
usedInPipelines: pipelineUsage[id] ? [...new Set(pipelineUsage[id])] : [],
|
||||
};
|
||||
};
|
||||
const agents = orderedIds.map(renderEntry).filter((x): x is NonNullable<ReturnType<typeof renderEntry>> => !!x);
|
||||
// 숨김 처리된 빌트인 — 사용자에게 "복원" 옵션을 제공하기 위해 한 줄 메타로 같이 보낸다.
|
||||
const hiddenBuiltins = (state.hiddenBuiltinIds ?? [])
|
||||
.map((id) => {
|
||||
const def = COMPANY_AGENTS[id];
|
||||
if (!def) return null;
|
||||
return { id, name: def.name, role: def.role, emoji: def.emoji };
|
||||
})
|
||||
.filter((x): x is { id: string; name: string; role: string; emoji: string } => !!x);
|
||||
this._view.webview.postMessage({
|
||||
type: 'companyAgents',
|
||||
value: {
|
||||
companyName: state.companyName,
|
||||
globalKnowledgeMixWeight: globalWeight,
|
||||
agents,
|
||||
hiddenBuiltins,
|
||||
// 직군 라벨 사전 + 표시 순서. 웹뷰는 enum 값을 모르므로
|
||||
// 백엔드가 정한 라벨/순서를 같이 보내 UI 일관성을 유지.
|
||||
roleCategoryLabels: ROLE_CATEGORY_LABELS,
|
||||
|
||||
Reference in New Issue
Block a user