@multiclawcli/core 0.10.1 → 0.12.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.
package/dist/index.js CHANGED
@@ -1175,7 +1175,7 @@ async function validateToolsPolicy(config, options = {}) {
1175
1175
  const descriptions = /* @__PURE__ */ new Map();
1176
1176
  for (const agent of agents2) {
1177
1177
  checkAbort();
1178
- if (!hasExplicitTools(agent)) continue;
1178
+ if (!hasExplicitTools(agent) && (agent.tools !== void 0 || !config.defaults?.tools)) continue;
1179
1179
  const runtime = runtimeRegistry.get(agent.runtime ?? "acp");
1180
1180
  const command = resolveCommand(agent, config);
1181
1181
  let commands = descriptions.get(runtime);
@@ -2479,7 +2479,7 @@ var AgentRunner = class {
2479
2479
  const runtime = runtimeRegistry.get(agent.runtime ?? "acp");
2480
2480
  const retries = agent.retries ?? 0;
2481
2481
  const timeout = agent.timeout ?? 6e5;
2482
- const tools = agent.tools ?? ["Read", "Write", "Bash"];
2482
+ const tools = agent.tools ?? this.config.defaults?.tools ?? ["Read", "Write", "Bash"];
2483
2483
  const completed = await withTimeout(
2484
2484
  (innerSignal) => withRetry(
2485
2485
  async (attempt) => {
@@ -3252,13 +3252,38 @@ Address these findings within your assigned scope, preserve the complete task re
3252
3252
  payload: { agentId: agent.id, agentName: agent.name, icon: agent.icon }
3253
3253
  });
3254
3254
  }
3255
+ const agentMap = new Map(this.config.agents.map((a) => [a.id, a]));
3255
3256
  return this.config.agents.filter((a) => runSet.has(a.id) && a.id !== this.config.review?.reviewer).map((a) => ({
3256
3257
  ...a,
3257
- dependsOn: a.dependsOn?.filter(
3258
- (dep) => !skippedIds.has(dep) && dep !== this.config.review?.reviewer
3259
- )
3258
+ dependsOn: a.dependsOn !== void 0 ? this.resolveEffectiveDeps(a.dependsOn, skippedIds, agentMap) : void 0
3260
3259
  }));
3261
3260
  }
3261
+ // When an intermediate agent is skipped, replace it in dependsOn with its own
3262
+ // dependencies (recursively). This preserves topological ordering across gaps:
3263
+ // code-reviewer → tester (skip) → backend-developer becomes
3264
+ // code-reviewer → backend-developer, so the reviewer never runs before the code is written.
3265
+ resolveEffectiveDeps(deps, skippedIds, agentMap, visited = /* @__PURE__ */ new Set()) {
3266
+ const reviewerId = this.config.review?.reviewer;
3267
+ const result = /* @__PURE__ */ new Set();
3268
+ for (const id of deps) {
3269
+ if (id === reviewerId) continue;
3270
+ if (visited.has(id)) continue;
3271
+ if (!skippedIds.has(id)) {
3272
+ result.add(id);
3273
+ } else {
3274
+ visited.add(id);
3275
+ for (const transitive of this.resolveEffectiveDeps(
3276
+ agentMap.get(id)?.dependsOn ?? [],
3277
+ skippedIds,
3278
+ agentMap,
3279
+ visited
3280
+ )) {
3281
+ result.add(transitive);
3282
+ }
3283
+ }
3284
+ }
3285
+ return [...result];
3286
+ }
3262
3287
  async runStage(agents2, signal) {
3263
3288
  const { maxConcurrency } = this.config;
3264
3289
  const results = /* @__PURE__ */ new Map();
@@ -75,6 +75,7 @@ export declare class Orchestrator {
75
75
  * reader looking in the wrong place.
76
76
  */
77
77
  private selectAgents;
78
+ private resolveEffectiveDeps;
78
79
  private runStage;
79
80
  /**
80
81
  * Whether `agent` owns task decomposition.
@@ -1,4 +1,4 @@
1
- import type { AgentDefinition } from "./agent";
1
+ import type { AgentDefinition, ToolName } from "./agent";
2
2
  import type { LeaderMessage } from "./leader";
3
3
  import type { RuntimePermissionHandler, RuntimeQuestionHandler } from "./runtime";
4
4
  /**
@@ -146,6 +146,7 @@ export interface MultiClawConfig {
146
146
  provider?: string;
147
147
  model?: string;
148
148
  command?: string;
149
+ tools?: ToolName[];
149
150
  };
150
151
  }
151
152
  export interface OrchestrationPreview {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiclawcli/core",
3
- "version": "0.10.1",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",