@yeaft/webchat-agent 1.0.554 → 1.0.556

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "1.0.554",
3
+ "version": "1.0.556",
4
4
  "description": "Remote worker agent for Yeaft Web Code Agent — connects the native Yeaft engine, CLI providers, and workbench tools",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -57,6 +57,9 @@ function projectCurrentActionSummary(action, projectedAction = action) {
57
57
  generation: actionGeneration(projectedAction.generation),
58
58
  assignmentMode: projectedAction.assignmentPolicy?.mode || (projectedAction.requiredRole ? 'fixed' : null),
59
59
  status: projectedAction.status,
60
+ sequence: projectedAction.sequence,
61
+ createdAt: projectedAction.createdAt,
62
+ updatedAt: projectedAction.updatedAt,
60
63
  objective: truncateUtf8(action?.brief?.objective, 1_000) || null,
61
64
  ...(projectedAction.assignedVp ? { assignedVp: projectedAction.assignedVp } : {}),
62
65
  };
@@ -589,6 +592,33 @@ function projectAssignmentPolicy(policy) {
589
592
  };
590
593
  }
591
594
 
595
+ // Only current-identity Run execution counts; queue/retry gaps are not runtime.
596
+ // Keep the active start separate so the browser can tick without polling the Agent.
597
+ function actionTiming(action, runs, matchingRuns) {
598
+ if (!Array.isArray(runs)) {
599
+ return {
600
+ executionDurationMs: Number.isFinite(action.executionDurationMs) && action.executionDurationMs >= 0
601
+ ? action.executionDurationMs : null,
602
+ executionStartedAt: Number.isFinite(action.executionStartedAt) && action.executionStartedAt > 0
603
+ ? action.executionStartedAt : null,
604
+ };
605
+ }
606
+ let executionDurationMs = null;
607
+ let executionStartedAt = null;
608
+ for (const run of matchingRuns) {
609
+ const start = run.startedAt;
610
+ if (!Number.isFinite(start) || start <= 0) continue;
611
+ const end = run.endedAt || run.terminalAt;
612
+ if (Number.isFinite(end) && end >= start) {
613
+ executionDurationMs = (executionDurationMs || 0) + end - start;
614
+ } else if (!end && !run.terminalStatus && run.status === 'running' && action.status === 'running') {
615
+ executionDurationMs ??= 0;
616
+ executionStartedAt = Math.max(executionStartedAt || 0, start);
617
+ }
618
+ }
619
+ return { executionDurationMs, executionStartedAt };
620
+ }
621
+
592
622
  function projectAction(action, runs, events, includeBody = true) {
593
623
  if (!action) return null;
594
624
  const execution = actionExecution(action, runs, events, includeBody);
@@ -617,6 +647,9 @@ function projectAction(action, runs, events, includeBody = true) {
617
647
  return {
618
648
  id: action.id,
619
649
  sequence: action.sequence,
650
+ createdAt: count(action.createdAt),
651
+ updatedAt: count(action.updatedAt),
652
+ ...actionTiming(action, runs, matchingRuns),
620
653
  type: action.type,
621
654
  stageId: action.stageId || action.type,
622
655
  assignmentPolicy: alreadyProjected
@@ -699,6 +732,11 @@ function projectActionStats(detail, liveActionId = bodyActionId(detail)) {
699
732
  id: projected.id,
700
733
  generation: actionGeneration(projected.generation),
701
734
  status: projected.status,
735
+ sequence: projected.sequence,
736
+ createdAt: projected.createdAt,
737
+ updatedAt: projected.updatedAt,
738
+ executionDurationMs: projected.executionDurationMs,
739
+ executionStartedAt: projected.executionStartedAt,
702
740
  assignedVp: projected.assignedVp,
703
741
  contentSummary: projected.contentSummary,
704
742
  executionStats: projected.executionStats,