@wrongstack/core 0.9.7 → 0.9.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-bridge-DMVOX0cF.d.ts → agent-bridge-Dti3KXGk.d.ts} +1 -1
- package/dist/{agent-subagent-runner-DaF_EgRG.d.ts → agent-subagent-runner-U-rs7kk7.d.ts} +3 -4
- package/dist/compactor-D7X96RLZ.d.ts +41 -0
- package/dist/{config-SkMIDN9L.d.ts → config-CLXMDOSs.d.ts} +5 -1
- package/dist/{context-BRNbHmRM.d.ts → context-zkZeILpr.d.ts} +46 -0
- package/dist/coordination/index.d.ts +14 -13
- package/dist/coordination/index.js +1263 -123
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +22 -21
- package/dist/defaults/index.js +1477 -152
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-CiG9qUM_.d.ts → events-DH-9r-_C.d.ts} +42 -1
- package/dist/execution/index.d.ts +42 -30
- package/dist/execution/index.js +359 -112
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +7 -6
- package/dist/extension/index.js.map +1 -1
- package/dist/{index-CP8638Wm.d.ts → index-BIHJ4uII.d.ts} +12 -8
- package/dist/{index-Bsha5K4D.d.ts → index-CFO9QmJo.d.ts} +9 -8
- package/dist/index.d.ts +319 -37
- package/dist/index.js +2571 -324
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +36 -0
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +10 -9
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-BouUWYW6.d.ts → mcp-servers-DkESgh0G.d.ts} +25 -3
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-3ZnTB1aT.d.ts → multi-agent-DNp6lAzg.d.ts} +35 -23
- package/dist/{multi-agent-coordinator-DTXF2aAl.d.ts → multi-agent-coordinator-CAhsegPz.d.ts} +20 -2
- package/dist/{null-fleet-bus-Chrc_3Pp.d.ts → null-fleet-bus-Dnl19vmf.d.ts} +496 -15
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-TcJfc29Y.d.ts → path-resolver-CHiBL0DD.d.ts} +2 -2
- package/dist/{secret-scrubber-DttNiGYA.d.ts → permission-H35s9Evv.d.ts} +2 -7
- package/dist/{permission-policy-BpCGYBud.d.ts → permission-policy-CT-nRmTn.d.ts} +9 -2
- package/dist/{plan-templates-envSmNlZ.d.ts → plan-templates-Bs8iRwi6.d.ts} +28 -4
- package/dist/{provider-runner-BEpikbbN.d.ts → provider-runner-BZdDrWrS.d.ts} +3 -3
- package/dist/{retry-policy-BYkq0ugs.d.ts → retry-policy-J9N_PM40.d.ts} +1 -1
- package/dist/sdd/index.d.ts +10 -10
- package/dist/sdd/index.js +225 -68
- package/dist/sdd/index.js.map +1 -1
- package/dist/secret-scrubber-3MHDDAtm.d.ts +6 -0
- package/dist/{secret-scrubber-QSeI0ADi.d.ts → secret-scrubber-7rSC_emZ.d.ts} +1 -1
- package/dist/security/index.d.ts +5 -4
- package/dist/security/index.js +37 -6
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-pox8abg0.d.ts → selector-CFTh3Z6p.d.ts} +1 -1
- package/dist/{session-reader-CSWcb5Ga.d.ts → session-reader-C7JJlxOw.d.ts} +2 -2
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +391 -6
- package/dist/storage/index.js +760 -40
- package/dist/storage/index.js.map +1 -1
- package/dist/{system-prompt-Bs-Wliab.d.ts → system-prompt-CneIxVip.d.ts} +1 -1
- package/dist/{tool-executor-CsktM3h9.d.ts → tool-executor-flTuxsqO.d.ts} +9 -4
- package/dist/types/index.d.ts +16 -15
- package/dist/types/index.js +60 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +25 -2
- package/dist/utils/index.js +90 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/compactor-DVTKL7XD.d.ts +0 -23
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as BridgeTransport, B as BridgeMessage, A as AgentBridge, a as AgentBridgeConfig } from './multi-agent-
|
|
1
|
+
import { b as BridgeTransport, B as BridgeMessage, A as AgentBridge, a as AgentBridgeConfig } from './multi-agent-DNp6lAzg.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* In-memory pub/sub transport for agent-to-agent messaging.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as Agent, f as AgentInput } from './index-
|
|
2
|
-
import { E as EventBus } from './events-
|
|
3
|
-
import { n as SubagentConfig, v as TaskSpec, t as SubagentRunner } from './multi-agent-
|
|
1
|
+
import { c as Agent, f as AgentInput } from './index-BIHJ4uII.js';
|
|
2
|
+
import { E as EventBus } from './events-DH-9r-_C.js';
|
|
3
|
+
import { n as SubagentConfig, v as TaskSpec, t as SubagentRunner } from './multi-agent-DNp6lAzg.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Single fleet-wide event with subagent attribution. Whatever a child
|
|
@@ -91,7 +91,6 @@ interface SubagentUsageSnapshot {
|
|
|
91
91
|
* each subagent's per-token rates from the models registry.
|
|
92
92
|
*/
|
|
93
93
|
declare class FleetUsageAggregator {
|
|
94
|
-
private readonly bus;
|
|
95
94
|
private readonly priceLookup?;
|
|
96
95
|
private readonly metaLookup?;
|
|
97
96
|
private readonly perSubagent;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { d as Context } from './context-zkZeILpr.js';
|
|
2
|
+
|
|
3
|
+
interface CompactRepairReport {
|
|
4
|
+
removedToolUses: string[];
|
|
5
|
+
removedToolResults: string[];
|
|
6
|
+
removedMessages: number;
|
|
7
|
+
}
|
|
8
|
+
interface CompactReport {
|
|
9
|
+
/**
|
|
10
|
+
* Token count of messages only (pre-compaction).
|
|
11
|
+
* Use `fullRequestTokensBefore` for accurate context-window load calculations.
|
|
12
|
+
*/
|
|
13
|
+
before: number;
|
|
14
|
+
/**
|
|
15
|
+
* Token count of messages only (post-compaction).
|
|
16
|
+
* Use `fullRequestTokensAfter` for accurate context-window load calculations.
|
|
17
|
+
*/
|
|
18
|
+
after: number;
|
|
19
|
+
/**
|
|
20
|
+
* Full API request token count before compaction: messages + systemPrompt + toolDefs.
|
|
21
|
+
* This is the accurate figure for context-window pressure monitoring.
|
|
22
|
+
*/
|
|
23
|
+
fullRequestTokensBefore: number;
|
|
24
|
+
/**
|
|
25
|
+
* Full API request token count after compaction: messages + systemPrompt + toolDefs.
|
|
26
|
+
* This is the accurate figure for context-window pressure monitoring.
|
|
27
|
+
*/
|
|
28
|
+
fullRequestTokensAfter: number;
|
|
29
|
+
reductions: {
|
|
30
|
+
phase: 'elision' | 'summary' | 'selective';
|
|
31
|
+
saved: number;
|
|
32
|
+
}[];
|
|
33
|
+
repaired?: CompactRepairReport;
|
|
34
|
+
}
|
|
35
|
+
interface Compactor {
|
|
36
|
+
compact(ctx: Context, opts?: {
|
|
37
|
+
aggressive?: boolean;
|
|
38
|
+
}): Promise<CompactReport>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type { CompactReport as C, Compactor as a };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { W as WireFamily } from './models-registry-BcYJDKLm.js';
|
|
2
|
-
import { P as Permission } from './context-
|
|
2
|
+
import { P as Permission } from './context-zkZeILpr.js';
|
|
3
3
|
|
|
4
4
|
type ContextWindowModeId = 'balanced' | 'frugal' | 'deep' | 'archival';
|
|
5
5
|
type ContextWindowAggressiveOn = 'hard' | 'soft' | 'warn';
|
|
@@ -215,6 +215,10 @@ interface ConfigLoader {
|
|
|
215
215
|
cliFlags?: Partial<Config>;
|
|
216
216
|
cwd?: string;
|
|
217
217
|
}): Promise<Config>;
|
|
218
|
+
/** Load and decrypt the sync config from ~/.wrongstack/sync.json. */
|
|
219
|
+
loadSyncConfig(): Promise<SyncConfig | null>;
|
|
220
|
+
/** Persist sync config to ~/.wrongstack/sync.json with encrypted token. */
|
|
221
|
+
persistSyncConfig(cfg: SyncConfig): Promise<void>;
|
|
218
222
|
}
|
|
219
223
|
/**
|
|
220
224
|
* Subscribable view over Config. Plugins and CLI subsystems use this instead
|
|
@@ -730,6 +730,29 @@ type SessionEvent = {
|
|
|
730
730
|
ts: string;
|
|
731
731
|
toPromptIndex: number;
|
|
732
732
|
revertedFiles: string[];
|
|
733
|
+
} | {
|
|
734
|
+
/**
|
|
735
|
+
* Idea #1 from IDEAS.md — Stateful Session Recovery.
|
|
736
|
+
*
|
|
737
|
+
* Marks the start of "the process is currently working on this
|
|
738
|
+
* point in the log". If the process exits cleanly, a matching
|
|
739
|
+
* `in_flight_end` follows. If the process dies (crash, OOM,
|
|
740
|
+
* machine sleep, SIGKILL) the marker is the last event in the
|
|
741
|
+
* file — and `SessionRecovery.detectStale` flags the session
|
|
742
|
+
* as resumable.
|
|
743
|
+
*
|
|
744
|
+
* `context` is a free-form description of the current
|
|
745
|
+
* operation (e.g. "iteration 14 / tool: read / id: tu-7") so
|
|
746
|
+
* the recovery UI can show "what was the agent doing when it
|
|
747
|
+
* died?".
|
|
748
|
+
*/
|
|
749
|
+
type: 'in_flight_start';
|
|
750
|
+
ts: string;
|
|
751
|
+
context: string;
|
|
752
|
+
} | {
|
|
753
|
+
type: 'in_flight_end';
|
|
754
|
+
ts: string;
|
|
755
|
+
reason: 'clean' | 'aborted' | 'recovered';
|
|
733
756
|
};
|
|
734
757
|
type FileSnapshot = {
|
|
735
758
|
path: string;
|
|
@@ -821,6 +844,29 @@ interface SessionWriter {
|
|
|
821
844
|
* Called by /clear to wipe chat history from persistent storage.
|
|
822
845
|
*/
|
|
823
846
|
clearSession(): Promise<void>;
|
|
847
|
+
/**
|
|
848
|
+
* Idea #1 from IDEAS.md — Stateful Session Recovery.
|
|
849
|
+
*
|
|
850
|
+
* Writes an `in_flight_start` event at the current point in the
|
|
851
|
+
* log. The agent loop should call this at the start of every
|
|
852
|
+
* long-running operation (an iteration, a tool execution, a
|
|
853
|
+
* streaming LLM call) so that a crashed process leaves a
|
|
854
|
+
* visible "what was I doing?" marker. Pair with
|
|
855
|
+
* `clearInFlightMarker` on clean shutdown.
|
|
856
|
+
*
|
|
857
|
+
* The `context` string is surfaced verbatim by
|
|
858
|
+
* `SessionRecovery.detectStale` and the `/resume --incomplete`
|
|
859
|
+
* CLI command, so prefer something a human can read at a glance:
|
|
860
|
+
* "iteration 14 / tool: read / id: tu-7"
|
|
861
|
+
*/
|
|
862
|
+
writeInFlightMarker(context: string): Promise<void>;
|
|
863
|
+
/**
|
|
864
|
+
* Writes an `in_flight_end` event. Call on every clean exit
|
|
865
|
+
* point (after a successful iteration, after the user issues
|
|
866
|
+
* /exit, after a graceful SIGINT, etc.). The `reason` is
|
|
867
|
+
* surfaced in the session log for postmortem review.
|
|
868
|
+
*/
|
|
869
|
+
clearInFlightMarker(reason: 'clean' | 'aborted' | 'recovered'): Promise<void>;
|
|
824
870
|
}
|
|
825
871
|
|
|
826
872
|
interface CacheStats {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
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, C as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE,
|
|
2
|
-
import { b as AgentDefinition } from '../multi-agent-coordinator-
|
|
3
|
-
export { T as AGENT_TOOL_PRESETS, A as AgentBudgetTier, a as AgentCapability, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-
|
|
4
|
-
export { c as BudgetExceededError, d as BudgetKind, e as BudgetLimits, f as BudgetNegotiationMode, g as BudgetThresholdDecision, h as BudgetThresholdHandler, i as BudgetThresholdSignal, j as BudgetUsage, m as SubagentBudget } from '../multi-agent-
|
|
5
|
-
export { A as AgentFactory, a as AgentFactoryResult, b as AgentRunnerOptions, F as FleetBus, c as FleetEvent, d as FleetHandler, e as FleetUsage, f as FleetUsageAggregator, S as SubagentUsageSnapshot, m as makeAgentSubagentRunner } from '../agent-subagent-runner-
|
|
6
|
-
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-
|
|
7
|
-
import '../context-
|
|
8
|
-
import '../director-state-BmYi3DGA.js';
|
|
9
|
-
import '../events-CiG9qUM_.js';
|
|
1
|
+
export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, s as Director, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, H as FleetManager, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, O as RefactorPhase, P as RefactorPlan, S as SECURITY_SCANNER_AGENT, Q as SharedFileEntry, T as SharedFileSnapshot, U as SubagentPromptParts, V as applyRosterBudget, W as attachAutoExtend, X as composeDirectorPrompt, Y as composeSubagentPrompt, Z as createDelegateTool, _ as getAgentDefinition, $ as makeAskTool, a0 as makeAssignTool, a1 as makeAwaitTasksTool, a2 as makeCollabDebugTool, a3 as makeDirectorSessionFactory, a4 as makeFleetEmitTool, a5 as makeFleetHealthTool, a6 as makeFleetSessionTool, a7 as makeFleetStatusTool, a8 as makeFleetUsageTool, a9 as makeRollUpTool, aa as makeSpawnTool, ab as makeTerminateTool, ac as makeWorkCompleteTool, ad as rosterSummaryFromConfigs } from '../null-fleet-bus-Dnl19vmf.js';
|
|
2
|
+
import { b as AgentDefinition } from '../multi-agent-coordinator-CAhsegPz.js';
|
|
3
|
+
export { T as AGENT_TOOL_PRESETS, A as AgentBudgetTier, a as AgentCapability, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-CAhsegPz.js';
|
|
4
|
+
export { c as BudgetExceededError, d as BudgetKind, e as BudgetLimits, f as BudgetNegotiationMode, g as BudgetThresholdDecision, h as BudgetThresholdHandler, i as BudgetThresholdSignal, j as BudgetUsage, m as SubagentBudget } from '../multi-agent-DNp6lAzg.js';
|
|
5
|
+
export { A as AgentFactory, a as AgentFactoryResult, b as AgentRunnerOptions, F as FleetBus, c as FleetEvent, d as FleetHandler, e as FleetUsage, f as FleetUsageAggregator, S as SubagentUsageSnapshot, m as makeAgentSubagentRunner } from '../agent-subagent-runner-U-rs7kk7.js';
|
|
6
|
+
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-Dti3KXGk.js';
|
|
7
|
+
import '../context-zkZeILpr.js';
|
|
10
8
|
import 'node:events';
|
|
11
|
-
import '../
|
|
9
|
+
import '../director-state-BmYi3DGA.js';
|
|
10
|
+
import '../events-DH-9r-_C.js';
|
|
11
|
+
import '../index-BIHJ4uII.js';
|
|
12
12
|
import '../logger-DDd5C--Z.js';
|
|
13
|
-
import '../system-prompt-
|
|
13
|
+
import '../system-prompt-CneIxVip.js';
|
|
14
14
|
import '../observability-BhnVLBLS.js';
|
|
15
|
-
import '../secret-scrubber-
|
|
16
|
-
import '../
|
|
15
|
+
import '../secret-scrubber-3MHDDAtm.js';
|
|
16
|
+
import '../permission-H35s9Evv.js';
|
|
17
|
+
import '../config-CLXMDOSs.js';
|
|
17
18
|
import '../models-registry-BcYJDKLm.js';
|
|
18
19
|
|
|
19
20
|
/** Phase 1 · Discovery — map the territory before any work begins. */
|