@wrongstack/core 0.63.4 → 0.66.13
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/{agent-bridge-B5rxWrg3.d.ts → agent-bridge-D-j6OOBT.d.ts} +1 -1
- package/dist/agent-subagent-runner-DRZ9-NnR.d.ts +1042 -0
- package/dist/{compactor-0vjZ8KTk.d.ts → compactor-D_ExJajC.d.ts} +1 -1
- package/dist/{config-BdDuaZmB.d.ts → config--86aHSln.d.ts} +1 -1
- package/dist/{context-iFMEO2rN.d.ts → context-y87Jc5ei.d.ts} +3 -3
- package/dist/coordination/index.d.ts +12 -12
- package/dist/coordination/index.js +87 -69
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +22 -22
- package/dist/defaults/index.js +113 -84
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-k8CHjcrN.d.ts → events-CIplI98R.d.ts} +1 -1
- package/dist/execution/index.d.ts +16 -385
- package/dist/execution/index.js +59 -51
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/goal-store-C7jcumEh.d.ts +96 -0
- package/dist/{index-Bc6BiP5q.d.ts → index-DKUvyTvV.d.ts} +28 -442
- package/dist/{index-CWdW_CJt.d.ts → index-b5uhfTSl.d.ts} +8 -8
- package/dist/index.d.ts +34 -32
- package/dist/index.js +647 -677
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/kernel/index.d.ts +9 -9
- package/dist/{mcp-servers-CwqQDMYy.d.ts → mcp-servers-DwoNBf6r.d.ts} +3 -3
- package/dist/models/index.d.ts +2 -2
- package/dist/{multi-agent-coordinator-CNUJYq7U.d.ts → multi-agent-coordinator-CWnH-CiX.d.ts} +10 -2
- package/dist/{null-fleet-bus-DRoJ0uOY.d.ts → null-fleet-bus-VApKRxcp.d.ts} +6 -7
- package/dist/observability/index.d.ts +2 -2
- package/dist/parallel-eternal-engine-0UwotoSx.d.ts +483 -0
- package/dist/{path-resolver-C5sPVne8.d.ts → path-resolver-DVkEcIw8.d.ts} +2 -2
- package/dist/{permission-Ld-i5ugf.d.ts → permission-C1A5whY5.d.ts} +5 -1
- package/dist/{permission-policy-CL-mPufp.d.ts → permission-policy-B2dK-T5N.d.ts} +19 -5
- package/dist/{plan-templates-ThBHOjaM.d.ts → plan-templates-Bprrzhbu.d.ts} +4 -4
- package/dist/{provider-runner-DJQa211J.d.ts → provider-runner-mXvXGSIw.d.ts} +3 -3
- package/dist/{retry-policy-BfBScewS.d.ts → retry-policy-CG3qvH_e.d.ts} +1 -1
- package/dist/sdd/index.d.ts +8 -8
- package/dist/sdd/index.js +58 -51
- package/dist/sdd/index.js.map +1 -1
- package/dist/security/index.d.ts +3 -3
- package/dist/security/index.js +31 -22
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-DxhW7ML3.d.ts → selector-RvBR_YRW.d.ts} +1 -1
- package/dist/session-event-bridge-CDHxcmQU.d.ts +93 -0
- package/dist/{session-reader-q2ThszgG.d.ts → session-reader-BIpwM60D.d.ts} +1 -1
- package/dist/storage/index.d.ts +7 -6
- package/dist/{system-prompt-7LHyBbIf.d.ts → system-prompt-b61lOd49.d.ts} +2 -2
- package/dist/types/index.d.ts +23 -14
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/multi-agent/SKILL.md +0 -2
- package/dist/agent-subagent-runner-Zc3f37Sg.d.ts +0 -182
- package/dist/goal-store-iHltMi5n.d.ts +0 -188
- package/dist/multi-agent-SASYOrWA.d.ts +0 -554
- package/dist/tool-executor-CIjpGaRA.d.ts +0 -111
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { W as WireFamily } from './models-registry-BcYJDKLm.js';
|
|
2
|
-
import { a as Capabilities, P as Permission } from './context-
|
|
2
|
+
import { a as Capabilities, P as Permission } from './context-y87Jc5ei.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Lifecycle hook types — the pure, serializable contract shared by the config
|
|
@@ -265,9 +265,9 @@ declare function isFsError(err: unknown): err is FsError;
|
|
|
265
265
|
|
|
266
266
|
type Permission = 'auto' | 'confirm' | 'deny';
|
|
267
267
|
/**
|
|
268
|
-
* Risk tier for tools in YOLO mode. YOLO auto-approves
|
|
269
|
-
*
|
|
270
|
-
*
|
|
268
|
+
* Risk tier for tools in YOLO mode. YOLO auto-approves everything by default,
|
|
269
|
+
* including destructive calls. Use `--confirm-destructive` to re-enable
|
|
270
|
+
* confirmation prompts for destructive operations.
|
|
271
271
|
*
|
|
272
272
|
* - `safe` — read-only, no side effects (read, glob, grep, etc.)
|
|
273
273
|
* - `standard` — non-destructive writes and mutations (write, edit, safe shell commands)
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { B as BrainArbiter, a as BrainDecision, b as BrainDecisionOption, c as BrainDecisionQueue, d as BrainDecisionRequest, e as BrainDecisionSource, f as BrainFallback, g as BrainRisk, D as DefaultBrainArbiter, h as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, l as formatHumanPrompt } from '../events-
|
|
2
|
-
export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, H as FleetManager, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-
|
|
3
|
-
import { b as AgentDefinition } from '../multi-agent-coordinator-
|
|
4
|
-
export { T as AGENT_TOOL_PRESETS, A as AgentBudgetTier, a as AgentCapability, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-
|
|
5
|
-
export { c as
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
import '../context-iFMEO2rN.js';
|
|
1
|
+
export { B as BrainArbiter, a as BrainDecision, b as BrainDecisionOption, c as BrainDecisionQueue, d as BrainDecisionRequest, e as BrainDecisionSource, f as BrainFallback, g as BrainRisk, D as DefaultBrainArbiter, h as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, l as formatHumanPrompt } from '../events-CIplI98R.js';
|
|
2
|
+
export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, H as FleetManager, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-VApKRxcp.js';
|
|
3
|
+
import { b as AgentDefinition } from '../multi-agent-coordinator-CWnH-CiX.js';
|
|
4
|
+
export { T as AGENT_TOOL_PRESETS, A as AgentBudgetTier, a as AgentCapability, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-CWnH-CiX.js';
|
|
5
|
+
export { c as AgentFactory, d as AgentFactoryResult, e as AgentRunnerOptions, g as BudgetExceededError, h as BudgetKind, i as BudgetLimits, j as BudgetNegotiationMode, k as BudgetThresholdDecision, l as BudgetThresholdHandler, m as BudgetThresholdSignal, n as BudgetUsage, F as FleetBus, p as FleetEvent, q as FleetHandler, r as FleetUsage, s as FleetUsageAggregator, K as SubagentBudget, V as SubagentUsageSnapshot, _ as makeAgentSubagentRunner } from '../agent-subagent-runner-DRZ9-NnR.js';
|
|
6
|
+
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-D-j6OOBT.js';
|
|
7
|
+
import '../context-y87Jc5ei.js';
|
|
9
8
|
import 'node:events';
|
|
10
9
|
import '../director-state-BmYi3DGA.js';
|
|
11
|
-
import '../config
|
|
10
|
+
import '../config--86aHSln.js';
|
|
12
11
|
import '../models-registry-BcYJDKLm.js';
|
|
13
|
-
import '../index-
|
|
12
|
+
import '../index-DKUvyTvV.js';
|
|
14
13
|
import '../logger-DDd5C--Z.js';
|
|
15
|
-
import '../system-prompt-
|
|
14
|
+
import '../system-prompt-b61lOd49.js';
|
|
16
15
|
import '../observability-BhnVLBLS.js';
|
|
17
16
|
import '../secret-scrubber-3MHDDAtm.js';
|
|
18
|
-
import '../permission-
|
|
17
|
+
import '../permission-C1A5whY5.js';
|
|
18
|
+
import '../retry-policy-CG3qvH_e.js';
|
|
19
19
|
|
|
20
20
|
/** Phase 1 · Discovery — map the territory before any work begins. */
|
|
21
21
|
declare const DISCOVERY_AGENTS: AgentDefinition[];
|
|
@@ -1174,6 +1174,10 @@ Emit each evaluation immediately. Do not wait until you have read all reports.`;
|
|
|
1174
1174
|
return lines.join("\n");
|
|
1175
1175
|
}
|
|
1176
1176
|
cleanup() {
|
|
1177
|
+
if (this._timeoutTimer) {
|
|
1178
|
+
clearTimeout(this._timeoutTimer);
|
|
1179
|
+
this._timeoutTimer = void 0;
|
|
1180
|
+
}
|
|
1177
1181
|
for (const dispose of this.disposers) dispose();
|
|
1178
1182
|
this.disposers.length = 0;
|
|
1179
1183
|
}
|
|
@@ -4679,15 +4683,22 @@ var SubagentBudget = class _SubagentBudget {
|
|
|
4679
4683
|
void this.checkLimits();
|
|
4680
4684
|
}
|
|
4681
4685
|
/**
|
|
4682
|
-
* Wall-clock budget check.
|
|
4683
|
-
*
|
|
4684
|
-
*
|
|
4686
|
+
* Wall-clock / idle budget check. Delegates to `checkLimits(elapsed)`, so
|
|
4687
|
+
* `timeout` and `idle_timeout` follow the SAME negotiation path as the other
|
|
4688
|
+
* kinds — they are NOT a special-cased hard stop. This is deliberate: a
|
|
4689
|
+
* heartbeat-aware policy (see `attachAutoExtend` and `CollabSession`) grants
|
|
4690
|
+
* a timeout extension only while the agent is making progress and denies it
|
|
4691
|
+
* once the agent is genuinely stuck, which is safer than an unconditional
|
|
4692
|
+
* hard kill of a long-but-working agent. The runner translates the resulting
|
|
4693
|
+
* `BudgetThresholdSignal` decision (`extend` → patch limits in place,
|
|
4694
|
+
* `stop` → abort) just like every other kind.
|
|
4685
4695
|
*
|
|
4686
|
-
* Decision table:
|
|
4687
|
-
* - no `onThreshold` handler
|
|
4688
|
-
* - `mode === 'sync'` → throw `BudgetExceededError`
|
|
4689
|
-
* - `mode === 'auto'` + no listener
|
|
4690
|
-
* - `mode === 'auto'` + listener
|
|
4696
|
+
* Decision table (same as `checkLimits`):
|
|
4697
|
+
* - no `onThreshold` handler → throw `BudgetExceededError` (hard stop)
|
|
4698
|
+
* - `mode === 'sync'` → throw `BudgetExceededError` (hard stop)
|
|
4699
|
+
* - `mode === 'auto'` + no listener → throw `BudgetExceededError` (no one to ask)
|
|
4700
|
+
* - `mode === 'auto'` + listener → throw `BudgetThresholdSignal` (negotiated;
|
|
4701
|
+
* a heartbeat-aware policy may extend the timeout)
|
|
4691
4702
|
*/
|
|
4692
4703
|
checkTimeout() {
|
|
4693
4704
|
if (this.startTime === null) return;
|
|
@@ -5086,7 +5097,10 @@ var NICKNAME_POOL = {
|
|
|
5086
5097
|
"lavoisier": { name: "Lavoisier", domain: "chemistry" },
|
|
5087
5098
|
"mendeleev": { name: "Mendeleev", domain: "chemistry" }
|
|
5088
5099
|
};
|
|
5089
|
-
var ALL_NICKNAMES = Object.
|
|
5100
|
+
var ALL_NICKNAMES = Object.entries(NICKNAME_POOL);
|
|
5101
|
+
var NAME_TO_KEY = Object.fromEntries(
|
|
5102
|
+
ALL_NICKNAMES.map(([key, entry]) => [entry.name, key])
|
|
5103
|
+
);
|
|
5090
5104
|
var DOMAIN_PREFERENCES = {
|
|
5091
5105
|
"security": ["shannon", "turing", "lamarr", "stallman"],
|
|
5092
5106
|
"bug-hunter": ["darwin", "curie", "feynman", "fermi"],
|
|
@@ -5119,17 +5133,23 @@ function assignNickname(role, used) {
|
|
|
5119
5133
|
for (const key of preferences) {
|
|
5120
5134
|
const entry = NICKNAME_POOL[key];
|
|
5121
5135
|
if (entry && !used.has(key)) {
|
|
5122
|
-
return `${entry.name} (${formatRole(role)})
|
|
5136
|
+
return { key, display: `${entry.name} (${formatRole(role)})` };
|
|
5123
5137
|
}
|
|
5124
5138
|
}
|
|
5125
|
-
for (const entry of ALL_NICKNAMES) {
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
return `${entry.name} (${formatRole(role)})`;
|
|
5139
|
+
for (const [key, entry] of ALL_NICKNAMES) {
|
|
5140
|
+
if (!used.has(key)) {
|
|
5141
|
+
return { key, display: `${entry.name} (${formatRole(role)})` };
|
|
5129
5142
|
}
|
|
5130
5143
|
}
|
|
5131
5144
|
const counter = used.size + 1;
|
|
5132
|
-
return `Scientist #${counter} (${formatRole(role)})
|
|
5145
|
+
return { key: `scientist-${counter}`, display: `Scientist #${counter} (${formatRole(role)})` };
|
|
5146
|
+
}
|
|
5147
|
+
function nicknameKeyFromDisplay(display) {
|
|
5148
|
+
const base = display.replace(/\s*\([^)]*\)\s*$/, "").trim();
|
|
5149
|
+
const key = NAME_TO_KEY[base];
|
|
5150
|
+
if (key) return key;
|
|
5151
|
+
const synthesized = base.match(/^Scientist #(\d+)$/);
|
|
5152
|
+
return synthesized ? `scientist-${synthesized[1]}` : void 0;
|
|
5133
5153
|
}
|
|
5134
5154
|
function formatRole(role) {
|
|
5135
5155
|
return role.split(/[-_]/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
|
|
@@ -5216,11 +5236,10 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
5216
5236
|
const name = subagent.name?.trim() ?? "";
|
|
5217
5237
|
const isPlaceholder = name === "" || name.toLowerCase() === role.toLowerCase() || name === "subagent" || name === "adhoc" || name === "generic" || /^slot-/.test(name);
|
|
5218
5238
|
if (!isPlaceholder) return subagent;
|
|
5219
|
-
const
|
|
5220
|
-
|
|
5221
|
-
this.
|
|
5222
|
-
|
|
5223
|
-
return { ...subagent, name: nickname };
|
|
5239
|
+
const { key, display } = assignNickname(role, this.usedNicknames);
|
|
5240
|
+
this.usedNicknames.add(key);
|
|
5241
|
+
this.subagentNicknames.set(subagentId, key);
|
|
5242
|
+
return { ...subagent, name: display };
|
|
5224
5243
|
}
|
|
5225
5244
|
async spawn(subagent) {
|
|
5226
5245
|
const id = subagent.id || randomUUID();
|
|
@@ -5472,23 +5491,32 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
5472
5491
|
*/
|
|
5473
5492
|
drainPendingAsAborted(message) {
|
|
5474
5493
|
const dropped = this.pendingTasks.splice(0, this.pendingTasks.length);
|
|
5475
|
-
for (const t of dropped)
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5494
|
+
for (const t of dropped) this.emitPendingAborted(t, message);
|
|
5495
|
+
}
|
|
5496
|
+
/**
|
|
5497
|
+
* Emit a synthetic `stopped`/`aborted_by_parent` completion for a single
|
|
5498
|
+
* PENDING task — one that was never counted in `inFlight`. This MUST bypass
|
|
5499
|
+
* `recordCompletion`: that path does `inFlight--`, which for a pending task
|
|
5500
|
+
* steals a decrement from a genuinely in-flight task and trips the underflow
|
|
5501
|
+
* guard — suppressing that real task's `task.completed` and hanging its
|
|
5502
|
+
* `awaitTasks()` caller. Pushes the result and fires the event directly.
|
|
5503
|
+
*/
|
|
5504
|
+
emitPendingAborted(task, message) {
|
|
5505
|
+
const synthetic = {
|
|
5506
|
+
subagentId: task.subagentId ?? "unassigned",
|
|
5507
|
+
taskId: task.id,
|
|
5508
|
+
status: "stopped",
|
|
5509
|
+
error: {
|
|
5510
|
+
kind: "aborted_by_parent",
|
|
5511
|
+
message,
|
|
5512
|
+
retryable: false
|
|
5513
|
+
},
|
|
5514
|
+
iterations: 0,
|
|
5515
|
+
toolCalls: 0,
|
|
5516
|
+
durationMs: 0
|
|
5517
|
+
};
|
|
5518
|
+
this.completedResults.push(synthetic);
|
|
5519
|
+
this.emit("task.completed", { task, result: synthetic });
|
|
5492
5520
|
}
|
|
5493
5521
|
async runDispatched(subagentId, task) {
|
|
5494
5522
|
const subagent = this.subagents.get(subagentId);
|
|
@@ -5749,20 +5777,10 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
|
|
|
5749
5777
|
const orphaned = this.pendingTasks.filter((t) => t.subagentId === subagentId);
|
|
5750
5778
|
this.pendingTasks = this.pendingTasks.filter((t) => t.subagentId !== subagentId);
|
|
5751
5779
|
for (const t of orphaned) {
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
error: {
|
|
5757
|
-
kind: "aborted_by_parent",
|
|
5758
|
-
message: `Subagent "${subagentId}" was removed while task "${t.id}" was pending`,
|
|
5759
|
-
retryable: false
|
|
5760
|
-
},
|
|
5761
|
-
iterations: 0,
|
|
5762
|
-
toolCalls: 0,
|
|
5763
|
-
durationMs: 0
|
|
5764
|
-
};
|
|
5765
|
-
this.recordCompletion(synthetic);
|
|
5780
|
+
this.emitPendingAborted(
|
|
5781
|
+
t,
|
|
5782
|
+
`Subagent "${subagentId}" was removed while task "${t.id}" was pending`
|
|
5783
|
+
);
|
|
5766
5784
|
}
|
|
5767
5785
|
this.fleetBus?.emit({
|
|
5768
5786
|
subagentId,
|
|
@@ -6188,18 +6206,20 @@ var Director = class _Director {
|
|
|
6188
6206
|
if (e.subagentId.startsWith("bug-hunter-") || e.subagentId.startsWith("refactor-planner-") || e.subagentId.startsWith("critic-")) {
|
|
6189
6207
|
return;
|
|
6190
6208
|
}
|
|
6191
|
-
if (payload.kind === "timeout") {
|
|
6209
|
+
if (payload.kind === "timeout" || payload.kind === "idle_timeout") {
|
|
6210
|
+
const heartbeatKey = `${e.subagentId}:${payload.kind}`;
|
|
6192
6211
|
const progress = progressBySubagent.get(e.subagentId) ?? 0;
|
|
6193
|
-
const lastProgress = lastTimeoutProgress.get(
|
|
6212
|
+
const lastProgress = lastTimeoutProgress.get(heartbeatKey) ?? -1;
|
|
6194
6213
|
if (progress <= lastProgress) {
|
|
6195
6214
|
payload.deny();
|
|
6196
6215
|
return;
|
|
6197
6216
|
}
|
|
6198
|
-
lastTimeoutProgress.set(
|
|
6217
|
+
lastTimeoutProgress.set(heartbeatKey, progress);
|
|
6218
|
+
const field = payload.kind === "timeout" ? "timeoutMs" : "idleTimeoutMs";
|
|
6199
6219
|
setImmediate(() => {
|
|
6200
6220
|
const newLimit = Math.min(Math.ceil(payload.limit * 2), 24 * 60 * 6e4);
|
|
6201
|
-
this.recordExtension(e.subagentId, e.taskId,
|
|
6202
|
-
payload.extend({
|
|
6221
|
+
this.recordExtension(e.subagentId, e.taskId, payload.kind, newLimit);
|
|
6222
|
+
payload.extend({ [field]: newLimit });
|
|
6203
6223
|
});
|
|
6204
6224
|
return;
|
|
6205
6225
|
}
|
|
@@ -6515,10 +6535,9 @@ var Director = class _Director {
|
|
|
6515
6535
|
if (this.fleetManager) {
|
|
6516
6536
|
this.fleetManager.assignNicknameAndRecord(config);
|
|
6517
6537
|
} else {
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
);
|
|
6538
|
+
const { key, display } = assignNickname(role, this._usedNicknames);
|
|
6539
|
+
config.name = display;
|
|
6540
|
+
this._usedNicknames.add(key);
|
|
6522
6541
|
}
|
|
6523
6542
|
}
|
|
6524
6543
|
result = await this.coordinator.spawn(config);
|
|
@@ -6840,8 +6859,8 @@ var Director = class _Director {
|
|
|
6840
6859
|
} else {
|
|
6841
6860
|
const entry = this.manifestEntries.get(subagentId);
|
|
6842
6861
|
if (entry?.name) {
|
|
6843
|
-
const nicknameKey = entry.name
|
|
6844
|
-
this._usedNicknames.delete(nicknameKey);
|
|
6862
|
+
const nicknameKey = nicknameKeyFromDisplay(entry.name);
|
|
6863
|
+
if (nicknameKey) this._usedNicknames.delete(nicknameKey);
|
|
6845
6864
|
}
|
|
6846
6865
|
}
|
|
6847
6866
|
this.manifestEntries.delete(subagentId);
|
|
@@ -8453,11 +8472,10 @@ var FleetManager = class {
|
|
|
8453
8472
|
*/
|
|
8454
8473
|
assignNicknameAndRecord(config) {
|
|
8455
8474
|
const role = config.role ?? "subagent";
|
|
8456
|
-
const
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
return nickname;
|
|
8475
|
+
const { key, display } = assignNickname(role, this._usedNicknames);
|
|
8476
|
+
this._usedNicknames.add(key);
|
|
8477
|
+
config.name = display;
|
|
8478
|
+
return display;
|
|
8461
8479
|
}
|
|
8462
8480
|
/**
|
|
8463
8481
|
* Returns the set of already-assigned nickname keys — useful for debugging
|
|
@@ -8642,8 +8660,8 @@ var FleetManager = class {
|
|
|
8642
8660
|
removeSubagent(subagentId) {
|
|
8643
8661
|
const entry = this.manifestEntries.get(subagentId);
|
|
8644
8662
|
if (entry?.name) {
|
|
8645
|
-
const nicknameKey = entry.name
|
|
8646
|
-
this._usedNicknames.delete(nicknameKey);
|
|
8663
|
+
const nicknameKey = nicknameKeyFromDisplay(entry.name);
|
|
8664
|
+
if (nicknameKey) this._usedNicknames.delete(nicknameKey);
|
|
8647
8665
|
}
|
|
8648
8666
|
for (const [taskId, task] of this.pendingTasks) {
|
|
8649
8667
|
if (task.subagentId === subagentId) {
|