@wrongstack/core 0.9.7 → 0.9.20
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-DMVOX0cF.d.ts → agent-bridge-Dti3KXGk.d.ts} +1 -1
- package/dist/{agent-subagent-runner-DaF_EgRG.d.ts → agent-subagent-runner-U-rs7kk7.d.ts} +3 -4
- package/dist/compactor-D7X96RLZ.d.ts +41 -0
- package/dist/{config-SkMIDN9L.d.ts → config-CLXMDOSs.d.ts} +5 -1
- package/dist/{context-BRNbHmRM.d.ts → context-zkZeILpr.d.ts} +46 -0
- package/dist/coordination/index.d.ts +14 -13
- package/dist/coordination/index.js +1263 -123
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +22 -21
- package/dist/defaults/index.js +1477 -152
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-CiG9qUM_.d.ts → events-DH-9r-_C.d.ts} +42 -1
- package/dist/execution/index.d.ts +42 -30
- package/dist/execution/index.js +359 -112
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +7 -6
- package/dist/extension/index.js.map +1 -1
- package/dist/{index-CP8638Wm.d.ts → index-BIHJ4uII.d.ts} +12 -8
- package/dist/{index-Bsha5K4D.d.ts → index-CFO9QmJo.d.ts} +9 -8
- package/dist/index.d.ts +319 -37
- package/dist/index.js +2571 -324
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +36 -0
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +10 -9
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-BouUWYW6.d.ts → mcp-servers-DkESgh0G.d.ts} +25 -3
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-3ZnTB1aT.d.ts → multi-agent-DNp6lAzg.d.ts} +35 -23
- package/dist/{multi-agent-coordinator-DTXF2aAl.d.ts → multi-agent-coordinator-CAhsegPz.d.ts} +20 -2
- package/dist/{null-fleet-bus-Chrc_3Pp.d.ts → null-fleet-bus-Dnl19vmf.d.ts} +496 -15
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-TcJfc29Y.d.ts → path-resolver-CHiBL0DD.d.ts} +2 -2
- package/dist/{secret-scrubber-DttNiGYA.d.ts → permission-H35s9Evv.d.ts} +2 -7
- package/dist/{permission-policy-BpCGYBud.d.ts → permission-policy-CT-nRmTn.d.ts} +9 -2
- package/dist/{plan-templates-envSmNlZ.d.ts → plan-templates-Bs8iRwi6.d.ts} +28 -4
- package/dist/{provider-runner-BEpikbbN.d.ts → provider-runner-BZdDrWrS.d.ts} +3 -3
- package/dist/{retry-policy-BYkq0ugs.d.ts → retry-policy-J9N_PM40.d.ts} +1 -1
- package/dist/sdd/index.d.ts +10 -10
- package/dist/sdd/index.js +225 -68
- package/dist/sdd/index.js.map +1 -1
- package/dist/secret-scrubber-3MHDDAtm.d.ts +6 -0
- package/dist/{secret-scrubber-QSeI0ADi.d.ts → secret-scrubber-7rSC_emZ.d.ts} +1 -1
- package/dist/security/index.d.ts +5 -4
- package/dist/security/index.js +37 -6
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-pox8abg0.d.ts → selector-CFTh3Z6p.d.ts} +1 -1
- package/dist/{session-reader-CSWcb5Ga.d.ts → session-reader-C7JJlxOw.d.ts} +2 -2
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +391 -6
- package/dist/storage/index.js +760 -40
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-Bs-Wliab.d.ts → system-prompt-CneIxVip.d.ts} +1 -1
- package/dist/{tool-executor-CsktM3h9.d.ts → tool-executor-flTuxsqO.d.ts} +9 -4
- package/dist/types/index.d.ts +16 -15
- package/dist/types/index.js +60 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +25 -2
- package/dist/utils/index.js +90 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/compactor-DVTKL7XD.d.ts +0 -23
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { c as AgentPhase, b as AgentDefinition, d as DefaultMultiAgentCoordinator, f as DispatchClassifier } from './multi-agent-coordinator-
|
|
2
|
-
import { n as SubagentConfig, u as TaskResult, k as CoordinatorStatus, v as TaskSpec, M as MultiAgentConfig, t as SubagentRunner } from './multi-agent-
|
|
3
|
-
import { B as SessionWriter, Q as Tool, y as SessionStore } from './context-
|
|
1
|
+
import { c as AgentPhase, b as AgentDefinition, d as DefaultMultiAgentCoordinator, f as DispatchClassifier } from './multi-agent-coordinator-CAhsegPz.js';
|
|
2
|
+
import { n as SubagentConfig, u as TaskResult, k as CoordinatorStatus, v as TaskSpec, M as MultiAgentConfig, t as SubagentRunner } from './multi-agent-DNp6lAzg.js';
|
|
3
|
+
import { B as SessionWriter, Q as Tool, y as SessionStore } from './context-zkZeILpr.js';
|
|
4
|
+
import { F as FleetBus, e as FleetUsage, f as FleetUsageAggregator } from './agent-subagent-runner-U-rs7kk7.js';
|
|
5
|
+
import { EventEmitter } from 'node:events';
|
|
4
6
|
import { a as DirectorStateSnapshot } from './director-state-BmYi3DGA.js';
|
|
5
|
-
import { I as InMemoryAgentBridge } from './agent-bridge-
|
|
6
|
-
import {
|
|
7
|
-
import { E as EventBus } from './events-CiG9qUM_.js';
|
|
7
|
+
import { I as InMemoryAgentBridge } from './agent-bridge-Dti3KXGk.js';
|
|
8
|
+
import { E as EventBus } from './events-DH-9r-_C.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Agent catalog aggregator.
|
|
@@ -30,6 +31,237 @@ declare const AGENT_CATALOG: Record<string, AgentDefinition>;
|
|
|
30
31
|
/** Role lookup helper. Returns undefined for unknown roles. */
|
|
31
32
|
declare function getAgentDefinition(role: string): AgentDefinition | undefined;
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Alert levels the Director can emit when a collab session needs attention.
|
|
36
|
+
* These flow through the FleetBus so the host can display them in the UI.
|
|
37
|
+
*/
|
|
38
|
+
declare enum DirectorAlertLevel {
|
|
39
|
+
/** The agent is still making progress but has hit a soft budget limit. */
|
|
40
|
+
WARNING = "warning",
|
|
41
|
+
/** The agent has hit a hard limit and the session cannot continue. */
|
|
42
|
+
CRITICAL = "critical",
|
|
43
|
+
/** The Director has decided to cancel the session (user request or policy). */
|
|
44
|
+
CANCELLED = "cancelled"
|
|
45
|
+
}
|
|
46
|
+
interface DirectorAlert {
|
|
47
|
+
sessionId: string;
|
|
48
|
+
subagentId: string;
|
|
49
|
+
role: string;
|
|
50
|
+
level: DirectorAlertLevel;
|
|
51
|
+
/** Human-readable message for UI/logs */
|
|
52
|
+
message: string;
|
|
53
|
+
/** Budget kind that triggered this alert, if any */
|
|
54
|
+
budgetKind?: 'timeout' | 'iterations' | 'tool_calls' | 'tokens' | 'cost';
|
|
55
|
+
/** Elapsed ms at time of alert */
|
|
56
|
+
elapsedMs?: number;
|
|
57
|
+
/** Limit that was hit */
|
|
58
|
+
limit?: number;
|
|
59
|
+
/** /btw notes the director has collected (may be empty) */
|
|
60
|
+
btwNotes?: string[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Immutable snapshot of target files at the start of a collab session.
|
|
64
|
+
* All agents in the session read from this snapshot — they see the same baseline.
|
|
65
|
+
*/
|
|
66
|
+
interface SharedFileSnapshot {
|
|
67
|
+
id: string;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
files: SharedFileEntry[];
|
|
70
|
+
}
|
|
71
|
+
interface SharedFileEntry {
|
|
72
|
+
path: string;
|
|
73
|
+
content: string;
|
|
74
|
+
language?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Bug finding emitted by BugHunter and consumed by RefactorPlanner + Critic.
|
|
78
|
+
*/
|
|
79
|
+
interface BugFinding {
|
|
80
|
+
id: string;
|
|
81
|
+
type: string;
|
|
82
|
+
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
83
|
+
location: {
|
|
84
|
+
file: string;
|
|
85
|
+
line: number;
|
|
86
|
+
};
|
|
87
|
+
description: string;
|
|
88
|
+
suggestedFix?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Refactoring plan emitted by RefactorPlanner, consuming BugFinding(s).
|
|
92
|
+
*/
|
|
93
|
+
interface RefactorPlan {
|
|
94
|
+
id: string;
|
|
95
|
+
basedOnBugIds: string[];
|
|
96
|
+
phases: RefactorPhase[];
|
|
97
|
+
riskScore: 'low' | 'medium' | 'high';
|
|
98
|
+
estimatedChangeCount: number;
|
|
99
|
+
rollbackStrategy: string;
|
|
100
|
+
}
|
|
101
|
+
/** One phase within a refactor plan. */
|
|
102
|
+
interface RefactorPhase {
|
|
103
|
+
number: number;
|
|
104
|
+
title: string;
|
|
105
|
+
tasks: string[];
|
|
106
|
+
risk: 'low' | 'medium' | 'high';
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Critic evaluation of a bug finding or refactor plan.
|
|
110
|
+
*/
|
|
111
|
+
interface CriticEvaluation {
|
|
112
|
+
id: string;
|
|
113
|
+
subjectType: 'bug_finding' | 'refactor_plan';
|
|
114
|
+
subjectId: string;
|
|
115
|
+
score: number;
|
|
116
|
+
verdict: 'approve' | 'needs_revision' | 'reject';
|
|
117
|
+
strengths: string[];
|
|
118
|
+
weaknesses: string[];
|
|
119
|
+
concerns: CriticConcern[];
|
|
120
|
+
}
|
|
121
|
+
interface CriticConcern {
|
|
122
|
+
description: string;
|
|
123
|
+
location?: {
|
|
124
|
+
file: string;
|
|
125
|
+
line: number;
|
|
126
|
+
};
|
|
127
|
+
severity: 'blocking' | 'advisory';
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Full structured report produced when a CollabSession resolves.
|
|
131
|
+
*/
|
|
132
|
+
interface CollabDebugReport {
|
|
133
|
+
sessionId: string;
|
|
134
|
+
startedAt: string;
|
|
135
|
+
completedAt: string;
|
|
136
|
+
targetPaths: string[];
|
|
137
|
+
/** How the session ended. 'completed' = all agents finished normally.
|
|
138
|
+
* 'cancelled' = Director called cancelCollabSession().
|
|
139
|
+
* 'timeout' = session-level timeout elapsed before all agents finished.
|
|
140
|
+
* 'critical_alert' = Director escalated a warning to a cancel decision.
|
|
141
|
+
*/
|
|
142
|
+
disposition: 'completed' | 'cancelled' | 'timeout' | 'critical_alert';
|
|
143
|
+
bugs: BugFinding[];
|
|
144
|
+
refactorPlans: RefactorPlan[];
|
|
145
|
+
evaluations: CriticEvaluation[];
|
|
146
|
+
/** Alerts that were raised during the session (may be empty). */
|
|
147
|
+
alerts: DirectorAlert[];
|
|
148
|
+
/** Overall verdict from the Critic across all evaluated subjects. */
|
|
149
|
+
overallVerdict: 'approve' | 'needs_revision' | 'reject';
|
|
150
|
+
/** Markdown-formatted summary for the director's context window. */
|
|
151
|
+
summary: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Per-agent budget configuration for collab sessions.
|
|
155
|
+
* Allows the caller (Director) to control the exact limits instead of
|
|
156
|
+
* using hard-coded defaults that may not match the director's policy.
|
|
157
|
+
*/
|
|
158
|
+
interface CollabBudgetConfig {
|
|
159
|
+
maxIterations: number;
|
|
160
|
+
maxToolCalls: number;
|
|
161
|
+
timeoutMs: number;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Budget overrides for specific roles in a collab session.
|
|
165
|
+
* When a role is not present in the map, the default budget is used.
|
|
166
|
+
*/
|
|
167
|
+
type CollabBudgetOverrides = Partial<Record<string, CollabBudgetConfig>>;
|
|
168
|
+
/**
|
|
169
|
+
* Emitted by a collab agent when it hits a soft budget limit.
|
|
170
|
+
* The Director's fleet handler receives this and calls collabAlert().
|
|
171
|
+
*/
|
|
172
|
+
interface CollabBudgetWarningPayload {
|
|
173
|
+
sessionId: string;
|
|
174
|
+
role: string;
|
|
175
|
+
kind: 'timeout' | 'iterations' | 'tool_calls' | 'tokens' | 'cost';
|
|
176
|
+
used: number;
|
|
177
|
+
limit: number;
|
|
178
|
+
timeoutMs?: number;
|
|
179
|
+
elapsedMs: number;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Emitted by the Director to cancel all agents in a collab session.
|
|
183
|
+
* CollabSession listens for this and causes its agent pool to finish early.
|
|
184
|
+
*/
|
|
185
|
+
interface DirectorCancelCollabPayload {
|
|
186
|
+
sessionId: string;
|
|
187
|
+
reason: string;
|
|
188
|
+
cancelledAt: string;
|
|
189
|
+
}
|
|
190
|
+
interface CollabSessionOptions {
|
|
191
|
+
/** Paths to scan — used to build the SharedFileSnapshot. */
|
|
192
|
+
targetPaths: string[];
|
|
193
|
+
/** Files already read and snapshot. When provided, snapshot is skipped. */
|
|
194
|
+
prebuiltSnapshot?: SharedFileSnapshot;
|
|
195
|
+
/** Max time to wait for the session to resolve (ms). Default: 10 min. */
|
|
196
|
+
timeoutMs?: number;
|
|
197
|
+
/**
|
|
198
|
+
* Budget overrides per role. When provided, these override the hard-coded
|
|
199
|
+
* defaults so the Director can enforce fleet-wide budget policy.
|
|
200
|
+
* Keys must match role names: 'bug-hunter', 'refactor-planner', 'critic'.
|
|
201
|
+
*/
|
|
202
|
+
budgetOverrides?: CollabBudgetOverrides;
|
|
203
|
+
/**
|
|
204
|
+
* Called by the Director when a collab agent hits a soft budget limit.
|
|
205
|
+
* The Director uses this to decide whether to cancel the session or extend.
|
|
206
|
+
* Return 'cancel' to stop the session immediately; 'extend' to continue
|
|
207
|
+
* with the agent's proposed new limits; 'ignore' to let the default
|
|
208
|
+
* auto-extend logic handle it.
|
|
209
|
+
*/
|
|
210
|
+
onBudgetWarning?: (alert: DirectorAlert) => 'cancel' | 'extend' | 'ignore';
|
|
211
|
+
}
|
|
212
|
+
declare class CollabSession extends EventEmitter {
|
|
213
|
+
readonly sessionId: string;
|
|
214
|
+
readonly options: CollabSessionOptions;
|
|
215
|
+
readonly snapshot: SharedFileSnapshot;
|
|
216
|
+
private readonly director;
|
|
217
|
+
private readonly fleetBus;
|
|
218
|
+
private readonly subagentIds;
|
|
219
|
+
private readonly bugs;
|
|
220
|
+
private readonly plans;
|
|
221
|
+
private readonly evaluations;
|
|
222
|
+
private readonly disposers;
|
|
223
|
+
private settled;
|
|
224
|
+
private readonly timeoutMs;
|
|
225
|
+
private cancelled;
|
|
226
|
+
private readonly alerts;
|
|
227
|
+
/** Tracks tool call counts per subagent for progress-based timeout decisions. */
|
|
228
|
+
private readonly progressBySubagent;
|
|
229
|
+
/** Last tool call count when a timeout warning was handled. */
|
|
230
|
+
private readonly lastTimeoutProgress;
|
|
231
|
+
/** Session-level timeout timer handle (cleared on cancel or natural completion). */
|
|
232
|
+
private _timeoutTimer?;
|
|
233
|
+
constructor(director: Director, fleetBus: FleetBus, options: CollabSessionOptions);
|
|
234
|
+
get id(): string;
|
|
235
|
+
getSessionAlerts(): DirectorAlert[];
|
|
236
|
+
isCancelled(): boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Snapshot of role → subagentId map. The Director calls coordinator.stop()
|
|
239
|
+
* for each agent when cancelling the session, using this map to enumerate
|
|
240
|
+
* all three collab agents.
|
|
241
|
+
*/
|
|
242
|
+
getSubagentIds(): ReadonlyMap<string, string>;
|
|
243
|
+
buildSnapshot(): Promise<SharedFileSnapshot>;
|
|
244
|
+
/**
|
|
245
|
+
* Cancel the session. Emits director.cancel_collab on the FleetBus so all
|
|
246
|
+
* collab agents finish early. The session-level timeout timer is also cleared.
|
|
247
|
+
* Safe to call multiple times (idempotent after first call).
|
|
248
|
+
*/
|
|
249
|
+
cancel(reason?: string): void;
|
|
250
|
+
start(): Promise<CollabDebugReport>;
|
|
251
|
+
private parseAndEmit;
|
|
252
|
+
private extractJsonObjects;
|
|
253
|
+
private budgetForRole;
|
|
254
|
+
private spawnAgent;
|
|
255
|
+
private buildBugHunterTask;
|
|
256
|
+
private buildRefactorPlannerTask;
|
|
257
|
+
private buildCriticTask;
|
|
258
|
+
private wireFleetBus;
|
|
259
|
+
private roleFromSubagentId;
|
|
260
|
+
private assembleReport;
|
|
261
|
+
private buildMarkdownSummary;
|
|
262
|
+
private cleanup;
|
|
263
|
+
}
|
|
264
|
+
|
|
33
265
|
/**
|
|
34
266
|
* Interface for a fleet coordinator. Implemented by both `Director`
|
|
35
267
|
* (full LLM-driven orchestration with fleet policy) and
|
|
@@ -155,14 +387,41 @@ interface IFleetManager {
|
|
|
155
387
|
} | undefined;
|
|
156
388
|
/**
|
|
157
389
|
* Called before a spawn is recorded. Returns a reason string if the
|
|
158
|
-
* spawn should be rejected (budget cap, depth limit, cost cap,
|
|
159
|
-
* or null to proceed. Director.spawn() calls this
|
|
390
|
+
* spawn should be rejected (budget cap, depth limit, cost cap, context
|
|
391
|
+
* overload, etc.), or null to proceed. Director.spawn() calls this
|
|
392
|
+
* internally.
|
|
160
393
|
*/
|
|
161
394
|
canSpawn(config: SubagentConfig): {
|
|
162
|
-
kind: 'max_spawns' | 'max_spawn_depth' | 'max_cost_usd';
|
|
395
|
+
kind: 'max_spawns' | 'max_spawn_depth' | 'max_cost_usd' | 'max_context_load';
|
|
163
396
|
limit: number;
|
|
164
397
|
observed: number;
|
|
165
398
|
} | null;
|
|
399
|
+
/**
|
|
400
|
+
* Update the leader agent's current context pressure (tokens used in the
|
|
401
|
+
* full API request: messages + systemPrompt + toolDefs). The fleet manager
|
|
402
|
+
* checks this before allowing a new spawn to prevent the leader from
|
|
403
|
+
* overflowing its context window while orchestrating subagents.
|
|
404
|
+
*/
|
|
405
|
+
setLeaderContextPressure(tokens: number): void;
|
|
406
|
+
/**
|
|
407
|
+
* Assign a memorable nickname (e.g. "Einstein (Bug Hunter)"), mark it
|
|
408
|
+
* as used so it is never reused, then record the spawn. The nickname
|
|
409
|
+
* is written back to `config.name` so the coordinator and manifest both
|
|
410
|
+
* see the human-readable name.
|
|
411
|
+
*
|
|
412
|
+
* Returns the assigned nickname string.
|
|
413
|
+
*/
|
|
414
|
+
assignNicknameAndRecord(subagentId: string, config: SubagentConfig, priceLookup?: {
|
|
415
|
+
input?: number;
|
|
416
|
+
output?: number;
|
|
417
|
+
cacheRead?: number;
|
|
418
|
+
cacheWrite?: number;
|
|
419
|
+
}): string;
|
|
420
|
+
/**
|
|
421
|
+
* Readonly view of already-assigned nickname keys. Used by `Director.spawn()`
|
|
422
|
+
* to avoid assigning the same nickname twice across the fleet.
|
|
423
|
+
*/
|
|
424
|
+
readonly usedNicknames: ReadonlySet<string>;
|
|
166
425
|
/**
|
|
167
426
|
* Called after a spawn succeeds. Records metadata for the usage
|
|
168
427
|
* aggregator and manifest.
|
|
@@ -264,6 +523,19 @@ interface FleetManagerOptions {
|
|
|
264
523
|
directorBudget?: {
|
|
265
524
|
maxCostUsd?: number;
|
|
266
525
|
};
|
|
526
|
+
/**
|
|
527
|
+
* Maximum context load (as a fraction of maxContext) the leader agent
|
|
528
|
+
* is allowed to reach before a new spawn is rejected. Default: 0.85.
|
|
529
|
+
* When the leader's context pressure exceeds this threshold, spawning
|
|
530
|
+
* a new subagent is refused — the leader must compact first.
|
|
531
|
+
* Set to 1.0 to disable this check.
|
|
532
|
+
*/
|
|
533
|
+
maxLeaderContextLoad?: number;
|
|
534
|
+
/**
|
|
535
|
+
* Provider's max context window in tokens. Used with `maxLeaderContextLoad`
|
|
536
|
+
* to compute the absolute token threshold. Default: 128_000.
|
|
537
|
+
*/
|
|
538
|
+
maxContext?: number;
|
|
267
539
|
}
|
|
268
540
|
/**
|
|
269
541
|
* Fleet-level policy container extracted from `Director`. Owns:
|
|
@@ -290,7 +562,6 @@ declare class FleetManager implements IFleetManager {
|
|
|
290
562
|
/** Usage rollup across all subagents. */
|
|
291
563
|
readonly usage: FleetUsageAggregator;
|
|
292
564
|
private readonly manifestPath?;
|
|
293
|
-
private readonly sessionsRoot?;
|
|
294
565
|
private readonly directorRunId;
|
|
295
566
|
/** Spawn cap (lifetime total). Infinity means unlimited. */
|
|
296
567
|
readonly maxSpawns: number;
|
|
@@ -314,8 +585,16 @@ declare class FleetManager implements IFleetManager {
|
|
|
314
585
|
private readonly pendingTasks;
|
|
315
586
|
private readonly subagentMeta;
|
|
316
587
|
private readonly priceLookups;
|
|
588
|
+
/** Tracks which nickname keys are already assigned — prevents collisions. */
|
|
589
|
+
private readonly _usedNicknames;
|
|
317
590
|
/** The coordinator (wired via setCoordinator by Director after construction). */
|
|
318
591
|
private coordinator;
|
|
592
|
+
/** Leader agent's current context pressure (full request tokens). */
|
|
593
|
+
private leaderContextPressure;
|
|
594
|
+
/** Maximum context load fraction before spawn is refused. */
|
|
595
|
+
private readonly maxLeaderContextLoad;
|
|
596
|
+
/** Provider's max context window in tokens. */
|
|
597
|
+
private readonly maxContext;
|
|
319
598
|
constructor(opts?: FleetManagerOptions);
|
|
320
599
|
get fleetBus(): FleetBus;
|
|
321
600
|
/**
|
|
@@ -335,11 +614,31 @@ declare class FleetManager implements IFleetManager {
|
|
|
335
614
|
* which cap was exceeded. Does NOT throw — the caller decides
|
|
336
615
|
* how to surface the rejection.
|
|
337
616
|
*/
|
|
338
|
-
canSpawn(
|
|
339
|
-
kind: 'max_spawns' | 'max_spawn_depth' | 'max_cost_usd';
|
|
617
|
+
canSpawn(_config: SubagentConfig): {
|
|
618
|
+
kind: 'max_spawns' | 'max_spawn_depth' | 'max_cost_usd' | 'max_context_load';
|
|
340
619
|
limit: number;
|
|
341
620
|
observed: number;
|
|
342
621
|
} | null;
|
|
622
|
+
setLeaderContextPressure(tokens: number): void;
|
|
623
|
+
/**
|
|
624
|
+
* Assign a memorable nickname (e.g. "Einstein (Bug Hunter)") to the config,
|
|
625
|
+
* record it so the same name is never reused, then record the spawn.
|
|
626
|
+
*
|
|
627
|
+
* Call this INSTEAD of `recordSpawn` when you want automatic nicknames.
|
|
628
|
+
* The nickname is written back to `config.name` BEFORE the coordinator
|
|
629
|
+
* sees the config, so the manifest, logs, and fleet UI all show it.
|
|
630
|
+
*/
|
|
631
|
+
assignNicknameAndRecord(subagentId: string, config: SubagentConfig, priceLookup?: {
|
|
632
|
+
input?: number;
|
|
633
|
+
output?: number;
|
|
634
|
+
cacheRead?: number;
|
|
635
|
+
cacheWrite?: number;
|
|
636
|
+
}): string;
|
|
637
|
+
/**
|
|
638
|
+
* Returns the set of already-assigned nickname keys — useful for debugging
|
|
639
|
+
* and testing.
|
|
640
|
+
*/
|
|
641
|
+
get usedNicknames(): ReadonlySet<string>;
|
|
343
642
|
/**
|
|
344
643
|
* Records a spawn: increments counter, stores metadata, updates state checkpoint,
|
|
345
644
|
* and schedules a debounced manifest write. Call AFTER the coordinator
|
|
@@ -575,6 +874,21 @@ interface DirectorOptions {
|
|
|
575
874
|
* `makeLLMClassifier(complete)` from the dispatcher module.
|
|
576
875
|
*/
|
|
577
876
|
dispatchClassifier?: DispatchClassifier;
|
|
877
|
+
/**
|
|
878
|
+
* Maximum context load (as a fraction of maxContext) the leader agent
|
|
879
|
+
* is allowed to reach before a new spawn is rejected. Default: 0.85.
|
|
880
|
+
* When the leader's context pressure exceeds this threshold, spawning
|
|
881
|
+
* a new subagent is refused — the leader must compact first.
|
|
882
|
+
* Only used when no `fleetManager` is provided (inline mode).
|
|
883
|
+
* Set to 1.0 to disable this check.
|
|
884
|
+
*/
|
|
885
|
+
maxLeaderContextLoad?: number;
|
|
886
|
+
/**
|
|
887
|
+
* Provider's max context window in tokens. Used with `maxLeaderContextLoad`
|
|
888
|
+
* to compute the absolute token threshold. Default: 128_000.
|
|
889
|
+
* Only used when no `fleetManager` is provided (inline mode).
|
|
890
|
+
*/
|
|
891
|
+
maxContext?: number;
|
|
578
892
|
}
|
|
579
893
|
/**
|
|
580
894
|
* Thrown by `Director.spawn()` when a configured spawn cap (`maxSpawns`,
|
|
@@ -586,7 +900,7 @@ declare class FleetSpawnBudgetError extends Error {
|
|
|
586
900
|
readonly kind: 'max_spawns' | 'max_spawn_depth';
|
|
587
901
|
readonly limit: number;
|
|
588
902
|
readonly observed: number;
|
|
589
|
-
constructor(kind: 'max_spawns' | 'max_spawn_depth', limit: number, observed: number);
|
|
903
|
+
constructor(kind: 'max_spawns' | 'max_spawn_depth', limit: number, observed: number, message?: string);
|
|
590
904
|
}
|
|
591
905
|
/**
|
|
592
906
|
* Thrown by `Director.spawn()` when the fleet-wide cost cap is exceeded.
|
|
@@ -614,6 +928,20 @@ declare class Director implements ICoordinator {
|
|
|
614
928
|
* injected; otherwise own FleetUsageAggregator.
|
|
615
929
|
*/
|
|
616
930
|
readonly usage: FleetUsageAggregator;
|
|
931
|
+
/**
|
|
932
|
+
* Update the leader agent's current context pressure (full request tokens:
|
|
933
|
+
* messages + systemPrompt + toolDefs). The director checks this before every
|
|
934
|
+
* spawn — if the pressure exceeds `maxLeaderContextLoad * maxContext`,
|
|
935
|
+
* spawning is refused with a `FleetContextOverflowError`.
|
|
936
|
+
*
|
|
937
|
+
* Call this after each leader agent iteration to keep the pressure current.
|
|
938
|
+
* The compactor's `CompactReport.fullRequestTokensAfter` is a natural source.
|
|
939
|
+
*/
|
|
940
|
+
setLeaderContextPressure(tokens: number): void;
|
|
941
|
+
/**
|
|
942
|
+
* Read the leader agent's current context pressure.
|
|
943
|
+
*/
|
|
944
|
+
getLeaderContextPressure(): number;
|
|
617
945
|
/**
|
|
618
946
|
* Optional fleet-level policy container. When provided the Director
|
|
619
947
|
* delegates spawn budgeting, manifest entries, and checkpointing to it
|
|
@@ -646,6 +974,8 @@ declare class Director implements ICoordinator {
|
|
|
646
974
|
private readonly subagentBridges;
|
|
647
975
|
/** Tracks per-spawn config + assigned task ids for manifest writing. */
|
|
648
976
|
private readonly manifestEntries;
|
|
977
|
+
/** Tracks assigned nicknames so the same name is never reused in one fleet. */
|
|
978
|
+
private readonly _usedNicknames;
|
|
649
979
|
private readonly manifestPath?;
|
|
650
980
|
private readonly roster?;
|
|
651
981
|
private readonly directorPreamble;
|
|
@@ -697,6 +1027,23 @@ declare class Director implements ICoordinator {
|
|
|
697
1027
|
private taskCompletedListener;
|
|
698
1028
|
/** Optional LLM classifier for smart dispatch. Passed from options. */
|
|
699
1029
|
readonly dispatchClassifier?: DispatchClassifier;
|
|
1030
|
+
/** Leader agent's current context pressure (full request tokens). */
|
|
1031
|
+
private leaderContextPressure;
|
|
1032
|
+
/** Maximum context load fraction before spawn is refused. */
|
|
1033
|
+
private readonly maxLeaderContextLoad;
|
|
1034
|
+
/** Provider's max context window in tokens. */
|
|
1035
|
+
private readonly maxContext;
|
|
1036
|
+
/**
|
|
1037
|
+
* When set by `workComplete()`, the director stops dispatching new tasks
|
|
1038
|
+
* and terminates all running subagents. Used when the director's LLM decides
|
|
1039
|
+
* the goal is satisfied and no further spawns are needed — prevents the
|
|
1040
|
+
* coordinator from keeping workers alive for tasks that will never arrive.
|
|
1041
|
+
*/
|
|
1042
|
+
private workCompleteFlag;
|
|
1043
|
+
/** Pending /btw notes stashed by the leader agent (see setLeaderBtwNote). */
|
|
1044
|
+
private _leaderBtwNotes;
|
|
1045
|
+
/** Active collab sessions tracked by sessionId (see spawnCollab). */
|
|
1046
|
+
private readonly _activeCollabSessions;
|
|
700
1047
|
constructor(opts: DirectorOptions);
|
|
701
1048
|
/**
|
|
702
1049
|
* Record a granted budget extension and broadcast it on the FleetBus so
|
|
@@ -706,6 +1053,75 @@ declare class Director implements ICoordinator {
|
|
|
706
1053
|
private recordExtension;
|
|
707
1054
|
/** Cumulative auto-extension count for one subagent (0 when never extended). */
|
|
708
1055
|
extensionsFor(subagentId: string): number;
|
|
1056
|
+
/**
|
|
1057
|
+
* Signal that the director's work is done. Once called:
|
|
1058
|
+
* - `spawn()` throws `FleetSpawnBudgetError('max_spawns', …)` — no new
|
|
1059
|
+
* subagents can be created
|
|
1060
|
+
* - Running subagents are NOT forcibly stopped — they finish naturally,
|
|
1061
|
+
* but no new tasks are dispatched to them
|
|
1062
|
+
*
|
|
1063
|
+
* This lets the director LLM say "I'm satisfied with the results, stop
|
|
1064
|
+
* spawning and wind down" — without killing in-flight work mid-execution.
|
|
1065
|
+
* Call `terminateAll()` separately if you need immediate teardown.
|
|
1066
|
+
*
|
|
1067
|
+
* Idempotent — calling twice is a no-op.
|
|
1068
|
+
*/
|
|
1069
|
+
workComplete(): void;
|
|
1070
|
+
/** Returns true if `workComplete()` has been called on this director. */
|
|
1071
|
+
isWorkComplete(): boolean;
|
|
1072
|
+
/**
|
|
1073
|
+
* Stashes a /btw note on the leader agent's context. The leader's agent loop
|
|
1074
|
+
* calls `consumeBtwNotes()` at each iteration boundary and folds pending notes
|
|
1075
|
+
* into the conversation as a visible block — no abort, no restart, just a
|
|
1076
|
+
* "by the way" nudge the model picks up on its next turn.
|
|
1077
|
+
*
|
|
1078
|
+
* This is the entry point for the host (CLI, TUI) to inject /btw notes
|
|
1079
|
+
* programmatically without going through the slash-command path.
|
|
1080
|
+
*/
|
|
1081
|
+
setLeaderBtwNote(note: string): number;
|
|
1082
|
+
/**
|
|
1083
|
+
* Read and clear all pending /btw notes the leader has stashed.
|
|
1084
|
+
* Returns them in FIFO order (empty array when none).
|
|
1085
|
+
*
|
|
1086
|
+
* Called by CollabSession when a budget threshold event fires so the
|
|
1087
|
+
* Director can inspect accumulated /btw notes before deciding whether
|
|
1088
|
+
* to cancel the collab session or let it continue.
|
|
1089
|
+
*/
|
|
1090
|
+
getLeaderBtwNotes(): string[];
|
|
1091
|
+
/**
|
|
1092
|
+
* Peek at pending /btw notes without consuming them.
|
|
1093
|
+
* Useful for UI to show "N pending notes" without clearing them.
|
|
1094
|
+
*/
|
|
1095
|
+
peekLeaderBtwNotes(): string[];
|
|
1096
|
+
/**
|
|
1097
|
+
* Drain (read + clear) all /btw notes in one call.
|
|
1098
|
+
* Alias for getLeaderBtwNotes() — kept for symmetry with consumeBtwNotes()
|
|
1099
|
+
* in the agent's btw.ts. The Director calls this at the point where it
|
|
1100
|
+
* makes a cancellation decision, not on every budget event.
|
|
1101
|
+
*/
|
|
1102
|
+
drainLeaderBtwNotes(): string[];
|
|
1103
|
+
/**
|
|
1104
|
+
* Cancel an active collab session by its id.
|
|
1105
|
+
* Emits `director.cancel_collab` on the FleetBus so the session's agents
|
|
1106
|
+
* finish early with a 'cancelled' disposition.
|
|
1107
|
+
*
|
|
1108
|
+
* Returns silently if the session id is not tracked or already settled.
|
|
1109
|
+
* The CollabDebugReport will reflect 'cancelled' disposition when awaited.
|
|
1110
|
+
*/
|
|
1111
|
+
cancelCollabSession(sessionId: string, reason?: string): void;
|
|
1112
|
+
/**
|
|
1113
|
+
* Subscribe a callback to be notified whenever a collab session raises
|
|
1114
|
+
* an alert (warning level). The callback receives the full DirectorAlert
|
|
1115
|
+
* payload so the host (CLI, TUI) can display it to the user.
|
|
1116
|
+
* Returns an unsubscribe function.
|
|
1117
|
+
*/
|
|
1118
|
+
onCollabAlert(handler: (alert: DirectorAlert) => void): () => void;
|
|
1119
|
+
/**
|
|
1120
|
+
* Returns all active (not yet settled) collab session ids.
|
|
1121
|
+
* Useful for the TUI to render a "N active sessions" badge and for
|
|
1122
|
+
* the host to know what can be cancelled.
|
|
1123
|
+
*/
|
|
1124
|
+
activeCollabSessions(): string[];
|
|
709
1125
|
/** Best-effort session-writer append. Swallows failures — the director
|
|
710
1126
|
* must not break a fleet run because the session JSONL handle closed. */
|
|
711
1127
|
private appendSessionEvent;
|
|
@@ -890,6 +1306,14 @@ declare class Director implements ICoordinator {
|
|
|
890
1306
|
* false and the caller should not proceed with the resume.
|
|
891
1307
|
*/
|
|
892
1308
|
acquireCheckpointLock(): Promise<boolean>;
|
|
1309
|
+
/**
|
|
1310
|
+
* Start a collaborative debugging session: BugHunter, RefactorPlanner,
|
|
1311
|
+
* and Critic run in parallel on the same target files, with findings
|
|
1312
|
+
* flowing through the FleetBus (bug.found → refactor.plan →
|
|
1313
|
+
* critic.evaluation). Returns a structured CollabDebugReport when all
|
|
1314
|
+
* three agents complete or the session times out.
|
|
1315
|
+
*/
|
|
1316
|
+
spawnCollab(options: CollabSessionOptions): Promise<CollabDebugReport>;
|
|
893
1317
|
/**
|
|
894
1318
|
* Resume from a prior checkpoint snapshot (loaded via
|
|
895
1319
|
* `loadDirectorState()`). Re-attach to the fleet mid-flight so
|
|
@@ -898,6 +1322,63 @@ declare class Director implements ICoordinator {
|
|
|
898
1322
|
resumeFromCheckpoint(snapshot: DirectorStateSnapshot): void;
|
|
899
1323
|
}
|
|
900
1324
|
|
|
1325
|
+
declare function makeSpawnTool(director: Director, roster?: Record<string, SubagentConfig>): Tool;
|
|
1326
|
+
declare function makeAssignTool(director: Director): Tool;
|
|
1327
|
+
declare function makeAwaitTasksTool(director: Director): Tool;
|
|
1328
|
+
declare function makeAskTool(director: Director): Tool;
|
|
1329
|
+
declare function makeRollUpTool(director: Director): Tool;
|
|
1330
|
+
declare function makeTerminateTool(director: Director): Tool;
|
|
1331
|
+
declare function makeFleetStatusTool(director: Director): Tool;
|
|
1332
|
+
declare function makeFleetUsageTool(director: Director): Tool;
|
|
1333
|
+
/**
|
|
1334
|
+
* Read a subagent's JSONL transcript and return the last assistant text,
|
|
1335
|
+
* stop reason, and tool-use count. The director can call this on a
|
|
1336
|
+
* running or timed-out subagent to see what it actually produced without
|
|
1337
|
+
* having to wait for natural completion.
|
|
1338
|
+
*/
|
|
1339
|
+
declare function makeFleetSessionTool(director: Director): Tool;
|
|
1340
|
+
/**
|
|
1341
|
+
* Health snapshot per subagent — budget pressure (how close to limits),
|
|
1342
|
+
* last activity timestamp, and current status. Lets the director make
|
|
1343
|
+
* smarter routing decisions without having to call fleet_usage + fleet_status separately.
|
|
1344
|
+
*/
|
|
1345
|
+
declare function makeFleetHealthTool(director: Director): Tool;
|
|
1346
|
+
/**
|
|
1347
|
+
* Collaborative debugging session: BugHunter, RefactorPlanner, and Critic
|
|
1348
|
+
* run in parallel on the same target files, with findings flowing through
|
|
1349
|
+
* the FleetBus (bug.found → refactor.plan → critic.evaluation).
|
|
1350
|
+
*
|
|
1351
|
+
* Returns a structured CollabDebugReport containing all bug findings,
|
|
1352
|
+
* refactor plans, critic evaluations, and an overall verdict.
|
|
1353
|
+
*/
|
|
1354
|
+
declare function makeCollabDebugTool(director: Director): Tool;
|
|
1355
|
+
/**
|
|
1356
|
+
* Tool for subagents to emit structured events on the FleetBus.
|
|
1357
|
+
* Any agent can emit any event type; the Director routes it to all listeners.
|
|
1358
|
+
* Common event types in collaborative sessions:
|
|
1359
|
+
* bug.found — BugHunter emits per-finding
|
|
1360
|
+
* refactor.plan — RefactorPlanner emits per-plan
|
|
1361
|
+
* critic.evaluation — Critic emits per-evaluation
|
|
1362
|
+
*
|
|
1363
|
+
* The payload structure is event-type-specific. Use null for empty payloads.
|
|
1364
|
+
*/
|
|
1365
|
+
declare function makeFleetEmitTool(director: Director): Tool;
|
|
1366
|
+
/**
|
|
1367
|
+
* Signal that the director's work is satisfied and the fleet should wind down.
|
|
1368
|
+
*
|
|
1369
|
+
* Once called:
|
|
1370
|
+
* - `spawn_subagent` throws — no new subagents can be created
|
|
1371
|
+
* - `assign_task` synthesizes an immediate `aborted_by_parent` completion
|
|
1372
|
+
* for any queued task (callers awaiting those tasks unblock immediately)
|
|
1373
|
+
* - Running subagents are NOT killed — they finish naturally; no new
|
|
1374
|
+
* tasks are dispatched to them
|
|
1375
|
+
*
|
|
1376
|
+
* Use this when you are satisfied with the results and want the fleet to
|
|
1377
|
+
* stop spawning without forcibly stopping in-flight work. Call
|
|
1378
|
+
* `terminate_subagent` separately for any subagent you need to stop immediately.
|
|
1379
|
+
*/
|
|
1380
|
+
declare function makeWorkCompleteTool(director: Director): Tool;
|
|
1381
|
+
|
|
901
1382
|
/**
|
|
902
1383
|
* Opaque host interface so this factory doesn't have to depend on the
|
|
903
1384
|
* CLI's `MultiAgentHost`. Any caller that exposes the same three
|
|
@@ -1065,7 +1546,7 @@ declare function makeDirectorSessionFactory(opts: DirectorSessionFactoryOptions)
|
|
|
1065
1546
|
* descriptions live on the tool definitions themselves; this preamble only
|
|
1066
1547
|
* teaches *when* to reach for them.
|
|
1067
1548
|
*/
|
|
1068
|
-
declare const DEFAULT_DIRECTOR_PREAMBLE = "You are the Director of a multi-agent fleet. You orchestrate worker\nsubagents by spawning them, assigning tasks, awaiting completions, and\nrolling up their outputs into your next decision.\n\nCore fleet tools available to you:\n - spawn_subagent \u2014 create a worker with a chosen provider / model / role\n - assign_task \u2014 hand a piece of work to a specific subagent\n - await_tasks \u2014 block until named task ids complete (parallel-safe)\n - ask_subagent \u2014 synchronously query a running subagent via the bridge\n - roll_up \u2014 aggregate finished tasks into a markdown/json summary\n - terminate_subagent \u2014 abort a stuck worker (use sparingly)\n - fleet_status \u2014 snapshot of all subagents and pending tasks\n - fleet_usage \u2014 token + cost breakdown per subagent and total\n\nWorking rules:\n 1. Decompose first. Before spawning, decide which sub-tasks are\n independent and can run in parallel. Sequential work doesn't need a\n subagent \u2014 do it yourself.\n 2. Match worker to job. Cheap/fast model for triage, capable model for\n synthesis. Different providers per sibling is allowed and encouraged.\n 3. Always pair an assign with an await. Don't fire-and-forget; you owe\n the user a single coherent answer at the end.\n 4. Roll up before deciding. After await_tasks resolves, call roll_up so\n the results are folded back into your context in a compact form.\n 5. Budget is real. Check fleet_usage periodically. If a subagent is\n thrashing, terminate it rather than letting cost climb silently.\n 6. Never claim a subagent's work as your own without verifying it. If a\n result looks wrong, ask_subagent for clarification before passing it\n to the user.";
|
|
1549
|
+
declare const DEFAULT_DIRECTOR_PREAMBLE = "You are the Director of a multi-agent fleet. You orchestrate worker\nsubagents by spawning them, assigning tasks, awaiting completions, and\nrolling up their outputs into your next decision.\n\nCore fleet tools available to you:\n - spawn_subagent \u2014 create a worker with a chosen provider / model / role\n - assign_task \u2014 hand a piece of work to a specific subagent\n - await_tasks \u2014 block until named task ids complete (parallel-safe)\n - ask_subagent \u2014 synchronously query a running subagent via the bridge\n - roll_up \u2014 aggregate finished tasks into a markdown/json summary\n - terminate_subagent \u2014 abort a stuck worker (use sparingly)\n - fleet_status \u2014 snapshot of all subagents and pending tasks\n - fleet_usage \u2014 token + cost breakdown per subagent and total\n\nWorking rules:\n 1. Decompose first. Before spawning, decide which sub-tasks are\n independent and can run in parallel. Sequential work doesn't need a\n subagent \u2014 do it yourself.\n 2. Match worker to job. Cheap/fast model for triage, capable model for\n synthesis. Different providers per sibling is allowed and encouraged.\n 3. Always pair an assign with an await. Don't fire-and-forget; you owe\n the user a single coherent answer at the end.\n 4. Roll up before deciding. After await_tasks resolves, call roll_up so\n the results are folded back into your context in a compact form.\n 5. Budget is real. Check fleet_usage periodically. If a subagent is\n thrashing, terminate it rather than letting cost climb silently.\n 6. Never claim a subagent's work as your own without verifying it. If a\n result looks wrong, ask_subagent for clarification before passing it\n to the user.\n 7. Wind down when satisfied. When the results are good enough, call\n work_complete \u2014 no new subagents will spawn and queued tasks complete\n as aborted. Running subagents finish naturally. Call terminate_subagent\n only for ones you need to stop immediately.";
|
|
1069
1550
|
/**
|
|
1070
1551
|
* Default baseline prepended to every subagent's system prompt. Tells the
|
|
1071
1552
|
* subagent its place in the hierarchy and the bridge contract — without
|
|
@@ -1264,4 +1745,4 @@ declare function attachAutoExtend(events: EventBus, policy?: AutoExtendPolicy):
|
|
|
1264
1745
|
*/
|
|
1265
1746
|
declare const NULL_FLEET_BUS: FleetBus;
|
|
1266
1747
|
|
|
1267
|
-
export { ACP_AGENTS as A, BUG_HUNTER_AGENT as B, type
|
|
1748
|
+
export { makeAskTool as $, ACP_AGENTS as A, BUG_HUNTER_AGENT as B, type CollabBudgetConfig as C, DEFAULT_DIRECTOR_PREAMBLE as D, FLEET_ROSTER_WITHACP as E, FLEET_ROSTER as F, FleetCostCapError as G, FleetManager as H, type FleetManagerOptions as I, type FleetRosterBudget as J, FleetSpawnBudgetError as K, type ICoordinator as L, type IFleetManager as M, NULL_FLEET_BUS as N, type RefactorPhase as O, type RefactorPlan as P, type SharedFileEntry as Q, REFACTOR_PLANNER_AGENT as R, SECURITY_SCANNER_AGENT as S, type SharedFileSnapshot as T, type SubagentPromptParts as U, applyRosterBudget as V, attachAutoExtend as W, composeDirectorPrompt as X, composeSubagentPrompt as Y, createDelegateTool as Z, getAgentDefinition as _, AGENTS_BY_PHASE as a, makeAssignTool as a0, makeAwaitTasksTool as a1, makeCollabDebugTool as a2, makeDirectorSessionFactory as a3, makeFleetEmitTool as a4, makeFleetHealthTool as a5, makeFleetSessionTool as a6, makeFleetStatusTool as a7, makeFleetUsageTool as a8, makeRollUpTool as a9, makeSpawnTool as aa, makeTerminateTool as ab, makeWorkCompleteTool as ac, rosterSummaryFromConfigs as ad, AGENT_CATALOG as b, ALL_AGENT_DEFINITIONS as c, ALL_FLEET_AGENTS as d, AUDIT_LOG_AGENT as e, type AutoExtendCeiling as f, type AutoExtendPolicy as g, type BugFinding as h, type CollabBudgetOverrides as i, type CollabBudgetWarningPayload as j, type CollabDebugReport as k, CollabSession as l, type CollabSessionOptions as m, type CreateDelegateToolOptions as n, type CriticConcern as o, type CriticEvaluation as p, DEFAULT_SUBAGENT_BASELINE as q, type DelegateHost as r, Director as s, type DirectorAlert as t, DirectorAlertLevel as u, type DirectorCancelCollabPayload as v, type DirectorPromptParts as w, type DirectorSessionFactory as x, type DirectorSessionFactoryOptions as y, FLEET_ROSTER_BUDGETS as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { e as MetricsSink, M as MetricLabels, f as MetricsSnapshot, b as HealthRegistry, H as HealthCheck, A as AggregateHealth, T as Tracer, S as Span } from '../observability-BhnVLBLS.js';
|
|
2
|
-
import { E as EventBus } from '../events-
|
|
3
|
-
import '../context-
|
|
2
|
+
import { E as EventBus } from '../events-DH-9r-_C.js';
|
|
3
|
+
import '../context-zkZeILpr.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* In-memory metrics sink. Suitable for embedded use, tests, and /metrics
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as EventBus } from './events-
|
|
1
|
+
import { E as EventBus } from './events-DH-9r-_C.js';
|
|
2
2
|
import { b as ModelsRegistry, R as ResolvedModel } from './models-registry-BcYJDKLm.js';
|
|
3
|
-
import { O as TokenCounter, $ as Usage, C as CacheStats } from './context-
|
|
3
|
+
import { O as TokenCounter, $ as Usage, C as CacheStats } from './context-zkZeILpr.js';
|
|
4
4
|
import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Q as Tool, d as Context, P as Permission } from './context-
|
|
1
|
+
import { Q as Tool, d as Context, P as Permission } from './context-zkZeILpr.js';
|
|
2
2
|
|
|
3
3
|
interface TrustPolicy {
|
|
4
4
|
[toolNameOrPattern: string]: {
|
|
@@ -48,9 +48,4 @@ interface PermissionPolicy {
|
|
|
48
48
|
reload(): Promise<void>;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
scrub(text: string): string;
|
|
53
|
-
scrubObject<T>(obj: T): T;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export type { PermissionDecision as P, SecretScrubber as S, TrustPolicy as T, PermissionPolicy as a };
|
|
51
|
+
export type { PermissionDecision as P, TrustPolicy as T, PermissionPolicy as a };
|