@wrongstack/core 0.5.6 → 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.
- package/dist/{agent-bridge-B07AYFBk.d.ts → agent-bridge-BKNiE1VH.d.ts} +1 -1
- package/dist/{compactor-BWhJXxsW.d.ts → compactor-RIPuTtWK.d.ts} +1 -1
- package/dist/{config-BgM0BIpz.d.ts → config-BGGuP_Ar.d.ts} +1 -1
- package/dist/{context-CLZXPPYk.d.ts → context-CDRyrkKQ.d.ts} +7 -0
- package/dist/coordination/index.d.ts +9 -9
- package/dist/coordination/index.js +339 -80
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +20 -19
- package/dist/defaults/index.js +731 -180
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-qnDZbrtb.d.ts → events-DPQKFX7W.d.ts} +1 -1
- package/dist/execution/index.d.ts +152 -12
- package/dist/execution/index.js +474 -5
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/extension/index.js +2 -1
- package/dist/extension/index.js.map +1 -1
- package/dist/goal-store-BQ3YX1h1.d.ts +75 -0
- package/dist/{index-DPLJw_ZI.d.ts → index-B0qTujQW.d.ts} +52 -5
- package/dist/{index-BDnUCRvL.d.ts → index-DkdRz6yK.d.ts} +351 -15
- package/dist/index.d.ts +109 -28
- package/dist/index.js +1143 -234
- 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-CSMfaBuL.d.ts → mcp-servers-DBdh3cee.d.ts} +3 -3
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +2 -3
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-Cv8wk47i.d.ts → multi-agent-Cpp7FXUl.d.ts} +11 -3
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-DiCUvEg6.d.ts → path-resolver--g_hKJ7V.d.ts} +2 -2
- package/dist/{plan-templates-DaxTCPfk.d.ts → plan-templates-CKJs_sYh.d.ts} +9 -8
- package/dist/{provider-runner-3SHqk9zB.d.ts → provider-runner-hl4Il3xS.d.ts} +3 -3
- package/dist/{retry-policy-LLUxJmYY.d.ts → retry-policy-LKS8MHsB.d.ts} +1 -1
- package/dist/sdd/index.d.ts +6 -4
- package/dist/sdd/index.js +102 -68
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-scrubber-Z_VXuXQT.d.ts → secret-scrubber-BzQR5BiL.d.ts} +1 -1
- package/dist/{secret-scrubber-BhJTNr9v.d.ts → secret-scrubber-CfMdAJ_l.d.ts} +1 -1
- package/dist/security/index.d.ts +3 -3
- package/dist/security/index.js +82 -82
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-DB2-byKH.d.ts → selector-C7HqnZJU.d.ts} +1 -1
- package/dist/{session-reader-4jxsYLZ8.d.ts → session-reader-CzfRA6Vk.d.ts} +1 -1
- package/dist/skills/index.js +102 -38
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +6 -5
- package/dist/storage/index.js +131 -22
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-DI4Dtc1I.d.ts → system-prompt-Dl2QY1_B.d.ts} +1 -1
- package/dist/{tool-executor-DSvmOBe6.d.ts → tool-executor-B03CRwu-.d.ts} +4 -4
- package/dist/types/index.d.ts +15 -15
- package/dist/types/index.js +100 -102
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,98 @@
|
|
|
1
1
|
import { a as DirectorStateSnapshot } from './director-state-BmYi3DGA.js';
|
|
2
|
-
import {
|
|
3
|
-
import { r as SessionWriter, v as Tool, p as SessionStore } from './context-
|
|
4
|
-
import { I as InMemoryAgentBridge } from './agent-bridge-
|
|
5
|
-
import { E as EventBus } from './events-
|
|
2
|
+
import { c as SubagentConfig, j as TaskResult, a as CoordinatorStatus, k as TaskSpec, M as MultiAgentConfig, i as SubagentRunner, b as MultiAgentCoordinator, S as SpawnResult, l as BridgeMessage, A as AgentBridge } from './multi-agent-Cpp7FXUl.js';
|
|
3
|
+
import { r as SessionWriter, v as Tool, p as SessionStore } from './context-CDRyrkKQ.js';
|
|
4
|
+
import { I as InMemoryAgentBridge } from './agent-bridge-BKNiE1VH.js';
|
|
5
|
+
import { E as EventBus } from './events-DPQKFX7W.js';
|
|
6
6
|
import { EventEmitter } from 'node:events';
|
|
7
|
-
import { r as Agent, u as AgentInput } from './index-
|
|
7
|
+
import { r as Agent, u as AgentInput } from './index-B0qTujQW.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Interface for a fleet coordinator. Implemented by both `Director`
|
|
11
|
+
* (full LLM-driven orchestration with fleet policy) and
|
|
12
|
+
* `DefaultMultiAgentCoordinator` (direct API-driven, no fleet policy).
|
|
13
|
+
*
|
|
14
|
+
* External callers — CLI slash commands, tests, the delegate tool —
|
|
15
|
+
* use this to stay agnostic to the orchestration mode.
|
|
16
|
+
*
|
|
17
|
+
* The interface captures the **orchestration contract**: spawn, assign,
|
|
18
|
+
* terminate, await, and query. Fleet-level policy (cost caps, manifest
|
|
19
|
+
* writing, checkpointing) lives behind this surface and is optional
|
|
20
|
+
* from the caller's perspective.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* let coordinator: ICoordinator = isDirectorMode
|
|
25
|
+
* ? new Director({ config, ... })
|
|
26
|
+
* : new DefaultMultiAgentCoordinator(config);
|
|
27
|
+
* const id = await coordinator.spawn({ name: 'worker', role: 'researcher' });
|
|
28
|
+
* await coordinator.assign({ id: 't-1', description: 'research X', subagentId: id });
|
|
29
|
+
* const results = await coordinator.awaitTasks(['t-1']);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
interface ICoordinator {
|
|
33
|
+
/** Stable identifier for this coordinator instance. */
|
|
34
|
+
readonly coordinatorId: string;
|
|
35
|
+
/**
|
|
36
|
+
* Spawn a new subagent and return its id. In director mode this
|
|
37
|
+
* enforces fleet-wide spawn caps and cost limits; in raw coordinator
|
|
38
|
+
* mode it is a direct pass-through.
|
|
39
|
+
*/
|
|
40
|
+
spawn(config: SubagentConfig): Promise<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Assign a task to a subagent (or to the fleet for auto-routing).
|
|
43
|
+
* Returns the assigned task id.
|
|
44
|
+
*/
|
|
45
|
+
assign(task: {
|
|
46
|
+
id: string;
|
|
47
|
+
description: string;
|
|
48
|
+
subagentId?: string;
|
|
49
|
+
}): Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Synchronously ask a subagent something via the in-memory bridge.
|
|
52
|
+
* The subagent must have been spawned and must handle `bridge.subscribe()`
|
|
53
|
+
* in its task loop. Returns the reply payload or throws on timeout.
|
|
54
|
+
*
|
|
55
|
+
* Only available in director mode — raw coordinator has no bridge.
|
|
56
|
+
*/
|
|
57
|
+
ask<T = unknown>(subagentId: string, payload: unknown, timeoutMs?: number): Promise<T>;
|
|
58
|
+
/**
|
|
59
|
+
* Wait for one or more tasks to complete and return their results.
|
|
60
|
+
* If a task is already done when called, returns immediately.
|
|
61
|
+
* Resolves to an array in the same order as `taskIds`.
|
|
62
|
+
*/
|
|
63
|
+
awaitTasks(taskIds: string[]): Promise<TaskResult[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Gracefully stop a single subagent. The subagent finishes its current
|
|
66
|
+
* in-flight work and exits cleanly — it does not hard-kill.
|
|
67
|
+
*/
|
|
68
|
+
terminate(subagentId: string): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Stop all subagents. In-flight tasks are allowed to complete;
|
|
71
|
+
* no new tasks are dispatched.
|
|
72
|
+
*/
|
|
73
|
+
terminateAll(): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Live coordinator status — subagent list, pending task count,
|
|
76
|
+
* completed task count, iteration totals.
|
|
77
|
+
*/
|
|
78
|
+
status(): CoordinatorStatus;
|
|
79
|
+
/**
|
|
80
|
+
* Snapshot of completed task results. In director mode this returns
|
|
81
|
+
* every `TaskResult` from the fleet; in raw coordinator mode this
|
|
82
|
+
* may return an empty array if the coordinator doesn't cache results.
|
|
83
|
+
*/
|
|
84
|
+
completedResults(): TaskResult[];
|
|
85
|
+
/**
|
|
86
|
+
* Subscribe to coordinator lifecycle events. Currently supports
|
|
87
|
+
* `task.completed` — the payload carries the task spec and result.
|
|
88
|
+
*
|
|
89
|
+
* Returns a disposer function; call it to unsubscribe.
|
|
90
|
+
*/
|
|
91
|
+
on(event: 'task.completed', handler: (payload: {
|
|
92
|
+
task: TaskSpec;
|
|
93
|
+
result: TaskResult;
|
|
94
|
+
}) => void): () => void;
|
|
95
|
+
}
|
|
8
96
|
|
|
9
97
|
/**
|
|
10
98
|
* Single fleet-wide event with subagent attribution. Whatever a child
|
|
@@ -118,6 +206,215 @@ declare class FleetUsageAggregator {
|
|
|
118
206
|
private onIterationStarted;
|
|
119
207
|
}
|
|
120
208
|
|
|
209
|
+
/**
|
|
210
|
+
* Interface for fleet-level lifecycle and policy. Covers:
|
|
211
|
+
* - Spawn lifecycle hooks (canSpawn check, recordSpawn after-effects)
|
|
212
|
+
* - Budget enforcement (fleet-wide cost cap, spawn count/depth caps)
|
|
213
|
+
* - Fleet manifest assembly and writing
|
|
214
|
+
* - Subagent metadata and usage tracking
|
|
215
|
+
*
|
|
216
|
+
* `FleetBus` is pure event fan-out and implements no policy.
|
|
217
|
+
* `FleetManager` encapsulates all fleet-level policy decisions.
|
|
218
|
+
* `Director` currently owns all of this — this interface lets us
|
|
219
|
+
* extract it into a swappable component in Phase 5.
|
|
220
|
+
*/
|
|
221
|
+
interface IFleetManager {
|
|
222
|
+
/** The FleetBus this manager publishes lifecycle events to. */
|
|
223
|
+
readonly fleetBus: FleetBus;
|
|
224
|
+
/**
|
|
225
|
+
* Snapshot of fleet-wide token usage and cost rollup.
|
|
226
|
+
* Safe to call from a tool's execute() body.
|
|
227
|
+
*/
|
|
228
|
+
snapshot(): FleetUsage;
|
|
229
|
+
/**
|
|
230
|
+
* Per-subagent metadata captured at spawn time (provider/model/name).
|
|
231
|
+
* Returns undefined if the subagent is not known to this manager.
|
|
232
|
+
*/
|
|
233
|
+
getSubagentMeta(id: string): {
|
|
234
|
+
provider?: string;
|
|
235
|
+
model?: string;
|
|
236
|
+
name?: string;
|
|
237
|
+
} | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* Called before a spawn is recorded. Returns a reason string if the
|
|
240
|
+
* spawn should be rejected (budget cap, depth limit, cost cap, etc.),
|
|
241
|
+
* or null to proceed. Director.spawn() calls this internally.
|
|
242
|
+
*/
|
|
243
|
+
canSpawn(config: SubagentConfig): {
|
|
244
|
+
kind: 'max_spawns' | 'max_spawn_depth' | 'max_cost_usd';
|
|
245
|
+
limit: number;
|
|
246
|
+
observed: number;
|
|
247
|
+
} | null;
|
|
248
|
+
/**
|
|
249
|
+
* Called after a spawn succeeds. Records metadata for the usage
|
|
250
|
+
* aggregator and manifest.
|
|
251
|
+
*
|
|
252
|
+
* @param priceLookup Per-token rate lookup for cost calculation.
|
|
253
|
+
* When omitted the cost column in usage snapshots stays at 0.
|
|
254
|
+
*/
|
|
255
|
+
recordSpawn(subagentId: string, config: SubagentConfig, priceLookup?: Record<string, number>): void;
|
|
256
|
+
/**
|
|
257
|
+
* Write the fleet manifest to disk. Returns the path written
|
|
258
|
+
* or null when no manifest path is configured.
|
|
259
|
+
*/
|
|
260
|
+
writeManifest(): Promise<string | null>;
|
|
261
|
+
/**
|
|
262
|
+
* Aggregate fleet-wide status: pending tasks with descriptions and
|
|
263
|
+
* live subagent snapshot from the coordinator. Used by
|
|
264
|
+
* `MultiAgentHost.status()` to eliminate host-side state duplication.
|
|
265
|
+
*/
|
|
266
|
+
getFleetStatus(): {
|
|
267
|
+
pending: {
|
|
268
|
+
taskId: string;
|
|
269
|
+
description: string;
|
|
270
|
+
subagentId: string;
|
|
271
|
+
}[];
|
|
272
|
+
live: {
|
|
273
|
+
subagentId: string;
|
|
274
|
+
status: string;
|
|
275
|
+
task?: string;
|
|
276
|
+
}[];
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* Register a pending task with its description. Called by
|
|
280
|
+
* `MultiAgentHost.spawn()` after `_spawnAndAssign()` returns so
|
|
281
|
+
* the description is available in `status()` without host-side storage.
|
|
282
|
+
*/
|
|
283
|
+
addPendingTask(taskId: string, subagentId: string, description: string): void;
|
|
284
|
+
/**
|
|
285
|
+
* Remove a pending task. Called when the task completes so the
|
|
286
|
+
* pending list stays accurate.
|
|
287
|
+
*/
|
|
288
|
+
removePendingTask(taskId: string): void;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** Options for constructing a FleetManager. */
|
|
292
|
+
interface FleetManagerOptions {
|
|
293
|
+
manifestPath?: string;
|
|
294
|
+
sessionsRoot?: string;
|
|
295
|
+
directorRunId?: string;
|
|
296
|
+
maxSpawns?: number;
|
|
297
|
+
maxSpawnDepth?: number;
|
|
298
|
+
spawnDepth?: number;
|
|
299
|
+
stateCheckpointPath?: string;
|
|
300
|
+
sessionWriter?: SessionWriter;
|
|
301
|
+
manifestDebounceMs?: number;
|
|
302
|
+
checkpointDebounceMs?: number;
|
|
303
|
+
directorBudget?: {
|
|
304
|
+
maxCostUsd?: number;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Fleet-level policy container extracted from `Director`. Owns:
|
|
309
|
+
* - FleetBus + FleetUsageAggregator
|
|
310
|
+
* - Spawn caps and counters
|
|
311
|
+
* - Manifest entries and debounced writing
|
|
312
|
+
* - State checkpointing
|
|
313
|
+
*
|
|
314
|
+
* This lets the `Director` focus on orchestration (spawn/assign/await/ask)
|
|
315
|
+
* while fleet-level decisions live in one place. The class implements
|
|
316
|
+
* `IFleetManager` so it remains swappable in future.
|
|
317
|
+
*
|
|
318
|
+
* @example
|
|
319
|
+
* ```typescript
|
|
320
|
+
* const fm = new FleetManager({ manifestPath: '/tmp/fleet.json' });
|
|
321
|
+
* const err = fm.canSpawn({ name: 'worker' });
|
|
322
|
+
* if (!err) fm.recordSpawn('sub-1', { name: 'worker' });
|
|
323
|
+
* await fm.writeManifest();
|
|
324
|
+
* ```
|
|
325
|
+
*/
|
|
326
|
+
declare class FleetManager implements IFleetManager {
|
|
327
|
+
/** The fleet-wide event bus. */
|
|
328
|
+
readonly fleet: FleetBus;
|
|
329
|
+
/** Usage rollup across all subagents. */
|
|
330
|
+
readonly usage: FleetUsageAggregator;
|
|
331
|
+
private readonly manifestPath?;
|
|
332
|
+
private readonly sessionsRoot?;
|
|
333
|
+
private readonly directorRunId;
|
|
334
|
+
/** Spawn cap (lifetime total). Infinity means unlimited. */
|
|
335
|
+
readonly maxSpawns: number;
|
|
336
|
+
/** Nesting cap. */
|
|
337
|
+
readonly maxSpawnDepth: number;
|
|
338
|
+
/** This director's depth in a director chain. Root = 0. */
|
|
339
|
+
readonly spawnDepth: number;
|
|
340
|
+
/** Live spawn counter. */
|
|
341
|
+
private spawnCount;
|
|
342
|
+
private readonly stateCheckpoint;
|
|
343
|
+
private readonly sessionWriter;
|
|
344
|
+
private manifestTimer;
|
|
345
|
+
private readonly manifestDebounceMs;
|
|
346
|
+
/** Fleet-wide cost cap. Infinity = no cap. Distinct from SubagentBudget limits,
|
|
347
|
+
* which track per-subagent spend — this field caps the entire fleet total. */
|
|
348
|
+
private readonly maxFleetCostUsd;
|
|
349
|
+
private readonly manifestEntries;
|
|
350
|
+
/** Pending tasks with their descriptions — populated by `addPendingTask`
|
|
351
|
+
* and cleared by `removePendingTask`. Replaces the host-side `pending`
|
|
352
|
+
* Map so task descriptions live in one place (FleetManager). */
|
|
353
|
+
private readonly pendingTasks;
|
|
354
|
+
private readonly subagentMeta;
|
|
355
|
+
private readonly priceLookups;
|
|
356
|
+
constructor(opts?: FleetManagerOptions);
|
|
357
|
+
get fleetBus(): FleetBus;
|
|
358
|
+
snapshot(): FleetUsage;
|
|
359
|
+
getSubagentMeta(id: string): {
|
|
360
|
+
provider?: string;
|
|
361
|
+
model?: string;
|
|
362
|
+
name?: string;
|
|
363
|
+
} | undefined;
|
|
364
|
+
/**
|
|
365
|
+
* Returns null if the spawn is allowed, or an object describing
|
|
366
|
+
* which cap was exceeded. Does NOT throw — the caller decides
|
|
367
|
+
* how to surface the rejection.
|
|
368
|
+
*/
|
|
369
|
+
canSpawn(config: SubagentConfig): {
|
|
370
|
+
kind: 'max_spawns' | 'max_spawn_depth' | 'max_cost_usd';
|
|
371
|
+
limit: number;
|
|
372
|
+
observed: number;
|
|
373
|
+
} | null;
|
|
374
|
+
/**
|
|
375
|
+
* Records a spawn: increments counter, stores metadata, updates state checkpoint,
|
|
376
|
+
* and schedules a debounced manifest write. Call AFTER the coordinator
|
|
377
|
+
* has successfully spawned the subagent.
|
|
378
|
+
*
|
|
379
|
+
* @param subagentId The subagent's id (from coordinator.spawn result)
|
|
380
|
+
* @param config The SubagentConfig that was used
|
|
381
|
+
* @param priceLookup Optional per-subagent pricing data
|
|
382
|
+
*/
|
|
383
|
+
recordSpawn(subagentId: string, config: SubagentConfig, priceLookup?: {
|
|
384
|
+
input?: number;
|
|
385
|
+
output?: number;
|
|
386
|
+
cacheRead?: number;
|
|
387
|
+
cacheWrite?: number;
|
|
388
|
+
}): void;
|
|
389
|
+
writeManifest(): Promise<string | null>;
|
|
390
|
+
/**
|
|
391
|
+
* Attach task ids to an already-spawned subagent. Called by
|
|
392
|
+
* `Director.assign()` after the coordinator assigns a task.
|
|
393
|
+
*/
|
|
394
|
+
addTaskToSubagent(subagentId: string, taskId: string): void;
|
|
395
|
+
/**
|
|
396
|
+
* Debounced manifest write. Call after any state mutation
|
|
397
|
+
* (spawn, assign, complete) so a burst collapses into one write.
|
|
398
|
+
*/
|
|
399
|
+
scheduleManifest(): void;
|
|
400
|
+
/** Best-effort session event writer. Swallows failures. */
|
|
401
|
+
private appendSessionEvent;
|
|
402
|
+
addPendingTask(taskId: string, subagentId: string, description: string): void;
|
|
403
|
+
removePendingTask(taskId: string): void;
|
|
404
|
+
getFleetStatus(): {
|
|
405
|
+
pending: {
|
|
406
|
+
taskId: string;
|
|
407
|
+
description: string;
|
|
408
|
+
subagentId: string;
|
|
409
|
+
}[];
|
|
410
|
+
live: {
|
|
411
|
+
subagentId: string;
|
|
412
|
+
status: string;
|
|
413
|
+
task?: string;
|
|
414
|
+
}[];
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
|
|
121
418
|
/**
|
|
122
419
|
* Director — high-level orchestrator that owns a `MultiAgentCoordinator`,
|
|
123
420
|
* a `FleetBus`, and a `FleetUsageAggregator`. Exposes a small imperative
|
|
@@ -175,7 +472,7 @@ interface DirectorOptions {
|
|
|
175
472
|
* lifetime. Default: unlimited. Acts as a hard fleet-wide cost cap —
|
|
176
473
|
* a runaway leader that keeps spawning workers gets cut off cleanly
|
|
177
474
|
* instead of burning provider tokens until the user kills the
|
|
178
|
-
* process. The N+1-th spawn call rejects with a `
|
|
475
|
+
* process. The N+1-th spawn call rejects with a `FleetSpawnBudgetError`.
|
|
179
476
|
*/
|
|
180
477
|
maxSpawns?: number;
|
|
181
478
|
/**
|
|
@@ -223,8 +520,11 @@ interface DirectorOptions {
|
|
|
223
520
|
* that would push the fleet's total cost above this limit. The cap
|
|
224
521
|
* is checked BEFORE the spawn is recorded — a refused spawn must not
|
|
225
522
|
* leak partial state into the manifest or fleet bus. Let in-flight
|
|
226
|
-
* tasks complete; refuse new spawns only. When
|
|
227
|
-
*
|
|
523
|
+
* tasks complete; refuse new spawns only. When omitted or Infinity,
|
|
524
|
+
* no cost cap applies.
|
|
525
|
+
*
|
|
526
|
+
* Distinct from SubagentBudget.maxCostUsd (per-subagent spend) — this
|
|
527
|
+
* field caps the *entire fleet* total.
|
|
228
528
|
*/
|
|
229
529
|
directorBudget?: {
|
|
230
530
|
/**
|
|
@@ -263,6 +563,17 @@ interface DirectorOptions {
|
|
|
263
563
|
* JSONLs. Defaults to the director's own `id` when omitted.
|
|
264
564
|
*/
|
|
265
565
|
directorRunId?: string;
|
|
566
|
+
/**
|
|
567
|
+
* Pre-built fleet manager. When provided the Director delegates all
|
|
568
|
+
* fleet-level policy (spawn budgets, manifest assembly, checkpointing)
|
|
569
|
+
* to this instance and takes ownership of the coordinator + bridge
|
|
570
|
+
* layer only. This enables unit-testing fleet policy in isolation
|
|
571
|
+
* and swapping implementations without changing the Director surface.
|
|
572
|
+
*
|
|
573
|
+
* When omitted the Director creates its own fleet infrastructure
|
|
574
|
+
* (same behavior as before this field was added).
|
|
575
|
+
*/
|
|
576
|
+
fleetManager?: FleetManager;
|
|
266
577
|
}
|
|
267
578
|
/**
|
|
268
579
|
* Thrown by `Director.spawn()` when a configured spawn cap (`maxSpawns`,
|
|
@@ -270,7 +581,7 @@ interface DirectorOptions {
|
|
|
270
581
|
* the `spawn_subagent` tool surface — can recognize the budget case and
|
|
271
582
|
* report it cleanly instead of treating it like an unexpected failure.
|
|
272
583
|
*/
|
|
273
|
-
declare class
|
|
584
|
+
declare class FleetSpawnBudgetError extends Error {
|
|
274
585
|
readonly kind: 'max_spawns' | 'max_spawn_depth';
|
|
275
586
|
readonly limit: number;
|
|
276
587
|
readonly observed: number;
|
|
@@ -278,20 +589,36 @@ declare class DirectorBudgetError extends Error {
|
|
|
278
589
|
}
|
|
279
590
|
/**
|
|
280
591
|
* Thrown by `Director.spawn()` when the fleet-wide cost cap is exceeded.
|
|
281
|
-
* Distinct from `
|
|
592
|
+
* Distinct from `FleetSpawnBudgetError` (spawn count/depth) — this is a
|
|
282
593
|
* dollar-denominated ceiling that tracks cumulative spend across all
|
|
283
594
|
* subagents in the fleet.
|
|
284
595
|
*/
|
|
285
|
-
declare class
|
|
596
|
+
declare class FleetCostCapError extends Error {
|
|
286
597
|
readonly kind: 'max_cost_usd';
|
|
287
598
|
readonly limit: number;
|
|
288
599
|
readonly observed: number;
|
|
289
600
|
constructor(limit: number, observed: number);
|
|
290
601
|
}
|
|
291
|
-
declare class Director {
|
|
602
|
+
declare class Director implements ICoordinator {
|
|
603
|
+
/** Alias for the ICoordinator contract. `id` is retained for backward compatibility. */
|
|
604
|
+
get coordinatorId(): string;
|
|
292
605
|
readonly id: string;
|
|
606
|
+
/**
|
|
607
|
+
* The fleet event bus. Backed by `fleetManager?.fleet` when a FleetManager
|
|
608
|
+
* is injected; otherwise own FleetBus instance (preserves existing behavior).
|
|
609
|
+
*/
|
|
293
610
|
readonly fleet: FleetBus;
|
|
611
|
+
/**
|
|
612
|
+
* Usage rollup. Backed by `fleetManager?.usage` when a FleetManager is
|
|
613
|
+
* injected; otherwise own FleetUsageAggregator.
|
|
614
|
+
*/
|
|
294
615
|
readonly usage: FleetUsageAggregator;
|
|
616
|
+
/**
|
|
617
|
+
* Optional fleet-level policy container. When provided the Director
|
|
618
|
+
* delegates spawn budgeting, manifest entries, and checkpointing to it
|
|
619
|
+
* instead of managing those internally. All other behavior is unchanged.
|
|
620
|
+
*/
|
|
621
|
+
readonly fleetManager: FleetManager | undefined;
|
|
295
622
|
/**
|
|
296
623
|
* Director-side bridge endpoint. Subagents are wired to the same
|
|
297
624
|
* in-memory transport so the director can `ask()` them synchronously
|
|
@@ -342,8 +669,8 @@ declare class Director {
|
|
|
342
669
|
/** Debounce timer for periodic manifest writes. */
|
|
343
670
|
private manifestTimer;
|
|
344
671
|
private readonly manifestDebounceMs;
|
|
345
|
-
/** Fleet-wide cost cap. Infinity means no cap. */
|
|
346
|
-
private readonly
|
|
672
|
+
/** Fleet-wide cost cap (entire fleet total, distinct from SubagentBudget limits). Infinity means no cap. */
|
|
673
|
+
private readonly maxFleetCostUsd;
|
|
347
674
|
/** Max auto-extensions per subagent per budget kind before denying. */
|
|
348
675
|
private readonly maxBudgetExtensions;
|
|
349
676
|
/** Sessions root for direct subagent JSONL reads (fleet_session tool). */
|
|
@@ -1003,4 +1330,13 @@ declare function applyRosterBudget(cfg: SubagentConfig): SubagentConfig;
|
|
|
1003
1330
|
/** Quick-access list for spawning all at once. */
|
|
1004
1331
|
declare const ALL_FLEET_AGENTS: SubagentConfig[];
|
|
1005
1332
|
|
|
1006
|
-
|
|
1333
|
+
/**
|
|
1334
|
+
* A no-op FleetBus that discards all events. Used when no real fleet
|
|
1335
|
+
* bus is available (non-director mode) so the runner's `fleetBus`
|
|
1336
|
+
* field is always valid and the `attach()` call is always safe.
|
|
1337
|
+
*
|
|
1338
|
+
* One singleton instance is sufficient — it has no state to reset.
|
|
1339
|
+
*/
|
|
1340
|
+
declare const NULL_FLEET_BUS: FleetBus;
|
|
1341
|
+
|
|
1342
|
+
export { ALL_FLEET_AGENTS as A, BUG_HUNTER_AGENT as B, type CreateDelegateToolOptions as C, DEFAULT_DIRECTOR_PREAMBLE as D, createDelegateTool as E, FLEET_ROSTER as F, makeAgentSubagentRunner as G, makeDirectorSessionFactory as H, type ICoordinator as I, rosterSummaryFromConfigs as J, FleetCostCapError as K, type MultiAgentCoordinatorOptions as M, NULL_FLEET_BUS as N, REFACTOR_PLANNER_AGENT as R, SECURITY_SCANNER_AGENT as S, AUDIT_LOG_AGENT as a, type AgentFactory as b, type AgentFactoryResult as c, type AgentRunnerOptions as d, DEFAULT_SUBAGENT_BASELINE as e, DefaultMultiAgentCoordinator as f, type DelegateHost as g, Director as h, type DirectorPromptParts as i, type DirectorSessionFactory as j, type DirectorSessionFactoryOptions as k, FLEET_ROSTER_BUDGETS as l, FleetBus as m, type FleetEvent as n, type FleetHandler as o, FleetManager as p, type FleetManagerOptions as q, FleetSpawnBudgetError as r, type FleetUsage as s, FleetUsageAggregator as t, type IFleetManager as u, type SubagentPromptParts as v, type SubagentUsageSnapshot as w, applyRosterBudget as x, composeDirectorPrompt as y, composeSubagentPrompt as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
import { S as SystemPromptBuilder, M as ModelCapabilities, B as BuildContext, C as Container } from './system-prompt-
|
|
2
|
-
export { a as BindOptions, D as Decorator, F as Factory, b as Middleware, c as MiddlewareHandler, N as NextFn, P as Pipeline, d as PipelineOptions, R as Renderer, T as Token } from './system-prompt-
|
|
3
|
-
import { E as EventBus, a as EventName, L as Listener } from './events-
|
|
4
|
-
export { b as EventLogger, c as EventMap, S as ScopedEventBus } from './events-
|
|
1
|
+
import { S as SystemPromptBuilder, M as ModelCapabilities, B as BuildContext, C as Container } from './system-prompt-Dl2QY1_B.js';
|
|
2
|
+
export { a as BindOptions, D as Decorator, F as Factory, b as Middleware, c as MiddlewareHandler, N as NextFn, P as Pipeline, d as PipelineOptions, R as Renderer, T as Token } from './system-prompt-Dl2QY1_B.js';
|
|
3
|
+
import { E as EventBus, a as EventName, L as Listener } from './events-DPQKFX7W.js';
|
|
4
|
+
export { b as EventLogger, c as EventMap, S as ScopedEventBus } from './events-DPQKFX7W.js';
|
|
5
5
|
export { RunController, RunControllerOptions, TOKENS } from './kernel/index.js';
|
|
6
|
-
import { a2 as Context, g as Provider, b as ContentBlock, T as TextBlock } from './context-
|
|
7
|
-
export { A as AgentError, C as Capabilities, a as ConfigError, a7 as ContextInit, a6 as ConversationState, E as ErrorCode, c as ErrorSeverity, d as ErrorSubsystem, F as FileSnapshot, I as ImageBlock, J as JSONSchema, M as Message, e as MessageRole, P as Permission, f as PluginError, h as ProviderError, i as ProviderErrorBody, a8 as ReadonlyConversationState, R as Request, j as Response, k as ResumedSession, l as RiskTier, a9 as RunEnv, aa as RunOptions, S as SessionData, m as SessionError, n as SessionEvent, o as SessionMetadata, p as SessionStore, q as SessionSummary, r as SessionWriter, ab as StateChange, ac as StateChangeHandler, s as StopReason, t as StreamEvent, u as ThinkingBlock, a5 as TodoItem, a3 as TokenCounter,
|
|
8
|
-
export { P as ProviderRunner, R as RunProviderOptions } from './provider-runner-
|
|
9
|
-
import { a as Config } from './config-
|
|
10
|
-
export { C as CONTEXT_WINDOW_MODES, b as ConfigLoader, c as ConfigStore, d as ContextConfig, e as ContextWindowAggressiveOn, f as ContextWindowConfigLike, g as ContextWindowMode, h as ContextWindowModeId, i as ContextWindowPolicy, j as ContextWindowThresholds, D as DEFAULT_CONTEXT_WINDOW_MODE_ID, F as FeaturesConfig, L as LogConfig, M as MCPServerConfig, P as PluginConfig, k as ProviderApiKey, l as ProviderConfig, T as ToolsConfig, m as formatContextWindowModeList, n as getContextWindowMode, o as isContextWindowModeId, p as listContextWindowModes, r as resolveContextWindowPolicy } from './config-
|
|
11
|
-
export { C as CompactReport, a as Compactor } from './compactor-
|
|
12
|
-
export { P as PermissionDecision, a as PermissionPolicy, T as TrustPolicy } from './secret-scrubber-
|
|
6
|
+
import { a2 as Context, g as Provider, v as Tool, b as ContentBlock, T as TextBlock } from './context-CDRyrkKQ.js';
|
|
7
|
+
export { A as AgentError, C as Capabilities, a as ConfigError, a7 as ContextInit, a6 as ConversationState, E as ErrorCode, c as ErrorSeverity, d as ErrorSubsystem, F as FileSnapshot, I as ImageBlock, J as JSONSchema, M as Message, e as MessageRole, P as Permission, f as PluginError, h as ProviderError, i as ProviderErrorBody, a8 as ReadonlyConversationState, R as Request, j as Response, k as ResumedSession, l as RiskTier, a9 as RunEnv, aa as RunOptions, S as SessionData, m as SessionError, n as SessionEvent, o as SessionMetadata, p as SessionStore, q as SessionSummary, r as SessionWriter, ab as StateChange, ac as StateChangeHandler, s as StopReason, t as StreamEvent, u as ThinkingBlock, a5 as TodoItem, a3 as TokenCounter, w as ToolCallContext, x as ToolError, y as ToolFinalEvent, z as ToolProgressEvent, B as ToolResultBlock, D as ToolStreamEvent, G as ToolUseBlock, U as Usage, W as WrongStackError, H as asBlocks, K as asText, ad as extractRunEnv, L as isAgentError, N as isConfigError, O as isImageBlock, Q as isPluginError, V as isSessionError, X as isTextBlock, Y as isThinkingBlock, Z as isToolError, _ as isToolResultBlock, $ as isToolUseBlock, a0 as isWrongStackError, a1 as toWrongStackError, ae as wrapAsState } from './context-CDRyrkKQ.js';
|
|
8
|
+
export { P as ProviderRunner, R as RunProviderOptions } from './provider-runner-hl4Il3xS.js';
|
|
9
|
+
import { a as Config } from './config-BGGuP_Ar.js';
|
|
10
|
+
export { C as CONTEXT_WINDOW_MODES, b as ConfigLoader, c as ConfigStore, d as ContextConfig, e as ContextWindowAggressiveOn, f as ContextWindowConfigLike, g as ContextWindowMode, h as ContextWindowModeId, i as ContextWindowPolicy, j as ContextWindowThresholds, D as DEFAULT_CONTEXT_WINDOW_MODE_ID, F as FeaturesConfig, L as LogConfig, M as MCPServerConfig, P as PluginConfig, k as ProviderApiKey, l as ProviderConfig, T as ToolsConfig, m as formatContextWindowModeList, n as getContextWindowMode, o as isContextWindowModeId, p as listContextWindowModes, r as resolveContextWindowPolicy } from './config-BGGuP_Ar.js';
|
|
11
|
+
export { C as CompactReport, a as Compactor } from './compactor-RIPuTtWK.js';
|
|
12
|
+
export { P as PermissionDecision, a as PermissionPolicy, S as SecretScrubber, T as TrustPolicy } from './secret-scrubber-CfMdAJ_l.js';
|
|
13
13
|
export { C as CheckpointInfo, R as RewindResult, a as RewindResultExtended, S as SessionRewinder } from './session-rewinder-C9HnMkhP.js';
|
|
14
|
-
import { e as AttachmentStore, d as AttachmentRef, A as AddAttachmentInput } from './session-reader-
|
|
15
|
-
export { a as Attachment, b as AttachmentKind, c as AttachmentMeta, D as DefaultSessionReader } from './session-reader-
|
|
16
|
-
export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from './secret-scrubber-
|
|
14
|
+
import { e as AttachmentStore, d as AttachmentRef, A as AddAttachmentInput } from './session-reader-CzfRA6Vk.js';
|
|
15
|
+
export { a as Attachment, b as AttachmentKind, c as AttachmentMeta, D as DefaultSessionReader } from './session-reader-CzfRA6Vk.js';
|
|
16
|
+
export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from './secret-scrubber-BzQR5BiL.js';
|
|
17
17
|
export { D as DefaultLogger, a as DefaultLoggerOptions } from './logger-BH6AE0W9.js';
|
|
18
|
-
export { D as DefaultPathResolver, a as DefaultTokenCounter } from './path-resolver
|
|
18
|
+
export { D as DefaultPathResolver, a as DefaultTokenCounter } from './path-resolver--g_hKJ7V.js';
|
|
19
19
|
import { b as MemoryStore } from './memory-CEXuo7sz.js';
|
|
20
20
|
export { M as MemoryEntry, a as MemoryScope } from './memory-CEXuo7sz.js';
|
|
21
|
-
export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, R as RecoveryStrategy, T as ToolExecutor, c as buildRecoveryStrategies } from './tool-executor-
|
|
21
|
+
export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, R as RecoveryStrategy, T as ToolExecutor, c as buildRecoveryStrategies } from './tool-executor-B03CRwu-.js';
|
|
22
22
|
import { a as SkillLoader } from './skill-CxuWrsKK.js';
|
|
23
23
|
export { S as SkillEntry, b as SkillManifest } from './skill-CxuWrsKK.js';
|
|
24
24
|
export { I as InputReader, P as PromptOption } from './input-reader-E-ffP2ee.js';
|
|
25
|
-
import { h as SlashCommand, j as SystemPromptContributor, b as PluginAPI, e as PluginPipelines, T as ToolRegistryView, g as ProviderRegistryView, M as MCPRegistryView, i as SlashCommandRegistryView, E as ExtensionRegistry, S as SessionWriterView, a as MetricsSinkView, n as ToolRegistry, o as ProviderRegistry, P as Plugin } from './index-
|
|
26
|
-
export { A as AfterIterationHook, p as AfterRunHook, q as AfterToolExecutionHook, r as Agent, s as AgentExtension, t as AgentInit, u as AgentInput, v as AgentPipelines, B as BeforeIterationHook, w as BeforeRunHook, x as BeforeToolExecutionHook, D as DEFAULT_MAX_ITERATIONS, O as OnErrorHook, c as PluginCapabilities, d as PluginDependency, y as ProviderFactory, z as ProviderRunnerWrapper, R as RunResult, C as ToolWrapper, U as UserInputPayload, F as createDefaultPipelines } from './index-
|
|
25
|
+
import { h as SlashCommand, j as SystemPromptContributor, b as PluginAPI, e as PluginPipelines, T as ToolRegistryView, g as ProviderRegistryView, M as MCPRegistryView, i as SlashCommandRegistryView, E as ExtensionRegistry, S as SessionWriterView, a as MetricsSinkView, n as ToolRegistry, o as ProviderRegistry, P as Plugin } from './index-B0qTujQW.js';
|
|
26
|
+
export { A as AfterIterationHook, p as AfterRunHook, q as AfterToolExecutionHook, r as Agent, s as AgentExtension, t as AgentInit, u as AgentInput, v as AgentPipelines, B as BeforeIterationHook, w as BeforeRunHook, x as BeforeToolExecutionHook, D as DEFAULT_MAX_ITERATIONS, O as OnErrorHook, c as PluginCapabilities, d as PluginDependency, y as ProviderFactory, z as ProviderRunnerWrapper, R as RunResult, C as ToolWrapper, U as UserInputPayload, F as createDefaultPipelines } from './index-B0qTujQW.js';
|
|
27
27
|
export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from './models-registry-DqzwpBQy.js';
|
|
28
28
|
import { c as ModeStore } from './mode-CV077NjV.js';
|
|
29
29
|
export { D as DEFAULT_MODES, M as Mode, a as ModeConfig, b as ModeManifest } from './mode-CV077NjV.js';
|
|
30
|
-
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-
|
|
31
|
-
export { n as BudgetExceededError, o as BudgetKind, p as BudgetLimits, q as BudgetUsage, C as CoordinatorEvents, a as CoordinatorStatus, D as DoneCondition, M as MultiAgentConfig, b as MultiAgentCoordinator, S as SpawnResult, r as SubagentBudget, c as SubagentConfig, d as SubagentContext, e as SubagentError, f as SubagentErrorKind, g as SubagentRunContext, h as SubagentRunOutcome, i as SubagentRunner, T as TaskDelegation, j as TaskResult, k as TaskSpec } from './multi-agent-
|
|
30
|
+
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-BKNiE1VH.js';
|
|
31
|
+
export { n as BudgetExceededError, o as BudgetKind, p as BudgetLimits, q as BudgetUsage, C as CoordinatorEvents, a as CoordinatorStatus, D as DoneCondition, M as MultiAgentConfig, b as MultiAgentCoordinator, S as SpawnResult, r as SubagentBudget, c as SubagentConfig, d as SubagentContext, e as SubagentError, f as SubagentErrorKind, g as SubagentRunContext, h as SubagentRunOutcome, i as SubagentRunner, T as TaskDelegation, j as TaskResult, k as TaskSpec } from './multi-agent-Cpp7FXUl.js';
|
|
32
32
|
export { C as CriticalPathResult, D as DEFAULT_SPEC_TEMPLATE, S as SpecAnalysis, a as SpecApiEndpoint, b as SpecRequirement, c as SpecSection, d as SpecSectionType, e as SpecStatus, f as SpecTemplate, g as SpecValidationResult, h as Specification, T as TaskAssignment, i as TaskDependency, j as TaskEdge, k as TaskFilter, l as TaskGraph, m as TaskNode, n as TaskPriority, o as TaskProgress, p as TaskSort, q as TaskStatus, r as TaskType, s as computeTaskProgress, t as findCriticalPath, u as topologicalSort } from './task-graph-BITvWt4t.js';
|
|
33
33
|
export { A as AggregateHealth, H as HealthCheck, a as HealthCheckResult, b as HealthRegistry, c as HealthStatus, M as MetricLabels, d as MetricSeries, e as MetricsSink, f as MetricsSnapshot, S as Span, T as Tracer } from './observability-BhnVLBLS.js';
|
|
34
34
|
export { AtomicWriteOptions, BuildChildEnvOptions, CompileFail, CompileResult, MessageRepairReport, MessageRepairResult, NewlineStyle, RequestTokenBreakdown, SafeParseResult, ToolOutputSerializerOptions, UnifiedDiffOptions, ValidationError, ValidationResult, atomicWrite, buildChildEnv, color, compileGlob, compileUserRegex, createToolOutputSerializer, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, formatTodosList, matchAny, matchGlob, normalizeToLf, repairToolUseAdjacency, safeParse, safeStringify, sanitizeJsonString, stripAnsi, toStyle, unifiedDiff, validateAgainstSchema } from './utils/index.js';
|
|
35
35
|
export { a as WstackPathOptions, W as WstackPaths, p as projectHash, r as resolveWstackPaths } from './wstack-paths-86YPFktR.js';
|
|
36
|
-
export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from './plan-templates-
|
|
36
|
+
export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from './plan-templates-CKJs_sYh.js';
|
|
37
37
|
export { D as DirectorStateCheckpoint, a as DirectorStateSnapshot, b as DirectorSubagentState, c as DirectorTaskState, l as loadDirectorState } from './director-state-BmYi3DGA.js';
|
|
38
38
|
export { AutoApprovePermissionPolicy, DefaultPermissionPolicy, PermissionPolicyOptions } from './security/index.js';
|
|
39
|
-
export { AutoCompactionMiddleware, AutonomousRunner, AutonomousRunnerOptions, DefaultSkillLoader, DoneCheckResult, DoneConditionChecker, IntelligentCompactor, IntelligentCompactorOptions, SelectiveCompactor, SelectiveCompactorOptions, SkillLoaderOptions } from './execution/index.js';
|
|
39
|
+
export { AutoCompactionMiddleware, AutonomousRunner, AutonomousRunnerOptions, DefaultSkillLoader, DoneCheckResult, DoneConditionChecker, EternalAutonomyEngine, EternalAutonomyOptions, EternalEngineState, IntelligentCompactor, IntelligentCompactorOptions, SelectiveCompactor, SelectiveCompactorOptions, SkillLoaderOptions } from './execution/index.js';
|
|
40
40
|
export { DefaultProviderRunner } from './defaults/index.js';
|
|
41
|
-
export { A as ALL_FLEET_AGENTS, a as AUDIT_LOG_AGENT, b as AgentFactory, c as AgentFactoryResult, d as AgentRunnerOptions, B as BUG_HUNTER_AGENT, C as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE, e as DEFAULT_SUBAGENT_BASELINE, f as DefaultMultiAgentCoordinator, g as DelegateHost, h as Director, i as
|
|
41
|
+
export { A as ALL_FLEET_AGENTS, a as AUDIT_LOG_AGENT, b as AgentFactory, c as AgentFactoryResult, d as AgentRunnerOptions, B as BUG_HUNTER_AGENT, C as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE, e as DEFAULT_SUBAGENT_BASELINE, f as DefaultMultiAgentCoordinator, g as DelegateHost, h as Director, i as DirectorPromptParts, j as DirectorSessionFactory, k as DirectorSessionFactoryOptions, F as FLEET_ROSTER, l as FLEET_ROSTER_BUDGETS, m as FleetBus, n as FleetEvent, o as FleetHandler, p as FleetManager, q as FleetManagerOptions, r as FleetSpawnBudgetError, s as FleetUsage, t as FleetUsageAggregator, I as ICoordinator, u as IFleetManager, M as MultiAgentCoordinatorOptions, N as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, S as SECURITY_SCANNER_AGENT, v as SubagentPromptParts, w as SubagentUsageSnapshot, x as applyRosterBudget, y as composeDirectorPrompt, z as composeSubagentPrompt, E as createDelegateTool, G as makeAgentSubagentRunner, H as makeDirectorSessionFactory, J as rosterSummaryFromConfigs } from './index-DkdRz6yK.js';
|
|
42
42
|
export { DefaultModeStore, LLMSelector, LLMSelectorOptions, ModeLoaderOptions, loadProjectModes, loadUserModes } from './models/index.js';
|
|
43
43
|
export { AISpecBuilder, AISpecBuilderOptions, AISpecPhase, AISpecSession, AutoExecutor, AutoExecutorOptions, BottleneckTask, CollectedAnswer, CriticalPathAnalysis, DefaultTaskStore, ExecutionSummary, GeneratedTask, SPEC_TEMPLATES, SpecDiff, SpecDrivenDev, SpecDrivenDevOptions, SpecIndexEntry, SpecParser, SpecStore, SpecStoreOptions, SpecVersion, SpecVersioning, TaskExecutionContext, TaskExecutionResult, TaskFlow, TaskFlowEventMap, TaskFlowEventName, TaskFlowExecutionContext, TaskFlowOptions, TaskFlowPhase, TaskGenerator, TaskGeneratorOptions, TaskGraphIndexEntry, TaskGraphStore, TaskGraphStoreOptions, TaskStore, TaskTracker, TaskTrackerOptions, TaskTransition, analyzeCriticalPath, createAutoExecutor, getTemplate, listTemplates, renderProgress, renderSpecAnalysis, renderTaskGraph, renderTaskList, templateToMarkdown } from './sdd/index.js';
|
|
44
44
|
export { DefaultHealthRegistry, InMemoryMetricsSink, MetricsServerHandle, MetricsServerOptions, NoopMetricsSink, NoopTracer, OTelTracer, OtlpMetricsExporterHandle, OtlpMetricsExporterOptions, OtlpTraceExporterHandle, OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, buildOtlpMetricsRequest, buildOtlpTracesRequest, renderPrometheus, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, wireMetricsToEvents } from './observability/index.js';
|
|
45
|
-
export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, s as sentinelServer, p as slackServer, z as zaiVisionServer } from './mcp-servers-
|
|
45
|
+
export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, s as sentinelServer, p as slackServer, z as zaiVisionServer } from './mcp-servers-DBdh3cee.js';
|
|
46
46
|
export { DownloadResult, InstallResult, InstalledSkillEntry, ManifestData, ParsedRef, SkillInstaller, SkillInstallerOptions, SkillManifestStore, UpdateResult, downloadGitHubTarball, parseSkillRef } from './skills/index.js';
|
|
47
47
|
export { DefaultSessionRewinder, SessionRewinderOptions } from './storage/index.js';
|
|
48
|
-
|
|
48
|
+
export { G as GoalFile, J as JournalEntry, M as MAX_JOURNAL_ENTRIES, a as appendJournal, e as emptyGoal, f as formatGoal, g as goalFilePath, l as loadGoal, s as saveGoal, b as summarizeUsage } from './goal-store-BQ3YX1h1.js';
|
|
49
|
+
import { R as RetryPolicy, E as ErrorHandler } from './retry-policy-LKS8MHsB.js';
|
|
49
50
|
import { L as Logger } from './logger-BMQgxvdy.js';
|
|
50
51
|
export { a as LogLevel } from './logger-BMQgxvdy.js';
|
|
51
52
|
export { a as ModelsDevPayload, c as ModelsDevProvider, M as ModelsRegistry, b as ResolvedModel, R as ResolvedProvider, W as WireFamily } from './models-registry-Y2xbog0E.js';
|
|
52
53
|
export { S as SecretVault } from './secret-vault-DoISxaKO.js';
|
|
53
54
|
import './path-resolver-CPRj4bFY.js';
|
|
54
|
-
import './selector-
|
|
55
|
+
import './selector-C7HqnZJU.js';
|
|
55
56
|
import 'node:events';
|
|
56
57
|
|
|
57
58
|
/**
|
|
@@ -355,6 +356,86 @@ declare const defaultOrchestrator: SecurityScannerOrchestrator;
|
|
|
355
356
|
declare function createSecuritySlashCommand(): SlashCommand;
|
|
356
357
|
declare const securitySlashCommand: SlashCommand;
|
|
357
358
|
|
|
359
|
+
/**
|
|
360
|
+
* L1-E: Autonomous continue — model-driven self-iteration continuation.
|
|
361
|
+
*
|
|
362
|
+
* In autonomous mode the model can signal "keep going without waiting for
|
|
363
|
+
* user input" by either:
|
|
364
|
+
*
|
|
365
|
+
* 1. **Tool call** — call `continue_to_next_iteration()` with no args.
|
|
366
|
+
* The tool returns `{ continue: true }` and sets
|
|
367
|
+
* `ctx.meta._autonomousContinue = true`. The agent loop detects this
|
|
368
|
+
* flag and re-runs the iteration instead of returning.
|
|
369
|
+
*
|
|
370
|
+
* 2. **Text marker** — include one of the below markers on its own line
|
|
371
|
+
* in the final text output (no tool call required):
|
|
372
|
+
*
|
|
373
|
+
* - `[continue]` — same as calling the tool; next iteration
|
|
374
|
+
* - `[next step]` — synonym for `[continue]`
|
|
375
|
+
* - `[proceed]` — synonym for `[continue]`
|
|
376
|
+
* - `[done]` — stop iterating; return to caller
|
|
377
|
+
*
|
|
378
|
+
* The parser matches `^\s*(?:\[continue\]|\[next step\]|\[proceed\]|\[done\])\s*$`
|
|
379
|
+
* so the marker must occupy its own line (possibly indented).
|
|
380
|
+
*
|
|
381
|
+
* Text markers are checked in `processResponse()` BEFORE the loop exit
|
|
382
|
+
* condition, so the model can emit `[continue]` as part of its final text
|
|
383
|
+
* block and the loop re-runs seamlessly.
|
|
384
|
+
*
|
|
385
|
+
* The `_autonomousContinue` flag lives in `ctx.meta` — it is cleared at
|
|
386
|
+
* the start of each iteration so a stale flag from a prior run cannot
|
|
387
|
+
* cause spurious continuation.
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* ```typescript
|
|
391
|
+
* // Enable autonomous continuation on the Agent
|
|
392
|
+
* const agent = new Agent({
|
|
393
|
+
* // ... other options
|
|
394
|
+
* autonomousContinue: true, // enable text-marker parsing
|
|
395
|
+
* });
|
|
396
|
+
*
|
|
397
|
+
* // The model can now end a response with:
|
|
398
|
+
* // [continue]
|
|
399
|
+
* // and the agent will immediately start the next iteration without
|
|
400
|
+
* // returning to the caller.
|
|
401
|
+
* ```
|
|
402
|
+
*/
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Directive emitted by the model to control the autonomous loop.
|
|
406
|
+
*
|
|
407
|
+
* `continue` — halt the current agent.run() and signal to the outer
|
|
408
|
+
* runner (e.g. AutonomousRunner) that it should re-invoke
|
|
409
|
+
* agent.run() immediately with a fresh continuation prompt.
|
|
410
|
+
*
|
|
411
|
+
* `stop` — halt and signal the outer runner to NOT continue.
|
|
412
|
+
* The agent.run() returns `{ status: 'done' }` as normal.
|
|
413
|
+
*
|
|
414
|
+
* `none` — no directive present; outer runner uses its own
|
|
415
|
+
* `doneCondition` to decide.
|
|
416
|
+
*/
|
|
417
|
+
type ContinueDirective = 'continue' | 'stop' | 'none';
|
|
418
|
+
/**
|
|
419
|
+
* Parse a `ContinueDirective` from raw assistant text.
|
|
420
|
+
*
|
|
421
|
+
* Matches markers on their own line (with optional leading/trailing
|
|
422
|
+
* whitespace). Case-insensitive. Returns `'none'` when no marker found.
|
|
423
|
+
*
|
|
424
|
+
* The marker must be on its own line to avoid false positives — e.g.
|
|
425
|
+
* "remember to use [continue] in your next email" does NOT trigger it.
|
|
426
|
+
*/
|
|
427
|
+
declare function parseContinueDirective(text: string): ContinueDirective;
|
|
428
|
+
/**
|
|
429
|
+
* Built-in tool that lets the model explicitly request the next iteration.
|
|
430
|
+
*
|
|
431
|
+
* When called, the agent loop detects the flag and re-runs instead of
|
|
432
|
+
* returning to the caller. This is the explicit counterpart to the
|
|
433
|
+
* `[continue]` text marker.
|
|
434
|
+
*
|
|
435
|
+
* The tool has no side effects and returns `{ continue: true }`.
|
|
436
|
+
*/
|
|
437
|
+
declare function makeContinueToNextIterationTool(): Tool;
|
|
438
|
+
|
|
358
439
|
interface InputBuilderOptions {
|
|
359
440
|
store: AttachmentStore;
|
|
360
441
|
/**
|
|
@@ -589,7 +670,7 @@ declare class DefaultPluginAPI implements PluginAPI {
|
|
|
589
670
|
* (PluginAPI, types/plugin) changes in a way that breaks existing setup
|
|
590
671
|
* functions. Plugins declare `apiVersion: "^1.0"` to opt into this contract.
|
|
591
672
|
*
|
|
592
|
-
* 0.1.9: additive — `
|
|
673
|
+
* 0.1.9: additive — `FleetSpawnBudgetError|FleetCostCapError` plus `FLEET_ROSTER` and the
|
|
593
674
|
* pre-built fleet agent configs (Audit Log, Bug Hunter, Refactor Planner,
|
|
594
675
|
* Security Scanner) now exported from `@wrongstack/core`.
|
|
595
676
|
* 0.1.10: additive — extended-thinking stream events, core subpath
|
|
@@ -642,4 +723,4 @@ declare function loadPlugins(plugins: Plugin[], opts: LoadPluginsOptions): Promi
|
|
|
642
723
|
*/
|
|
643
724
|
declare function unloadPlugins(loadedPlugins: Plugin[], opts: LoadPluginsOptions): Promise<void>;
|
|
644
725
|
|
|
645
|
-
export { AddAttachmentInput, AttachmentRef, AttachmentStore, BuildContext, Config, Container, ContentBlock, Context, DefaultPluginAPI, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type DetectedDependency, type DetectionResult, EventBus, EventName, ExtensionRegistry, type Finding, type FullScanResult, type GeneratedSecuritySkill, type GeneratedSkill, type GeneratedSkillContent, GitignoreUpdater, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, MCPRegistryView, MemoryStore, MetricsSinkView, ModeStore, ModelCapabilities, type PackageManager, Plugin, PluginAPI, type PluginAPIInit, PluginPipelines, Provider, ProviderRegistry, ProviderRegistryView, ReportGenerator, type ReportOptions, type ScanOptions, type ScanResult, type ScanScope, type SecurityPattern, SecurityScanner, type SecurityScannerContext, type SecurityScannerOptions, SecurityScannerOrchestrator, SessionWriterView, type SeverityLevel, type SkillGenerationContext, SkillGenerator, type SkillGeneratorOptions, SkillLoader, SlashCommand, SlashCommandRegistry, SlashCommandRegistryView, SystemPromptBuilder, SystemPromptContributor, type TechStack, TechStackDetector, type TechStackInfo, TextBlock, ToolRegistry, ToolRegistryView, createSecuritySlashCommand, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, loadPlugins, securitySlashCommand, unloadPlugins };
|
|
726
|
+
export { AddAttachmentInput, AttachmentRef, AttachmentStore, BuildContext, Config, Container, ContentBlock, Context, type ContinueDirective, DefaultPluginAPI, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type DetectedDependency, type DetectionResult, EventBus, EventName, ExtensionRegistry, type Finding, type FullScanResult, type GeneratedSecuritySkill, type GeneratedSkill, type GeneratedSkillContent, GitignoreUpdater, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, MCPRegistryView, MemoryStore, MetricsSinkView, ModeStore, ModelCapabilities, type PackageManager, Plugin, PluginAPI, type PluginAPIInit, PluginPipelines, Provider, ProviderRegistry, ProviderRegistryView, ReportGenerator, type ReportOptions, type ScanOptions, type ScanResult, type ScanScope, type SecurityPattern, SecurityScanner, type SecurityScannerContext, type SecurityScannerOptions, SecurityScannerOrchestrator, SessionWriterView, type SeverityLevel, type SkillGenerationContext, SkillGenerator, type SkillGeneratorOptions, SkillLoader, SlashCommand, SlashCommandRegistry, SlashCommandRegistryView, SystemPromptBuilder, SystemPromptContributor, type TechStack, TechStackDetector, type TechStackInfo, TextBlock, Tool, ToolRegistry, ToolRegistryView, createSecuritySlashCommand, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, loadPlugins, makeContinueToNextIterationTool, parseContinueDirective, securitySlashCommand, unloadPlugins };
|