feat: Implement Pipeline Templates for Company Suite and refine orchestration logic
This commit is contained in:
@@ -316,6 +316,35 @@ export async function handleChatMessage(provider: SidebarChatProvider, data: any
|
||||
if (result.ok) await provider._sendCompanyPipelines();
|
||||
return true;
|
||||
}
|
||||
case 'getCompanyPipelineTemplate': {
|
||||
// Returns a template's stages so the editor can pre-fill the form.
|
||||
const { getPipelineTemplate } = await import('../features/company');
|
||||
const tplId = typeof data.templateId === 'string' ? data.templateId : '';
|
||||
const tpl = getPipelineTemplate(tplId);
|
||||
provider._view?.webview.postMessage({
|
||||
type: 'companyPipelineTemplateContent',
|
||||
value: tpl ? {
|
||||
templateId: tpl.templateId,
|
||||
suggestedPipelineId: tpl.suggestedPipelineId,
|
||||
suggestedPipelineName: tpl.suggestedPipelineName,
|
||||
stages: tpl.stages,
|
||||
} : null,
|
||||
});
|
||||
return true;
|
||||
}
|
||||
case 'respondCompanyApproval': {
|
||||
// Webview의 승인 카드 버튼 클릭 → dispatcher의 await 해제.
|
||||
// payload: { stageId, decision: 'approve' | 'revise' | 'abort', comment? }
|
||||
const stageId = typeof data.stageId === 'string' ? data.stageId : '';
|
||||
const decision = typeof data.decision === 'string' ? data.decision : '';
|
||||
if (!stageId || !['approve', 'revise', 'abort'].includes(decision)) return true;
|
||||
let payload: any;
|
||||
if (decision === 'approve') payload = { kind: 'approve' };
|
||||
else if (decision === 'abort') payload = { kind: 'abort' };
|
||||
else payload = { kind: 'revise', comment: typeof data.comment === 'string' ? data.comment : '' };
|
||||
provider.resolveApprovalGate(stageId, payload);
|
||||
return true;
|
||||
}
|
||||
case 'setActiveCompanyPipeline': {
|
||||
const { setActivePipeline } = await import('../features/company');
|
||||
const pid = typeof data.pipelineId === 'string' && data.pipelineId.trim()
|
||||
|
||||
Reference in New Issue
Block a user