吸收数字员工PlanStep本地软租约

This commit is contained in:
baiyanyun
2026-06-10 22:29:52 +08:00
parent 909f11dae5
commit 6f2ccdf783
13 changed files with 604 additions and 49 deletions

View File

@@ -63,6 +63,7 @@ interface DigitalPlanItem {
readyStepCount: number;
runningStepCount: number;
blockedStepCount: number;
leasedStepCount: number;
schedulerJob?: CronJob | null;
source: 'plan_template';
}
@@ -71,6 +72,7 @@ interface PlanStepOrchestrationSummary {
ready: number;
running: number;
blocked: number;
leased: number;
}
interface BlockedPlanStepInputTarget {
@@ -417,6 +419,7 @@ function buildPlanTemplateItem(job: CronJob, duties: DigitalEmployeeDuty[], sele
readyStepCount: 0,
runningStepCount: 0,
blockedStepCount: 0,
leasedStepCount: 0,
schedulerJob: job,
source: 'plan_template',
};
@@ -441,9 +444,12 @@ function planStepOrchestrationSummary(rows: PlanStepBusinessRow[]): Map<string,
rows.forEach((step) => {
const planId = step.plan_id || '';
if (!planId) return;
const current = summary.get(planId) ?? { ready: 0, running: 0, blocked: 0 };
const current = summary.get(planId) ?? { ready: 0, running: 0, blocked: 0, leased: 0 };
const status = step.status.toLowerCase();
if (status === 'ready') current.ready += 1;
if (step.lease_active || step.skip_reason === 'lease_active') {
current.leased += 1;
current.running += 1;
} else if (status === 'ready' && step.dispatchable) current.ready += 1;
else if (['running', 'active', 'leased', 'queued'].includes(status)) current.running += 1;
else if (status === 'blocked') current.blocked += 1;
summary.set(planId, current);
@@ -1128,8 +1134,9 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit
readyStepCount: orchestration.ready,
runningStepCount: orchestration.running,
blockedStepCount: orchestration.blocked,
resultText: orchestration.ready > 0 || orchestration.running > 0 || orchestration.blocked > 0
? `Ready ${orchestration.ready} · 运行 ${orchestration.running} · 阻塞 ${orchestration.blocked}`
leasedStepCount: orchestration.leased,
resultText: orchestration.ready > 0 || orchestration.running > 0 || orchestration.blocked > 0 || orchestration.leased > 0
? `Ready ${orchestration.ready} · 运行 ${orchestration.running} · 阻塞 ${orchestration.blocked}${orchestration.leased > 0 ? ` · 租约 ${orchestration.leased}` : ''}`
: item.resultText,
};
});