@multiclawcli/dashboard 0.6.2 → 0.6.3

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.
Files changed (2) hide show
  1. package/dist/tui.js +39 -1
  2. package/package.json +2 -2
package/dist/tui.js CHANGED
@@ -881,11 +881,49 @@ function conversationTurns(state) {
881
881
  for (const turn of recordedTurns(state)) {
882
882
  if (turn.phase !== "complete" || turn.cancelled || !turn.requirement) continue;
883
883
  turns.push(
884
- turn.reply ? { requirement: turn.requirement, reply: turn.reply } : { requirement: turn.requirement }
884
+ turn.reply ? { requirement: turn.requirement, reply: turn.reply } : { requirement: turn.requirement, outcome: conversationOutcome(turn) }
885
885
  );
886
886
  }
887
887
  return turns;
888
888
  }
889
+ function conversationOutcome(turn) {
890
+ const reviewer = turn.acceptance?.reviewer;
891
+ const isWorker = (id) => id !== reviewer && !turn.leaderIds.includes(id);
892
+ const workers = Object.values(turn.agents).filter((agent) => isWorker(agent.id));
893
+ const completedAgents = workers.filter((agent) => agent.status === "success").map((agent) => agent.id);
894
+ const observed = workers.filter(
895
+ (agent) => agent.status !== "pending" && agent.status !== "skipped"
896
+ );
897
+ const failedAgents = Object.values(turn.agents).filter(
898
+ (agent) => agent.id !== reviewer && agent.status === "failed" && (isWorker(agent.id) || observed.length === 0)
899
+ ).map((agent) => ({
900
+ agentId: agent.id,
901
+ ...agent.error !== void 0 ? { reason: agent.error } : {}
902
+ }));
903
+ const selected = turn.stages.flatMap((stage) => stage.agents).filter((agent) => isWorker(agent.id));
904
+ const unresolved = selected.some((agent) => {
905
+ const status = turn.agents[agent.id]?.status;
906
+ return status === void 0 || status === "pending" || status === "running" || status === "retrying" || status === "skipped";
907
+ });
908
+ let execution = "unknown";
909
+ if (turn.interrupted) execution = "interrupted";
910
+ else if (failedAgents.length > 0) execution = "failed";
911
+ else if (observed.some((agent) => agent.status === "cancelled")) execution = "cancelled";
912
+ else if (observed.length > 0 && observed.every((agent) => agent.status === "success") && !unresolved)
913
+ execution = "success";
914
+ else if (observed.length === 0 && turn.success === false && !turn.acceptance) execution = "failed";
915
+ return {
916
+ execution,
917
+ completedAgents,
918
+ failedAgents,
919
+ ...turn.acceptance ? {
920
+ acceptance: {
921
+ status: turn.acceptance.status,
922
+ ...turn.acceptance.reason !== void 0 ? { reason: turn.acceptance.reason } : {}
923
+ }
924
+ } : {}
925
+ };
926
+ }
889
927
  function tuiReducer(state, action) {
890
928
  switch (action.type) {
891
929
  case "event":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiclawcli/dashboard",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./tui": {
@@ -25,7 +25,7 @@
25
25
  "access": "public"
26
26
  },
27
27
  "dependencies": {
28
- "@multiclawcli/core": "0.6.2",
28
+ "@multiclawcli/core": "0.6.3",
29
29
  "ink": "^8.0.0",
30
30
  "react": "^19.3.1",
31
31
  "string-width": "^8.3.0"