multiclaw 0.5.1 → 0.6.1

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.
@@ -1,5 +1,6 @@
1
1
  export interface RunOptions {
2
2
  config?: string;
3
+ leader?: boolean;
3
4
  noLeader?: boolean;
4
5
  /**
5
6
  * `true` for a bare `--resume` (latest run), or a path to a specific run.
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js CHANGED
@@ -148,9 +148,10 @@ function formatDoctorReport(report, useColor = true) {
148
148
  const lines = [];
149
149
  const c = (code, text) => color(useColor, code, text);
150
150
  const cell = (text, width, code) => {
151
- const rendered = code ? color(useColor, code, text) : text;
152
- const visible = text.replace(ANSI_RE, "").length;
153
- return rendered + " ".repeat(Math.max(0, width - visible));
151
+ const plain = text.replace(ANSI_RE, "");
152
+ const clipped = plain.length > width - 1 ? `${plain.slice(0, Math.max(0, width - 2))}\u2026` : plain;
153
+ const rendered = code ? color(useColor, code, clipped) : clipped;
154
+ return rendered + " ".repeat(Math.max(0, width - clipped.length));
154
155
  };
155
156
  lines.push("");
156
157
  lines.push(c(DIM, "multiclaw doctor \u2014 environment check"));
@@ -611,7 +612,7 @@ ${C.bold}${C.purple}${edge[0]}${line}${edge[3]}`);
611
612
  break;
612
613
  }
613
614
  case "orchestration:complete": {
614
- const { success, totalDuration, agentResults, reply } = e.payload;
615
+ const { success, totalDuration, agentResults, reply, acceptance } = e.payload;
615
616
  if (reply) {
616
617
  const mark = reply.mode === "ask" ? "?" : S.ok;
617
618
  console.log(`
@@ -619,11 +620,22 @@ ${C.cyan}${mark} ${reply.message}${C.reset}`);
619
620
  }
620
621
  const line = (isFancy ? "\u2550" : "=").repeat(50);
621
622
  const edge = isFancy ? ["\u2554", "\u2551", "\u255A", "\u2557", "\u255D"] : ["+", "|", "+", "+", "+"];
622
- const title = reply ? reply.mode === "ask" ? `${S.warn} Needs your input` : `${S.ok} Answered` : e.payload.cancelled ? `${S.skip} Cancelled` : success ? `${S.ok} All done` : `${S.warn} Done (with failures)`;
623
+ const title = reply ? reply.mode === "ask" ? `${S.warn} Needs your input` : `${S.ok} Answered` : acceptance ? acceptance.status === "approved" ? `${S.ok} Approved` : acceptance.status === "changes_required" ? `${S.warn} Changes required` : acceptance.status === "cancelled" ? `${S.skip} Acceptance cancelled` : `${S.fail} Acceptance failed` : e.payload.cancelled ? `${S.skip} Cancelled` : success ? `${S.ok} All done` : `${S.warn} Done (with failures)`;
623
624
  console.log(`
624
625
  ${C.bold}${C.purple}${edge[0]}${line}${edge[3]}`);
625
626
  console.log(`${edge[1]} ${title.padEnd(48)}${edge[1]}`);
626
627
  console.log(`${edge[2]}${line}${edge[4]}${C.reset}`);
628
+ if (acceptance) {
629
+ console.log(
630
+ ` Reviewer: ${acceptance.reviewer} Repair rounds: ${acceptance.repairRounds}`
631
+ );
632
+ if (acceptance.reason) console.log(` ${acceptance.reason}`);
633
+ const review = acceptance.reviews[acceptance.reviews.length - 1];
634
+ if (review) {
635
+ console.log(` ${review.summary}`);
636
+ for (const issue of review.issues) console.log(` ${S.bullet} ${issue}`);
637
+ }
638
+ }
627
639
  const nameWidth = Math.max(8, ...agentResults.map((r) => r.agentName.length));
628
640
  const totalStr = `${(totalDuration / 1e3).toFixed(1)}s`;
629
641
  const cost = e.payload.totalCostUsd;
@@ -769,12 +781,13 @@ function readReport(runDir) {
769
781
  }
770
782
  }
771
783
  function resumeOptionsFromReport(report, requirementOverride) {
772
- const agents2 = [...new Set(report.agentResults.map((result) => result.agentId))];
784
+ const latest = new Map(report.agentResults.map((result) => [result.agentId, result]));
785
+ const agents2 = [...latest.keys()].filter((id) => id !== report.acceptance?.reviewer);
773
786
  if (agents2.length === 0) {
774
787
  throw new Error("The previous run has no agent results \u2014 nothing to resume");
775
788
  }
776
789
  const sessions = {};
777
- for (const result of report.agentResults) {
790
+ for (const result of latest.values()) {
778
791
  if (result.sessionId) sessions[result.agentId] = result.sessionId;
779
792
  }
780
793
  const requirement = requirementOverride ?? report.requirement;
@@ -796,7 +809,7 @@ function resumeOptionsFromReport(report, requirementOverride) {
796
809
  var EXIT_CANCELLED = 130;
797
810
  async function runCommand(requirementArg, options) {
798
811
  const config = await loadConfig(options.config, requirementArg);
799
- if (options.noLeader) {
812
+ if (options.leader === false || options.noLeader) {
800
813
  config.useLeader = false;
801
814
  }
802
815
  const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
@@ -912,7 +925,15 @@ async function tuiCommand(options) {
912
925
  await startTui({
913
926
  config,
914
927
  onTurnStart: (eventBus, logDir) => {
915
- new FileLogWriter(logDir).attach(eventBus);
928
+ const writer = new FileLogWriter(logDir);
929
+ const detach = writer.attach(eventBus);
930
+ return async () => {
931
+ try {
932
+ await writer.drain();
933
+ } finally {
934
+ detach();
935
+ }
936
+ };
916
937
  }
917
938
  });
918
939
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multiclaw",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "multiclaw": "dist/index.js"
@@ -27,11 +27,11 @@
27
27
  "url": "https://github.com/shipengqi/multiclaw/issues"
28
28
  },
29
29
  "dependencies": {
30
- "@agentclientprotocol/claude-agent-acp": "^0.93.0",
30
+ "@agentclientprotocol/claude-agent-acp": "^0.95.0",
31
31
  "@agentclientprotocol/codex-acp": "^2.2.2",
32
- "@inquirer/prompts": "^8.7.3",
33
- "@multiclawcli/core": "0.5.1",
34
- "@multiclawcli/dashboard": "0.5.1",
32
+ "@inquirer/prompts": "^8.7.4",
33
+ "@multiclawcli/core": "0.6.1",
34
+ "@multiclawcli/dashboard": "0.6.1",
35
35
  "commander": "^15.0.0",
36
36
  "jiti": "^2.7.0"
37
37
  },