multiclaw 0.5.1 → 0.6.0

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
@@ -611,7 +611,7 @@ ${C.bold}${C.purple}${edge[0]}${line}${edge[3]}`);
611
611
  break;
612
612
  }
613
613
  case "orchestration:complete": {
614
- const { success, totalDuration, agentResults, reply } = e.payload;
614
+ const { success, totalDuration, agentResults, reply, acceptance } = e.payload;
615
615
  if (reply) {
616
616
  const mark = reply.mode === "ask" ? "?" : S.ok;
617
617
  console.log(`
@@ -619,11 +619,22 @@ ${C.cyan}${mark} ${reply.message}${C.reset}`);
619
619
  }
620
620
  const line = (isFancy ? "\u2550" : "=").repeat(50);
621
621
  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)`;
622
+ 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
623
  console.log(`
624
624
  ${C.bold}${C.purple}${edge[0]}${line}${edge[3]}`);
625
625
  console.log(`${edge[1]} ${title.padEnd(48)}${edge[1]}`);
626
626
  console.log(`${edge[2]}${line}${edge[4]}${C.reset}`);
627
+ if (acceptance) {
628
+ console.log(
629
+ ` Reviewer: ${acceptance.reviewer} Repair rounds: ${acceptance.repairRounds}`
630
+ );
631
+ if (acceptance.reason) console.log(` ${acceptance.reason}`);
632
+ const review = acceptance.reviews[acceptance.reviews.length - 1];
633
+ if (review) {
634
+ console.log(` ${review.summary}`);
635
+ for (const issue of review.issues) console.log(` ${S.bullet} ${issue}`);
636
+ }
637
+ }
627
638
  const nameWidth = Math.max(8, ...agentResults.map((r) => r.agentName.length));
628
639
  const totalStr = `${(totalDuration / 1e3).toFixed(1)}s`;
629
640
  const cost = e.payload.totalCostUsd;
@@ -769,12 +780,13 @@ function readReport(runDir) {
769
780
  }
770
781
  }
771
782
  function resumeOptionsFromReport(report, requirementOverride) {
772
- const agents2 = [...new Set(report.agentResults.map((result) => result.agentId))];
783
+ const latest = new Map(report.agentResults.map((result) => [result.agentId, result]));
784
+ const agents2 = [...latest.keys()].filter((id) => id !== report.acceptance?.reviewer);
773
785
  if (agents2.length === 0) {
774
786
  throw new Error("The previous run has no agent results \u2014 nothing to resume");
775
787
  }
776
788
  const sessions = {};
777
- for (const result of report.agentResults) {
789
+ for (const result of latest.values()) {
778
790
  if (result.sessionId) sessions[result.agentId] = result.sessionId;
779
791
  }
780
792
  const requirement = requirementOverride ?? report.requirement;
@@ -796,7 +808,7 @@ function resumeOptionsFromReport(report, requirementOverride) {
796
808
  var EXIT_CANCELLED = 130;
797
809
  async function runCommand(requirementArg, options) {
798
810
  const config = await loadConfig(options.config, requirementArg);
799
- if (options.noLeader) {
811
+ if (options.leader === false || options.noLeader) {
800
812
  config.useLeader = false;
801
813
  }
802
814
  const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
@@ -912,7 +924,15 @@ async function tuiCommand(options) {
912
924
  await startTui({
913
925
  config,
914
926
  onTurnStart: (eventBus, logDir) => {
915
- new FileLogWriter(logDir).attach(eventBus);
927
+ const writer = new FileLogWriter(logDir);
928
+ const detach = writer.attach(eventBus);
929
+ return async () => {
930
+ try {
931
+ await writer.drain();
932
+ } finally {
933
+ detach();
934
+ }
935
+ };
916
936
  }
917
937
  });
918
938
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multiclaw",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
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.0",
34
+ "@multiclawcli/dashboard": "0.6.0",
35
35
  "commander": "^15.0.0",
36
36
  "jiti": "^2.7.0"
37
37
  },