@wrongstack/core 0.1.4 → 0.1.7
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/README.md +155 -0
- package/dist/defaults/index.d.ts +68 -33
- package/dist/defaults/index.js +559 -239
- package/dist/defaults/index.js.map +1 -1
- package/dist/index.d.ts +26 -12
- package/dist/index.js +745 -322
- package/dist/index.js.map +1 -1
- package/dist/kernel/index.d.ts +5 -4
- package/dist/kernel/index.js +2 -1
- package/dist/kernel/index.js.map +1 -1
- package/dist/{secret-scrubber-qU3AwEiI.d.ts → mode-Pjt5vMS6.d.ts} +94 -3
- package/dist/{provider-DovtyuM8.d.ts → provider-txgB0Oq9.d.ts} +27 -30
- package/dist/{session-reader-DR4u3bu9.d.ts → session-reader-7AutWHut.d.ts} +13 -32
- package/dist/system-prompt-vAB0F54-.d.ts +23 -0
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +34 -15
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +16 -11
- package/dist/utils/index.js +40 -13
- package/dist/utils/index.js.map +1 -1
- package/dist/{wstack-paths-D24ynAz1.d.ts → wstack-paths-BGu2INTm.d.ts} +7 -0
- package/package.json +7 -4
- package/dist/system-prompt--mzZnenv.d.ts +0 -16
package/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# @wrongstack/core
|
|
2
|
+
|
|
3
|
+
Kernel, types, and default implementations that drive the WrongStack CLI agent.
|
|
4
|
+
|
|
5
|
+
This package has no `bin`. It's a library you'd depend on if you were building a plugin, embedding the agent in another tool, or replacing one of the default implementations (a custom session store, a stricter permission policy, your own retry strategy).
|
|
6
|
+
|
|
7
|
+
If you're just using WrongStack from the terminal, install [`wrongstack`](../../README.md) instead.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @wrongstack/core
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires **Node.js ≥ 22.0.0**.
|
|
16
|
+
|
|
17
|
+
## What's in here
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
src/
|
|
21
|
+
core/ — Agent, Context, ConversationState, ProviderRunner, InputBuilder
|
|
22
|
+
defaults/ — Production-ready implementations (session store, secret vault, …)
|
|
23
|
+
kernel/ — Container, TOKENS, EventBus, ToolRegistry, ProviderRegistry
|
|
24
|
+
plugin/ — Plugin loader, PluginAPI, manifest validation
|
|
25
|
+
registry/ — SlashCommandRegistry, ToolRegistry, ProviderRegistry
|
|
26
|
+
types/ — Public type surface (Tool, Provider, SessionStore, …)
|
|
27
|
+
utils/ — wstack-paths, safe-json, deterministic-stringify, lru-cache
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Quick example
|
|
31
|
+
|
|
32
|
+
Run an agent loop with the Anthropic provider and a single tool:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import {
|
|
36
|
+
Agent,
|
|
37
|
+
Container,
|
|
38
|
+
Context,
|
|
39
|
+
DefaultEventBus,
|
|
40
|
+
DefaultLogger,
|
|
41
|
+
DefaultPermissionPolicy,
|
|
42
|
+
DefaultSessionStore,
|
|
43
|
+
DefaultSystemPromptBuilder,
|
|
44
|
+
DefaultTokenCounter,
|
|
45
|
+
ToolRegistry,
|
|
46
|
+
TOKENS,
|
|
47
|
+
} from '@wrongstack/core';
|
|
48
|
+
import { AnthropicProvider } from '@wrongstack/providers';
|
|
49
|
+
import { readTool, writeTool, bashTool } from '@wrongstack/tools';
|
|
50
|
+
|
|
51
|
+
const container = new Container();
|
|
52
|
+
container.bind(TOKENS.EventBus, () => new DefaultEventBus());
|
|
53
|
+
container.bind(TOKENS.Logger, () => new DefaultLogger());
|
|
54
|
+
container.bind(TOKENS.PermissionPolicy, () => new DefaultPermissionPolicy());
|
|
55
|
+
|
|
56
|
+
const provider = new AnthropicProvider({ apiKey: process.env.ANTHROPIC_API_KEY! });
|
|
57
|
+
const tools = new ToolRegistry([readTool, writeTool, bashTool]);
|
|
58
|
+
|
|
59
|
+
const ctx = new Context({
|
|
60
|
+
cwd: process.cwd(),
|
|
61
|
+
projectRoot: process.cwd(),
|
|
62
|
+
provider,
|
|
63
|
+
model: 'claude-sonnet-4-6',
|
|
64
|
+
tokenCounter: new DefaultTokenCounter({ providerId: 'anthropic' }),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const agent = new Agent({
|
|
68
|
+
container,
|
|
69
|
+
ctx,
|
|
70
|
+
tools,
|
|
71
|
+
systemPromptBuilder: new DefaultSystemPromptBuilder(),
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const result = await agent.run({
|
|
75
|
+
input: { text: 'list the files in src/' },
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
console.log(result.assistantText);
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Replacing a default
|
|
82
|
+
|
|
83
|
+
Every concrete class under `defaults/` implements an interface in `types/`. The container resolves by token, so swapping is a one-line change:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import { TOKENS } from '@wrongstack/core';
|
|
87
|
+
|
|
88
|
+
class StrictPolicy implements PermissionPolicy {
|
|
89
|
+
async check(tool, input, ctx) {
|
|
90
|
+
if (tool.name === 'bash') return { decision: 'deny', reason: 'no shell' };
|
|
91
|
+
return { decision: 'allow' };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
container.bind(TOKENS.PermissionPolicy, () => new StrictPolicy());
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The same pattern works for `SessionStore`, `MemoryStore`, `SystemPromptBuilder`, `RetryPolicy`, `ErrorHandler`, `TokenCounter`, `SecretVault`, `SecretScrubber`, `Compactor`, `ConfigStore`, `ModelsRegistry`, `ModeStore`.
|
|
99
|
+
|
|
100
|
+
## Building a tool
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import type { Tool } from '@wrongstack/core';
|
|
104
|
+
|
|
105
|
+
export const echoTool: Tool<{ text: string }, string> = {
|
|
106
|
+
name: 'echo',
|
|
107
|
+
description: 'Echo a string back.',
|
|
108
|
+
inputSchema: {
|
|
109
|
+
type: 'object',
|
|
110
|
+
properties: { text: { type: 'string' } },
|
|
111
|
+
required: ['text'],
|
|
112
|
+
},
|
|
113
|
+
permission: 'auto',
|
|
114
|
+
mutating: false,
|
|
115
|
+
async execute(input) {
|
|
116
|
+
return input.text;
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
See [docs/tool-author-guide.md](../../docs/tool-author-guide.md) for the full contract (`subjectKey`, `executeStream`, `cleanup`, abort handling, output bounds).
|
|
122
|
+
|
|
123
|
+
## Building a provider
|
|
124
|
+
|
|
125
|
+
Most providers can ride the declarative wire-format adapter — see [`@wrongstack/providers`](../providers). For direct implementation, see [docs/provider-author-guide.md](../../docs/provider-author-guide.md).
|
|
126
|
+
|
|
127
|
+
## Building a plugin
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
import type { Plugin } from '@wrongstack/core';
|
|
131
|
+
|
|
132
|
+
export default {
|
|
133
|
+
name: 'my-plugin',
|
|
134
|
+
version: '1.0.0',
|
|
135
|
+
capabilities: { tools: true, slashCommands: true },
|
|
136
|
+
async setup(api) {
|
|
137
|
+
api.registerTool(myTool);
|
|
138
|
+
api.registerSlashCommand({ name: 'my-cmd', description: '…', run: async () => {} });
|
|
139
|
+
},
|
|
140
|
+
} satisfies Plugin;
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
See [docs/plugin-author-guide.md](../../docs/plugin-author-guide.md).
|
|
144
|
+
|
|
145
|
+
## Path layout
|
|
146
|
+
|
|
147
|
+
All developer-level state lives under `~/.wrongstack/`. Per-project state is keyed by `sha256(absoluteProjectRoot).slice(0,12)` under `~/.wrongstack/projects/<hash>/`. The only thing inside the project tree itself is the optional, committable `.wrongstack/AGENTS.md` and `.wrongstack/skills/`. See `WstackPaths` in [utils/wstack-paths.ts](src/utils/wstack-paths.ts) for the full layout.
|
|
148
|
+
|
|
149
|
+
## Security model
|
|
150
|
+
|
|
151
|
+
See [SECURITY.md](../../SECURITY.md) at the repo root for the threat model, adversary trust assumptions, and the catalog of controls (SSRF defenses, child-env sanitization, secret vault, prompt-injection assumptions for LLM-generated tool inputs).
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
MIT
|
package/dist/defaults/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as Logger, f as LogLevel, P as PathResolver,
|
|
2
|
-
import { u as TokenCounter, U as Usage, C as CacheStats, p as SessionStore, o as SessionMetadata, r as SessionWriter, l as ResumedSession, S as SessionData, q as SessionSummary, c as ContentBlock, v as Tool, a0 as Context, i as ProviderError,
|
|
3
|
-
import { h as AttachmentStore, A as AddAttachmentInput, g as AttachmentRef, d as Attachment, S as SecretVault,
|
|
4
|
-
export {
|
|
5
|
-
import { a as WstackPaths } from '../wstack-paths-
|
|
1
|
+
import { g as Logger, f as LogLevel, P as PathResolver, r as ModelsRegistry, O as EventBus, z as ResolvedModel, j as MemoryStore, i as MemoryScope, S as SecretScrubber, t as PermissionPolicy, I as InputReader, s as PermissionDecision, B as RetryPolicy, E as ErrorHandler, a as Compactor, R as RecoveryDecision, H as SkillLoader, J as SkillManifest, G as SkillEntry, b as Config, c as ConfigLoader, d as ConfigStore, C as CompactReport, a0 as MiddlewareHandler, p as ModelsDevPayload, A as ResolvedProvider, W as WireFamily, n as ModeStore, l as ModeConfig, k as Mode, M as MCPServerConfig } from '../mode-Pjt5vMS6.js';
|
|
2
|
+
import { u as TokenCounter, U as Usage, C as CacheStats, p as SessionStore, o as SessionMetadata, r as SessionWriter, l as ResumedSession, S as SessionData, q as SessionSummary, c as ContentBlock, v as Tool, a0 as Context, i as ProviderError, h as Provider, M as Message, F as ToolUseBlock, B as ToolResultBlock, n as SessionEvent } from '../provider-txgB0Oq9.js';
|
|
3
|
+
import { h as AttachmentStore, A as AddAttachmentInput, g as AttachmentRef, d as Attachment, S as SecretVault, x as MultiAgentCoordinator, w as MultiAgentConfig, a9 as SubagentRunner, a5 as SubagentConfig, X as SpawnResult, al as TaskSpec, B as BridgeMessage, a as AgentBridge, l as CoordinatorStatus, aj as TaskResult, aC as Agent, aE as AgentInput, j as BridgeTransport, b as AgentBridgeConfig, o as DoneCondition, aM as RunResult, a4 as Specification, Y as SpecAnalysis, a3 as SpecValidationResult, af as TaskGraph, ag as TaskNode, ae as TaskFilter, ak as TaskSort, ai as TaskProgress, an as TaskType, ah as TaskPriority, at as ToolExecutorOptions, au as ToolExecutorStrategy, ao as ToolBatchResult, O as SessionReader, n as DefaultSessionReaderOptions, N as SessionQuery, T as SessionSummaryLite, R as SessionSearchQuery, Q as SessionSearchHit, L as SessionExportOptions, u as MetricsSink, s as MetricLabels, v as MetricsSnapshot, q as HealthRegistry, H as HealthCheck, c as AggregateHealth, aw as Tracer, W as Span } from '../session-reader-7AutWHut.js';
|
|
4
|
+
export { aG as BudgetExceededError, aH as BudgetKind, aI as BudgetLimits, aJ as BudgetUsage, aN as SubagentBudget } from '../session-reader-7AutWHut.js';
|
|
5
|
+
import { a as WstackPaths } from '../wstack-paths-BGu2INTm.js';
|
|
6
6
|
import { EventEmitter } from 'node:events';
|
|
7
7
|
|
|
8
8
|
interface DefaultLoggerOptions {
|
|
@@ -165,17 +165,30 @@ interface MemoryStoreOptions {
|
|
|
165
165
|
*/
|
|
166
166
|
declare class DefaultMemoryStore implements MemoryStore {
|
|
167
167
|
private readonly files;
|
|
168
|
+
/**
|
|
169
|
+
* Per-scope serialization queue. `remember` / `forget` / `consolidate` /
|
|
170
|
+
* `clear` are read-modify-write against a single file; without a lock,
|
|
171
|
+
* two concurrent calls on the same scope can read the same baseline and
|
|
172
|
+
* the later write silently drops the earlier entry. We chain each
|
|
173
|
+
* mutation onto the prior promise for the same scope so they run in
|
|
174
|
+
* issue order. Different scopes still proceed in parallel.
|
|
175
|
+
*/
|
|
176
|
+
private readonly writeChain;
|
|
168
177
|
constructor(opts: MemoryStoreOptions);
|
|
178
|
+
private runSerialized;
|
|
169
179
|
readAll(): Promise<string>;
|
|
170
180
|
read(scope: MemoryScope): Promise<string>;
|
|
171
181
|
remember(text: string, scope?: MemoryScope): Promise<void>;
|
|
172
182
|
forget(query: string, scope?: MemoryScope): Promise<number>;
|
|
183
|
+
private forgetUnsafe;
|
|
173
184
|
consolidate(scope: MemoryScope): Promise<void>;
|
|
185
|
+
private consolidateUnsafe;
|
|
174
186
|
clear(scope?: MemoryScope): Promise<void>;
|
|
175
187
|
}
|
|
176
188
|
|
|
177
189
|
declare class DefaultSecretScrubber implements SecretScrubber {
|
|
178
190
|
scrub(text: string): string;
|
|
191
|
+
private scrubOne;
|
|
179
192
|
scrubObject<T>(obj: T): T;
|
|
180
193
|
}
|
|
181
194
|
|
|
@@ -247,6 +260,7 @@ declare class DefaultPermissionPolicy implements PermissionPolicy {
|
|
|
247
260
|
}
|
|
248
261
|
|
|
249
262
|
declare class DefaultRetryPolicy implements RetryPolicy {
|
|
263
|
+
private static readonly NETWORK_ERR_RE;
|
|
250
264
|
shouldRetry(err: Error | ProviderError, attempt: number): boolean;
|
|
251
265
|
maxAttempts(err: Error | ProviderError): number;
|
|
252
266
|
delayMs(attempt: number): number;
|
|
@@ -254,15 +268,15 @@ declare class DefaultRetryPolicy implements RetryPolicy {
|
|
|
254
268
|
|
|
255
269
|
/**
|
|
256
270
|
* Tiered error recovery strategies.
|
|
257
|
-
* Each strategy is attempted in order until one
|
|
271
|
+
* Each strategy is attempted in order until one returns a decision.
|
|
258
272
|
*/
|
|
259
273
|
interface RecoveryStrategy {
|
|
260
274
|
/** Human-readable label for logs. */
|
|
261
275
|
label: string;
|
|
262
276
|
/** Optional compactor for context_overflow recovery. */
|
|
263
277
|
compactor?: Compactor;
|
|
264
|
-
/** Returns
|
|
265
|
-
attempt: (err: unknown, ctx: Context) => Promise<
|
|
278
|
+
/** Returns an explicit recovery decision, or null to fall through. */
|
|
279
|
+
attempt: (err: unknown, ctx: Context) => Promise<RecoveryDecision | null>;
|
|
266
280
|
}
|
|
267
281
|
declare class DefaultErrorHandler implements ErrorHandler {
|
|
268
282
|
private readonly strategies;
|
|
@@ -271,7 +285,7 @@ declare class DefaultErrorHandler implements ErrorHandler {
|
|
|
271
285
|
kind: 'rate_limit' | 'overloaded' | 'server' | 'client' | 'network' | 'abort' | 'context_overflow' | 'unknown';
|
|
272
286
|
retryable: boolean;
|
|
273
287
|
};
|
|
274
|
-
recover(err: unknown, ctx: Context): Promise<
|
|
288
|
+
recover(err: unknown, ctx: Context): Promise<RecoveryDecision | null>;
|
|
275
289
|
}
|
|
276
290
|
|
|
277
291
|
interface SkillLoaderOptions {
|
|
@@ -292,6 +306,7 @@ declare class DefaultSkillLoader implements SkillLoader {
|
|
|
292
306
|
list(): Promise<SkillManifest[]>;
|
|
293
307
|
find(name: string): Promise<SkillManifest | undefined>;
|
|
294
308
|
manifestText(): Promise<string>;
|
|
309
|
+
listEntries(): Promise<SkillEntry[]>;
|
|
295
310
|
readBody(name: string): Promise<string>;
|
|
296
311
|
}
|
|
297
312
|
|
|
@@ -674,10 +689,16 @@ declare class LLMSelector implements MessageSelector {
|
|
|
674
689
|
private parseSelectorOutput;
|
|
675
690
|
}
|
|
676
691
|
|
|
692
|
+
type CompactionFailureMode = 'throw' | 'throw_on_hard' | 'continue';
|
|
693
|
+
interface AutoCompactionOptions {
|
|
694
|
+
aggressiveOn?: 'hard' | 'soft' | 'warn';
|
|
695
|
+
events?: EventBus;
|
|
696
|
+
failureMode?: CompactionFailureMode;
|
|
697
|
+
}
|
|
677
698
|
/**
|
|
678
|
-
* Pipeline middleware that monitors context token load and
|
|
679
|
-
*
|
|
680
|
-
*
|
|
699
|
+
* Pipeline middleware that monitors context token load and automatically
|
|
700
|
+
* triggers compaction when the warn/soft/hard thresholds are crossed.
|
|
701
|
+
* Runs before the next agent iteration.
|
|
681
702
|
*/
|
|
682
703
|
declare class AutoCompactionMiddleware {
|
|
683
704
|
readonly name = "AutoCompaction";
|
|
@@ -688,18 +709,24 @@ declare class AutoCompactionMiddleware {
|
|
|
688
709
|
private readonly maxContext;
|
|
689
710
|
private readonly estimator;
|
|
690
711
|
private readonly aggressiveOn;
|
|
712
|
+
private readonly events?;
|
|
713
|
+
private readonly failureMode;
|
|
691
714
|
/**
|
|
692
|
-
* @param compactor Compactor to use for compaction
|
|
693
|
-
* @param maxContext Provider's max context window in tokens
|
|
694
|
-
* @param estimator Token estimation function
|
|
695
|
-
* @param thresholds
|
|
696
|
-
* @param
|
|
715
|
+
* @param compactor Compactor to use for compaction.
|
|
716
|
+
* @param maxContext Provider's max context window in tokens.
|
|
717
|
+
* @param estimator Token estimation function.
|
|
718
|
+
* @param thresholds Threshold fractions (0-1) of maxContext.
|
|
719
|
+
* @param opts Optional behavior. By default, failures at the
|
|
720
|
+
* hard threshold throw AGENT_CONTEXT_OVERFLOW so
|
|
721
|
+
* the agent does not continue into a likely
|
|
722
|
+
* provider context overflow. Warn/soft failures
|
|
723
|
+
* still emit compaction.failed and continue.
|
|
697
724
|
*/
|
|
698
725
|
constructor(compactor: Compactor, maxContext: number, estimator: (ctx: Context) => number, thresholds: {
|
|
699
726
|
warn: number;
|
|
700
727
|
soft: number;
|
|
701
728
|
hard: number;
|
|
702
|
-
},
|
|
729
|
+
}, optsOrAggressiveOn?: AutoCompactionOptions | 'hard' | 'soft' | 'warn', events?: EventBus);
|
|
703
730
|
handler(): MiddlewareHandler<Context>;
|
|
704
731
|
private compact;
|
|
705
732
|
}
|
|
@@ -883,6 +910,10 @@ declare class InMemoryAgentBridge implements AgentBridge {
|
|
|
883
910
|
}
|
|
884
911
|
declare function createMessage<T = unknown>(type: BridgeMessage['type'], from: string, payload: T, to?: string): BridgeMessage<T>;
|
|
885
912
|
|
|
913
|
+
type AutonomousResult = RunResult & {
|
|
914
|
+
toolCalls: number;
|
|
915
|
+
reason?: string;
|
|
916
|
+
};
|
|
886
917
|
interface DoneCheckResult {
|
|
887
918
|
done: boolean;
|
|
888
919
|
reason?: string;
|
|
@@ -891,6 +922,7 @@ interface DoneCheckResult {
|
|
|
891
922
|
}
|
|
892
923
|
declare class DoneConditionChecker {
|
|
893
924
|
private readonly condition;
|
|
925
|
+
private readonly compiledRegex;
|
|
894
926
|
constructor(condition: DoneCondition);
|
|
895
927
|
check(state: {
|
|
896
928
|
iterations: number;
|
|
@@ -907,10 +939,7 @@ interface AutonomousRunnerOptions {
|
|
|
907
939
|
iteration: number;
|
|
908
940
|
toolCalls: number;
|
|
909
941
|
}) => void;
|
|
910
|
-
onDone?: (result:
|
|
911
|
-
toolCalls: number;
|
|
912
|
-
reason?: string;
|
|
913
|
-
}) => void;
|
|
942
|
+
onDone?: (result: AutonomousResult) => void;
|
|
914
943
|
}
|
|
915
944
|
declare class AutonomousRunner {
|
|
916
945
|
private readonly opts;
|
|
@@ -920,19 +949,11 @@ declare class AutonomousRunner {
|
|
|
920
949
|
private stopped;
|
|
921
950
|
private readonly doneChecker;
|
|
922
951
|
constructor(opts: AutonomousRunnerOptions);
|
|
923
|
-
run(): Promise<
|
|
924
|
-
toolCalls: number;
|
|
925
|
-
reason?: string;
|
|
926
|
-
}>;
|
|
952
|
+
run(): Promise<AutonomousResult>;
|
|
927
953
|
stop(): void;
|
|
928
954
|
}
|
|
929
955
|
|
|
930
|
-
interface SpecParserOptions {
|
|
931
|
-
strict?: boolean;
|
|
932
|
-
}
|
|
933
956
|
declare class SpecParser {
|
|
934
|
-
private readonly opts;
|
|
935
|
-
constructor(opts?: SpecParserOptions);
|
|
936
957
|
parse(content: string): Specification;
|
|
937
958
|
private extractTitle;
|
|
938
959
|
private extractVersion;
|
|
@@ -957,6 +978,13 @@ interface TaskStore {
|
|
|
957
978
|
}
|
|
958
979
|
interface TaskTrackerOptions {
|
|
959
980
|
store: TaskStore;
|
|
981
|
+
/**
|
|
982
|
+
* Called when an in-the-background persistence (`saveGraph`) rejects.
|
|
983
|
+
* The synchronous TaskTracker methods (addNode/addEdge/updateNodeStatus)
|
|
984
|
+
* fire-and-forget their writes; without this, a failing store silently
|
|
985
|
+
* loses graph mutations. Defaults to a console.warn.
|
|
986
|
+
*/
|
|
987
|
+
onPersistError?: (err: unknown) => void;
|
|
960
988
|
}
|
|
961
989
|
interface TaskTransition {
|
|
962
990
|
from: TaskNode['status'];
|
|
@@ -984,6 +1012,14 @@ declare class TaskTracker {
|
|
|
984
1012
|
getTransitions(taskId?: string): TaskTransition[];
|
|
985
1013
|
private unblockDependents;
|
|
986
1014
|
private checkAndBlockIfNeeded;
|
|
1015
|
+
/**
|
|
1016
|
+
* Fire-and-forget persistence with attached error handler.
|
|
1017
|
+
* Synchronous mutators (addNode/addEdge/updateNodeStatus) use this to
|
|
1018
|
+
* avoid forcing an async cascade through every caller; if the store
|
|
1019
|
+
* rejects, the configured `onPersistError` is invoked so failures are
|
|
1020
|
+
* surfaced instead of swallowed by an unhandled promise rejection.
|
|
1021
|
+
*/
|
|
1022
|
+
private persist;
|
|
987
1023
|
}
|
|
988
1024
|
|
|
989
1025
|
interface TaskGeneratorOptions {
|
|
@@ -1006,7 +1042,6 @@ declare class TaskGenerator {
|
|
|
1006
1042
|
private createTaskFromEndpoint;
|
|
1007
1043
|
private buildDescription;
|
|
1008
1044
|
private mapRequirementType;
|
|
1009
|
-
private mapPriority;
|
|
1010
1045
|
private estimateHours;
|
|
1011
1046
|
private estimateForEndpoint;
|
|
1012
1047
|
generateSubtasks(parentTaskId: string, spec: Specification): Promise<void>;
|
|
@@ -1679,4 +1714,4 @@ declare const sentinelServer: () => MCPServerConfig;
|
|
|
1679
1714
|
/** Everything bundled — full set of built-in servers. Useful for `wstack mcp add --all`. */
|
|
1680
1715
|
declare const allServers: () => Record<string, MCPServerConfig>;
|
|
1681
1716
|
|
|
1682
|
-
export { type AbandonedSession, type AgentFactory, type AgentFactoryResult, type AgentRunnerOptions, type AttachmentStoreOptions, AutoCompactionMiddleware, AutonomousRunner, type AutonomousRunnerOptions, type CompactorOptions, type ConfigLoaderOptions, type ConfigMigration, ConfigMigrationError, type ConfigSource, type ContextManagerAction, type ContextManagerInput, type ContextManagerResult, type ContextManagerToolOptions, DEFAULT_CONFIG_MIGRATIONS, DefaultAttachmentStore, DefaultConfigLoader, DefaultConfigStore, DefaultErrorHandler, DefaultHealthRegistry, DefaultLogger, type DefaultLoggerOptions, DefaultMemoryStore, DefaultModeStore, DefaultModelsRegistry, type DefaultModelsRegistryOptions, DefaultMultiAgentCoordinator, DefaultPathResolver, DefaultPermissionPolicy, DefaultRetryPolicy, DefaultSecretScrubber, DefaultSecretVault, DefaultSessionReader, DefaultSessionStore, DefaultSkillLoader, DefaultTaskStore, DefaultTokenCounter, type DoneCheckResult, DoneConditionChecker, type GeneratedTask, HybridCompactor, InMemoryAgentBridge, InMemoryBridgeTransport, InMemoryMetricsSink, IntelligentCompactor, type IntelligentCompactorOptions, LLMSelector, type LLMSelectorOptions, type MemoryStoreOptions, type MetricsServerHandle, type MetricsServerOptions, type MigrationContext, type MigrationResult, type ModeLoaderOptions, type MultiAgentCoordinatorOptions, NoopMetricsSink, NoopTracer, OTelTracer, type OtlpMetricsExporterHandle, type OtlpMetricsExporterOptions, type OtlpTraceExporterHandle, type OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, type PermissionPolicyOptions, type PersistedQueueItem, QueueStore, RecoveryLock, type RecoveryLockOptions, type SecretVaultOptions, SelectiveCompactor, type SelectiveCompactorOptions, type SessionStoreOptions, type SkillLoaderOptions, SpecDrivenDev, type SpecDrivenDevOptions, SpecParser,
|
|
1717
|
+
export { type AbandonedSession, type AgentFactory, type AgentFactoryResult, type AgentRunnerOptions, type AttachmentStoreOptions, AutoCompactionMiddleware, AutonomousRunner, type AutonomousRunnerOptions, type CompactorOptions, type ConfigLoaderOptions, type ConfigMigration, ConfigMigrationError, type ConfigSource, type ContextManagerAction, type ContextManagerInput, type ContextManagerResult, type ContextManagerToolOptions, DEFAULT_CONFIG_MIGRATIONS, DefaultAttachmentStore, DefaultConfigLoader, DefaultConfigStore, DefaultErrorHandler, DefaultHealthRegistry, DefaultLogger, type DefaultLoggerOptions, DefaultMemoryStore, DefaultModeStore, DefaultModelsRegistry, type DefaultModelsRegistryOptions, DefaultMultiAgentCoordinator, DefaultPathResolver, DefaultPermissionPolicy, DefaultRetryPolicy, DefaultSecretScrubber, DefaultSecretVault, DefaultSessionReader, DefaultSessionStore, DefaultSkillLoader, DefaultTaskStore, DefaultTokenCounter, type DoneCheckResult, DoneConditionChecker, type GeneratedTask, HybridCompactor, InMemoryAgentBridge, InMemoryBridgeTransport, InMemoryMetricsSink, IntelligentCompactor, type IntelligentCompactorOptions, LLMSelector, type LLMSelectorOptions, type MemoryStoreOptions, type MetricsServerHandle, type MetricsServerOptions, type MigrationContext, type MigrationResult, type ModeLoaderOptions, type MultiAgentCoordinatorOptions, NoopMetricsSink, NoopTracer, OTelTracer, type OtlpMetricsExporterHandle, type OtlpMetricsExporterOptions, type OtlpTraceExporterHandle, type OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, type PermissionPolicyOptions, type PersistedQueueItem, QueueStore, RecoveryLock, type RecoveryLockOptions, type SecretVaultOptions, SelectiveCompactor, type SelectiveCompactorOptions, type SessionStoreOptions, type SkillLoaderOptions, SpecDrivenDev, type SpecDrivenDevOptions, SpecParser, TaskFlow, type TaskFlowEventMap, type TaskFlowEventName, type TaskFlowExecutionContext, type TaskFlowOptions, type TaskFlowPhase, TaskGenerator, type TaskGeneratorOptions, type TaskStore, TaskTracker, type TaskTrackerOptions, type TaskTransition, ToolExecutor, allServers, awsServer, blockServer, braveSearchServer, buildOtlpMetricsRequest, buildOtlpTracesRequest, classifyFamily, context7Server, contextManagerTool, createContextManagerTool, createMessage, decryptConfigSecrets, encryptConfigSecrets, everArtServer, filesystemServer, githubServer, googleMapsServer, loadProjectModes, loadUserModes, makeAgentSubagentRunner, migratePlaintextSecrets, renderPrometheus, rewriteConfigEncrypted, runConfigMigrations, sentinelServer, slackServer, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, wireMetricsToEvents };
|