@wrongstack/core 0.7.0 → 0.7.3
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-CrQpYjM7.d.ts → agent-bridge-hXRN-GO_.d.ts} +1 -1
- package/dist/{compactor-CWV1u-IU.d.ts → compactor-Mw7-rNyb.d.ts} +1 -1
- package/dist/{config-C34JRwl4.d.ts → config-Bi4Q0fnz.d.ts} +2 -2
- package/dist/{context-bmR0YgBm.d.ts → context-z2x5gv_V.d.ts} +5 -1
- package/dist/coordination/index.d.ts +42 -12
- package/dist/coordination/index.js +2522 -33
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +24 -24
- package/dist/defaults/index.js +2783 -228
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-CEKFTmIY.d.ts → events-D4pGukpI.d.ts} +26 -2
- package/dist/execution/index.d.ts +38 -15
- package/dist/execution/index.js +2406 -21
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +8 -8
- package/dist/{index-BJIFLGII.d.ts → index-BUHs7xJ9.d.ts} +8 -8
- package/dist/index.d.ts +40 -32
- package/dist/index.js +2813 -215
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +9 -9
- package/dist/infrastructure/index.js +12 -0
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +11 -11
- package/dist/kernel/index.js +12 -0
- package/dist/kernel/index.js.map +1 -1
- package/dist/{logger-BMQgxvdy.d.ts → logger-DDd5C--Z.d.ts} +1 -1
- package/dist/{logger-BH6AE0W9.d.ts → logger-bOzkF5LL.d.ts} +1 -1
- package/dist/{mcp-servers-BRJicm5o.d.ts → mcp-servers-n2L9ohMX.d.ts} +3 -3
- package/dist/models/index.d.ts +4 -4
- package/dist/{models-registry-Y2xbog0E.d.ts → models-registry-BcYJDKLm.d.ts} +1 -1
- package/dist/{models-registry-DqzwpBQy.d.ts → models-registry-OG_30xqZ.d.ts} +1 -1
- package/dist/{multi-agent-Cm1wYSrw.d.ts → multi-agent-7OK4pEKW.d.ts} +6 -3
- package/dist/{multi-agent-coordinator-CCupVFqv.d.ts → multi-agent-coordinator-D8PLzfz6.d.ts} +165 -4
- package/dist/{index-CZR0HjxM.d.ts → null-fleet-bus-Bkk3gafb.d.ts} +97 -6
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-CfT7e_HT.d.ts → path-resolver-DPUjF10O.d.ts} +3 -3
- package/dist/{plan-templates-Q78an-GJ.d.ts → plan-templates-DWbEIJvV.d.ts} +5 -5
- package/dist/{provider-runner-WDj28o7J.d.ts → provider-runner-iST8U3ni.d.ts} +4 -4
- package/dist/{retry-policy-Dpxp4SET.d.ts → retry-policy-OwtKNxo8.d.ts} +2 -2
- package/dist/sdd/index.d.ts +3 -3
- package/dist/{secret-scrubber-CowtdEF8.d.ts → secret-scrubber-DXkhwuka.d.ts} +1 -1
- package/dist/{secret-scrubber-C2YCYtkn.d.ts → secret-scrubber-nI8qjaqW.d.ts} +1 -1
- package/dist/security/index.d.ts +3 -3
- package/dist/{selector-CP39HhCe.d.ts → selector-DkvgYVS4.d.ts} +1 -1
- package/dist/{session-reader-Dwjn4WZR.d.ts → session-reader-DsadjyF9.d.ts} +1 -1
- package/dist/storage/index.d.ts +7 -7
- package/dist/storage/index.js +8 -4
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-CfgXqyv2.d.ts → system-prompt-CWA6ml-d.d.ts} +2 -2
- package/dist/{tool-executor-D5NFi_LV.d.ts → tool-executor-Tutu4ePV.d.ts} +6 -5
- package/dist/types/index.d.ts +19 -19
- package/dist/types/index.js +29 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/{wstack-paths-86YPFktR.d.ts → wstack-paths-BGu2INTm.d.ts} +1 -1
- package/package.json +1 -1
package/dist/{multi-agent-coordinator-CCupVFqv.d.ts → multi-agent-coordinator-D8PLzfz6.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { E as EventBus } from './events-
|
|
3
|
-
import {
|
|
1
|
+
import { c as Agent, f as AgentInput } from './index-BUHs7xJ9.js';
|
|
2
|
+
import { E as EventBus } from './events-D4pGukpI.js';
|
|
3
|
+
import { m as SubagentConfig, u as TaskSpec, s as SubagentRunner, k as MultiAgentCoordinator, M as MultiAgentConfig, S as SpawnResult, B as BridgeMessage, A as AgentBridge, j as CoordinatorStatus, t as TaskResult } from './multi-agent-7OK4pEKW.js';
|
|
4
4
|
import { EventEmitter } from 'node:events';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -172,6 +172,167 @@ interface AgentRunnerOptions {
|
|
|
172
172
|
*/
|
|
173
173
|
declare function makeAgentSubagentRunner(opts: AgentRunnerOptions): SubagentRunner;
|
|
174
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Catalog types for the WrongStack agent fleet.
|
|
177
|
+
*
|
|
178
|
+
* An `AgentDefinition` bundles the runtime `SubagentConfig` (id/name/role/
|
|
179
|
+
* prompt/tools) with two things the bare config lacks:
|
|
180
|
+
* - a per-role `budget` tier (consumed by FLEET_ROSTER_BUDGETS), and
|
|
181
|
+
* - dispatcher `capability` metadata (keywords + summary + phase) used by
|
|
182
|
+
* the smart dispatcher to route a free-form task to the best agent.
|
|
183
|
+
*
|
|
184
|
+
* Phase files (`phase1-discovery.ts` … `phase9-meta.ts`) each export an
|
|
185
|
+
* `AgentDefinition[]`; `index.ts` aggregates them into `AGENT_CATALOG`.
|
|
186
|
+
* `fleet.ts` derives `FLEET_ROSTER` + `FLEET_ROSTER_BUDGETS` from the catalog.
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
/** Lifecycle phase grouping. Drives statusline labels + dispatcher tie-breaks. */
|
|
190
|
+
type AgentPhase = 'discovery' | 'planning' | 'build' | 'verify' | 'review' | 'domain' | 'knowledge' | 'delivery' | 'meta';
|
|
191
|
+
/** Per-role budget tier. Same shape as fleet.ts `FleetRosterBudget`. */
|
|
192
|
+
interface AgentBudgetTier {
|
|
193
|
+
timeoutMs?: number;
|
|
194
|
+
maxIterations?: number;
|
|
195
|
+
maxToolCalls?: number;
|
|
196
|
+
maxTokens?: number;
|
|
197
|
+
maxCostUsd?: number;
|
|
198
|
+
}
|
|
199
|
+
/** Dispatcher routing metadata. */
|
|
200
|
+
interface AgentCapability {
|
|
201
|
+
phase: AgentPhase;
|
|
202
|
+
/**
|
|
203
|
+
* One-line capability summary. Fed to the LLM dispatcher classifier as the
|
|
204
|
+
* candidate's description, and shown to the user when explaining a routing
|
|
205
|
+
* decision. Keep it concrete and distinct from sibling agents.
|
|
206
|
+
*/
|
|
207
|
+
summary: string;
|
|
208
|
+
/**
|
|
209
|
+
* Lowercased signal words/phrases for the heuristic dispatcher. A task whose
|
|
210
|
+
* description contains these scores toward this agent. Order doesn't matter;
|
|
211
|
+
* prefer specific terms ("graphql", "wcag") over generic ones ("code").
|
|
212
|
+
*/
|
|
213
|
+
keywords: string[];
|
|
214
|
+
}
|
|
215
|
+
/** A single catalog entry: runtime config + budget tier + routing metadata. */
|
|
216
|
+
interface AgentDefinition {
|
|
217
|
+
config: SubagentConfig;
|
|
218
|
+
budget: AgentBudgetTier;
|
|
219
|
+
capability: AgentCapability;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Budget tiers by workload weight. Deliberately generous — the project's
|
|
223
|
+
* existing roster uses multi-hour ceilings to avoid spurious timeouts on
|
|
224
|
+
* monorepo-scale work, and the auto-extend handshake raises them further when
|
|
225
|
+
* a subagent is still making progress.
|
|
226
|
+
*/
|
|
227
|
+
declare const LIGHT_BUDGET: AgentBudgetTier;
|
|
228
|
+
declare const MEDIUM_BUDGET: AgentBudgetTier;
|
|
229
|
+
declare const HEAVY_BUDGET: AgentBudgetTier;
|
|
230
|
+
/**
|
|
231
|
+
* Tool allowlist presets. Agents pass the smallest set that covers their job —
|
|
232
|
+
* a planning agent should not hold `write`/`bash`, a reviewer should be
|
|
233
|
+
* read-only. Spread + extend per-agent where a role needs one extra tool.
|
|
234
|
+
*/
|
|
235
|
+
declare const TOOLS: {
|
|
236
|
+
/** Pure read/inspect — safe for analysis and review agents. */
|
|
237
|
+
readonly read: readonly ["read", "grep", "glob", "search", "tree"];
|
|
238
|
+
/** Read + structured inspection (logs, diffs, json, dependency audit). */
|
|
239
|
+
readonly inspect: readonly ["read", "grep", "glob", "search", "tree", "json", "diff", "logs", "audit"];
|
|
240
|
+
/** Read + edit (no shell). For agents that write code/docs but don't run it. */
|
|
241
|
+
readonly write: readonly ["read", "grep", "glob", "search", "tree", "write", "edit", "replace", "patch"];
|
|
242
|
+
/** Full build loop: edit + run (lint/format/typecheck/test/bash). */
|
|
243
|
+
readonly build: readonly ["read", "grep", "glob", "search", "tree", "write", "edit", "replace", "patch", "bash", "exec", "lint", "format", "typecheck", "test"];
|
|
244
|
+
/** Version control. */
|
|
245
|
+
readonly vcs: readonly ["read", "grep", "glob", "git", "diff"];
|
|
246
|
+
/** Dependency management + CVE audit. */
|
|
247
|
+
readonly deps: readonly ["read", "grep", "glob", "install", "outdated", "audit", "json"];
|
|
248
|
+
/** Documentation authoring. */
|
|
249
|
+
readonly docs: readonly ["read", "grep", "glob", "search", "tree", "write", "edit", "document"];
|
|
250
|
+
/** Web research. */
|
|
251
|
+
readonly research: readonly ["read", "grep", "glob", "search", "fetch"];
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Smart agent dispatcher.
|
|
256
|
+
*
|
|
257
|
+
* Routes a free-form task description to the best agent in the catalog using a
|
|
258
|
+
* two-stage strategy:
|
|
259
|
+
*
|
|
260
|
+
* 1. Heuristic — keyword/phrase scoring against each agent's `capability`
|
|
261
|
+
* metadata. Deterministic, instant, no provider call. Multi-word phrases
|
|
262
|
+
* score higher than single words (they're more specific signals).
|
|
263
|
+
*
|
|
264
|
+
* 2. LLM fallback — when the heuristic is ambiguous (confidence below the
|
|
265
|
+
* threshold, or no keyword hit at all) an injected `classifier` resolves
|
|
266
|
+
* the tie. The classifier is provider-agnostic: callers wire it to any
|
|
267
|
+
* `complete(prompt) => text` function via `makeLLMClassifier`, so core
|
|
268
|
+
* stays free of provider dependencies and the path is unit-testable.
|
|
269
|
+
*
|
|
270
|
+
* If neither stage yields a confident pick, the dispatcher falls back to the
|
|
271
|
+
* `executor` generalist rather than failing.
|
|
272
|
+
*/
|
|
273
|
+
|
|
274
|
+
/** Default agent used when nothing else matches — the generalist builder. */
|
|
275
|
+
declare const DEFAULT_DISPATCH_ROLE = "executor";
|
|
276
|
+
interface DispatchCandidate {
|
|
277
|
+
role: string;
|
|
278
|
+
name: string;
|
|
279
|
+
score: number;
|
|
280
|
+
/** Capability keywords that matched the task text. */
|
|
281
|
+
matched: string[];
|
|
282
|
+
}
|
|
283
|
+
type DispatchMethod = 'heuristic' | 'llm' | 'fallback';
|
|
284
|
+
interface DispatchResult {
|
|
285
|
+
role: string;
|
|
286
|
+
definition: AgentDefinition;
|
|
287
|
+
/** 0..1 — heuristic margin, or 1 when an LLM made a definite choice. */
|
|
288
|
+
confidence: number;
|
|
289
|
+
method: DispatchMethod;
|
|
290
|
+
/** Human-readable explanation of why this agent was chosen. */
|
|
291
|
+
reason: string;
|
|
292
|
+
/** Runner-up candidates (top heuristic scorers), best-first. */
|
|
293
|
+
alternatives: DispatchCandidate[];
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Provider-agnostic classifier seam. Given the task and the candidate agents
|
|
297
|
+
* (role + summary), return the chosen role (and optional reason), or null to
|
|
298
|
+
* decline. Wire via `makeLLMClassifier`.
|
|
299
|
+
*/
|
|
300
|
+
type DispatchClassifier = (task: string, candidates: {
|
|
301
|
+
role: string;
|
|
302
|
+
name: string;
|
|
303
|
+
summary: string;
|
|
304
|
+
}[]) => Promise<{
|
|
305
|
+
role: string;
|
|
306
|
+
reason?: string;
|
|
307
|
+
} | null>;
|
|
308
|
+
interface DispatchOptions {
|
|
309
|
+
/** Optional LLM fallback for ambiguous tasks. */
|
|
310
|
+
classifier?: DispatchClassifier;
|
|
311
|
+
/** Heuristic confidence below this triggers the classifier. Default 0.4. */
|
|
312
|
+
confidenceThreshold?: number;
|
|
313
|
+
/** How many top candidates to offer the classifier. Default 6. */
|
|
314
|
+
maxCandidates?: number;
|
|
315
|
+
/** Override the catalog (testing). Defaults to the full `AGENT_CATALOG`. */
|
|
316
|
+
catalog?: Record<string, AgentDefinition>;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Score every agent against the task. A keyword hit adds 1 point; a multi-word
|
|
320
|
+
* keyword phrase adds points equal to its word count (more specific = stronger
|
|
321
|
+
* signal). Returns candidates sorted best-first, zero-score agents dropped.
|
|
322
|
+
*/
|
|
323
|
+
declare function scoreAgents(task: string, catalog?: Record<string, AgentDefinition>): DispatchCandidate[];
|
|
324
|
+
/**
|
|
325
|
+
* Route a task to the best agent. Async because the LLM fallback may run; the
|
|
326
|
+
* pure-heuristic path resolves without awaiting anything.
|
|
327
|
+
*/
|
|
328
|
+
declare function dispatchAgent(task: string, opts?: DispatchOptions): Promise<DispatchResult>;
|
|
329
|
+
/**
|
|
330
|
+
* Build a `DispatchClassifier` from a minimal `complete(prompt) => text`
|
|
331
|
+
* function. The caller supplies the provider call; this owns the prompt and
|
|
332
|
+
* the parsing. Keeps `dispatcher` free of any provider import.
|
|
333
|
+
*/
|
|
334
|
+
declare function makeLLMClassifier(complete: (prompt: string) => Promise<string>): DispatchClassifier;
|
|
335
|
+
|
|
175
336
|
interface MultiAgentCoordinatorOptions {
|
|
176
337
|
/**
|
|
177
338
|
* Callback that executes a task on behalf of a subagent. Required for
|
|
@@ -284,4 +445,4 @@ declare class DefaultMultiAgentCoordinator extends EventEmitter implements Multi
|
|
|
284
445
|
private isDone;
|
|
285
446
|
}
|
|
286
447
|
|
|
287
|
-
export { type
|
|
448
|
+
export { type AgentBudgetTier as A, DEFAULT_DISPATCH_ROLE as D, FleetBus as F, HEAVY_BUDGET as H, LIGHT_BUDGET as L, MEDIUM_BUDGET as M, type SubagentUsageSnapshot as S, TOOLS as T, type AgentCapability as a, type AgentDefinition as b, type AgentFactory as c, type AgentFactoryResult as d, type AgentPhase as e, type AgentRunnerOptions as f, DefaultMultiAgentCoordinator as g, type DispatchCandidate as h, type DispatchClassifier as i, type DispatchMethod as j, type DispatchOptions as k, type DispatchResult as l, type FleetEvent as m, type FleetHandler as n, type FleetUsage as o, FleetUsageAggregator as p, type MultiAgentCoordinatorOptions as q, dispatchAgent as r, makeAgentSubagentRunner as s, makeLLMClassifier as t, scoreAgents as u };
|
|
@@ -1,8 +1,33 @@
|
|
|
1
|
+
import { e as AgentPhase, b as AgentDefinition, F as FleetBus, o as FleetUsage, p as FleetUsageAggregator } from './multi-agent-coordinator-D8PLzfz6.js';
|
|
2
|
+
import { m as SubagentConfig, t as TaskResult, j as CoordinatorStatus, u as TaskSpec, M as MultiAgentConfig, s as SubagentRunner } from './multi-agent-7OK4pEKW.js';
|
|
3
|
+
import { B as SessionWriter, Q as Tool, y as SessionStore } from './context-z2x5gv_V.js';
|
|
1
4
|
import { a as DirectorStateSnapshot } from './director-state-BmYi3DGA.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import { I as InMemoryAgentBridge } from './agent-bridge-hXRN-GO_.js';
|
|
6
|
+
import { E as EventBus } from './events-D4pGukpI.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Agent catalog aggregator.
|
|
10
|
+
*
|
|
11
|
+
* Collects every phase's `AgentDefinition[]` into:
|
|
12
|
+
* - `ALL_AGENT_DEFINITIONS` — flat list, catalog order (phase 1 → 9)
|
|
13
|
+
* - `AGENT_CATALOG` — keyed by role for O(1) lookup
|
|
14
|
+
* - `AGENTS_BY_PHASE` — grouped for statusline / dispatcher tie-breaks
|
|
15
|
+
*
|
|
16
|
+
* `fleet.ts` derives `FLEET_ROSTER` + `FLEET_ROSTER_BUDGETS` from this, and the
|
|
17
|
+
* dispatcher routes free-form tasks against `capability` metadata here.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** Every catalog agent, in phase order. */
|
|
21
|
+
declare const ALL_AGENT_DEFINITIONS: AgentDefinition[];
|
|
22
|
+
/** Phase → its agents, for grouped display and dispatcher fallbacks. */
|
|
23
|
+
declare const AGENTS_BY_PHASE: Record<AgentPhase, AgentDefinition[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Role → definition. Built once at module load. Throws on a duplicate role so
|
|
26
|
+
* a copy-paste collision fails loudly at startup instead of silently shadowing.
|
|
27
|
+
*/
|
|
28
|
+
declare const AGENT_CATALOG: Record<string, AgentDefinition>;
|
|
29
|
+
/** Role lookup helper. Returns undefined for unknown roles. */
|
|
30
|
+
declare function getAgentDefinition(role: string): AgentDefinition | undefined;
|
|
6
31
|
|
|
7
32
|
/**
|
|
8
33
|
* Interface for a fleet coordinator. Implemented by both `Director`
|
|
@@ -575,6 +600,9 @@ declare class Director implements ICoordinator {
|
|
|
575
600
|
/** Snapshot of which subagent owns each task — drives state-checkpoint
|
|
576
601
|
* status updates without re-walking the manifest. */
|
|
577
602
|
private readonly taskOwners;
|
|
603
|
+
/** Cumulative auto-extension grants per subagent (all budget kinds). Lets
|
|
604
|
+
* /fleet render "⚡ extended ×N" without replaying the event stream. */
|
|
605
|
+
private readonly extendTotals;
|
|
578
606
|
/**
|
|
579
607
|
* Handle to the coordinator-side `task.completed` listener so we can
|
|
580
608
|
* unsubscribe in `shutdown()`. Without this, repeated Director
|
|
@@ -584,6 +612,14 @@ declare class Director implements ICoordinator {
|
|
|
584
612
|
*/
|
|
585
613
|
private taskCompletedListener;
|
|
586
614
|
constructor(opts: DirectorOptions);
|
|
615
|
+
/**
|
|
616
|
+
* Record a granted budget extension and broadcast it on the FleetBus so
|
|
617
|
+
* the host can re-emit `subagent.budget_extended` for live UI badges.
|
|
618
|
+
* Called from both the timeout heartbeat path and the per-kind grant path.
|
|
619
|
+
*/
|
|
620
|
+
private recordExtension;
|
|
621
|
+
/** Cumulative auto-extension count for one subagent (0 when never extended). */
|
|
622
|
+
extensionsFor(subagentId: string): number;
|
|
587
623
|
/** Best-effort session-writer append. Swallows failures — the director
|
|
588
624
|
* must not break a fleet run because the session JSONL handle closed. */
|
|
589
625
|
private appendSessionEvent;
|
|
@@ -1063,7 +1099,12 @@ declare const REFACTOR_PLANNER_AGENT: SubagentConfig;
|
|
|
1063
1099
|
* Use for: CI checks, pre-release audits, dependency vulnerability scanning.
|
|
1064
1100
|
*/
|
|
1065
1101
|
declare const SECURITY_SCANNER_AGENT: SubagentConfig;
|
|
1066
|
-
/**
|
|
1102
|
+
/**
|
|
1103
|
+
* All agents in a map for easy lookup by role. The four legacy pre-built
|
|
1104
|
+
* agents plus the phase 1-9 catalog (`ALL_AGENT_DEFINITIONS`). Catalog roles
|
|
1105
|
+
* are guaranteed collision-free by the catalog builder; none overlap the
|
|
1106
|
+
* legacy four.
|
|
1107
|
+
*/
|
|
1067
1108
|
declare const FLEET_ROSTER: Record<string, SubagentConfig>;
|
|
1068
1109
|
interface FleetRosterBudget {
|
|
1069
1110
|
timeoutMs?: number;
|
|
@@ -1076,6 +1117,56 @@ declare const FLEET_ROSTER_BUDGETS: Record<string, FleetRosterBudget>;
|
|
|
1076
1117
|
declare function applyRosterBudget(cfg: SubagentConfig): SubagentConfig;
|
|
1077
1118
|
/** Quick-access list for spawning all at once. */
|
|
1078
1119
|
declare const ALL_FLEET_AGENTS: SubagentConfig[];
|
|
1120
|
+
/** All ACP external agents. */
|
|
1121
|
+
declare const ACP_AGENTS: SubagentConfig[];
|
|
1122
|
+
/** Extended roster including ACP agents. */
|
|
1123
|
+
declare const FLEET_ROSTER_WITHACP: Record<string, SubagentConfig>;
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* Default auto-extend policy for subagent budgets.
|
|
1127
|
+
*
|
|
1128
|
+
* The budget's soft-limit path (`SubagentBudget` → `budget.threshold_reached`)
|
|
1129
|
+
* only negotiates an extension when SOMETHING listens on the EventBus. Under a
|
|
1130
|
+
* `Director`, that listener is the director's own auto-extend handler. On the
|
|
1131
|
+
* plain coordinator path (e.g. a bare `/spawn` with no director) nothing
|
|
1132
|
+
* listens, so the budget falls back to a hard stop and the subagent dies the
|
|
1133
|
+
* moment it crosses a soft limit.
|
|
1134
|
+
*
|
|
1135
|
+
* `attachAutoExtend` is the additive fix: wire it to a subagent's EventBus and
|
|
1136
|
+
* budget overruns are auto-granted headroom instead of killing the run. It is
|
|
1137
|
+
* heartbeat-aware for the timeout kind — wall-clock time always advances, so a
|
|
1138
|
+
* naive "extend timeout forever" would let a wedged agent run indefinitely.
|
|
1139
|
+
* Instead, a timeout extension is granted only when the agent has executed a
|
|
1140
|
+
* new tool call or started a new iteration since the last timeout extension.
|
|
1141
|
+
* No progress since last time ⇒ the agent is genuinely stuck ⇒ deny and let it
|
|
1142
|
+
* fail. The non-timeout kinds (iterations/tool_calls/tokens/cost) extend up to
|
|
1143
|
+
* a per-kind cap, then deny — those ceilings are the real runaway guard.
|
|
1144
|
+
*/
|
|
1145
|
+
|
|
1146
|
+
interface AutoExtendCeiling {
|
|
1147
|
+
maxIterations?: number;
|
|
1148
|
+
maxToolCalls?: number;
|
|
1149
|
+
maxTokens?: number;
|
|
1150
|
+
maxCostUsd?: number;
|
|
1151
|
+
timeoutMs?: number;
|
|
1152
|
+
}
|
|
1153
|
+
interface AutoExtendPolicy {
|
|
1154
|
+
/** Multiplier applied to the tripped limit when extending. Default 0.5 (+50%). */
|
|
1155
|
+
factor?: number;
|
|
1156
|
+
/**
|
|
1157
|
+
* Max extensions per NON-timeout kind before denying. Timeout is governed by
|
|
1158
|
+
* the heartbeat check, not this cap, so it can extend indefinitely while the
|
|
1159
|
+
* agent makes progress. Default 8.
|
|
1160
|
+
*/
|
|
1161
|
+
maxExtensionsPerKind?: number;
|
|
1162
|
+
/** Absolute ceilings — an extension never pushes a limit past these. */
|
|
1163
|
+
ceiling?: AutoExtendCeiling;
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* Attach an auto-extend policy to a subagent's EventBus. Returns an unsubscribe
|
|
1167
|
+
* function that detaches all listeners — call it when the subagent task ends.
|
|
1168
|
+
*/
|
|
1169
|
+
declare function attachAutoExtend(events: EventBus, policy?: AutoExtendPolicy): () => void;
|
|
1079
1170
|
|
|
1080
1171
|
/**
|
|
1081
1172
|
* A no-op FleetBus that discards all events. Used when no real fleet
|
|
@@ -1086,4 +1177,4 @@ declare const ALL_FLEET_AGENTS: SubagentConfig[];
|
|
|
1086
1177
|
*/
|
|
1087
1178
|
declare const NULL_FLEET_BUS: FleetBus;
|
|
1088
1179
|
|
|
1089
|
-
export {
|
|
1180
|
+
export { ACP_AGENTS as A, BUG_HUNTER_AGENT as B, type CreateDelegateToolOptions as C, DEFAULT_DIRECTOR_PREAMBLE as D, createDelegateTool as E, FLEET_ROSTER as F, getAgentDefinition as G, makeDirectorSessionFactory as H, type ICoordinator as I, rosterSummaryFromConfigs as J, NULL_FLEET_BUS as N, REFACTOR_PLANNER_AGENT as R, SECURITY_SCANNER_AGENT as S, AGENTS_BY_PHASE as a, 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, DEFAULT_SUBAGENT_BASELINE as h, type DelegateHost as i, Director as j, type DirectorPromptParts as k, type DirectorSessionFactory as l, type DirectorSessionFactoryOptions as m, FLEET_ROSTER_BUDGETS as n, FLEET_ROSTER_WITHACP as o, FleetCostCapError as p, FleetManager as q, type FleetManagerOptions as r, type FleetRosterBudget as s, FleetSpawnBudgetError as t, type IFleetManager as u, type SubagentPromptParts as v, applyRosterBudget as w, attachAutoExtend as x, composeDirectorPrompt as y, composeSubagentPrompt 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-D4pGukpI.js';
|
|
3
|
+
import '../context-z2x5gv_V.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-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { E as EventBus } from './events-D4pGukpI.js';
|
|
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-z2x5gv_V.js';
|
|
4
4
|
import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { E as EventBus } from './events-
|
|
2
|
-
import {
|
|
3
|
-
import { e as AttachmentStore, A as AddAttachmentInput, d as AttachmentRef, a as Attachment } from './session-reader-
|
|
1
|
+
import { E as EventBus } from './events-D4pGukpI.js';
|
|
2
|
+
import { y as SessionStore, x as SessionMetadata, B as SessionWriter, r as ResumedSession, S as SessionData, z as SessionSummary, c as ContentBlock, w as SessionEvent, N as TodoItem, f as ConversationState } from './context-z2x5gv_V.js';
|
|
3
|
+
import { e as AttachmentStore, A as AddAttachmentInput, d as AttachmentRef, a as Attachment } from './session-reader-DsadjyF9.js';
|
|
4
4
|
import { b as MemoryStore, a as MemoryScope } from './memory-CEXuo7sz.js';
|
|
5
|
-
import {
|
|
6
|
-
import { c as ConfigStore, a as Config, b as ConfigLoader } from './config-
|
|
5
|
+
import { a as WstackPaths } from './wstack-paths-BGu2INTm.js';
|
|
6
|
+
import { c as ConfigStore, a as Config, b as ConfigLoader } from './config-Bi4Q0fnz.js';
|
|
7
7
|
import { S as SecretVault } from './secret-vault-DoISxaKO.js';
|
|
8
8
|
|
|
9
9
|
interface SessionStoreOptions {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as EventBus } from './events-
|
|
2
|
-
import {
|
|
1
|
+
import { E as EventBus } from './events-D4pGukpI.js';
|
|
2
|
+
import { a as Logger } from './logger-DDd5C--Z.js';
|
|
3
3
|
import { T as Tracer } from './observability-BhnVLBLS.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { m as Provider, p as Request, d as Context, q as Response } from './context-z2x5gv_V.js';
|
|
5
|
+
import { a as RetryPolicy } from './retry-policy-OwtKNxo8.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Options passed to a ProviderRunner when calling the provider.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { q as Response, d as Context, n as ProviderError } from './context-z2x5gv_V.js';
|
|
2
2
|
|
|
3
3
|
type RecoveryDecision = {
|
|
4
4
|
/**
|
|
@@ -43,4 +43,4 @@ interface RetryPolicy {
|
|
|
43
43
|
maxAttempts(err: ProviderError | Error): number;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export type { ErrorHandler as E,
|
|
46
|
+
export type { ErrorHandler as E, RecoveryDecision as R, RetryPolicy as a };
|
package/dist/sdd/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h as Specification, S as SpecAnalysis, g as SpecValidationResult, l as TaskGraph, m as TaskNode, k as TaskFilter, p as TaskSort, o as TaskProgress, r as TaskType, n as TaskPriority, e as SpecStatus, f as SpecTemplate, b as SpecRequirement } from '../task-graph-D1YQbpxF.js';
|
|
2
|
-
import { E as EventBus } from '../events-
|
|
3
|
-
import { D as DoneCondition } from '../multi-agent-
|
|
4
|
-
import '../context-
|
|
2
|
+
import { E as EventBus } from '../events-D4pGukpI.js';
|
|
3
|
+
import { D as DoneCondition } from '../multi-agent-7OK4pEKW.js';
|
|
4
|
+
import '../context-z2x5gv_V.js';
|
|
5
5
|
|
|
6
6
|
declare class SpecParser {
|
|
7
7
|
parse(content: string): Specification;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as SecretVault } from './secret-vault-DoISxaKO.js';
|
|
2
|
-
import { S as SecretScrubber } from './secret-scrubber-
|
|
2
|
+
import { S as SecretScrubber } from './secret-scrubber-nI8qjaqW.js';
|
|
3
3
|
|
|
4
4
|
interface SecretVaultOptions {
|
|
5
5
|
/** Absolute path to the key file. Created with mode 0o600 if missing. */
|
package/dist/security/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
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-
|
|
2
|
-
import {
|
|
1
|
+
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-DXkhwuka.js';
|
|
2
|
+
import { Q as Tool, d as Context } from '../context-z2x5gv_V.js';
|
|
3
3
|
import { I as InputReader } from '../input-reader-E-ffP2ee.js';
|
|
4
|
-
import { a as PermissionPolicy, P as PermissionDecision } from '../secret-scrubber-
|
|
4
|
+
import { a as PermissionPolicy, P as PermissionDecision } from '../secret-scrubber-nI8qjaqW.js';
|
|
5
5
|
import '../secret-vault-DoISxaKO.js';
|
|
6
6
|
|
|
7
7
|
interface PermissionPolicyOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as ContentBlock, w as SessionEvent, x as SessionMetadata, y as SessionStore } from './context-z2x5gv_V.js';
|
|
2
2
|
|
|
3
3
|
type AttachmentKind = 'text' | 'image' | 'file';
|
|
4
4
|
interface AttachmentMeta {
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
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-
|
|
2
|
-
export { D as DefaultSessionReader } from '../session-reader-
|
|
1
|
+
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-DWbEIJvV.js';
|
|
2
|
+
export { D as DefaultSessionReader } from '../session-reader-DsadjyF9.js';
|
|
3
3
|
import { S as SessionRewinder, C as CheckpointInfo, a as RewindResultExtended } from '../session-rewinder-C9HnMkhP.js';
|
|
4
4
|
export { D as DirectorStateCheckpoint, a as DirectorStateSnapshot, b as DirectorSubagentState, c as DirectorTaskState, l as loadDirectorState } from '../director-state-BmYi3DGA.js';
|
|
5
5
|
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-HHgaq5ue.js';
|
|
6
|
-
import '../events-
|
|
7
|
-
import '../context-
|
|
6
|
+
import '../events-D4pGukpI.js';
|
|
7
|
+
import '../context-z2x5gv_V.js';
|
|
8
8
|
import '../memory-CEXuo7sz.js';
|
|
9
|
-
import '../wstack-paths-
|
|
10
|
-
import '../config-
|
|
11
|
-
import '../models-registry-
|
|
9
|
+
import '../wstack-paths-BGu2INTm.js';
|
|
10
|
+
import '../config-Bi4Q0fnz.js';
|
|
11
|
+
import '../models-registry-BcYJDKLm.js';
|
|
12
12
|
import '../secret-vault-DoISxaKO.js';
|
|
13
13
|
|
|
14
14
|
interface SessionRewinderOptions {
|
package/dist/storage/index.js
CHANGED
|
@@ -1199,19 +1199,23 @@ var BEHAVIOR_DEFAULTS = {
|
|
|
1199
1199
|
var ENV_MAP = {
|
|
1200
1200
|
WRONGSTACK_PROVIDER: (c, v) => {
|
|
1201
1201
|
c.provider = v;
|
|
1202
|
-
(c._envSource
|
|
1202
|
+
if (c._envSource === void 0) c._envSource = /* @__PURE__ */ new Set();
|
|
1203
|
+
c._envSource.add("provider");
|
|
1203
1204
|
},
|
|
1204
1205
|
WRONGSTACK_MODEL: (c, v) => {
|
|
1205
1206
|
c.model = v;
|
|
1206
|
-
(c._envSource
|
|
1207
|
+
if (c._envSource === void 0) c._envSource = /* @__PURE__ */ new Set();
|
|
1208
|
+
c._envSource.add("model");
|
|
1207
1209
|
},
|
|
1208
1210
|
WRONGSTACK_API_KEY: (c, v) => {
|
|
1209
1211
|
c.apiKey = v;
|
|
1210
|
-
(c._envSource
|
|
1212
|
+
if (c._envSource === void 0) c._envSource = /* @__PURE__ */ new Set();
|
|
1213
|
+
c._envSource.add("apiKey");
|
|
1211
1214
|
},
|
|
1212
1215
|
WRONGSTACK_BASE_URL: (c, v) => {
|
|
1213
1216
|
c.baseUrl = v;
|
|
1214
|
-
(c._envSource
|
|
1217
|
+
if (c._envSource === void 0) c._envSource = /* @__PURE__ */ new Set();
|
|
1218
|
+
c._envSource.add("baseUrl");
|
|
1215
1219
|
},
|
|
1216
1220
|
WRONGSTACK_LOG_LEVEL: (c, v) => {
|
|
1217
1221
|
if (!c.log) c.log = { level: "info" };
|