@wrongstack/core 0.270.0 → 0.272.1
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-PcHQl_UQ.d.ts → agent-bridge-DFQYEeXf.d.ts} +1 -1
- package/dist/{agent-subagent-runner-SHJW7t8q.d.ts → agent-subagent-runner-BZa_IEcd.d.ts} +7 -7
- package/dist/{brain-BYcK__Ym.d.ts → brain-etbcbRwV.d.ts} +95 -2
- package/dist/{compactor-C2RKEBtC.d.ts → compactor-72ug-ZRB.d.ts} +1 -1
- package/dist/{config-C_ae2k86.d.ts → config-rRS8yorV.d.ts} +71 -2
- package/dist/{context-Dp87Bcaq.d.ts → context-Dw55zZ_Q.d.ts} +110 -1
- package/dist/coordination/index.d.ts +181 -17
- package/dist/coordination/index.js +1018 -166
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +25 -25
- package/dist/defaults/index.js +804 -222
- package/dist/defaults/index.js.map +1 -1
- package/dist/execution/index.d.ts +23 -18
- package/dist/execution/index.js +136 -41
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +36 -6
- package/dist/execution/prompt-enhancer.js +35 -9
- package/dist/execution/prompt-enhancer.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/{global-mailbox-Bvrz1P3f.d.ts → global-mailbox-DJ4EoRr0.d.ts} +145 -5
- package/dist/{goal-preamble-CA_4yiGQ.d.ts → goal-preamble-hM8BH7TK.d.ts} +9 -9
- package/dist/{goal-store-DhuJoUNG.d.ts → goal-store-CWlbT0TO.d.ts} +1 -1
- package/dist/hq/index.d.ts +95 -6
- package/dist/hq/index.js +628 -50
- package/dist/hq/index.js.map +1 -1
- package/dist/{index-whDfTANu.d.ts → index-2Lhk5v0o.d.ts} +2 -2
- package/dist/{index-W4VJCzHa.d.ts → index-DWm_PE9L.d.ts} +5 -5
- package/dist/{index-CZQ6Pwbs.d.ts → index-DqW4o62H.d.ts} +8 -8
- package/dist/index.d.ts +96 -56
- package/dist/index.js +2464 -519
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +5 -3
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +9 -9
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-DJdZiRcv.d.ts → mcp-servers-BpWHTKlE.d.ts} +3 -3
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.js +28 -5
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-C3a-2-Yd.d.ts → models-registry-CXQFUn5t.d.ts} +1 -1
- package/dist/{multi-agent-coordinator-CJSpTe5O.d.ts → multi-agent-coordinator-jyimfo7D.d.ts} +1 -1
- package/dist/{null-fleet-bus-QVshIsDx.d.ts → null-fleet-bus-DOGQcvrY.d.ts} +6 -6
- package/dist/observability/index.d.ts +2 -2
- package/dist/{parallel-eternal-engine-D9y5Pkcc.d.ts → parallel-eternal-engine-rItJBYp9.d.ts} +9 -9
- package/dist/{path-resolver-CnQ8SIfh.d.ts → path-resolver-DrpF5MGK.d.ts} +3 -3
- package/dist/{permission-CvYQNUqZ.d.ts → permission-CC7XFYWG.d.ts} +1 -1
- package/dist/{permission-policy-D5Ss8j4B.d.ts → permission-policy-cYR4RJmw.d.ts} +2 -2
- package/dist/{pipeline-l_zzFRh3.d.ts → pipeline-Ckkn3AOA.d.ts} +2 -2
- package/dist/{plan-templates-NtPgyeJA.d.ts → plan-templates-BvHw5Znw.d.ts} +33 -9
- package/dist/{provider-model-resolve-d5poT5y0.d.ts → provider-model-resolve-nZqnCeaR.d.ts} +3 -3
- package/dist/{provider-runner-gkctlQV_.d.ts → provider-runner-zVOn1p67.d.ts} +3 -3
- package/dist/{retry-policy-CtFhfwa8.d.ts → retry-policy-BV7nzeAd.d.ts} +1 -1
- package/dist/sdd/index.d.ts +8 -8
- package/dist/sdd/index.js +2 -0
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-vault-BLsVmTIK.d.ts → secret-vault-eMBKfheR.d.ts} +9 -1
- package/dist/security/index.d.ts +5 -5
- package/dist/security/index.js +137 -10
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-CXl2_y9W.d.ts → selector-C4ORTOid.d.ts} +1 -1
- package/dist/{session-event-bridge-Ccud20CC.d.ts → session-event-bridge-CeNpUL9w.d.ts} +1 -1
- package/dist/{session-reader-ZeXQmsmE.d.ts → session-reader-BepLSnGL.d.ts} +1 -1
- package/dist/storage/index.d.ts +50 -13
- package/dist/storage/index.js +620 -220
- package/dist/storage/index.js.map +1 -1
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +9 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/types/index.d.ts +19 -19
- package/dist/types/index.js +202 -41
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +17 -4
- package/dist/utils/index.js +48 -9
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { E as EventBus, B as BrainArbiter, f as BrainDecisionOption, k as BrainRisk, h as BrainDecisionRequest, e as BrainDecision, i as BrainDecisionSource } from '../brain-
|
|
2
|
-
export { g as BrainDecisionQueue, j as BrainFallback, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, w as formatHumanPrompt } from '../brain-
|
|
3
|
-
import { H as FleetManager, s as Director } from '../null-fleet-bus-
|
|
4
|
-
export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-
|
|
5
|
-
import { b as AgentDefinition } from '../multi-agent-coordinator-
|
|
6
|
-
export { T as AGENT_TOOL_PRESETS, c as AgentBudgetTier, d as AgentCapability, A as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-
|
|
7
|
-
import { F as FleetBus } from '../agent-subagent-runner-
|
|
8
|
-
export { h as AgentFactory, v as AgentFactoryResult, w as AgentRunnerOptions, x as BudgetExceededError, y as BudgetKind, z as BudgetLimits, E as BudgetNegotiationMode, G as BudgetThresholdDecision, H as BudgetThresholdHandler, I as BudgetThresholdSignal, J as BudgetUsage, L as DECISION_TIMEOUT_MS, N as FleetEvent, O as FleetHandler, i as FleetUsage, j as FleetUsageAggregator, Q as SubagentBudget, Y as SubagentUsageSnapshot, Z as TIMEOUT_PREEMPT_FRACTION, $ as makeAgentSubagentRunner, a0 as withDisabledToolFiltering } from '../agent-subagent-runner-
|
|
9
|
-
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-
|
|
1
|
+
import { E as EventBus, B as BrainArbiter, f as BrainDecisionOption, k as BrainRisk, h as BrainDecisionRequest, e as BrainDecision, i as BrainDecisionSource } from '../brain-etbcbRwV.js';
|
|
2
|
+
export { g as BrainDecisionQueue, j as BrainFallback, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, w as formatHumanPrompt } from '../brain-etbcbRwV.js';
|
|
3
|
+
import { H as FleetManager, s as Director } from '../null-fleet-bus-DOGQcvrY.js';
|
|
4
|
+
export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-DOGQcvrY.js';
|
|
5
|
+
import { b as AgentDefinition } from '../multi-agent-coordinator-jyimfo7D.js';
|
|
6
|
+
export { T as AGENT_TOOL_PRESETS, c as AgentBudgetTier, d as AgentCapability, A as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-jyimfo7D.js';
|
|
7
|
+
import { F as FleetBus } from '../agent-subagent-runner-BZa_IEcd.js';
|
|
8
|
+
export { h as AgentFactory, v as AgentFactoryResult, w as AgentRunnerOptions, x as BudgetExceededError, y as BudgetKind, z as BudgetLimits, E as BudgetNegotiationMode, G as BudgetThresholdDecision, H as BudgetThresholdHandler, I as BudgetThresholdSignal, J as BudgetUsage, L as DECISION_TIMEOUT_MS, N as FleetEvent, O as FleetHandler, i as FleetUsage, j as FleetUsageAggregator, Q as SubagentBudget, Y as SubagentUsageSnapshot, Z as TIMEOUT_PREEMPT_FRACTION, $ as makeAgentSubagentRunner, a0 as withDisabledToolFiltering } from '../agent-subagent-runner-BZa_IEcd.js';
|
|
9
|
+
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-DFQYEeXf.js';
|
|
10
10
|
import { b as Mailbox, c as MailboxSendInput, M as MailboxMessage, d as MailboxQuery, e as MailboxAckInput, f as MailboxAckBatchInput, a as MailboxAgentStatus, A as AgentRegistrationInput, g as AgentHeartbeatInput, P as PurgeOptions, j as PurgeResult, C as ClientRegistrationInput, h as ClientHeartbeatInput, i as ClientStatus } from '../mailbox-types-Ct2hJq0P.js';
|
|
11
11
|
export { k as MailboxMessageType, l as MailboxTaskContext, R as ReadReceipts, m as RegisteredAgent, n as normalizeRecipient } from '../mailbox-types-Ct2hJq0P.js';
|
|
12
|
-
export { G as GlobalMailbox,
|
|
13
|
-
import { C as Context, T as Tool } from '../context-
|
|
12
|
+
export { G as GlobalMailbox, aw as resolveProjectDir } from '../global-mailbox-DJ4EoRr0.js';
|
|
13
|
+
import { C as Context, T as Tool } from '../context-Dw55zZ_Q.js';
|
|
14
|
+
import { A as AdaptiveConcurrencyConfig } from '../config-rRS8yorV.js';
|
|
14
15
|
import 'node:events';
|
|
15
16
|
import '../logger-B63L5bTg.js';
|
|
16
17
|
import '../director-state-BfeCUbmk.js';
|
|
17
|
-
import '../
|
|
18
|
-
import '../
|
|
19
|
-
import '../pipeline-l_zzFRh3.js';
|
|
18
|
+
import '../index-DWm_PE9L.js';
|
|
19
|
+
import '../pipeline-Ckkn3AOA.js';
|
|
20
20
|
import '../observability-D-HZN_mF.js';
|
|
21
|
-
import '../permission-
|
|
22
|
-
import '../retry-policy-
|
|
21
|
+
import '../permission-CC7XFYWG.js';
|
|
22
|
+
import '../retry-policy-BV7nzeAd.js';
|
|
23
23
|
|
|
24
24
|
/** Phase 1 · Discovery — map the territory before any work begins. */
|
|
25
25
|
declare const DISCOVERY_AGENTS: AgentDefinition[];
|
|
@@ -65,6 +65,10 @@ declare class DefaultMailbox implements Mailbox {
|
|
|
65
65
|
private _messageCache;
|
|
66
66
|
private _messageCacheMtime;
|
|
67
67
|
private _messageCacheSize;
|
|
68
|
+
/** Primary index: recipient → Set of messages (points into _messageCache). */
|
|
69
|
+
private _byTo;
|
|
70
|
+
/** Secondary index: sender → Set of messages (points into _messageCache). */
|
|
71
|
+
private _byFrom;
|
|
68
72
|
constructor(sessionDir: string);
|
|
69
73
|
get mailboxPath(): string;
|
|
70
74
|
send(input: MailboxSendInput): Promise<MailboxMessage>;
|
|
@@ -83,9 +87,20 @@ declare class DefaultMailbox implements Mailbox {
|
|
|
83
87
|
clientHeartbeat(_input: ClientHeartbeatInput): Promise<void>;
|
|
84
88
|
getClientStatuses(): Promise<ClientStatus[]>;
|
|
85
89
|
private _readAll;
|
|
90
|
+
/**
|
|
91
|
+
* Read only newly-appended bytes from the file and append them to the
|
|
92
|
+
* in-memory cache, avoiding a full re-read when the file only grew.
|
|
93
|
+
*/
|
|
94
|
+
private _readNewMessagesOnly;
|
|
95
|
+
/** Parse a JSONL string into MailboxMessage[], including migration. */
|
|
96
|
+
private _parseLines;
|
|
86
97
|
private _readAllCached;
|
|
87
98
|
private _setMessageCache;
|
|
88
99
|
private _pushToCache;
|
|
100
|
+
/** Rebuild both indexes from a full message list. */
|
|
101
|
+
private _buildIndexes;
|
|
102
|
+
/** Add a single message to both indexes. */
|
|
103
|
+
private _indexMsg;
|
|
89
104
|
}
|
|
90
105
|
|
|
91
106
|
/**
|
|
@@ -1723,4 +1738,153 @@ declare class AutonomousCoordinator {
|
|
|
1723
1738
|
private _emit;
|
|
1724
1739
|
}
|
|
1725
1740
|
|
|
1726
|
-
|
|
1741
|
+
interface AgentTimelineEntry {
|
|
1742
|
+
/** Unique entry id (ULID or timestamp-based). */
|
|
1743
|
+
id: string;
|
|
1744
|
+
/** Subagent id this entry belongs to. */
|
|
1745
|
+
subagentId: string;
|
|
1746
|
+
/** Human-readable agent name/role. */
|
|
1747
|
+
agentName: string;
|
|
1748
|
+
/** ISO 8601 timestamp. */
|
|
1749
|
+
ts: string;
|
|
1750
|
+
/** Content type. */
|
|
1751
|
+
kind: 'text' | 'tool_use' | 'tool_result' | 'error' | 'status' | 'system';
|
|
1752
|
+
/** The message content (text, tool summary, error message, status text). */
|
|
1753
|
+
content: string;
|
|
1754
|
+
/** Iteration index within the subagent's run. */
|
|
1755
|
+
iteration: number;
|
|
1756
|
+
/** For tool entries: tool name. */
|
|
1757
|
+
toolName?: string | undefined;
|
|
1758
|
+
/** For tool entries: whether the tool succeeded. */
|
|
1759
|
+
toolOk?: boolean | undefined;
|
|
1760
|
+
/** Running cost estimate. */
|
|
1761
|
+
costUsd?: number | undefined;
|
|
1762
|
+
}
|
|
1763
|
+
interface AgentVirtualSession {
|
|
1764
|
+
subagentId: string;
|
|
1765
|
+
agentName: string;
|
|
1766
|
+
createdAt: string;
|
|
1767
|
+
status: string;
|
|
1768
|
+
task?: string | undefined;
|
|
1769
|
+
/** Ordered transcript entries (newest last). */
|
|
1770
|
+
transcript: AgentTimelineEntry[];
|
|
1771
|
+
}
|
|
1772
|
+
interface AgentMonitorOptions {
|
|
1773
|
+
/** The FleetBus to listen on for subagent events. Optional — set via `setFleetBus()` before `start()`. */
|
|
1774
|
+
fleetBus?: FleetBus | undefined;
|
|
1775
|
+
/** Local EventBus for emitting agent.timeline.* and agent.status_changed events. */
|
|
1776
|
+
events: EventBus;
|
|
1777
|
+
/** Directory where per-subagent JSONL transcripts will be written. */
|
|
1778
|
+
transcriptsDir: string;
|
|
1779
|
+
/** Maximum in-memory entries per subagent (ring buffer). Default 500. */
|
|
1780
|
+
maxEntriesPerAgent?: number;
|
|
1781
|
+
/** Whether agent stream is initially enabled. Default false. */
|
|
1782
|
+
streamEnabled?: boolean;
|
|
1783
|
+
/** Called for each new timeline entry — used by HQ publisher bridge. */
|
|
1784
|
+
onEntry?: ((entry: AgentTimelineEntry) => void) | undefined;
|
|
1785
|
+
}
|
|
1786
|
+
declare class AgentMonitorService {
|
|
1787
|
+
private _fleetBus;
|
|
1788
|
+
private readonly _events;
|
|
1789
|
+
private readonly _transcriptsDir;
|
|
1790
|
+
private readonly _maxEntries;
|
|
1791
|
+
private _streamEnabled;
|
|
1792
|
+
private _onEntry;
|
|
1793
|
+
/** Per-subagent virtual sessions. */
|
|
1794
|
+
private readonly _sessions;
|
|
1795
|
+
/** Disposers for FleetBus subscriptions, keyed by subagentId. */
|
|
1796
|
+
private readonly _subscriptions;
|
|
1797
|
+
/** Generic fleet-wide subscription disposer. */
|
|
1798
|
+
private _fleetDisposer;
|
|
1799
|
+
/** Track whether service is running. */
|
|
1800
|
+
private _started;
|
|
1801
|
+
constructor(opts: AgentMonitorOptions);
|
|
1802
|
+
/** Set the FleetBus to listen on. Must be called before `start()`. */
|
|
1803
|
+
setFleetBus(bus: FleetBus): void;
|
|
1804
|
+
get streamEnabled(): boolean;
|
|
1805
|
+
/** Enable/disable streaming agent conversations to the main chat timeline. */
|
|
1806
|
+
setStreamEnabled(enabled: boolean): void;
|
|
1807
|
+
/** Get a snapshot of all known agent sessions. */
|
|
1808
|
+
getAllSessions(): AgentVirtualSession[];
|
|
1809
|
+
/** Get a specific agent's virtual session, or undefined. */
|
|
1810
|
+
getSession(subagentId: string): AgentVirtualSession | undefined;
|
|
1811
|
+
/** Get transcript entries for a specific agent, newest first. */
|
|
1812
|
+
getTranscript(subagentId: string, limit?: number): AgentTimelineEntry[];
|
|
1813
|
+
/** Set a callback for each new timeline entry (HQ bridge). */
|
|
1814
|
+
setOnEntry(handler: ((entry: AgentTimelineEntry) => void) | undefined): void;
|
|
1815
|
+
/** Start listening to FleetBus events. */
|
|
1816
|
+
start(): void;
|
|
1817
|
+
/** Stop listening and clean up all subscriptions. */
|
|
1818
|
+
stop(): void;
|
|
1819
|
+
/** Ensure a subagent is being tracked. Called when a subagent spawns. */
|
|
1820
|
+
trackSubagent(subagentId: string, agentName: string, task?: string): void;
|
|
1821
|
+
/** Mark a subagent as completed/failed/etc. Called on subagent finish. */
|
|
1822
|
+
completeSubagent(subagentId: string, status: 'completed' | 'failed' | 'timeout' | 'stopped' | 'budget_exhausted', summary?: string): void;
|
|
1823
|
+
private _routeEvent;
|
|
1824
|
+
private _addEntry;
|
|
1825
|
+
private _appendToFile;
|
|
1826
|
+
private _uid;
|
|
1827
|
+
}
|
|
1828
|
+
declare function createAgentMonitorService(opts: AgentMonitorOptions): AgentMonitorService;
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* Adaptive Concurrency Controller
|
|
1832
|
+
*
|
|
1833
|
+
* Automatically adjusts `maxConcurrent` based on:
|
|
1834
|
+
* - Rate limit (429) errors → decrease concurrency
|
|
1835
|
+
* - Sustained successful requests → increase concurrency
|
|
1836
|
+
*
|
|
1837
|
+
* This provides automatic backpressure without manual tuning.
|
|
1838
|
+
*/
|
|
1839
|
+
|
|
1840
|
+
interface AdaptiveConcurrencyState {
|
|
1841
|
+
current: number;
|
|
1842
|
+
min: number;
|
|
1843
|
+
max: number;
|
|
1844
|
+
consecutiveSuccesses: number;
|
|
1845
|
+
consecutiveFailures: number;
|
|
1846
|
+
totalDecreases: number;
|
|
1847
|
+
totalIncreases: number;
|
|
1848
|
+
enabled: boolean;
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Adaptive Concurrency Controller
|
|
1852
|
+
*
|
|
1853
|
+
* Monitors fleet events for rate-limit (429) errors and adjusts concurrency
|
|
1854
|
+
* automatically to prevent overwhelming the API provider.
|
|
1855
|
+
*/
|
|
1856
|
+
declare class AdaptiveConcurrencyController {
|
|
1857
|
+
private readonly config;
|
|
1858
|
+
private state;
|
|
1859
|
+
private readonly disposers;
|
|
1860
|
+
private stateChangeHandlers;
|
|
1861
|
+
constructor(fleetBus: FleetBus, setMaxConcurrent: (n: number) => void, config?: Partial<AdaptiveConcurrencyConfig>, onStateChange?: (state: AdaptiveConcurrencyState) => void);
|
|
1862
|
+
private setupEventHandlers;
|
|
1863
|
+
/**
|
|
1864
|
+
* Handle a rate limit (429) error - decrease concurrency
|
|
1865
|
+
*/
|
|
1866
|
+
private handleRateLimit;
|
|
1867
|
+
/**
|
|
1868
|
+
* Force a decrease (e.g., manual trigger or other error types)
|
|
1869
|
+
*/
|
|
1870
|
+
decrease(target?: number): void;
|
|
1871
|
+
/**
|
|
1872
|
+
* Get the current state
|
|
1873
|
+
*/
|
|
1874
|
+
getState(): AdaptiveConcurrencyState;
|
|
1875
|
+
/**
|
|
1876
|
+
* Update configuration at runtime
|
|
1877
|
+
*/
|
|
1878
|
+
updateConfig(config: Partial<AdaptiveConcurrencyConfig>): void;
|
|
1879
|
+
/**
|
|
1880
|
+
* Dispose of the controller and clean up event listeners
|
|
1881
|
+
*/
|
|
1882
|
+
dispose(): void;
|
|
1883
|
+
private notifyStateChange;
|
|
1884
|
+
/**
|
|
1885
|
+
* Register a state change handler
|
|
1886
|
+
*/
|
|
1887
|
+
onStateChange(handler: (state: AdaptiveConcurrencyState) => void): () => void;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
export { AdaptiveConcurrencyController, type AdaptiveConcurrencyState, AgentDefinition, AgentHeartbeatInput, type AgentMonitorOptions, AgentMonitorService, AgentRegistrationInput, type AgentTimelineEntry, type AgentVirtualSession, type ApplyResult, type ApprovalDecision, AutonomousBrain, type AutonomousBrainOptions, AutonomousCoordinator, type AutonomousCoordinatorOptions, type AutonomousDecisionRequest, type AutonomousDecisionType, BUILD_AGENTS, BrainArbiter, BrainDecision, BrainDecisionOption, BrainDecisionRequest, BrainDecisionSource, type BrainInterventionInput, BrainMonitor, type BrainMonitorOptions, BrainRisk, type ChangeFile, ChangeManager, type ChangeManagerOptions, type ChangeNode, type ChangeProposal, type ChangeStatus, type ConsensusOptions, ConsensusProtocol, type ConsensusResult, type CoordinatorEvent, type CoordinatorStats, type DAGEdgeEvent, type DAGEdgeHandler, type DAGNode, type DAGNodeStatus, DEFAULT_QUALITY_CHECKS, DELIVERY_AGENTS, DEPENDENCY_FILE_PATTERNS, DISCOVERY_AGENTS, DOMAIN_AGENTS, type DecisionNode, type DecisionPrompt, DefaultMailbox, type DepWatchEntry, type DepWatcherBridgeOptions, type DependencyWatcherConfig, Director, type EscalationDecision, type FactCategory, type FactNode, FleetBus, FleetManager, type GoalNode, type GoalPriority, type GoalStatus, type GraphSubscription, KNOWLEDGE_AGENTS, KnowledgeGraph, type LLMProvider, META_AGENTS, type MailToolsOptions, Mailbox, MailboxAckInput, MailboxAgentStatus, type MailboxHooksOptions, MailboxMessage, MailboxQuery, type MailboxResolver, MailboxSendInput, type MailboxToolOptions, type NodeFilter, type NodeType, type OutdatedNotifyMessage, PLANNING_AGENTS, type PackageAuthorEntry, type PackageAuthorLog, type PackageAuthorTrackerOptions, type PackageOutdatedEntry, type PackageOutdatedResult, type PackageOutdatedWatcherOptions, type PrioritizationDecision, type QualityCheck, type QualityGateChecks, type QualityGateResult, type QuorumRule, REVIEW_AGENTS, type RollbackResult, type RunOptions, type RunnablesHandler, type SpawnDecision, type TaskAuctionOptions, TaskAuctioneer, type TaskBid, TaskDAG, VERIFY_AGENTS, type VoteNode, type VoteRecord, type VoteValue, type VoterConfig, attachDepWatcherBridge, createAgentMonitorService, createMailboxHooks, detectEcosystem, getFullPackageLog, getManifestPackages, getPackageAuthor, getPackagesByAgent, mailboxSessionTag, makeDependencyWatcherConfig, makeMailInboxTool, makeMailSendTool, makeMailboxTool, recordPackageAction, resolveMailboxIdentity, startPackageOutdatedWatcher, updatePackageOutdatedStatus };
|